From 357a0e650ee692bcb2c2a918e7d1e142cea5d500 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 12 Dec 2017 14:30:54 +0100 Subject: [PATCH] Upgrade to latest API versions + code regen --- .../v1/abusiveexperiencereport-api.json | 250 + .../v1/acceleratedmobilepageurl-api.json | 160 +- .../v2beta1/adexchangebuyer2-api.json | 5094 +- .../v1.1/adexchangeseller-api.json | 4 +- .../v1/adexchangeseller-api.json | 4 +- .../v2.0/adexchangeseller-api.json | 4 +- .../v1/adexperiencereport-api.json | 314 +- etc/api/admin/directory_v1/admin-api.json | 375 +- etc/api/admin/reports_v1/admin-api.json | 88 +- etc/api/adsense/v1.4/adsense-api.json | 4 +- etc/api/adsensehost/v4.1/adsensehost-api.json | 4 +- .../v4/analyticsreporting-api.json | 1176 +- .../v1/androiddeviceprovisioning-api.json | 1236 +- .../v1/androidenterprise-api.json | 381 +- .../v1/androidmanagement-api.json | 394 +- .../v1.1/androidpublisher-api.json | 6 +- .../v1/androidpublisher-api.json | 4 +- .../v2/androidpublisher-api.json | 120 +- etc/api/api-list.yaml | 23 +- etc/api/appengine/v1/appengine-api.json | 4740 +- etc/api/appengine/v1alpha/appengine-api.json | 1945 +- etc/api/appengine/v1beta/appengine-api.json | 5131 +- etc/api/appengine/v1beta4/appengine-api.json | 3032 +- etc/api/appengine/v1beta5/appengine-api.json | 2643 +- etc/api/appsactivity/v1/appsactivity-api.json | 4 +- etc/api/appstate/v1/appstate-api.json | 4 +- etc/api/bigquery/v2/bigquery-api.json | 51 +- .../v1/bigquerydatatransfer-api.json | 2164 +- etc/api/calendar/v3/calendar-api.json | 19 +- etc/api/classroom/v1/classroom-api.json | 4235 +- etc/api/cloudbuild/v1/cloudbuild-api.json | 1779 +- .../clouddebugger/v2/clouddebugger-api.json | 1712 +- .../v1beta1/clouderrorreporting-api.json | 1136 +- .../cloudfunctions/v1/cloudfunctions-api.json | 1146 +- .../v1beta2/cloudfunctions-api.json | 1348 +- etc/api/cloudiot/v1/cloudiot-api.json | 1311 + etc/api/cloudiot/v1beta1/cloudiot-api.json | 1112 + etc/api/cloudkms/v1/cloudkms-api.json | 1956 +- .../v1/cloudresourcemanager-api.json | 2380 +- .../v1beta1/cloudresourcemanager-api.json | 1744 +- .../v2beta1/cloudresourcemanager-api.json | 962 +- .../cloudtasks/v2beta2/cloudtasks-api.json | 1417 +- etc/api/cloudtrace/v1/cloudtrace-api.json | 335 +- etc/api/cloudtrace/v2/cloudtrace-api.json | 592 +- etc/api/compute/alpha/compute-api.json | 3216 +- etc/api/compute/beta/compute-api.json | 2963 +- etc/api/compute/v1/compute-api.json | 7113 +- etc/api/container/v1/container-api.json | 4187 +- etc/api/container/v1beta1/container-api.json | 5107 +- etc/api/content/v2/content-api.json | 542 +- etc/api/content/v2sandbox/content-api.json | 349 +- etc/api/customsearch/v1/customsearch-api.json | 2 +- etc/api/dataflow/v1b3/dataflow-api.json | 6377 +- etc/api/dataproc/v1/dataproc-api.json | 2409 +- etc/api/dataproc/v1beta2/dataproc-api.json | 3941 +- etc/api/datastore/v1/datastore-api.json | 2990 +- etc/api/datastore/v1beta1/datastore-api.json | 456 +- etc/api/datastore/v1beta3/datastore-api.json | 1308 +- .../alpha/deploymentmanager-api.json | 101 +- .../v2/deploymentmanager-api.json | 6 +- .../v2beta/deploymentmanager-api.json | 20 +- .../dfareporting/v2.8/dfareporting-api.json | 18 +- .../dfareporting/v3.0/dfareporting-api.json | 19792 +++++ .../dialogflow/v2beta1/dialogflow-api.json | 2905 + etc/api/dlp/v2beta1/dlp-api.json | 4999 +- etc/api/dns/v1/dns-api.json | 4 +- etc/api/dns/v1beta2/dns-api.json | 1406 + etc/api/dns/v2beta1/dns-api.json | 4 +- .../v1/doubleclickbidmanager-api.json | 2 +- .../v2/doubleclicksearch-api.json | 4 +- etc/api/drive/v2/drive-api.json | 62 +- etc/api/drive/v3/drive-api.json | 56 +- .../v1/firebasedynamiclinks-api.json | 979 +- .../v1/firebaseremoteconfig-api.json | 422 +- .../firebaserules/v1/firebaserules-api.json | 1379 +- etc/api/firestore/v1beta1/firestore-api.json | 1968 + etc/api/fitness/v1/fitness-api.json | 14 +- etc/api/fusiontables/v1/fusiontables-api.json | 4 +- etc/api/fusiontables/v2/fusiontables-api.json | 27 +- etc/api/games/v1/games-api.json | 4 +- .../gamesconfiguration-api.json | 4 +- .../v1management/gamesmanagement-api.json | 4 +- etc/api/genomics/v1/genomics-api.json | 4496 +- etc/api/genomics/v1alpha2/genomics-api.json | 1073 +- etc/api/gmail/v1/gmail-api.json | 4 +- etc/api/iam/v1/iam-api.json | 2866 +- .../v3/identitytoolkit-api.json | 82 +- etc/api/kgsearch/v1/kgsearch-api.json | 120 +- etc/api/language/v1/language-api.json | 1877 +- etc/api/language/v1beta1/language-api.json | 1156 +- etc/api/language/v1beta2/language-api.json | 1408 +- etc/api/logging/v2/logging-api.json | 5840 +- etc/api/logging/v2beta1/logging-api.json | 1809 +- .../manufacturers/v1/manufacturers-api.json | 701 +- etc/api/ml/v1/ml-api.json | 3517 +- etc/api/monitoring/v3/monitoring-api.json | 2842 +- etc/api/oauth2/v1/oauth2-api.json | 4 +- etc/api/oauth2/v2/oauth2-api.json | 6 +- etc/api/oslogin/v1/oslogin-api.json | 428 + etc/api/oslogin/v1alpha/oslogin-api.json | 423 +- etc/api/oslogin/v1beta/oslogin-api.json | 473 +- etc/api/partners/v2/partners-api.json | 5056 +- etc/api/people/v1/people-api.json | 3268 +- etc/api/plus/v1/plus-api.json | 4 +- etc/api/plusdomains/v1/plusdomains-api.json | 4 +- etc/api/poly/v1/poly-api.json | 588 + .../v1beta1/proximitybeacon-api.json | 1387 +- etc/api/pubsub/v1/pubsub-api.json | 1853 +- etc/api/pubsub/v1beta1a/pubsub-api.json | 858 +- etc/api/pubsub/v1beta2/pubsub-api.json | 1468 +- .../v1beta1/resourceviews-api.json | 2 +- .../runtimeconfig/v1/runtimeconfig-api.json | 298 +- .../v1beta1/runtimeconfig-api.json | 1110 +- etc/api/safebrowsing/v4/safebrowsing-api.json | 1661 +- etc/api/script/v1/script-api.json | 267 +- .../searchconsole/v1/searchconsole-api.json | 206 +- .../v1/serviceconsumermanagement-api.json | 2362 + .../servicecontrol/v1/servicecontrol-api.json | 1904 +- .../v1/servicemanagement-api.json | 3865 +- etc/api/serviceuser/v1/serviceuser-api.json | 1799 +- etc/api/shared.yaml | 4 + etc/api/sheets/v4/sheets-api.json | 6477 +- etc/api/slides/v1/slides-api.json | 4471 +- etc/api/sourcerepo/v1/sourcerepo-api.json | 810 +- etc/api/spanner/v1/spanner-api.json | 3576 +- etc/api/speech/v1/speech-api.json | 602 +- etc/api/speech/v1beta1/speech-api.json | 405 +- etc/api/sqladmin/v1beta3/sqladmin-api.json | 4 +- etc/api/sqladmin/v1beta4/sqladmin-api.json | 117 +- etc/api/storage/v1/storage-api.json | 108 +- etc/api/storage/v1beta1/storage-api.json | 4 +- etc/api/storage/v1beta2/storage-api.json | 4 +- .../v1/storagetransfer-api.json | 1490 +- .../v1/streetviewpublish-api.json | 851 +- etc/api/tagmanager/v1/tagmanager-api.json | 214 +- etc/api/tagmanager/v2/tagmanager-api.json | 68 +- etc/api/taskqueue/v1beta2/taskqueue-api.json | 2 +- etc/api/testing/v1/testing-api.json | 1326 +- .../toolresults/v1beta3/toolresults-api.json | 111 +- etc/api/tpu/v1alpha1/tpu-api.json | 805 + etc/api/translate/v2/translate-api.json | 340 +- etc/api/urlshortener/v1/urlshortener-api.json | 2 +- etc/api/vault/v1/vault-api.json | 1294 +- .../v1beta1/videointelligence-api.json | 1252 +- etc/api/vision/v1/vision-api.json | 1283 +- etc/api/vision/v1p1beta1/vision-api.json | 1459 + etc/api/webmasters/v3/webmasters-api.json | 2 +- etc/api/youtube/v3/youtube-api.json | 33 +- .../v1/youtubeanalytics-api.json | 4 +- .../v1beta1/youtubeanalytics-api.json | 4 +- .../v1/youtubereporting-api.json | 854 +- gen/abusiveexperiencereport1-cli/Cargo.toml | 40 + gen/abusiveexperiencereport1-cli/LICENSE.md | 30 + gen/abusiveexperiencereport1-cli/README.md | 116 + gen/abusiveexperiencereport1-cli/mkdocs.yml | 18 + gen/abusiveexperiencereport1-cli/src/cmn.rs | 799 + gen/abusiveexperiencereport1-cli/src/main.rs | 414 + gen/abusiveexperiencereport1/Cargo.toml | 31 + gen/abusiveexperiencereport1/LICENSE.md | 30 + gen/abusiveexperiencereport1/README.md | 176 + gen/abusiveexperiencereport1/src/cmn.rs | 753 + gen/abusiveexperiencereport1/src/lib.rs | 1020 + gen/adexchangeseller2-cli/Cargo.toml | 4 +- gen/adexchangeseller2-cli/README.md | 2 +- gen/adexchangeseller2-cli/mkdocs.yml | 2 +- gen/adexchangeseller2-cli/src/main.rs | 2 +- gen/adexchangeseller2/Cargo.toml | 4 +- gen/adexchangeseller2/README.md | 46 +- gen/adexchangeseller2/src/lib.rs | 2 +- gen/adexperiencereport1-cli/Cargo.toml | 4 +- gen/adexperiencereport1-cli/README.md | 2 +- gen/adexperiencereport1-cli/mkdocs.yml | 2 +- gen/adexperiencereport1-cli/src/main.rs | 2 +- gen/adexperiencereport1/Cargo.toml | 4 +- gen/adexperiencereport1/README.md | 44 +- gen/adexperiencereport1/src/lib.rs | 16 +- gen/admin1_directory-cli/Cargo.toml | 4 +- gen/admin1_directory-cli/README.md | 6 +- gen/admin1_directory-cli/mkdocs.yml | 5 +- gen/admin1_directory-cli/src/main.rs | 364 +- gen/admin1_directory/Cargo.toml | 4 +- gen/admin1_directory/README.md | 116 +- gen/admin1_directory/src/lib.rs | 9743 ++- gen/admin1_reports-cli/Cargo.toml | 4 +- gen/admin1_reports-cli/README.md | 4 +- gen/admin1_reports-cli/mkdocs.yml | 3 +- gen/admin1_reports-cli/src/main.rs | 118 +- gen/admin1_reports/Cargo.toml | 4 +- gen/admin1_reports/README.md | 84 +- gen/admin1_reports/src/lib.rs | 1207 +- 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/androiddeviceprovisioning1-cli/Cargo.toml | 4 +- gen/androiddeviceprovisioning1-cli/README.md | 2 +- gen/androiddeviceprovisioning1-cli/mkdocs.yml | 2 +- .../src/main.rs | 4 +- gen/androiddeviceprovisioning1/Cargo.toml | 4 +- gen/androiddeviceprovisioning1/README.md | 46 +- gen/androiddeviceprovisioning1/src/lib.rs | 148 +- gen/androidenterprise1-cli/Cargo.toml | 4 +- gen/androidenterprise1-cli/README.md | 7 +- gen/androidenterprise1-cli/mkdocs.yml | 6 +- gen/androidenterprise1-cli/src/main.rs | 461 +- gen/androidenterprise1/Cargo.toml | 4 +- gen/androidenterprise1/README.md | 84 +- gen/androidenterprise1/src/lib.rs | 3685 +- gen/androidmanagement1-cli/Cargo.toml | 4 +- gen/androidmanagement1-cli/README.md | 2 +- gen/androidmanagement1-cli/mkdocs.yml | 2 +- gen/androidmanagement1-cli/src/main.rs | 52 +- gen/androidmanagement1/Cargo.toml | 4 +- gen/androidmanagement1/README.md | 48 +- gen/androidmanagement1/src/lib.rs | 482 +- gen/androidpublisher2-cli/Cargo.toml | 4 +- gen/androidpublisher2-cli/README.md | 3 +- gen/androidpublisher2-cli/mkdocs.yml | 3 +- gen/androidpublisher2-cli/src/main.rs | 113 +- gen/androidpublisher2/Cargo.toml | 4 +- gen/androidpublisher2/README.md | 62 +- gen/androidpublisher2/src/lib.rs | 450 +- gen/appengine1-cli/Cargo.toml | 4 +- gen/appengine1-cli/README.md | 8 +- gen/appengine1-cli/mkdocs.yml | 8 +- gen/appengine1-cli/src/main.rs | 708 +- gen/appengine1/Cargo.toml | 4 +- gen/appengine1/README.md | 42 +- gen/appengine1/src/lib.rs | 5731 +- 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 | 34 +- gen/appengine1_beta4/Cargo.toml | 4 +- gen/appengine1_beta4/README.md | 42 +- gen/appengine1_beta4/src/lib.rs | 193 +- 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 | 50 +- gen/appengine1_beta5/Cargo.toml | 4 +- gen/appengine1_beta5/README.md | 42 +- gen/appengine1_beta5/src/lib.rs | 212 +- 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 | 2 +- gen/bigquery2-cli/mkdocs.yml | 2 +- gen/bigquery2-cli/src/main.rs | 9 +- gen/bigquery2/Cargo.toml | 4 +- gen/bigquery2/README.md | 58 +- gen/bigquery2/src/lib.rs | 59 +- gen/bigquerydatatransfer1-cli/Cargo.toml | 4 +- gen/bigquerydatatransfer1-cli/README.md | 2 +- gen/bigquerydatatransfer1-cli/mkdocs.yml | 2 +- gen/bigquerydatatransfer1-cli/src/main.rs | 18 +- gen/bigquerydatatransfer1/Cargo.toml | 4 +- gen/bigquerydatatransfer1/README.md | 42 +- gen/bigquerydatatransfer1/src/lib.rs | 738 +- gen/calendar3-cli/Cargo.toml | 4 +- gen/calendar3-cli/README.md | 2 +- gen/calendar3-cli/mkdocs.yml | 2 +- gen/calendar3-cli/src/main.rs | 14 +- gen/calendar3/Cargo.toml | 4 +- gen/calendar3/README.md | 86 +- gen/calendar3/src/lib.rs | 157 +- gen/classroom1-cli/Cargo.toml | 4 +- gen/classroom1-cli/README.md | 2 +- gen/classroom1-cli/mkdocs.yml | 2 +- gen/classroom1-cli/src/main.rs | 66 +- gen/classroom1/Cargo.toml | 4 +- gen/classroom1/README.md | 56 +- gen/classroom1/src/lib.rs | 1646 +- gen/clouddebugger2-cli/Cargo.toml | 4 +- gen/clouddebugger2-cli/README.md | 2 +- gen/clouddebugger2-cli/mkdocs.yml | 2 +- gen/clouddebugger2-cli/src/main.rs | 30 +- gen/clouddebugger2/Cargo.toml | 4 +- gen/clouddebugger2/README.md | 44 +- gen/clouddebugger2/src/lib.rs | 78 +- gen/cloudfunctions1-cli/Cargo.toml | 4 +- gen/cloudfunctions1-cli/README.md | 10 +- gen/cloudfunctions1-cli/mkdocs.yml | 10 +- gen/cloudfunctions1-cli/src/main.rs | 880 +- gen/cloudfunctions1/Cargo.toml | 4 +- gen/cloudfunctions1/README.md | 49 +- gen/cloudfunctions1/src/lib.rs | 3521 +- gen/cloudiot1-cli/Cargo.toml | 40 + gen/cloudiot1-cli/LICENSE.md | 30 + gen/cloudiot1-cli/README.md | 129 + gen/cloudiot1-cli/mkdocs.yml | 32 + gen/cloudiot1-cli/src/cmn.rs | 799 + gen/cloudiot1-cli/src/main.rs | 1917 + gen/cloudiot1/Cargo.toml | 31 + gen/cloudiot1/LICENSE.md | 30 + gen/cloudiot1/README.md | 183 + gen/cloudiot1/src/cmn.rs | 753 + gen/cloudiot1/src/lib.rs | 6192 ++ gen/cloudkms1-cli/Cargo.toml | 4 +- gen/cloudkms1-cli/README.md | 2 +- gen/cloudkms1-cli/mkdocs.yml | 2 +- gen/cloudkms1-cli/src/main.rs | 8 +- gen/cloudkms1/Cargo.toml | 4 +- gen/cloudkms1/README.md | 42 +- gen/cloudkms1/src/lib.rs | 131 +- gen/cloudresourcemanager1-cli/Cargo.toml | 4 +- gen/cloudresourcemanager1-cli/README.md | 2 +- gen/cloudresourcemanager1-cli/mkdocs.yml | 2 +- gen/cloudresourcemanager1-cli/src/main.rs | 10 +- gen/cloudresourcemanager1/Cargo.toml | 4 +- gen/cloudresourcemanager1/README.md | 58 +- gen/cloudresourcemanager1/src/lib.rs | 670 +- .../Cargo.toml | 4 +- gen/cloudresourcemanager1_beta1-cli/README.md | 2 +- .../mkdocs.yml | 2 +- .../src/main.rs | 2 +- gen/cloudresourcemanager1_beta1/Cargo.toml | 4 +- gen/cloudresourcemanager1_beta1/README.md | 48 +- gen/cloudresourcemanager1_beta1/src/lib.rs | 14 +- gen/cloudtasks2_beta2-cli/Cargo.toml | 4 +- gen/cloudtasks2_beta2-cli/README.md | 2 +- gen/cloudtasks2_beta2-cli/mkdocs.yml | 2 +- gen/cloudtasks2_beta2-cli/src/main.rs | 152 +- gen/cloudtasks2_beta2/Cargo.toml | 4 +- gen/cloudtasks2_beta2/README.md | 42 +- gen/cloudtasks2_beta2/src/lib.rs | 861 +- gen/container1-cli/Cargo.toml | 4 +- gen/container1-cli/README.md | 2 +- gen/container1-cli/mkdocs.yml | 2 +- gen/container1-cli/src/main.rs | 28 +- gen/container1/Cargo.toml | 4 +- gen/container1/README.md | 46 +- gen/container1/src/lib.rs | 498 +- gen/content2-cli/Cargo.toml | 4 +- gen/content2-cli/README.md | 4 +- gen/content2-cli/mkdocs.yml | 4 +- gen/content2-cli/src/main.rs | 503 +- gen/content2/Cargo.toml | 4 +- gen/content2/README.md | 76 +- gen/content2/src/lib.rs | 1955 +- gen/content2_sandbox-cli/Cargo.toml | 4 +- gen/content2_sandbox-cli/README.md | 4 +- gen/content2_sandbox-cli/mkdocs.yml | 4 +- gen/content2_sandbox-cli/src/main.rs | 339 +- gen/content2_sandbox/Cargo.toml | 4 +- gen/content2_sandbox/README.md | 50 +- gen/content2_sandbox/src/lib.rs | 3391 +- gen/dataproc1-cli/Cargo.toml | 4 +- gen/dataproc1-cli/README.md | 2 +- gen/dataproc1-cli/mkdocs.yml | 2 +- gen/dataproc1-cli/src/main.rs | 11 +- gen/dataproc1/Cargo.toml | 4 +- gen/dataproc1/README.md | 43 +- gen/dataproc1/src/lib.rs | 677 +- 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 | 4 +- gen/dfareporting2d8-cli/Cargo.toml | 4 +- gen/dfareporting2d8-cli/README.md | 2 +- gen/dfareporting2d8-cli/mkdocs.yml | 2 +- gen/dfareporting2d8-cli/src/main.rs | 2 +- gen/dfareporting2d8/Cargo.toml | 4 +- gen/dfareporting2d8/README.md | 286 +- gen/dfareporting2d8/src/lib.rs | 16 +- gen/dfareporting3-cli/Cargo.toml | 40 + gen/dfareporting3-cli/LICENSE.md | 30 + gen/dfareporting3-cli/README.md | 376 + gen/dfareporting3-cli/mkdocs.yml | 220 + gen/dfareporting3-cli/src/cmn.rs | 799 + gen/dfareporting3-cli/src/main.rs | 23805 +++++ gen/dfareporting3/Cargo.toml | 31 + gen/dfareporting3/LICENSE.md | 30 + gen/dfareporting3/README.md | 315 + gen/dfareporting3/src/cmn.rs | 753 + gen/dfareporting3/src/lib.rs | 72393 ++++++++++++++++ gen/dialogflow2_beta1-cli/Cargo.toml | 40 + gen/dialogflow2_beta1-cli/LICENSE.md | 30 + gen/dialogflow2_beta1-cli/README.md | 149 + gen/dialogflow2_beta1-cli/mkdocs.yml | 52 + gen/dialogflow2_beta1-cli/src/cmn.rs | 799 + gen/dialogflow2_beta1-cli/src/main.rs | 4044 + gen/dialogflow2_beta1/Cargo.toml | 31 + gen/dialogflow2_beta1/LICENSE.md | 30 + gen/dialogflow2_beta1/README.md | 191 + gen/dialogflow2_beta1/src/cmn.rs | 753 + gen/dialogflow2_beta1/src/lib.rs | 12988 +++ gen/dlp2_beta1-cli/Cargo.toml | 4 +- gen/dlp2_beta1-cli/README.md | 2 +- gen/dlp2_beta1-cli/mkdocs.yml | 2 +- gen/dlp2_beta1-cli/src/main.rs | 11 +- gen/dlp2_beta1/Cargo.toml | 4 +- gen/dlp2_beta1/README.md | 50 +- gen/dlp2_beta1/src/lib.rs | 641 +- 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/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 | 58 +- gen/drive2/Cargo.toml | 4 +- gen/drive2/README.md | 110 +- gen/drive2/src/lib.rs | 270 +- gen/drive3-cli/Cargo.toml | 4 +- gen/drive3-cli/README.md | 2 +- gen/drive3-cli/mkdocs.yml | 2 +- gen/drive3-cli/src/main.rs | 53 +- gen/drive3/Cargo.toml | 4 +- gen/drive3/README.md | 96 +- gen/drive3/src/lib.rs | 213 +- gen/firebasedynamiclinks1-cli/Cargo.toml | 4 +- gen/firebasedynamiclinks1-cli/README.md | 2 +- gen/firebasedynamiclinks1-cli/mkdocs.yml | 2 +- gen/firebasedynamiclinks1-cli/src/main.rs | 18 +- gen/firebasedynamiclinks1/Cargo.toml | 4 +- gen/firebasedynamiclinks1/README.md | 46 +- gen/firebasedynamiclinks1/src/lib.rs | 86 +- gen/firebaseremoteconfig1-cli/Cargo.toml | 4 +- gen/firebaseremoteconfig1-cli/README.md | 2 +- gen/firebaseremoteconfig1-cli/mkdocs.yml | 2 +- gen/firebaseremoteconfig1-cli/src/main.rs | 2 +- gen/firebaseremoteconfig1/Cargo.toml | 4 +- gen/firebaseremoteconfig1/README.md | 42 +- gen/firebaseremoteconfig1/src/lib.rs | 24 +- gen/firestore1_beta1-cli/Cargo.toml | 40 + gen/firestore1_beta1-cli/LICENSE.md | 30 + gen/firestore1_beta1-cli/README.md | 130 + gen/firestore1_beta1-cli/mkdocs.yml | 33 + gen/firestore1_beta1-cli/src/cmn.rs | 799 + gen/firestore1_beta1-cli/src/main.rs | 2175 + gen/firestore1_beta1/Cargo.toml | 31 + gen/firestore1_beta1/LICENSE.md | 30 + gen/firestore1_beta1/README.md | 186 + gen/firestore1_beta1/src/cmn.rs | 753 + gen/firestore1_beta1/src/lib.rs | 7242 ++ gen/fitness1-cli/Cargo.toml | 4 +- gen/fitness1-cli/README.md | 2 +- gen/fitness1-cli/mkdocs.yml | 2 +- gen/fitness1-cli/src/main.rs | 6 +- gen/fitness1/Cargo.toml | 4 +- gen/fitness1/README.md | 42 +- gen/fitness1/src/lib.rs | 16 +- gen/fusiontables2-cli/Cargo.toml | 4 +- gen/fusiontables2-cli/README.md | 3 +- gen/fusiontables2-cli/mkdocs.yml | 3 +- gen/fusiontables2-cli/src/main.rs | 81 +- gen/fusiontables2/Cargo.toml | 4 +- gen/fusiontables2/README.md | 70 +- gen/fusiontables2/src/lib.rs | 293 +- 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 | 56 +- gen/genomics1/Cargo.toml | 4 +- gen/genomics1/README.md | 74 +- gen/genomics1/src/lib.rs | 424 +- 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 | 2 +- gen/iam1-cli/Cargo.toml | 4 +- gen/iam1-cli/README.md | 2 +- gen/iam1-cli/mkdocs.yml | 2 +- gen/iam1-cli/src/main.rs | 76 +- gen/iam1/Cargo.toml | 4 +- gen/iam1/README.md | 52 +- gen/iam1/src/lib.rs | 277 +- gen/identitytoolkit3-cli/Cargo.toml | 4 +- gen/identitytoolkit3-cli/README.md | 3 +- gen/identitytoolkit3-cli/mkdocs.yml | 3 +- gen/identitytoolkit3-cli/src/main.rs | 116 +- gen/identitytoolkit3/Cargo.toml | 4 +- gen/identitytoolkit3/README.md | 44 +- gen/identitytoolkit3/src/lib.rs | 670 +- gen/logging2-cli/Cargo.toml | 4 +- gen/logging2-cli/README.md | 17 +- gen/logging2-cli/mkdocs.yml | 14 +- gen/logging2-cli/src/main.rs | 1309 +- gen/logging2/Cargo.toml | 4 +- gen/logging2/README.md | 63 +- gen/logging2/src/lib.rs | 7626 +- 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 | 16 +- gen/logging2_beta1/Cargo.toml | 4 +- gen/logging2_beta1/README.md | 52 +- gen/logging2_beta1/src/lib.rs | 1329 +- gen/manufacturers1-cli/Cargo.toml | 4 +- gen/manufacturers1-cli/README.md | 2 +- gen/manufacturers1-cli/mkdocs.yml | 2 +- gen/manufacturers1-cli/src/main.rs | 26 +- gen/manufacturers1/Cargo.toml | 4 +- gen/manufacturers1/README.md | 42 +- gen/manufacturers1/src/lib.rs | 90 +- gen/ml1-cli/Cargo.toml | 4 +- gen/ml1-cli/README.md | 7 +- gen/ml1-cli/mkdocs.yml | 7 +- gen/ml1-cli/src/main.rs | 661 +- gen/ml1/Cargo.toml | 4 +- gen/ml1/README.md | 59 +- gen/ml1/src/lib.rs | 2735 +- gen/monitoring3-cli/Cargo.toml | 4 +- gen/monitoring3-cli/README.md | 9 +- gen/monitoring3-cli/mkdocs.yml | 8 +- gen/monitoring3-cli/src/main.rs | 601 +- gen/monitoring3/Cargo.toml | 4 +- gen/monitoring3/README.md | 58 +- gen/monitoring3/src/lib.rs | 5401 +- gen/oslogin1-cli/Cargo.toml | 40 + gen/oslogin1-cli/LICENSE.md | 30 + gen/oslogin1-cli/README.md | 119 + gen/oslogin1-cli/mkdocs.yml | 22 + gen/oslogin1-cli/src/cmn.rs | 799 + gen/oslogin1-cli/src/main.rs | 812 + gen/oslogin1/Cargo.toml | 31 + gen/oslogin1/LICENSE.md | 30 + gen/oslogin1/README.md | 183 + gen/oslogin1/src/cmn.rs | 753 + gen/oslogin1/src/lib.rs | 2293 + gen/oslogin1_beta-cli/Cargo.toml | 4 +- gen/oslogin1_beta-cli/README.md | 3 +- gen/oslogin1_beta-cli/mkdocs.yml | 3 +- gen/oslogin1_beta-cli/src/main.rs | 89 +- gen/oslogin1_beta/Cargo.toml | 4 +- gen/oslogin1_beta/README.md | 42 +- gen/oslogin1_beta/src/lib.rs | 496 +- gen/partners2-cli/Cargo.toml | 4 +- gen/partners2-cli/README.md | 2 +- gen/partners2-cli/mkdocs.yml | 2 +- gen/partners2-cli/src/main.rs | 35 +- gen/partners2/Cargo.toml | 4 +- gen/partners2/README.md | 70 +- gen/partners2/src/lib.rs | 487 +- gen/people1-cli/Cargo.toml | 4 +- gen/people1-cli/README.md | 2 +- gen/people1-cli/mkdocs.yml | 2 +- gen/people1-cli/src/main.rs | 18 +- gen/people1/Cargo.toml | 4 +- gen/people1/README.md | 46 +- gen/people1/src/lib.rs | 494 +- 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/poly1-cli/Cargo.toml | 40 + gen/poly1-cli/LICENSE.md | 30 + gen/poly1-cli/README.md | 114 + gen/poly1-cli/mkdocs.yml | 20 + gen/poly1-cli/src/cmn.rs | 799 + gen/poly1-cli/src/main.rs | 614 + gen/poly1/Cargo.toml | 31 + gen/poly1/LICENSE.md | 30 + gen/poly1/README.md | 185 + gen/poly1/src/cmn.rs | 753 + gen/poly1/src/lib.rs | 1931 + 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 | 11 +- gen/proximitybeacon1_beta1/Cargo.toml | 4 +- gen/proximitybeacon1_beta1/README.md | 52 +- gen/proximitybeacon1_beta1/src/lib.rs | 248 +- gen/pubsub1-cli/Cargo.toml | 4 +- gen/pubsub1-cli/README.md | 9 +- gen/pubsub1-cli/mkdocs.yml | 9 +- gen/pubsub1-cli/src/main.rs | 771 +- gen/pubsub1/Cargo.toml | 4 +- gen/pubsub1/README.md | 42 +- gen/pubsub1/src/lib.rs | 2432 +- 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 | 10 +- gen/pubsub1_beta2/Cargo.toml | 4 +- gen/pubsub1_beta2/README.md | 42 +- gen/pubsub1_beta2/src/lib.rs | 226 +- gen/safebrowsing4-cli/Cargo.toml | 4 +- gen/safebrowsing4-cli/README.md | 4 +- gen/safebrowsing4-cli/mkdocs.yml | 3 +- gen/safebrowsing4-cli/src/main.rs | 137 +- gen/safebrowsing4/Cargo.toml | 4 +- gen/safebrowsing4/README.md | 54 +- gen/safebrowsing4/src/lib.rs | 470 +- 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 | 10 +- gen/serviceconsumermanagement1-cli/Cargo.toml | 40 + gen/serviceconsumermanagement1-cli/LICENSE.md | 30 + gen/serviceconsumermanagement1-cli/README.md | 124 + gen/serviceconsumermanagement1-cli/mkdocs.yml | 26 + gen/serviceconsumermanagement1-cli/src/cmn.rs | 799 + .../src/main.rs | 1269 + gen/serviceconsumermanagement1/Cargo.toml | 31 + gen/serviceconsumermanagement1/LICENSE.md | 30 + gen/serviceconsumermanagement1/README.md | 185 + gen/serviceconsumermanagement1/src/cmn.rs | 753 + gen/serviceconsumermanagement1/src/lib.rs | 6357 ++ gen/sourcerepo1-cli/Cargo.toml | 4 +- gen/sourcerepo1-cli/README.md | 2 +- gen/sourcerepo1-cli/mkdocs.yml | 2 +- gen/sourcerepo1-cli/src/main.rs | 6 +- gen/sourcerepo1/Cargo.toml | 4 +- gen/sourcerepo1/README.md | 42 +- gen/sourcerepo1/src/lib.rs | 46 +- gen/spanner1-cli/Cargo.toml | 4 +- gen/spanner1-cli/README.md | 2 +- gen/spanner1-cli/mkdocs.yml | 2 +- gen/spanner1-cli/src/main.rs | 6 +- gen/spanner1/Cargo.toml | 4 +- gen/spanner1/README.md | 42 +- gen/spanner1/src/lib.rs | 646 +- gen/sqladmin1_beta4-cli/Cargo.toml | 4 +- gen/sqladmin1_beta4-cli/README.md | 3 +- gen/sqladmin1_beta4-cli/mkdocs.yml | 3 +- gen/sqladmin1_beta4-cli/src/main.rs | 134 +- gen/sqladmin1_beta4/Cargo.toml | 4 +- gen/sqladmin1_beta4/README.md | 71 +- gen/sqladmin1_beta4/src/lib.rs | 407 +- gen/storage1-cli/Cargo.toml | 4 +- gen/storage1-cli/README.md | 2 +- gen/storage1-cli/mkdocs.yml | 2 +- gen/storage1-cli/src/main.rs | 33 +- gen/storage1/Cargo.toml | 4 +- gen/storage1/README.md | 80 +- gen/storage1/src/lib.rs | 222 +- gen/storagetransfer1-cli/Cargo.toml | 4 +- gen/storagetransfer1-cli/README.md | 2 +- gen/storagetransfer1-cli/mkdocs.yml | 2 +- gen/storagetransfer1-cli/src/main.rs | 14 +- gen/storagetransfer1/Cargo.toml | 4 +- gen/storagetransfer1/README.md | 52 +- gen/storagetransfer1/src/lib.rs | 1228 +- gen/tagmanager1-cli/Cargo.toml | 4 +- gen/tagmanager1-cli/README.md | 2 +- gen/tagmanager1-cli/mkdocs.yml | 2 +- gen/tagmanager1-cli/src/main.rs | 156 +- gen/tagmanager1/Cargo.toml | 4 +- gen/tagmanager1/README.md | 44 +- gen/tagmanager1/src/lib.rs | 69 +- gen/tagmanager2-cli/Cargo.toml | 4 +- gen/tagmanager2-cli/README.md | 2 +- gen/tagmanager2-cli/mkdocs.yml | 2 +- gen/tagmanager2-cli/src/main.rs | 29 +- gen/tagmanager2/Cargo.toml | 4 +- gen/tagmanager2/README.md | 44 +- gen/tagmanager2/src/lib.rs | 4 +- gen/testing1-cli/Cargo.toml | 4 +- gen/testing1-cli/README.md | 2 +- gen/testing1-cli/mkdocs.yml | 2 +- gen/testing1-cli/src/main.rs | 14 +- gen/testing1/Cargo.toml | 4 +- gen/testing1/README.md | 46 +- gen/testing1/src/lib.rs | 336 +- gen/tpu1_alpha1-cli/Cargo.toml | 40 + gen/tpu1_alpha1-cli/LICENSE.md | 30 + gen/tpu1_alpha1-cli/README.md | 125 + gen/tpu1_alpha1-cli/mkdocs.yml | 28 + gen/tpu1_alpha1-cli/src/cmn.rs | 799 + gen/tpu1_alpha1-cli/src/main.rs | 1353 + gen/tpu1_alpha1/Cargo.toml | 31 + gen/tpu1_alpha1/LICENSE.md | 30 + gen/tpu1_alpha1/README.md | 185 + gen/tpu1_alpha1/src/cmn.rs | 753 + gen/tpu1_alpha1/src/lib.rs | 4284 + gen/translate2/src/lib.rs | 14 +- gen/vault1-cli/Cargo.toml | 4 +- gen/vault1-cli/README.md | 2 +- gen/vault1-cli/mkdocs.yml | 2 +- gen/vault1-cli/src/main.rs | 2 +- gen/vault1/Cargo.toml | 4 +- gen/vault1/README.md | 44 +- gen/vault1/src/lib.rs | 10 +- gen/videointelligence1_beta1-cli/Cargo.toml | 4 +- gen/videointelligence1_beta1-cli/README.md | 2 +- gen/videointelligence1_beta1-cli/mkdocs.yml | 2 +- gen/videointelligence1_beta1-cli/src/main.rs | 2 +- gen/videointelligence1_beta1/Cargo.toml | 4 +- gen/videointelligence1_beta1/README.md | 42 +- gen/videointelligence1_beta1/src/lib.rs | 84 +- gen/youtube3-cli/Cargo.toml | 4 +- gen/youtube3-cli/README.md | 2 +- gen/youtube3-cli/mkdocs.yml | 2 +- gen/youtube3-cli/src/main.rs | 30 +- gen/youtube3/Cargo.toml | 4 +- gen/youtube3/README.md | 158 +- gen/youtube3/src/lib.rs | 21 +- 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 | 66 +- 776 files changed, 356718 insertions(+), 104442 deletions(-) create mode 100644 etc/api/abusiveexperiencereport/v1/abusiveexperiencereport-api.json create mode 100644 etc/api/cloudiot/v1/cloudiot-api.json create mode 100644 etc/api/cloudiot/v1beta1/cloudiot-api.json create mode 100644 etc/api/dfareporting/v3.0/dfareporting-api.json create mode 100644 etc/api/dialogflow/v2beta1/dialogflow-api.json create mode 100644 etc/api/dns/v1beta2/dns-api.json create mode 100644 etc/api/firestore/v1beta1/firestore-api.json create mode 100644 etc/api/oslogin/v1/oslogin-api.json create mode 100644 etc/api/poly/v1/poly-api.json create mode 100644 etc/api/serviceconsumermanagement/v1/serviceconsumermanagement-api.json create mode 100644 etc/api/tpu/v1alpha1/tpu-api.json create mode 100644 etc/api/vision/v1p1beta1/vision-api.json create mode 100644 gen/abusiveexperiencereport1-cli/Cargo.toml create mode 100644 gen/abusiveexperiencereport1-cli/LICENSE.md create mode 100644 gen/abusiveexperiencereport1-cli/README.md create mode 100644 gen/abusiveexperiencereport1-cli/mkdocs.yml create mode 100644 gen/abusiveexperiencereport1-cli/src/cmn.rs create mode 100644 gen/abusiveexperiencereport1-cli/src/main.rs create mode 100644 gen/abusiveexperiencereport1/Cargo.toml create mode 100644 gen/abusiveexperiencereport1/LICENSE.md create mode 100644 gen/abusiveexperiencereport1/README.md create mode 100644 gen/abusiveexperiencereport1/src/cmn.rs create mode 100644 gen/abusiveexperiencereport1/src/lib.rs create mode 100644 gen/cloudiot1-cli/Cargo.toml create mode 100644 gen/cloudiot1-cli/LICENSE.md create mode 100644 gen/cloudiot1-cli/README.md create mode 100644 gen/cloudiot1-cli/mkdocs.yml create mode 100644 gen/cloudiot1-cli/src/cmn.rs create mode 100644 gen/cloudiot1-cli/src/main.rs create mode 100644 gen/cloudiot1/Cargo.toml create mode 100644 gen/cloudiot1/LICENSE.md create mode 100644 gen/cloudiot1/README.md create mode 100644 gen/cloudiot1/src/cmn.rs create mode 100644 gen/cloudiot1/src/lib.rs create mode 100644 gen/dfareporting3-cli/Cargo.toml create mode 100644 gen/dfareporting3-cli/LICENSE.md create mode 100644 gen/dfareporting3-cli/README.md create mode 100644 gen/dfareporting3-cli/mkdocs.yml create mode 100644 gen/dfareporting3-cli/src/cmn.rs create mode 100644 gen/dfareporting3-cli/src/main.rs create mode 100644 gen/dfareporting3/Cargo.toml create mode 100644 gen/dfareporting3/LICENSE.md create mode 100644 gen/dfareporting3/README.md create mode 100644 gen/dfareporting3/src/cmn.rs create mode 100644 gen/dfareporting3/src/lib.rs create mode 100644 gen/dialogflow2_beta1-cli/Cargo.toml create mode 100644 gen/dialogflow2_beta1-cli/LICENSE.md create mode 100644 gen/dialogflow2_beta1-cli/README.md create mode 100644 gen/dialogflow2_beta1-cli/mkdocs.yml create mode 100644 gen/dialogflow2_beta1-cli/src/cmn.rs create mode 100644 gen/dialogflow2_beta1-cli/src/main.rs create mode 100644 gen/dialogflow2_beta1/Cargo.toml create mode 100644 gen/dialogflow2_beta1/LICENSE.md create mode 100644 gen/dialogflow2_beta1/README.md create mode 100644 gen/dialogflow2_beta1/src/cmn.rs create mode 100644 gen/dialogflow2_beta1/src/lib.rs create mode 100644 gen/firestore1_beta1-cli/Cargo.toml create mode 100644 gen/firestore1_beta1-cli/LICENSE.md create mode 100644 gen/firestore1_beta1-cli/README.md create mode 100644 gen/firestore1_beta1-cli/mkdocs.yml create mode 100644 gen/firestore1_beta1-cli/src/cmn.rs create mode 100644 gen/firestore1_beta1-cli/src/main.rs create mode 100644 gen/firestore1_beta1/Cargo.toml create mode 100644 gen/firestore1_beta1/LICENSE.md create mode 100644 gen/firestore1_beta1/README.md create mode 100644 gen/firestore1_beta1/src/cmn.rs create mode 100644 gen/firestore1_beta1/src/lib.rs create mode 100644 gen/oslogin1-cli/Cargo.toml create mode 100644 gen/oslogin1-cli/LICENSE.md create mode 100644 gen/oslogin1-cli/README.md create mode 100644 gen/oslogin1-cli/mkdocs.yml create mode 100644 gen/oslogin1-cli/src/cmn.rs create mode 100644 gen/oslogin1-cli/src/main.rs create mode 100644 gen/oslogin1/Cargo.toml create mode 100644 gen/oslogin1/LICENSE.md create mode 100644 gen/oslogin1/README.md create mode 100644 gen/oslogin1/src/cmn.rs create mode 100644 gen/oslogin1/src/lib.rs create mode 100644 gen/poly1-cli/Cargo.toml create mode 100644 gen/poly1-cli/LICENSE.md create mode 100644 gen/poly1-cli/README.md create mode 100644 gen/poly1-cli/mkdocs.yml create mode 100644 gen/poly1-cli/src/cmn.rs create mode 100644 gen/poly1-cli/src/main.rs create mode 100644 gen/poly1/Cargo.toml create mode 100644 gen/poly1/LICENSE.md create mode 100644 gen/poly1/README.md create mode 100644 gen/poly1/src/cmn.rs create mode 100644 gen/poly1/src/lib.rs create mode 100644 gen/serviceconsumermanagement1-cli/Cargo.toml create mode 100644 gen/serviceconsumermanagement1-cli/LICENSE.md create mode 100644 gen/serviceconsumermanagement1-cli/README.md create mode 100644 gen/serviceconsumermanagement1-cli/mkdocs.yml create mode 100644 gen/serviceconsumermanagement1-cli/src/cmn.rs create mode 100644 gen/serviceconsumermanagement1-cli/src/main.rs create mode 100644 gen/serviceconsumermanagement1/Cargo.toml create mode 100644 gen/serviceconsumermanagement1/LICENSE.md create mode 100644 gen/serviceconsumermanagement1/README.md create mode 100644 gen/serviceconsumermanagement1/src/cmn.rs create mode 100644 gen/serviceconsumermanagement1/src/lib.rs create mode 100644 gen/tpu1_alpha1-cli/Cargo.toml create mode 100644 gen/tpu1_alpha1-cli/LICENSE.md create mode 100644 gen/tpu1_alpha1-cli/README.md create mode 100644 gen/tpu1_alpha1-cli/mkdocs.yml create mode 100644 gen/tpu1_alpha1-cli/src/cmn.rs create mode 100644 gen/tpu1_alpha1-cli/src/main.rs create mode 100644 gen/tpu1_alpha1/Cargo.toml create mode 100644 gen/tpu1_alpha1/LICENSE.md create mode 100644 gen/tpu1_alpha1/README.md create mode 100644 gen/tpu1_alpha1/src/cmn.rs create mode 100644 gen/tpu1_alpha1/src/lib.rs diff --git a/etc/api/abusiveexperiencereport/v1/abusiveexperiencereport-api.json b/etc/api/abusiveexperiencereport/v1/abusiveexperiencereport-api.json new file mode 100644 index 0000000000..67d3c513db --- /dev/null +++ b/etc/api/abusiveexperiencereport/v1/abusiveexperiencereport-api.json @@ -0,0 +1,250 @@ +{ + "ownerName": "Google", + "resources": { + "sites": { + "methods": { + "get": { + "response": { + "$ref": "SiteSummaryResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/xapi.zoo" + ], + "parameters": { + "name": { + "description": "The required site name. This is the site property whose abusive\nexperiences have been reviewed, and it must 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\nreturned by the API will lead to the verification page, prompting the user\nto go through that process before they can gain access to the Abusive\nExperience Report.", + "required": true, + "type": "string", + "pattern": "^sites/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/sites/{sitesId}", + "path": "v1/{+name}", + "id": "abusiveexperiencereport.sites.get", + "description": "Gets a summary of the abusive experience rating of a site." + } + } + }, + "violatingSites": { + "methods": { + "list": { + "description": "Lists sites with Abusive Experience Report statuses of \"Failing\".", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ViolatingSitesResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/xapi.zoo" + ], + "flatPath": "v1/violatingSites", + "id": "abusiveexperiencereport.violatingSites.list", + "path": "v1/violatingSites" + } + } + } + }, + "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\").", + "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": { + "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" + }, + "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": { + "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.", + "type": "boolean", + "default": "true", + "location": "query" + } + }, + "version": "v1", + "baseUrl": "https://abusiveexperiencereport.googleapis.com/", + "servicePath": "", + "description": "View Abusive Experience Report data, and get a list of sites that have a significant number of abusive experiences.", + "kind": "discovery#restDescription", + "basePath": "", + "documentationLink": "https://developers.google.com/abusive-experience-report/", + "id": "abusiveexperiencereport:v1", + "revision": "20171129", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "ViolatingSitesResponse": { + "properties": { + "violatingSites": { + "description": "A list of summaries of violating sites.", + "type": "array", + "items": { + "$ref": "SiteSummaryResponse" + } + } + }, + "id": "ViolatingSitesResponse", + "description": "Response message for ListViolatingSites.", + "type": "object" + }, + "SiteSummaryResponse": { + "properties": { + "underReview": { + "description": "Whether the site is currently under review.", + "type": "boolean" + }, + "reportUrl": { + "description": "A link that leads to a full abusive experience report.", + "type": "string" + }, + "lastChangeTime": { + "description": "The last time that the site changed status.", + "format": "google-datetime", + "type": "string" + }, + "reviewedSite": { + "description": "The name of the site reviewed.", + "type": "string" + }, + "abusiveStatus": { + "description": "The status of the site reviewed for the abusive experiences.", + "type": "string", + "enumDescriptions": [ + "Not reviewed.", + "Passing.", + "Failing." + ], + "enum": [ + "UNKNOWN", + "PASSING", + "FAILING" + ] + }, + "enforcementTime": { + "description": "The date on which enforcement begins.", + "format": "google-datetime", + "type": "string" + }, + "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 abusive experience enforcement status of the site.", + "type": "string" + } + }, + "id": "SiteSummaryResponse", + "description": "Response message for GetSiteSummary.", + "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" + }, + "canonicalName": "Abusive Experience Report", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/xapi.zoo": { + "description": "Test scope for access to the Zoo service" + } + } + } + }, + "rootUrl": "https://abusiveexperiencereport.googleapis.com/", + "ownerDomain": "google.com", + "name": "abusiveexperiencereport", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Abusive Experience Report API" +} diff --git a/etc/api/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-api.json b/etc/api/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-api.json index b69a099ab3..3903fd6271 100644 --- a/etc/api/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-api.json +++ b/etc/api/acceleratedmobilepageurl/v1/acceleratedmobilepageurl-api.json @@ -1,7 +1,4 @@ { - "ownerName": "Google", - "discoveryVersion": "v1", - "version_module": true, "resources": { "ampUrls": { "methods": { @@ -13,47 +10,78 @@ }, "parameters": {}, "flatPath": "v1/ampUrls:batchGet", - "path": "v1/ampUrls:batchGet", "id": "acceleratedmobilepageurl.ampUrls.batchGet", - "description": "Returns AMP URL(s) and equivalent\n[AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format).", + "path": "v1/ampUrls:batchGet", "request": { "$ref": "BatchGetAmpUrlsRequest" - } + }, + "description": "Returns AMP URL(s) and equivalent\n[AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format)." } } } }, "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" + }, + "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": { - "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" + "description": "Pretty-print response.", + "type": "boolean", + "default": "true" }, "bearer_token": { "location": "query", "description": "OAuth bearer token.", "type": "string" }, - "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "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", + "default": "true" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", "location": "query" }, "fields": { @@ -61,15 +89,10 @@ "type": "string", "location": "query" }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, "callback": { + "location": "query", "description": "JSONP", - "type": "string", - "location": "query" + "type": "string" }, "$.xgafv": { "enum": [ @@ -83,74 +106,48 @@ "v2 error format" ], "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": { - "location": "query", - "description": "OAuth access token.", - "type": "string" } }, "schemas": { "BatchGetAmpUrlsResponse": { - "description": "Batch AMP URL response.", - "type": "object", "properties": { - "urlErrors": { - "description": "The errors for requested URLs that have no AMP URL.", - "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.", + "type": "array", "items": { "$ref": "AmpUrl" - }, - "type": "array" + } + }, + "urlErrors": { + "description": "The errors for requested URLs that have no AMP URL.", + "type": "array", + "items": { + "$ref": "AmpUrlError" + } } }, - "id": "BatchGetAmpUrlsResponse" + "id": "BatchGetAmpUrlsResponse", + "description": "Batch AMP URL response.", + "type": "object" }, "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" }, - "ampUrl": { - "description": "The AMP URL pointing to the publisher's web server.", - "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" } }, - "id": "AmpUrl" + "id": "AmpUrl", + "description": "AMP URL response for a requested URL.", + "type": "object" }, "AmpUrlError": { "description": "AMP URL Error resource for a requested URL that couldn't be found.", @@ -193,30 +190,30 @@ "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" + "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." + ] } }, "id": "BatchGetAmpUrlsRequest" } }, "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", @@ -229,8 +226,11 @@ "ownerDomain": "google.com", "name": "acceleratedmobilepageurl", "batchPath": "batch", + "revision": "20171202", "documentationLink": "https://developers.google.com/amp/cache/", - "revision": "20170921", "id": "acceleratedmobilepageurl:v1", - "title": "Accelerated Mobile Pages (AMP) URL API" + "title": "Accelerated Mobile Pages (AMP) URL API", + "discoveryVersion": "v1", + "ownerName": "Google", + "version_module": true } diff --git a/etc/api/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json b/etc/api/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json index 0416c57876..e45cd3fc4b 100644 --- a/etc/api/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json +++ b/etc/api/adexchangebuyer2/v2beta1/adexchangebuyer2-api.json @@ -1,1916 +1,20 @@ { - "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", - "title": "Ad Exchange Buyer API II", - "ownerName": "Google", - "resources": { - "accounts": { - "resources": { - "clients": { - "methods": { - "list": { - "response": { - "$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).", - "type": "string", - "location": "query", - "enum": [ - "NO_DUPLICATES", - "FORCE_ENABLE_DUPLICATE_IDS" - ] - }, - "accountId": { - "location": "path", - "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.", - "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" - }, - "stopWatching": { - "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" - ], - "httpMethod": "POST", - "parameters": { - "accountId": { - "location": "path", - "description": "The account of the creative to stop notifications for.", - "type": "string", - "required": true - }, - "creativeId": { - "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" - ] - }, - "get": { - "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", - "parameterOrder": [ - "accountId", - "creativeId" - ] - }, - "watch": { - "httpMethod": "POST", - "parameterOrder": [ - "accountId", - "creativeId" - ], - "response": { - "$ref": "Empty" - }, - "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", - "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": { - "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}", - "id": "adexchangebuyer2.accounts.creatives.update", - "request": { - "$ref": "Creative" - }, - "description": "Updates a creative.", - "httpMethod": "PUT", - "parameterOrder": [ - "accountId", - "creativeId" - ], - "response": { - "$ref": "Creative" - }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "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": { - "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\nListDealAssociationsResponse.next_page_token\nreturned from the previous call to 'ListDealAssociations' method.", - "type": "string" - }, - "pageSize": { - "location": "query", - "format": "int32", - "description": "Requested page size. Server may return fewer associations than requested.\nIf unspecified, server will pick an appropriate default.", - "type": "integer" - }, - "accountId": { - "description": "The account to list the associations from.\nSpecify \"-\" to list all creatives the current user has access to.", - "type": "string", - "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": { - "description": "The creative ID to list the associations from.\nSpecify \"-\" to list all creatives under the above account.", - "type": "string", - "required": true, - "location": "path" - } - }, - "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations", - "id": "adexchangebuyer2.accounts.creatives.dealAssociations.list", - "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations", - "description": "List all creative-deal associations.", - "response": { - "$ref": "ListDealAssociationsResponse" - }, - "parameterOrder": [ - "accountId", - "creativeId" - ], - "httpMethod": "GET" - }, - "remove": { - "httpMethod": "POST", - "parameterOrder": [ - "accountId", - "creativeId" - ], - "response": { - "$ref": "Empty" - }, - "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 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.", - "type": "string", - "required": true - } - }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "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" - } - } - } - } - } - }, - "filterSets": { - "methods": { - "list": { - "response": { - "$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": { - "filterSetId": { - "format": "int64", - "description": "The ID of the filter set to get.", - "type": "string", - "required": true, - "location": "path" - }, - "accountId": { - "location": "path", - "format": "int64", - "description": "Account ID of the buyer.", - "type": "string", - "required": true - } - }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ] - }, - "create": { - "response": { - "$ref": "FilterSet" - }, - "parameterOrder": [ - "accountId" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "parameters": { - "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": { - "location": "path", - "format": "int64", - "description": "Account ID of the buyer.", - "type": "string", - "required": true - } - }, - "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": { - "filteredBids": { - "methods": { - "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", - "filterSetId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "parameters": { - "filterSetId": { - "type": "string", - "required": true, - "location": "path", - "format": "int64", - "description": "The ID of the filter set to apply." - }, - "pageToken": { - "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": "query" - }, - "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}/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" - } - } - } - } - }, - "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": "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", - "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\nListBidResponsesWithoutBidsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.bidResponsesWithoutBids.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": { - "format": "int64", - "description": "Account ID of the buyer.", - "type": "string", - "required": true, - "location": "path" - }, - "filterSetId": { - "format": "int64", - "description": "The ID of the filter set to apply.", - "type": "string", - "required": true, - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/adexchange.buyer" - ], - "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" - ] - } - } - } - } - } - } - } - }, - "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" - }, - "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": { - "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", - "baseUrl": "https://adexchangebuyer.googleapis.com/", - "servicePath": "", - "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": "", - "revision": "20170922", - "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest/reference/rest/", - "id": "adexchangebuyer2:v2beta1", "discoveryVersion": "v1", "version_module": true, "schemas": { - "AddDealAssociationRequest": { - "description": "A request for associating a deal and a creative.", - "type": "object", - "properties": { - "association": { - "description": "The association between a creative and a deal that should be added.", - "$ref": "CreativeDealAssociation" - } - }, - "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": { - "nextPageToken": { - "description": "A token to retrieve the next page of results.\nPass this value in the\nListClientUserInvitationsRequest.pageToken\nfield in the subsequent call to the\nclients.invitations.list\nmethod to retrieve the next\npage of results.", - "type": "string" - }, - "invitations": { - "description": "The returned list of client users.", - "items": { - "$ref": "ClientUserInvitation" - }, - "type": "array" - } - }, - "id": "ListClientUserInvitationsResponse", - "type": "object" - }, - "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\nListCreativeStatusBreakdownByDetailRequest.pageToken\nfield in the subsequent call to the\naccounts.filterSets.filteredBids.details.list\nmethod to retrieve the next page of results.", - "type": "string" - }, - "filteredBidDetailRows": { - "description": "List of rows, with counts of bids with a given creative status aggregated\nby detail.", - "items": { - "$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.", - "items": { - "format": "int32", - "type": "integer" - }, - "type": "array" - } - }, - "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.", - "items": { - "enum": [ - "DESKTOP", - "ANDROID", - "IOS" - ], - "type": "string" - }, - "type": "array" - } - }, - "id": "PlatformContext" - }, "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": { "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", + "format": "int64", "type": "string" }, "value": { - "type": "string", + "description": "The expected value of the metric.", "format": "int64", - "description": "The expected value of the metric." + "type": "string" } }, "id": "MetricValue" @@ -1919,7 +23,18 @@ "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": { + "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.", + "format": "int64", + "type": "string" + }, "status": { + "enumDescriptions": [ + "A placeholder for an undefined user status.", + "A user who was already created but hasn't accepted the invitation yet.", + "A user that is currently active.", + "A user that is currently disabled." + ], "enum": [ "USER_STATUS_UNSPECIFIED", "PENDING", @@ -1927,26 +42,15 @@ "DISABLED" ], "description": "The status of the client user.", - "type": "string", - "enumDescriptions": [ - "A placeholder for an undefined user status.", - "A user who was already created but hasn't accepted the invitation yet.", - "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.", + "format": "int64", "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.", + "email": { + "description": "User's email address. The value of this field\nis ignored in an update operation.", "type": "string" } }, @@ -1961,12 +65,12 @@ "type": "string" }, "creativeId": { - "type": "string", - "description": "The ID of the creative associated with the deal." + "description": "The ID of the creative associated with the deal.", + "type": "string" }, "dealsId": { - "type": "string", - "description": "The externalDealId for the deal associated with the creative." + "description": "The externalDealId for the deal associated with the creative.", + "type": "string" } }, "id": "CreativeDealAssociation" @@ -1975,16 +79,16 @@ "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." - }, - "reasons": { - "description": "The set of filtering reasons for this date.", - "items": { - "$ref": "Reason" - }, - "type": "array" } }, "id": "FilteringStats" @@ -1993,90 +97,105 @@ "description": "A creative and its classification data.", "type": "object", "properties": { - "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).", + "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": { - "$ref": "ServingRestriction" - }, - "type": "array" + "type": "string" + } + }, + "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" + }, + "native": { + "$ref": "NativeContent", + "description": "A native creative." }, "video": { "description": "A video creative.", "$ref": "VideoContent" }, + "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" + } + }, "agencyId": { - "format": "int64", "description": "The agency ID for this creative.", + "format": "int64", "type": "string" }, "clickThroughUrls": { "description": "The set of destination URLs for the creative.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } + }, + "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.", + "type": "array", + "items": { + "format": "int32", + "type": "integer" + } }, "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", "ALCOHOL" ], "type": "string" - }, - "type": "array" + } }, "corrections": { "description": "@OutputOnly Shows any corrections that were applied to this creative.", + "type": "array", "items": { "$ref": "Correction" - }, - "type": "array" + } }, "version": { - "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": { "description": "The set of URLs to be called to record an impression.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "html": { - "description": "An HTML creative.", - "$ref": "HtmlContent" + "$ref": "HtmlContent", + "description": "An HTML creative." }, "dealsStatus": { "enumDescriptions": [ @@ -2098,11 +217,11 @@ }, "detectedProductCategories": { "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", "items": { - "type": "integer", - "format": "int32" - }, - "type": "array" + "format": "int32", + "type": "integer" + } }, "openAuctionStatus": { "enumDescriptions": [ @@ -2126,27 +245,28 @@ "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" - }, - "type": "array" + } + }, + "detectedDomains": { + "description": "@OutputOnly\nThe detected domains for this creative.", + "type": "array", + "items": { + "type": "string" + } }, "filteringStats": { - "description": "@OutputOnly The filtering stats for this creative.", - "$ref": "FilteringStats" + "$ref": "FilteringStats", + "description": "@OutputOnly The filtering stats for this creative." }, "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", @@ -2176,7 +296,6 @@ ], "type": "string" }, - "type": "array", "enumDescriptions": [ "Do not use. This is a placeholder value only.", "The creative is tagged.", @@ -2205,23 +324,8 @@ ] }, "apiUpdateTime": { - "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.", - "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.", + "format": "google-datetime", "type": "string" } }, @@ -2238,42 +342,31 @@ }, "id": "RemoveDealAssociationRequest" }, + "ListCreativeStatusBreakdownByCreativeResponse": { + "description": "Response message for listing all creatives associated with a given filtered\nbid reason.", + "type": "object", + "properties": { + "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 filteredBids.creatives.list\nmethod to retrieve the next page of results.", + "type": "string" + }, + "filteredBidCreativeRows": { + "description": "List of rows, with counts of bids with a given creative status aggregated\nby creative.", + "type": "array", + "items": { + "$ref": "FilteredBidCreativeRow" + } + } + }, + "id": "ListCreativeStatusBreakdownByCreativeResponse" + }, "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", - "CLIENT_DEAL_NEGOTIATOR", - "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" - }, - "visibleToSeller": { - "description": "Whether the client buyer will be visible to sellers.", - "type": "boolean" - }, - "entityId": { - "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": { - "format": "int64", "description": "The globally-unique numerical ID of the client.\nThe value of this field is ignored in create and update operations.", + "format": "int64", "type": "string" }, "entityName": { @@ -2281,7 +374,6 @@ "type": "string" }, "status": { - "type": "string", "enumDescriptions": [ "A placeholder for an undefined client status.", "A client that is currently disabled.", @@ -2292,11 +384,14 @@ "DISABLED", "ACTIVE" ], - "description": "The status of the client buyer." + "description": "The status of the client buyer.", + "type": "string" + }, + "partnerClientId": { + "description": "Optional arbitrary unique identifier of this client buyer from the\nstandpoint of its Ad Exchange sponsor buyer.\n\nThis field can be used to associate a client buyer with the identifier\nin the namespace of its sponsor buyer, lookup client buyers by that\nidentifier and verify whether an Ad Exchange counterpart of a given client\nbuyer already exists.\n\nIf present, must be unique among all the client buyers for its\nAd Exchange sponsor buyer.", + "type": "string" }, "entityType": { - "description": "The type of the client entity: `ADVERTISER`, `BRAND`, or `AGENCY`.", - "type": "string", "enumDescriptions": [ "A placeholder for an undefined client entity type. Should not be used.", "An advertiser.", @@ -2308,42 +403,47 @@ "ADVERTISER", "BRAND", "AGENCY" - ] - } - }, - "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" + ], + "description": "The type of the client entity: `ADVERTISER`, `BRAND`, or `AGENCY`.", + "type": "string" }, - "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.", + "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": { + "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." + ], + "enum": [ + "CLIENT_ROLE_UNSPECIFIED", + "CLIENT_DEAL_VIEWER", + "CLIENT_DEAL_NEGOTIATOR", + "CLIENT_DEAL_APPROVER" + ] + }, + "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", "type": "string" } }, - "id": "ListCreativeStatusBreakdownByCreativeResponse" + "id": "Client" }, "Correction": { "description": "@OutputOnly Shows any corrections that were applied to this creative.", "type": "object", "properties": { - "details": { - "description": "Additional details about what was corrected.", - "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.", @@ -2372,41 +472,68 @@ "FLASH_ATTRIBUTE_REMOVED", "VIDEO_IN_SNIPPET_ATTRIBUTE_ADDED" ], - "description": "The type of correction that was applied to the creative." + "description": "The type of correction that was applied to the creative.", + "type": "string" }, "contexts": { "description": "The contexts for the correction.", + "type": "array", "items": { "$ref": "ServingContext" - }, - "type": "array" + } + }, + "details": { + "description": "Additional details about what was corrected.", + "type": "array", + "items": { + "type": "string" + } } }, "id": "Correction" }, "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", "properties": { + "relativeDateRange": { + "$ref": "RelativeDateRange", + "description": "A relative date range, defined by an offset from today and a duration.\nInterpreted relative to Pacific time zone." + }, + "platforms": { + "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." + ], + "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).", + "type": "array", + "items": { + "enum": [ + "PLATFORM_UNSPECIFIED", + "DESKTOP", + "TABLET", + "MOBILE" + ], + "type": "string" + } + }, + "name": { + "description": "A user-defined name of the filter set. Filter set names must be unique\nglobally and match one of the patterns:\n\n- `bidders/*/filterSets/*` (for accessing bidder-level troubleshooting\ndata)\n- `bidders/*/accounts/*/filterSets/*` (for accessing account-level\ntroubleshooting data)\n\nThis field is required in create operations.", + "type": "string" + }, "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.", + "type": "array", "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" + "$ref": "AbsoluteDateRange", + "description": "An absolute date range, defined by a start date and an end date.\nInterpreted relative to Pacific time zone." }, "environment": { "enumDescriptions": [ @@ -2422,12 +549,9 @@ "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": { + "description": "DEPRECATED: use repeated formats field instead.\nThe format on which to filter; optional.", + "type": "string", "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).", @@ -2437,84 +561,54 @@ "FORMAT_UNSPECIFIED", "DISPLAY", "VIDEO" - ], - "description": "The format on which to filter; optional.", + ] + }, + "dealId": { + "description": "The ID of the deal on which to filter; optional. This field may be set\nonly for a filter set that accesses account-level troubleshooting data,\ni.e. one whose name matches the `bidders/*/accounts/*/filterSets/*`\npattern.", + "format": "int64", "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." + ], + "enum": [ + "TIME_SERIES_GRANULARITY_UNSPECIFIED", + "HOURLY", + "DAILY" ] }, - "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).", + "formats": { + "description": "The list of formats on which to filter; may be empty. The filters\nrepresented by multiple formats are ORed together (i.e. if non-empty,\nresults must match any one of the formats).", + "type": "array", "items": { "type": "string", "enum": [ - "PLATFORM_UNSPECIFIED", - "DESKTOP", - "TABLET", - "MOBILE" + "FORMAT_UNSPECIFIED", + "DISPLAY", + "VIDEO" ] }, - "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." + "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." ] + }, + "creativeId": { + "description": "The ID of the creative on which to filter; optional. This field may be set\nonly for a filter set that accesses account-level troubleshooting data,\ni.e. one whose name matches the `bidders/*/accounts/*/filterSets/*`\npattern.", + "type": "string" } }, - "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" + "id": "FilterSet" }, "ListDealAssociationsResponse": { "description": "A response for listing creative and deal associations", @@ -2526,19 +620,33 @@ }, "associations": { "description": "The list of associations.", + "type": "array", "items": { "$ref": "CreativeDealAssociation" - }, - "type": "array" + } } }, "id": "ListDealAssociationsResponse" }, - "StopWatchingCreativeRequest": { - "description": "A request for stopping notifications for changes to creative Status.", + "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": {}, - "id": "StopWatchingCreativeRequest" + "properties": { + "impressionCount": { + "$ref": "MetricValue", + "description": "The number of impressions for which there was a bid request or bid response\nwith the specified callout status." + }, + "rowDimensions": { + "description": "The values of all dimensions associated with metric values in this row.", + "$ref": "RowDimensions" + }, + "calloutStatusId": { + "description": "The ID of the callout status.\nSee [callout-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/callout-status-codes).", + "format": "int32", + "type": "integer" + } + }, + "id": "CalloutStatusRow" }, "Disapproval": { "description": "@OutputOnly The reason and details for a disapproval.", @@ -2546,13 +654,12 @@ "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.", @@ -2745,18 +852,37 @@ "PERSONAL_LOANS", "UNSUPPORTED_FLASH_CONTENT" ], - "description": "The categorized reason for disapproval." + "description": "The categorized reason for disapproval.", + "type": "string" } }, "id": "Disapproval" }, + "StopWatchingCreativeRequest": { + "description": "A request for stopping notifications for changes to creative Status.", + "type": "object", + "properties": {}, + "id": "StopWatchingCreativeRequest" + }, "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.", @@ -2766,21 +892,9 @@ "STATUS_UNSPECIFIED", "DISAPPROVAL", "PENDING_REVIEW" - ] - }, - "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" + ], + "description": "The status of the creative in this context (for example, it has been\nexplicitly disapproved or is pending review).", + "type": "string" } }, "id": "ServingRestriction" @@ -2789,26 +903,25 @@ "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": { + "year": { + "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", "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": { - "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": "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.", + "format": "int32", "type": "integer" } }, "id": "Date" }, "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": { @@ -2816,7 +929,8 @@ "$ref": "TimeInterval", "description": "The time interval that this row represents." } - } + }, + "id": "RowDimensions" }, "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 `{}`.", @@ -2830,14 +944,14 @@ "properties": { "appTypes": { "description": "The app types this restriction applies to.", + "type": "array", "items": { + "type": "string", "enum": [ "NATIVE", "WEB" - ], - "type": "string" + ] }, - "type": "array", "enumDescriptions": [ "Native app context.", "Mobile web app context." @@ -2851,14 +965,14 @@ "type": "object", "properties": { "creativeStatusRows": { + "description": "List of rows, with counts of filtered bids aggregated by filtering reason\n(i.e. creative status).", + "type": "array", "items": { "$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.", + "description": "A token to retrieve the next page of results.\nPass this value in the\nListFilteredBidsRequest.pageToken\nfield in the subsequent call to the filteredBids.list\nmethod to retrieve the next page of results.", "type": "string" } }, @@ -2874,30 +988,66 @@ "Matches impressions that require SSL compatibility." ], "description": "The security types in this context.", + "type": "array", "items": { "enum": [ "INSECURE", "SSL" ], "type": "string" - }, - "type": "array" + } } }, "id": "SecurityContext" }, + "ListFilteredBidRequestsResponse": { + "description": "Response message for listing all reasons that bid requests were filtered and\nnot sent to the buyer.", + "type": "object", + "properties": { + "calloutStatusRows": { + "description": "List of rows, with counts of filtered bid requests aggregated by callout\nstatus.", + "type": "array", + "items": { + "$ref": "CalloutStatusRow" + } + }, + "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 filteredBidRequests.list\nmethod to retrieve the next page of results.", + "type": "string" + } + }, + "id": "ListFilteredBidRequestsResponse" + }, + "ListCreativesResponse": { + "description": "A response for listing creatives.", + "type": "object", + "properties": { + "creatives": { + "description": "The list of creatives.", + "type": "array", + "items": { + "$ref": "Creative" + } + }, + "nextPageToken": { + "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" + }, "HtmlContent": { "description": "HTML content for a creative.", "type": "object", "properties": { "height": { - "type": "integer", + "description": "The height of the HTML snippet in pixels.", "format": "int32", - "description": "The height of the HTML snippet in pixels." + "type": "integer" }, "width": { - "format": "int32", "description": "The width of the HTML snippet in pixels.", + "format": "int32", "type": "integer" }, "snippet": { @@ -2907,56 +1057,20 @@ }, "id": "HtmlContent" }, - "ListCreativesResponse": { - "description": "A response for listing creatives.", - "type": "object", - "properties": { - "creatives": { - "description": "The list of creatives.", - "items": { - "$ref": "Creative" - }, - "type": "array" - }, - "nextPageToken": { - "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" - }, - "ListFilteredBidRequestsResponse": { - "description": "Response message for listing all reasons that bid requests were filtered and\nnot sent to the buyer.", - "type": "object", - "properties": { - "calloutStatusRows": { - "description": "List of rows, with counts of filtered bid requests aggregated by callout\nstatus.", - "items": { - "$ref": "CalloutStatusRow" - }, - "type": "array" - }, - "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" - } - }, - "id": "ListFilteredBidRequestsResponse" - }, "ListBidMetricsResponse": { "description": "Response message for listing the metrics that are measured in number of bids.", "type": "object", "properties": { "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.", + "description": "A token to retrieve the next page of results.\nPass this value in the\nListBidMetricsRequest.pageToken\nfield in the subsequent call to the bidMetrics.list\nmethod to retrieve the next page of results.", "type": "string" }, "bidMetricsRows": { "description": "List of rows, each containing a set of bid metrics.", + "type": "array", "items": { "$ref": "BidMetricsRow" - }, - "type": "array" + } } }, "id": "ListBidMetricsResponse" @@ -2966,54 +1080,18 @@ "type": "object", "properties": { "status": { - "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.", + "format": "int64", "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", @@ -3025,21 +1103,61 @@ }, "id": "VideoContent" }, + "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).", + "type": "array", + "items": { + "$ref": "CreativeStatusRow" + } + }, + "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 losingBids.list\nmethod to retrieve the next page of results.", + "type": "string" + } + }, + "id": "ListLosingBidsResponse" + }, + "ListNonBillableWinningBidsResponse": { + "description": "Response message for listing all reasons for which a buyer was not billed for\na winning bid.", + "type": "object", + "properties": { + "nonBillableWinningBidStatusRows": { + "description": "List of rows, with counts of bids not billed aggregated by reason.", + "type": "array", + "items": { + "$ref": "NonBillableWinningBidStatusRow" + } + }, + "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 nonBillableWinningBids.list\nmethod to retrieve the next page of results.", + "type": "string" + } + }, + "id": "ListNonBillableWinningBidsResponse" + }, "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": { + "successfulResponses": { + "$ref": "MetricValue", + "description": "The number of impressions for which the buyer successfully sent a response\nto Ad Exchange." + }, "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." + "description": "The number of impressions available to the buyer on Ad Exchange.\nIn some cases this value may be unavailable.", + "$ref": "MetricValue" }, "inventoryMatches": { - "description": "The number of impressions that match the buyer's inventory pretargeting.", - "$ref": "MetricValue" + "$ref": "MetricValue", + "description": "The number of impressions that match the buyer's inventory pretargeting." }, "bidRequests": { "$ref": "MetricValue", @@ -3048,10 +1166,6 @@ "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" @@ -3061,62 +1175,48 @@ "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.", + "type": "array", "items": { + "type": "string", "enum": [ "OPEN_AUCTION", "DIRECT_DEALS" - ], - "type": "string" + ] }, - "type": "array" + "enumDescriptions": [ + "The restriction applies to open auction.", + "The restriction applies to direct deals." + ] } }, "id": "AuctionContext" }, "ListImpressionMetricsResponse": { + "description": "Response message for listing the metrics that are measured in number of\nimpressions.", + "type": "object", "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.", + "description": "A token to retrieve the next page of results.\nPass this value in the\nListImpressionMetricsRequest.pageToken\nfield in the subsequent call to the impressionMetrics.list\nmethod to retrieve the next page of results.", "type": "string" }, "impressionMetricsRows": { "description": "List of rows, each containing a set of impression metrics.", + "type": "array", "items": { "$ref": "ImpressionMetricsRow" - }, - "type": "array" + } } }, - "id": "ListImpressionMetricsResponse", - "description": "Response message for listing the metrics that are measured in number of\nimpressions.", - "type": "object" + "id": "ListImpressionMetricsResponse" }, "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", "properties": { - "impressionsWon": { - "$ref": "MetricValue", - "description": "The number of bids that won an impression." - }, - "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" + "$ref": "MetricValue", + "description": "The number of bids for which the buyer was billed." }, "bidsInAuction": { "description": "The number of bids that were permitted to compete in the auction.", @@ -3125,11 +1225,25 @@ "rowDimensions": { "description": "The values of all dimensions associated with metric values in this row.", "$ref": "RowDimensions" + }, + "viewableImpressions": { + "$ref": "MetricValue", + "description": "The number of bids for which the corresponding impression was viewable (as\ndefined by Active View)." + }, + "impressionsWon": { + "$ref": "MetricValue", + "description": "The number of bids that won an impression." + }, + "measurableImpressions": { + "description": "The number of bids for which the corresponding impression was measurable\nfor viewability (as defined by Active View).", + "$ref": "MetricValue" + }, + "bids": { + "description": "The number of bids that Ad Exchange received from the buyer.", + "$ref": "MetricValue" } }, - "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" + "id": "BidMetricsRow" }, "ListBidResponseErrorsResponse": { "description": "Response message for listing all reasons that bid responses resulted in an\nerror.", @@ -3137,13 +1251,13 @@ "properties": { "calloutStatusRows": { "description": "List of rows, with counts of bid responses aggregated by callout status.", + "type": "array", "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.", + "description": "A token to retrieve the next page of results.\nPass this value in the\nListBidResponseErrorsRequest.pageToken\nfield in the subsequent call to the bidResponseErrors.list\nmethod to retrieve the next page of results.", "type": "string" } }, @@ -3158,8 +1272,8 @@ "$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).", + "format": "int32", "type": "integer" }, "bidCount": { @@ -3174,8 +1288,8 @@ "type": "object", "properties": { "startTimestamp": { - "format": "google-datetime", "description": "The start timestamp of the real-time RTB metrics aggregation.", + "format": "google-datetime", "type": "string" } }, @@ -3185,7 +1299,13 @@ "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": { + "bidCount": { + "$ref": "MetricValue", + "description": "The number of bids with the specified status." + }, "status": { + "description": "The status specifying why the winning bids were not billed.", + "type": "string", "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.", @@ -3195,17 +1315,11 @@ "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" @@ -3218,14 +1332,14 @@ "$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" + "$ref": "MetricValue", + "description": "The number of bids with the specified detail." + }, + "detailId": { + "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.", + "format": "int32", + "type": "integer" } }, "id": "FilteredBidDetailRow" @@ -3244,11 +1358,2367 @@ } }, "id": "AbsoluteDateRange" + }, + "AddDealAssociationRequest": { + "description": "A request for associating a deal and a creative.", + "type": "object", + "properties": { + "association": { + "$ref": "CreativeDealAssociation", + "description": "The association between a creative and a deal that should be added." + } + }, + "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": { + "description": "An interval of time, with an absolute start and end.", + "type": "object", + "properties": { + "endTime": { + "description": "The timestamp marking the end of the range (exclusive) for which data is\nincluded.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "The timestamp marking the start of the range (inclusive) for which data is\nincluded.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "TimeInterval" + }, + "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": { + "offsetDays": { + "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.", + "format": "int32", + "type": "integer" + }, + "durationDays": { + "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.", + "format": "int32", + "type": "integer" + } + }, + "id": "RelativeDateRange" + }, + "NativeContent": { + "description": "Native content for a creative.", + "type": "object", + "properties": { + "priceDisplayText": { + "description": "The price of the promoted app including currency info.", + "type": "string" + }, + "image": { + "description": "A large image.", + "$ref": "Image" + }, + "clickTrackingUrl": { + "description": "The URL to use for click tracking.", + "type": "string" + }, + "advertiserName": { + "description": "The name of the advertiser or sponsor, to be displayed in the ad creative.", + "type": "string" + }, + "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": { + "description": "The app icon, for app download ads.", + "$ref": "Image" + }, + "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" + } + }, + "id": "NativeContent" + }, + "ListClientsResponse": { + "type": "object", + "properties": { + "clients": { + "description": "The returned list of clients.", + "type": "array", + "items": { + "$ref": "Client" + } + }, + "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" + } + }, + "id": "ListClientsResponse" + }, + "ListBidResponsesWithoutBidsResponse": { + "description": "Response message for listing all reasons that bid responses were considered\nto have no applicable bids.", + "type": "object", + "properties": { + "bidResponseWithoutBidsStatusRows": { + "description": "List of rows, with counts of bid responses without bids aggregated by\nstatus.", + "type": "array", + "items": { + "$ref": "BidResponseWithoutBidsStatusRow" + } + }, + "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 bidResponsesWithoutBids.list\nmethod to retrieve the next page of results.", + "type": "string" + } + }, + "id": "ListBidResponsesWithoutBidsResponse" + }, + "ServingContext": { + "description": "The serving context for this restriction.", + "type": "object", + "properties": { + "location": { + "description": "Matches impressions coming from users *or* publishers in a specific\nlocation.", + "$ref": "LocationContext" + }, + "auctionType": { + "$ref": "AuctionContext", + "description": "Matches impressions for a particular auction type." + }, + "all": { + "description": "Matches all contexts.", + "type": "string", + "enumDescriptions": [ + "A simple context." + ], + "enum": [ + "SIMPLE_CONTEXT" + ] + }, + "appType": { + "description": "Matches impressions for a particular app type.", + "$ref": "AppContext" + }, + "securityType": { + "$ref": "SecurityContext", + "description": "Matches impressions for a particular security type." + }, + "platform": { + "description": "Matches impressions coming from a particular platform.", + "$ref": "PlatformContext" + } + }, + "id": "ServingContext" + }, + "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": { + "height": { + "description": "Image height in pixels.", + "format": "int32", + "type": "integer" + }, + "width": { + "description": "Image width in pixels.", + "format": "int32", + "type": "integer" + }, + "url": { + "description": "The URL of the image.", + "type": "string" + } + }, + "id": "Image" + }, + "ListFilterSetsResponse": { + "description": "Response message for listing filter sets.", + "type": "object", + "properties": { + "filterSets": { + "description": "The filter sets belonging to the buyer.", + "type": "array", + "items": { + "$ref": "FilterSet" + } + }, + "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": { + "description": "The number of impressions for which there was a bid response with the\nspecified status.", + "$ref": "MetricValue" + }, + "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": { + "description": "The values of all dimensions associated with metric values in this row.", + "$ref": "RowDimensions" + } + }, + "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": { + "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" + }, + "email": { + "description": "The email address to which the invitation is sent. Email\naddresses should be unique among all client users under each sponsor\nbuyer.", + "type": "string" + }, + "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", + "type": "string" + } + }, + "id": "ClientUserInvitation" + }, + "ListClientUsersResponse": { + "type": "object", + "properties": { + "users": { + "description": "The returned list of client users.", + "type": "array", + "items": { + "$ref": "ClientUser" + } + }, + "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" + } + }, + "id": "ListClientUsersResponse" + }, + "ListCreativeStatusBreakdownByDetailResponse": { + "description": "Response message for listing all details associated with a given filtered bid\nreason.", + "type": "object", + "properties": { + "filteredBidDetailRows": { + "description": "List of rows, with counts of bids with a given creative status aggregated\nby detail.", + "type": "array", + "items": { + "$ref": "FilteredBidDetailRow" + } + }, + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListCreativeStatusBreakdownByDetailRequest.pageToken\nfield in the subsequent call to the filteredBids.details.list\nmethod to retrieve the next page of results.", + "type": "string" + }, + "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" + }, + "ListClientUserInvitationsResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "description": "A token to retrieve the next page of results.\nPass this value in the\nListClientUserInvitationsRequest.pageToken\nfield in the subsequent call to the\nclients.invitations.list\nmethod to retrieve the next\npage of results.", + "type": "string" + }, + "invitations": { + "description": "The returned list of client users.", + "type": "array", + "items": { + "$ref": "ClientUserInvitation" + } + } + }, + "id": "ListClientUserInvitationsResponse" + }, + "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" + } + } + }, + "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": { + "type": "string", + "enum": [ + "DESKTOP", + "ANDROID", + "IOS" + ] + } + } + }, + "id": "PlatformContext" } }, - "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": "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", + "title": "Ad Exchange Buyer API II", + "ownerName": "Google", + "resources": { + "bidders": { + "resources": { + "filterSets": { + "methods": { + "delete": { + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}", + "path": "v2beta1/{+name}", + "id": "adexchangebuyer2.bidders.filterSets.delete", + "description": "Deletes the requested filter set from the account with the given account\nID.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "location": "path", + "description": "Full name of the resource to delete.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "get": { + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}", + "path": "v2beta1/{+name}", + "id": "adexchangebuyer2.bidders.filterSets.get", + "description": "Retrieves the requested filter set for the account with the given account\nID.", + "response": { + "$ref": "FilterSet" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Full name of the resource being requested.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "response": { + "$ref": "ListFilterSetsResponse" + }, + "parameterOrder": [ + "ownerName" + ], + "httpMethod": "GET", + "parameters": { + "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" + }, + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + }, + "ownerName": { + "location": "path", + "description": "Name of the owner (bidder or account) of the filter sets to be listed.\nFor example:\n\n- For a bidder-level filter set for bidder 123: `bidders/123`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/filterSets", + "path": "v2beta1/{+ownerName}/filterSets", + "id": "adexchangebuyer2.bidders.filterSets.list", + "description": "Lists all filter sets for the account with the given account ID." + }, + "create": { + "response": { + "$ref": "FilterSet" + }, + "parameterOrder": [ + "ownerName" + ], + "httpMethod": "POST", + "parameters": { + "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" + }, + "ownerName": { + "description": "Name of the owner (bidder or account) of the filter set to be created.\nFor example:\n\n- For a bidder-level filter set for bidder 123: `bidders/123`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/filterSets", + "path": "v2beta1/{+ownerName}/filterSets", + "id": "adexchangebuyer2.bidders.filterSets.create", + "request": { + "$ref": "FilterSet" + }, + "description": "Creates the specified filter set for the account with the given account ID." + } + }, + "resources": { + "losingBids": { + "methods": { + "list": { + "description": "List all reasons for which bids lost in the auction, with the number of\nbids that lost for each reason.", + "httpMethod": "GET", + "parameterOrder": [ + "filterSetName" + ], + "response": { + "$ref": "ListLosingBidsResponse" + }, + "parameters": { + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + }, + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "pageToken": { + "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 losingBids.list\nmethod.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/losingBids", + "id": "adexchangebuyer2.bidders.filterSets.losingBids.list", + "path": "v2beta1/{+filterSetName}/losingBids" + } + } + }, + "bidMetrics": { + "methods": { + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "filterSetName" + ], + "response": { + "$ref": "ListBidMetricsResponse" + }, + "parameters": { + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + }, + "filterSetName": { + "location": "path", + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$" + }, + "pageToken": { + "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 bidMetrics.list\nmethod.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/bidMetrics", + "id": "adexchangebuyer2.bidders.filterSets.bidMetrics.list", + "path": "v2beta1/{+filterSetName}/bidMetrics", + "description": "Lists all metrics that are measured in terms of number of bids." + } + } + }, + "impressionMetrics": { + "methods": { + "list": { + "description": "Lists all metrics that are measured in terms of number of impressions.", + "httpMethod": "GET", + "parameterOrder": [ + "filterSetName" + ], + "response": { + "$ref": "ListImpressionMetricsResponse" + }, + "parameters": { + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "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 impressionMetrics.list\nmethod.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/impressionMetrics", + "id": "adexchangebuyer2.bidders.filterSets.impressionMetrics.list", + "path": "v2beta1/{+filterSetName}/impressionMetrics" + } + } + }, + "bidResponseErrors": { + "methods": { + "list": { + "description": "List all errors that occurred in bid responses, with the number of bid\nresponses affected for each reason.", + "response": { + "$ref": "ListBidResponseErrorsResponse" + }, + "parameterOrder": [ + "filterSetName" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + }, + "filterSetName": { + "location": "path", + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$" + }, + "pageToken": { + "location": "query", + "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 bidResponseErrors.list\nmethod.", + "type": "string" + } + }, + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/bidResponseErrors", + "path": "v2beta1/{+filterSetName}/bidResponseErrors", + "id": "adexchangebuyer2.bidders.filterSets.bidResponseErrors.list" + } + } + }, + "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": [ + "filterSetName" + ], + "httpMethod": "GET", + "parameters": { + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "pageToken": { + "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 bidResponsesWithoutBids.list\nmethod.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/bidResponsesWithoutBids", + "path": "v2beta1/{+filterSetName}/bidResponsesWithoutBids", + "id": "adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list" + } + } + }, + "filteredBidRequests": { + "methods": { + "list": { + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBidRequests", + "path": "v2beta1/{+filterSetName}/filteredBidRequests", + "id": "adexchangebuyer2.bidders.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.", + "response": { + "$ref": "ListFilteredBidRequestsResponse" + }, + "parameterOrder": [ + "filterSetName" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "pageToken": { + "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 filteredBidRequests.list\nmethod.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "nonBillableWinningBids": { + "methods": { + "list": { + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/nonBillableWinningBids", + "path": "v2beta1/{+filterSetName}/nonBillableWinningBids", + "id": "adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list", + "description": "List all reasons for which winning bids were not billable, with the number\nof bids not billed for each reason.", + "response": { + "$ref": "ListNonBillableWinningBidsResponse" + }, + "parameterOrder": [ + "filterSetName" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "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 nonBillableWinningBids.list\nmethod.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "filteredBids": { + "methods": { + "list": { + "description": "List all reasons for which bids were filtered, with the number of bids\nfiltered for each reason.", + "response": { + "$ref": "ListFilteredBidsResponse" + }, + "parameterOrder": [ + "filterSetName" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + }, + "filterSetName": { + "location": "path", + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$" + }, + "pageToken": { + "location": "query", + "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 filteredBids.list\nmethod.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBids", + "path": "v2beta1/{+filterSetName}/filteredBids", + "id": "adexchangebuyer2.bidders.filterSets.filteredBids.list" + } + }, + "resources": { + "creatives": { + "methods": { + "list": { + "description": "List all creatives associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each creative.", + "response": { + "$ref": "ListCreativeStatusBreakdownByCreativeResponse" + }, + "parameterOrder": [ + "filterSetName", + "creativeStatusId" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + }, + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "creativeStatusId": { + "location": "path", + "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).", + "format": "int32", + "required": true, + "type": "integer" + }, + "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 filteredBids.creatives.list\nmethod.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/creatives", + "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives", + "id": "adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list" + } + } + }, + "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": [ + "filterSetName", + "creativeStatusId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "filterSetName": { + "location": "path", + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/filterSets/[^/]+$" + }, + "creativeStatusId": { + "location": "path", + "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.", + "format": "int32", + "required": true, + "type": "integer" + }, + "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 filteredBids.details.list\nmethod.", + "type": "string" + }, + "pageSize": { + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/details", + "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details", + "id": "adexchangebuyer2.bidders.filterSets.filteredBids.details.list" + } + } + } + } + } + } + }, + "accounts": { + "resources": { + "filterSets": { + "methods": { + "delete": { + "description": "Deletes the requested filter set from the account with the given account\nID.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "location": "path", + "description": "Full name of the resource to delete.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}", + "path": "v2beta1/{+name}", + "id": "adexchangebuyer2.bidders.accounts.filterSets.delete" + }, + "get": { + "description": "Retrieves the requested filter set for the account with the given account\nID.", + "response": { + "$ref": "FilterSet" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Full name of the resource being requested.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}", + "path": "v2beta1/{+name}", + "id": "adexchangebuyer2.bidders.accounts.filterSets.get" + }, + "list": { + "response": { + "$ref": "ListFilterSetsResponse" + }, + "parameterOrder": [ + "ownerName" + ], + "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\nListFilterSetsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.list\nmethod.", + "type": "string", + "location": "query" + }, + "pageSize": { + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "ownerName": { + "description": "Name of the owner (bidder or account) of the filter sets to be listed.\nFor example:\n\n- For a bidder-level filter set for bidder 123: `bidders/123`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets", + "path": "v2beta1/{+ownerName}/filterSets", + "id": "adexchangebuyer2.bidders.accounts.filterSets.list", + "description": "Lists all filter sets for the account with the given account ID." + }, + "create": { + "request": { + "$ref": "FilterSet" + }, + "description": "Creates the specified filter set for the account with the given account ID.", + "httpMethod": "POST", + "parameterOrder": [ + "ownerName" + ], + "response": { + "$ref": "FilterSet" + }, + "parameters": { + "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" + }, + "ownerName": { + "location": "path", + "description": "Name of the owner (bidder or account) of the filter set to be created.\nFor example:\n\n- For a bidder-level filter set for bidder 123: `bidders/123`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets", + "id": "adexchangebuyer2.bidders.accounts.filterSets.create", + "path": "v2beta1/{+ownerName}/filterSets" + } + }, + "resources": { + "bidResponseErrors": { + "methods": { + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "filterSetName" + ], + "response": { + "$ref": "ListBidResponseErrorsResponse" + }, + "parameters": { + "filterSetName": { + "location": "path", + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$" + }, + "pageToken": { + "location": "query", + "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 bidResponseErrors.list\nmethod.", + "type": "string" + }, + "pageSize": { + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/bidResponseErrors", + "id": "adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list", + "path": "v2beta1/{+filterSetName}/bidResponseErrors", + "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": [ + "filterSetName" + ], + "httpMethod": "GET", + "parameters": { + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "pageToken": { + "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 bidResponsesWithoutBids.list\nmethod.", + "type": "string", + "location": "query" + }, + "pageSize": { + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/bidResponsesWithoutBids", + "path": "v2beta1/{+filterSetName}/bidResponsesWithoutBids", + "id": "adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list" + } + } + }, + "filteredBidRequests": { + "methods": { + "list": { + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBidRequests", + "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list", + "path": "v2beta1/{+filterSetName}/filteredBidRequests", + "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", + "parameterOrder": [ + "filterSetName" + ], + "response": { + "$ref": "ListFilteredBidRequestsResponse" + }, + "parameters": { + "filterSetName": { + "location": "path", + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$" + }, + "pageToken": { + "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 filteredBidRequests.list\nmethod.", + "type": "string" + }, + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "nonBillableWinningBids": { + "methods": { + "list": { + "description": "List all reasons for which winning bids were not billable, with the number\nof bids not billed for each reason.", + "response": { + "$ref": "ListNonBillableWinningBidsResponse" + }, + "parameterOrder": [ + "filterSetName" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "filterSetName": { + "location": "path", + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$" + }, + "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 nonBillableWinningBids.list\nmethod.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + } + }, + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/nonBillableWinningBids", + "path": "v2beta1/{+filterSetName}/nonBillableWinningBids", + "id": "adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list" + } + } + }, + "filteredBids": { + "methods": { + "list": { + "response": { + "$ref": "ListFilteredBidsResponse" + }, + "parameterOrder": [ + "filterSetName" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "pageToken": { + "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 filteredBids.list\nmethod.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + } + }, + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBids", + "path": "v2beta1/{+filterSetName}/filteredBids", + "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list", + "description": "List all reasons for which bids were filtered, with the number of bids\nfiltered for each reason." + } + }, + "resources": { + "creatives": { + "methods": { + "list": { + "description": "List all creatives associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each creative.", + "response": { + "$ref": "ListCreativeStatusBreakdownByCreativeResponse" + }, + "parameterOrder": [ + "filterSetName", + "creativeStatusId" + ], + "httpMethod": "GET", + "parameters": { + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "creativeStatusId": { + "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).", + "format": "int32", + "required": true, + "type": "integer", + "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 filteredBids.creatives.list\nmethod.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/creatives", + "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives", + "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list" + } + } + }, + "details": { + "methods": { + "list": { + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/details", + "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details", + "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.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": [ + "filterSetName", + "creativeStatusId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + }, + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "creativeStatusId": { + "location": "path", + "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.", + "format": "int32", + "required": true, + "type": "integer" + }, + "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 filteredBids.details.list\nmethod.", + "type": "string" + } + } + } + } + } + } + }, + "losingBids": { + "methods": { + "list": { + "description": "List all reasons for which bids lost in the auction, with the number of\nbids that lost for each reason.", + "httpMethod": "GET", + "parameterOrder": [ + "filterSetName" + ], + "response": { + "$ref": "ListLosingBidsResponse" + }, + "parameters": { + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "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 losingBids.list\nmethod.", + "type": "string" + }, + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/losingBids", + "id": "adexchangebuyer2.bidders.accounts.filterSets.losingBids.list", + "path": "v2beta1/{+filterSetName}/losingBids" + } + } + }, + "impressionMetrics": { + "methods": { + "list": { + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/impressionMetrics", + "id": "adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list", + "path": "v2beta1/{+filterSetName}/impressionMetrics", + "description": "Lists all metrics that are measured in terms of number of impressions.", + "httpMethod": "GET", + "parameterOrder": [ + "filterSetName" + ], + "response": { + "$ref": "ListImpressionMetricsResponse" + }, + "parameters": { + "filterSetName": { + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$", + "location": "path" + }, + "pageToken": { + "location": "query", + "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 impressionMetrics.list\nmethod.", + "type": "string" + }, + "pageSize": { + "location": "query", + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "bidMetrics": { + "methods": { + "list": { + "description": "Lists all metrics that are measured in terms of number of bids.", + "response": { + "$ref": "ListBidMetricsResponse" + }, + "parameterOrder": [ + "filterSetName" + ], + "httpMethod": "GET", + "parameters": { + "filterSetName": { + "location": "path", + "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`", + "required": true, + "type": "string", + "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$" + }, + "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 bidMetrics.list\nmethod.", + "type": "string" + }, + "pageSize": { + "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/bidMetrics", + "path": "v2beta1/{+filterSetName}/bidMetrics", + "id": "adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list" + } + } + } + } + } + } + } + } + }, + "accounts": { + "resources": { + "clients": { + "methods": { + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "accountId", + "clientAccountId" + ], + "response": { + "$ref": "Client" + }, + "parameters": { + "accountId": { + "location": "path", + "description": "Numerical account ID of the client's sponsor buyer. (required)", + "format": "int64", + "required": true, + "type": "string" + }, + "clientAccountId": { + "description": "Numerical account ID of the client buyer 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}", + "id": "adexchangebuyer2.accounts.clients.get", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}", + "description": "Gets a client buyer with a given client account ID." + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "ListClientsResponse" + }, + "parameters": { + "accountId": { + "location": "path", + "description": "Unique numerical account ID of the sponsor buyer to list the clients for.", + "format": "int64", + "required": true, + "type": "string" + }, + "pageSize": { + "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", + "location": "query" + }, + "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" + }, + "partnerClientId": { + "description": "Optional unique identifier (from the standpoint of an Ad Exchange sponsor\nbuyer partner) of the client to return.\nIf specified, at most one client will be returned in the response.", + "type": "string", + "location": "query" + } + }, + "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." + }, + "update": { + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}", + "id": "adexchangebuyer2.accounts.clients.update", + "description": "Updates an existing client buyer.", + "request": { + "$ref": "Client" + }, + "response": { + "$ref": "Client" + }, + "parameterOrder": [ + "accountId", + "clientAccountId" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "accountId": { + "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", + "location": "path" + }, + "clientAccountId": { + "description": "Unique numerical account ID of the client to update. (required)", + "format": "int64", + "required": true, + "type": "string", + "location": "path" + } + } + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Client" + }, + "parameters": { + "accountId": { + "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", + "required": true, + "type": "string", + "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", + "request": { + "$ref": "Client" + }, + "description": "Creates a new client buyer." + } + }, + "resources": { + "invitations": { + "methods": { + "get": { + "description": "Retrieves an existing client user invitation.", + "response": { + "$ref": "ClientUserInvitation" + }, + "parameterOrder": [ + "accountId", + "clientAccountId", + "invitationId" + ], + "httpMethod": "GET", + "parameters": { + "accountId": { + "description": "Numerical account ID of the client's sponsor buyer. (required)", + "format": "int64", + "required": true, + "type": "string", + "location": "path" + }, + "clientAccountId": { + "location": "path", + "description": "Numerical account ID of the client buyer that the user invitation\nto be retrieved is associated with. (required)", + "format": "int64", + "required": true, + "type": "string" + }, + "invitationId": { + "description": "Numerical identifier of the user invitation 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}/invitations/{invitationId}", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}", + "id": "adexchangebuyer2.accounts.clients.invitations.get" + }, + "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": { + "accountId": { + "description": "Numerical account ID of the client's sponsor buyer. (required)", + "format": "int64", + "required": true, + "type": "string", + "location": "path" + }, + "pageSize": { + "description": "Requested page size. Server may return fewer clients than requested.\nIf unspecified, server will pick an appropriate default.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "clientAccountId": { + "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", + "location": "path" + }, + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations", + "id": "adexchangebuyer2.accounts.clients.invitations.list" + }, + "create": { + "request": { + "$ref": "ClientUserInvitation" + }, + "description": "Creates and sends out an email invitation to access\nan Ad Exchange client buyer account.", + "response": { + "$ref": "ClientUserInvitation" + }, + "parameterOrder": [ + "accountId", + "clientAccountId" + ], + "httpMethod": "POST", + "parameters": { + "accountId": { + "location": "path", + "description": "Numerical account ID of the client's sponsor buyer. (required)", + "format": "int64", + "required": true, + "type": "string" + }, + "clientAccountId": { + "location": "path", + "description": "Numerical account ID of the client buyer that the user\nshould be associated with. (required)", + "format": "int64", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations", + "id": "adexchangebuyer2.accounts.clients.invitations.create" + } + } + }, + "users": { + "methods": { + "list": { + "description": "Lists all the known client users for a specified\nsponsor buyer account ID.", + "response": { + "$ref": "ListClientUsersResponse" + }, + "parameterOrder": [ + "accountId", + "clientAccountId" + ], + "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\nListClientUsersResponse.nextPageToken\nreturned from the previous call to the\naccounts.clients.users.list method.", + "type": "string", + "location": "query" + }, + "accountId": { + "location": "path", + "description": "Numerical account ID of the sponsor buyer of the client to list users for.\n(required)", + "format": "int64", + "required": true, + "type": "string" + }, + "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" + }, + "clientAccountId": { + "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", + "location": "path" + } + }, + "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users", + "id": "adexchangebuyer2.accounts.clients.users.list" + }, + "get": { + "response": { + "$ref": "ClientUser" + }, + "parameterOrder": [ + "accountId", + "clientAccountId", + "userId" + ], + "httpMethod": "GET", + "parameters": { + "accountId": { + "location": "path", + "description": "Numerical account ID of the client's sponsor buyer. (required)", + "format": "int64", + "required": true, + "type": "string" + }, + "clientAccountId": { + "description": "Numerical account ID of the client buyer\nthat the user to be retrieved is associated with. (required)", + "format": "int64", + "required": true, + "type": "string", + "location": "path" + }, + "userId": { + "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}", + "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.", + "response": { + "$ref": "ClientUser" + }, + "parameterOrder": [ + "accountId", + "clientAccountId", + "userId" + ], + "httpMethod": "PUT", + "parameters": { + "accountId": { + "location": "path", + "description": "Numerical account ID of the client's sponsor buyer. (required)", + "format": "int64", + "required": true, + "type": "string" + }, + "clientAccountId": { + "description": "Numerical account ID of the client buyer that the user to be retrieved\nis associated with. (required)", + "format": "int64", + "required": true, + "type": "string", + "location": "path" + }, + "userId": { + "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}", + "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}", + "id": "adexchangebuyer2.accounts.clients.users.update" + } + } + } + } + }, + "creatives": { + "methods": { + "list": { + "description": "Lists creatives.", + "response": { + "$ref": "ListCreativesResponse" + }, + "parameterOrder": [ + "accountId" + ], + "httpMethod": "GET", + "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" + }, + "accountId": { + "description": "The account to list the creatives from.\nSpecify \"-\" to list all creatives the current user has access to.", + "required": true, + "type": "string", + "location": "path" + }, + "pageSize": { + "location": "query", + "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" + }, + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/creatives", + "path": "v2beta1/accounts/{accountId}/creatives", + "id": "adexchangebuyer2.accounts.creatives.list" + }, + "create": { + "request": { + "$ref": "Creative" + }, + "description": "Creates a creative.", + "response": { + "$ref": "Creative" + }, + "parameterOrder": [ + "accountId" + ], + "httpMethod": "POST", + "parameters": { + "duplicateIdMode": { + "description": "Indicates if multiple creatives can share an ID or not. Default is\nNO_DUPLICATES (one ID per creative).", + "type": "string", + "location": "query", + "enum": [ + "NO_DUPLICATES", + "FORCE_ENABLE_DUPLICATE_IDS" + ] + }, + "accountId": { + "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/creatives", + "path": "v2beta1/accounts/{accountId}/creatives", + "id": "adexchangebuyer2.accounts.creatives.create" + }, + "stopWatching": { + "request": { + "$ref": "StopWatchingCreativeRequest" + }, + "description": "Stops watching a creative. Will stop push notifications being sent to the\ntopics when the creative changes status.", + "httpMethod": "POST", + "parameterOrder": [ + "accountId", + "creativeId" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "accountId": { + "description": "The account of the creative to stop notifications for.", + "required": true, + "type": "string", + "location": "path" + }, + "creativeId": { + "location": "path", + "description": "The creative ID of the creative to stop notifications for.\nSpecify \"-\" to specify stopping account level notifications.", + "required": true, + "type": "string" + } + }, + "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" + }, + "get": { + "response": { + "$ref": "Creative" + }, + "parameterOrder": [ + "accountId", + "creativeId" + ], + "httpMethod": "GET", + "parameters": { + "accountId": { + "location": "path", + "description": "The account the creative belongs to.", + "required": true, + "type": "string" + }, + "creativeId": { + "location": "path", + "description": "The ID of the creative to retrieve.", + "required": true, + "type": "string" + } + }, + "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", + "description": "Gets a creative." + }, + "watch": { + "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}: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.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "accountId", + "creativeId" + ], + "httpMethod": "POST", + "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" + ] + }, + "update": { + "description": "Updates a creative.", + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "parameterOrder": [ + "accountId", + "creativeId" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "accountId": { + "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.", + "required": true, + "type": "string", + "location": "path" + }, + "creativeId": { + "description": "The buyer-defined creative ID of this creative.\nCan be used to filter the response of the\ncreatives.list\nmethod.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}", + "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}", + "id": "adexchangebuyer2.accounts.creatives.update" + } + }, + "resources": { + "dealAssociations": { + "methods": { + "list": { + "description": "List all creative-deal associations.", + "httpMethod": "GET", + "parameterOrder": [ + "accountId", + "creativeId" + ], + "response": { + "$ref": "ListDealAssociationsResponse" + }, + "parameters": { + "pageToken": { + "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", + "location": "query" + }, + "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": { + "description": "Requested page size. Server may return fewer associations than requested.\nIf unspecified, server will pick an appropriate default.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "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", + "location": "query" + }, + "creativeId": { + "description": "The creative ID to list the associations from.\nSpecify \"-\" to list all creatives under the above account.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations", + "id": "adexchangebuyer2.accounts.creatives.dealAssociations.list", + "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations" + }, + "add": { + "description": "Associate an existing deal with a creative.", + "request": { + "$ref": "AddDealAssociationRequest" + }, + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "accountId", + "creativeId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "parameters": { + "accountId": { + "description": "The account the creative belongs to.", + "required": true, + "type": "string", + "location": "path" + }, + "creativeId": { + "location": "path", + "description": "The ID of the creative associated with the deal.", + "required": true, + "type": "string" + } + }, + "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add", + "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add", + "id": "adexchangebuyer2.accounts.creatives.dealAssociations.add" + }, + "remove": { + "httpMethod": "POST", + "parameterOrder": [ + "accountId", + "creativeId" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "accountId": { + "location": "path", + "description": "The account the creative belongs to.", + "required": true, + "type": "string" + }, + "creativeId": { + "location": "path", + "description": "The ID of the creative associated with the deal.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ], + "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove", + "id": "adexchangebuyer2.accounts.creatives.dealAssociations.remove", + "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove", + "request": { + "$ref": "RemoveDealAssociationRequest" + }, + "description": "Remove the association between a deal and a creative." + } + } + } + } + } + } + } + }, + "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": { + "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.", + "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": { + "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": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + } + }, + "version": "v2beta1", + "baseUrl": "https://adexchangebuyer.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Accesses the latest features for managing Ad Exchange accounts, Real-Time Bidding configurations and auction metrics, and Marketplace programmatic deals.", + "servicePath": "", + "basePath": "", + "revision": "20171208", + "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest/reference/rest/", + "id": "adexchangebuyer2:v2beta1" } diff --git a/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json b/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json index 9dae67df86..4bb2573139 100644 --- a/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json +++ b/etc/api/adexchangeseller/v1.1/adexchangeseller-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Dz_LMqDcbtnyBd4CwnrsbswCFU4\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/ptWrH6xTfYx9JmkFvi4WlT7efFk\"", "discoveryVersion": "v1", "id": "adexchangeseller:v1.1", "name": "adexchangeseller", "canonicalName": "Ad Exchange Seller", "version": "v1.1", - "revision": "20160805", + "revision": "20171101", "title": "Ad Exchange Seller API", "description": "Accesses the inventory of Ad Exchange seller users and generates reports.", "ownerDomain": "google.com", diff --git a/etc/api/adexchangeseller/v1/adexchangeseller-api.json b/etc/api/adexchangeseller/v1/adexchangeseller-api.json index 19545cba9c..13fae80695 100644 --- a/etc/api/adexchangeseller/v1/adexchangeseller-api.json +++ b/etc/api/adexchangeseller/v1/adexchangeseller-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/EberIAMM9RntL16aqUh0FmyQxWY\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/LZjbJqGI4YbMK1jq7CAP1O0QwyE\"", "discoveryVersion": "v1", "id": "adexchangeseller:v1", "name": "adexchangeseller", "canonicalName": "Ad Exchange Seller", "version": "v1", - "revision": "20160805", + "revision": "20171101", "title": "Ad Exchange Seller API", "description": "Accesses the inventory of Ad Exchange seller users and generates reports.", "ownerDomain": "google.com", diff --git a/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json b/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json index 99d812aed9..4d0187a4f4 100644 --- a/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json +++ b/etc/api/adexchangeseller/v2.0/adexchangeseller-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/1XDufO4826VKTkrV2WU9EmKApiQ\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/yPQ_FKbZQkgdh3799oQXrXWTC8I\"", "discoveryVersion": "v1", "id": "adexchangeseller:v2.0", "name": "adexchangeseller", "canonicalName": "Ad Exchange Seller", "version": "v2.0", - "revision": "20160805", + "revision": "20171101", "title": "Ad Exchange Seller API", "description": "Accesses the inventory of Ad Exchange seller users and generates reports.", "ownerDomain": "google.com", diff --git a/etc/api/adexperiencereport/v1/adexperiencereport-api.json b/etc/api/adexperiencereport/v1/adexperiencereport-api.json index 073895c30f..c78c044e94 100644 --- a/etc/api/adexperiencereport/v1/adexperiencereport-api.json +++ b/etc/api/adexperiencereport/v1/adexperiencereport-api.json @@ -1,21 +1,67 @@ { - "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.", + "ViolatingSitesResponse": { + "description": "Response message for ListViolatingSites.", "type": "object", "properties": { + "violatingSites": { + "description": "A list of summaries of violating sites.", + "type": "array", + "items": { + "$ref": "SiteSummaryResponse" + } + } + }, + "id": "ViolatingSitesResponse" + }, + "SiteSummaryResponse": { + "description": "Response message for GetSiteSummary.", + "type": "object", + "properties": { + "desktopSummary": { + "description": "Summary for the desktop review of the site.", + "$ref": "PlatformSummary" + }, + "mobileSummary": { + "$ref": "PlatformSummary", + "description": "Summary for the mobile review of the site." + }, + "reviewedSite": { + "description": "The name of the site reviewed.", + "type": "string" + } + }, + "id": "SiteSummaryResponse" + }, + "PlatformSummary": { + "properties": { + "enforcementTime": { + "description": "The date on which ad filtering begins.", + "format": "google-datetime", + "type": "string" + }, + "region": { + "description": "The assigned regions for the site and platform.", + "type": "array", + "items": { + "enum": [ + "REGION_UNKNOWN", + "REGION_A", + "REGION_B" + ], + "type": "string" + }, + "enumDescriptions": [ + "Ad standard not yet defined for your region.", + "Region A.", + "Region B." + ] + }, "filterStatus": { + "description": "The ad filtering status of the site.", + "type": "string", "enumDescriptions": [ "N/A.", "Ad filtering is on.", @@ -29,9 +75,7 @@ "OFF", "PAUSED", "PENDING" - ], - "description": "The ad filtering status of the site.", - "type": "string" + ] }, "underReview": { "description": "Whether the site is currently under review.", @@ -42,11 +86,17 @@ "type": "string" }, "lastChangeTime": { - "format": "google-datetime", "description": "The last time that the site changed status.", + "format": "google-datetime", "type": "string" }, "betterAdsStatus": { + "enumDescriptions": [ + "Not reviewed.", + "Passing.", + "Warning.", + "Failing." + ], "enum": [ "UNKNOWN", "PASSING", @@ -54,78 +104,19 @@ "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.", + "id": "PlatformSummary", + "description": "Summary of the ad experience rating of a site for a specific platform.", "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", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, "canonicalName": "Ad Experience Report", "auth": { "oauth2": { @@ -146,11 +137,11 @@ "violatingSites": { "methods": { "list": { - "httpMethod": "GET", - "parameterOrder": [], "response": { "$ref": "ViolatingSitesResponse" }, + "parameterOrder": [], + "httpMethod": "GET", "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/xapi.zoo" @@ -165,6 +156,9 @@ "sites": { "methods": { "get": { + "path": "v1/{+name}", + "id": "adexperiencereport.sites.get", + "description": "Gets a summary of the ad experience rating of a site.", "response": { "$ref": "SiteSummaryResponse" }, @@ -172,27 +166,84 @@ "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": { + "name": { + "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.", + "required": true, + "type": "string", + "pattern": "^sites/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/sites/{sitesId}" } } } }, "parameters": { + "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": { + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string" + }, + "$.xgafv": { + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 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" + ] + }, + "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.", @@ -200,8 +251,8 @@ }, "pp": { "description": "Pretty-print response.", - "default": "true", "type": "boolean", + "default": "true", "location": "query" }, "oauth_token": { @@ -215,69 +266,18 @@ "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" } - } + }, + "version": "v1", + "baseUrl": "https://adexperiencereport.googleapis.com/", + "kind": "discovery#restDescription", + "description": "View Ad Experience Report data, and get a list of sites that have a significant number of annoying ads.", + "servicePath": "", + "basePath": "", + "revision": "20171129", + "documentationLink": "https://developers.google.com/ad-experience-report/", + "id": "adexperiencereport:v1" } diff --git a/etc/api/admin/directory_v1/admin-api.json b/etc/api/admin/directory_v1/admin-api.json index 33fcb8713d..1e8ee56abd 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/JB19efQGH5f-JRT49yZz7BTyNQU\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Kj9xn8poaVUzROuH45_u0sIJuaA\"", "discoveryVersion": "v1", "id": "admin:directory_v1", "name": "admin", "canonicalName": "directory", "version": "directory_v1", - "revision": "20170830", + "revision": "20171127", "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", @@ -207,6 +207,50 @@ } } }, + "AppAccessCollections": { + "id": "AppAccessCollections", + "type": "object", + "description": "JSON template for App Access Collections Resource object in Directory API.", + "properties": { + "blockedApiAccessBuckets": { + "type": "array", + "description": "List of blocked api access buckets.", + "items": { + "type": "string" + } + }, + "enforceSettingsForAndroidDrive": { + "type": "boolean", + "description": "Boolean to indicate whether to enforce app access settings on Android Drive or not." + }, + "errorMessage": { + "type": "string", + "description": "Error message provided by the Admin that will be shown to the user when an app is blocked." + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as an app access collection. Value: admin#directory#appaccesscollection", + "default": "admin#directory#appaccesscollection" + }, + "resourceId": { + "type": "string", + "description": "Unique ID of app access collection. (Readonly)", + "format": "int64" + }, + "resourceName": { + "type": "string", + "description": "Resource name given by the customer while creating/updating. Should be unique under given customer." + }, + "trustDomainOwnedApps": { + "type": "boolean", + "description": "Boolean that indicates whether to trust domain owned apps." + } + } + }, "Asp": { "id": "Asp", "type": "object", @@ -273,26 +317,50 @@ "type": "object", "description": "JSON template for Calendar Resource object in Directory API.", "properties": { + "buildingId": { + "type": "string", + "description": "Unique ID for the building a resource is located in." + }, + "capacity": { + "type": "integer", + "description": "Capacity of a resource, number of seats in a room.", + "format": "int32" + }, "etags": { "type": "string", "description": "ETag of the resource." }, + "featureInstances": { + "type": "any" + }, + "floorName": { + "type": "string", + "description": "Name of the floor a resource is located on." + }, + "floorSection": { + "type": "string", + "description": "Name of the section within a floor a resource is located in." + }, "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)" + "description": "The read-only 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.", "default": "admin#directory#resources#calendars#CalendarResource" }, + "resourceCategory": { + "type": "string", + "description": "The category of the calendar resource. Either CONFERENCE_ROOM or OTHER. Legacy data is set to CATEGORY_UNKNOWN." + }, "resourceDescription": { "type": "string", - "description": "The brief description of the calendar resource." + "description": "Description of the resource, visible only to admins. The brief description of the calendar resource." }, "resourceEmail": { "type": "string", - "description": "The read-only email ID for the calendar resource. Generated as part of creating a new calendar resource." + "description": "The read-only email ID for the calendar resource. Generated as part of creating a new calendar resource. The read-only email for the calendar resource. Generated as part of creating a new calendar resource." }, "resourceId": { "type": "string", @@ -300,11 +368,15 @@ }, "resourceName": { "type": "string", - "description": "The name of the calendar resource. For example, Training Room 1A" + "description": "The name of the calendar resource. For example, \"Training Room 1A\". The name of the calendar resource. For example, Training Room 1A" }, "resourceType": { "type": "string", - "description": "The type of the calendar resource. Used for grouping resources in the calendar user interface." + "description": "The type of the calendar resource, intended for non-room resources. The type of the calendar resource. Used for grouping resources in the calendar user interface." + }, + "userVisibleDescription": { + "type": "string", + "description": "Description of the resource, visible to users and admins." } } }, @@ -428,6 +500,32 @@ "type": "string", "description": "Chromebook boot mode (Read-only)" }, + "deviceFiles": { + "type": "array", + "description": "List of device files to download (Read-only)", + "items": { + "type": "object", + "properties": { + "createTime": { + "type": "string", + "description": "Date and time the file was created", + "format": "date-time" + }, + "downloadUrl": { + "type": "string", + "description": "File downlod URL" + }, + "name": { + "type": "string", + "description": "File name" + }, + "type": { + "type": "string", + "description": "File type" + } + } + } + }, "deviceId": { "type": "string", "description": "Unique identifier of Chrome OS Device (Read-only)" @@ -809,6 +907,36 @@ } } }, + "Feature": { + "id": "Feature", + "type": "object", + "description": "JSON template for Feature object in Directory API.", + "properties": { + "etags": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#resources#features#Feature" + }, + "name": { + "type": "string", + "description": "The name of the feature." + } + } + }, + "FeatureInstance": { + "id": "FeatureInstance", + "type": "object", + "description": "JSON template for a \"feature instance\".", + "properties": { + "feature": { + "$ref": "Feature" + } + } + }, "Group": { "id": "Group", "type": "object", @@ -959,6 +1087,18 @@ } } }, + "MembersHasMember": { + "id": "MembersHasMember", + "type": "object", + "description": "JSON template for Has Member response in Directory API.", + "properties": { + "isMember": { + "type": "boolean", + "description": "Identifies whether given user is a member or not.", + "readOnly": true + } + } + }, "MobileDevice": { "id": "MobileDevice", "type": "object", @@ -1778,6 +1918,59 @@ } } }, + "TrustedAppId": { + "id": "TrustedAppId", + "type": "object", + "description": "JSON template for Trusted App Ids Resource object in Directory API.", + "properties": { + "androidPackageName": { + "type": "string", + "description": "Android package name." + }, + "certificateHashSHA1": { + "type": "string", + "description": "SHA1 signature of the app certificate." + }, + "certificateHashSHA256": { + "type": "string", + "description": "SHA256 signature of the app certificate." + }, + "etag": { + "type": "string" + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a trusted AppId.", + "default": "admin#directory#trustedappid" + } + } + }, + "TrustedApps": { + "id": "TrustedApps", + "type": "object", + "description": "JSON template for Trusted Apps response object of a user in Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as trusted apps response.", + "default": "admin#directory#trustedapplist" + }, + "nextPageToken": { + "type": "string" + }, + "trustedApps": { + "type": "array", + "description": "Trusted Apps list.", + "items": { + "$ref": "TrustedAppId" + } + } + } + }, "User": { "id": "User", "type": "object", @@ -2405,6 +2598,11 @@ "type": "object", "description": "JSON template for a POSIX account entry. Description of the field family: go/fbs-posix.", "properties": { + "accountId": { + "type": "string", + "description": "A POSIX account field identifier. (Read-only)", + "readOnly": true + }, "gecos": { "type": "string", "description": "The GECOS (user information) for this account." @@ -2821,7 +3019,7 @@ }, "orgUnitPath": { "type": "string", - "description": "Full path of the organization unit or its Id", + "description": "Full path of the organizational unit or its ID", "location": "query" }, "pageToken": { @@ -2876,7 +3074,7 @@ "id": "directory.chromeosdevices.moveDevicesToOu", "path": "customer/{customerId}/devices/chromeos/moveDevicesToOu", "httpMethod": "POST", - "description": "Move or insert multiple Chrome OS Devices to Organization Unit", + "description": "Move or insert multiple Chrome OS Devices to organizational unit", "parameters": { "customerId": { "type": "string", @@ -2886,7 +3084,7 @@ }, "orgUnitPath": { "type": "string", - "description": "Full path of the target organization unit or its Id", + "description": "Full path of the target organizational unit or its ID", "required": true, "location": "query" } @@ -3315,7 +3513,7 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group", + "description": "Email or immutable ID of the group", "required": true, "location": "path" } @@ -3335,7 +3533,7 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group", + "description": "Email or immutable ID of the group", "required": true, "location": "path" } @@ -3396,7 +3594,7 @@ }, "userKey": { "type": "string", - "description": "Email or immutable Id of the user if only those groups are to be listed, the given user is a member of. If Id, it should match with id of user object", + "description": "Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If ID, it should match with id of user object", "location": "query" } }, @@ -3416,7 +3614,7 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + "description": "Email or immutable ID of the group. If ID, it should match with id of group object", "required": true, "location": "path" } @@ -3442,7 +3640,7 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + "description": "Email or immutable ID of the group. If ID, it should match with id of group object", "required": true, "location": "path" } @@ -3478,7 +3676,7 @@ }, "groupKey": { "type": "string", - "description": "Email or immutable Id of the group", + "description": "Email or immutable ID of the group", "required": true, "location": "path" } @@ -3499,7 +3697,7 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group", + "description": "Email or immutable ID of the group", "required": true, "location": "path" } @@ -3525,7 +3723,7 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group", + "description": "Email or immutable ID of the group", "required": true, "location": "path" } @@ -3556,13 +3754,13 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group", + "description": "Email or immutable ID of the group", "required": true, "location": "path" }, "memberKey": { "type": "string", - "description": "Email or immutable Id of the member", + "description": "Email or immutable ID of the member", "required": true, "location": "path" } @@ -3584,13 +3782,13 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group", + "description": "Email or immutable ID of the group", "required": true, "location": "path" }, "memberKey": { "type": "string", - "description": "Email or immutable Id of the member", + "description": "Email or immutable ID of the member", "required": true, "location": "path" } @@ -3609,6 +3807,39 @@ "https://www.googleapis.com/auth/admin.directory.group.readonly" ] }, + "hasMember": { + "id": "directory.members.hasMember", + "path": "groups/{groupKey}/hasMember/{memberKey}", + "httpMethod": "GET", + "description": "Checks Membership of an user within a Group", + "parameters": { + "groupKey": { + "type": "string", + "description": "Email or immutable Id of the group", + "required": true, + "location": "path" + }, + "memberKey": { + "type": "string", + "description": "Email or immutable Id of the member", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "groupKey", + "memberKey" + ], + "response": { + "$ref": "MembersHasMember" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.group", + "https://www.googleapis.com/auth/admin.directory.group.member", + "https://www.googleapis.com/auth/admin.directory.group.member.readonly", + "https://www.googleapis.com/auth/admin.directory.group.readonly" + ] + }, "insert": { "id": "directory.members.insert", "path": "groups/{groupKey}/members", @@ -3617,7 +3848,7 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group", + "description": "Email or immutable ID of the group", "required": true, "location": "path" } @@ -3644,7 +3875,7 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group", + "description": "Email or immutable ID of the group", "required": true, "location": "path" }, @@ -3687,13 +3918,13 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + "description": "Email or immutable ID of the group. If ID, it should match with id of group object", "required": true, "location": "path" }, "memberKey": { "type": "string", - "description": "Email or immutable Id of the user. If Id, it should match with id of member object", + "description": "Email or immutable ID of the user. If ID, it should match with id of member object", "required": true, "location": "path" } @@ -3721,13 +3952,13 @@ "parameters": { "groupKey": { "type": "string", - "description": "Email or immutable Id of the group. If Id, it should match with id of group object", + "description": "Email or immutable ID of the group. If ID, it should match with id of group object", "required": true, "location": "path" }, "memberKey": { "type": "string", - "description": "Email or immutable Id of the user. If Id, it should match with id of member object", + "description": "Email or immutable ID of the user. If ID, it should match with id of member object", "required": true, "location": "path" } @@ -4121,7 +4352,7 @@ "id": "directory.orgunits.delete", "path": "customer/{customerId}/orgunits{/orgUnitPath*}", "httpMethod": "DELETE", - "description": "Remove Organization Unit", + "description": "Remove organizational unit", "parameters": { "customerId": { "type": "string", @@ -4131,7 +4362,7 @@ }, "orgUnitPath": { "type": "string", - "description": "Full path of the organization unit or its Id", + "description": "Full path of the organizational unit or its ID", "required": true, "repeated": true, "location": "path" @@ -4149,7 +4380,7 @@ "id": "directory.orgunits.get", "path": "customer/{customerId}/orgunits{/orgUnitPath*}", "httpMethod": "GET", - "description": "Retrieve Organization Unit", + "description": "Retrieve organizational unit", "parameters": { "customerId": { "type": "string", @@ -4159,7 +4390,7 @@ }, "orgUnitPath": { "type": "string", - "description": "Full path of the organization unit or its Id", + "description": "Full path of the organizational unit or its ID", "required": true, "repeated": true, "location": "path" @@ -4181,7 +4412,7 @@ "id": "directory.orgunits.insert", "path": "customer/{customerId}/orgunits", "httpMethod": "POST", - "description": "Add Organization Unit", + "description": "Add organizational unit", "parameters": { "customerId": { "type": "string", @@ -4207,7 +4438,7 @@ "id": "directory.orgunits.list", "path": "customer/{customerId}/orgunits", "httpMethod": "GET", - "description": "Retrieve all Organization Units", + "description": "Retrieve all organizational units", "parameters": { "customerId": { "type": "string", @@ -4217,7 +4448,7 @@ }, "orgUnitPath": { "type": "string", - "description": "the URL-encoded organization unit's path or its Id", + "description": "the URL-encoded organizational unit's path or its ID", "default": "", "location": "query" }, @@ -4229,7 +4460,7 @@ "children" ], "enumDescriptions": [ - "All sub-organization units.", + "All sub-organizational units.", "Immediate children only (default)." ], "location": "query" @@ -4250,7 +4481,7 @@ "id": "directory.orgunits.patch", "path": "customer/{customerId}/orgunits{/orgUnitPath*}", "httpMethod": "PATCH", - "description": "Update Organization Unit. This method supports patch semantics.", + "description": "Update organizational unit. This method supports patch semantics.", "parameters": { "customerId": { "type": "string", @@ -4260,7 +4491,7 @@ }, "orgUnitPath": { "type": "string", - "description": "Full path of the organization unit or its Id", + "description": "Full path of the organizational unit or its ID", "required": true, "repeated": true, "location": "path" @@ -4284,7 +4515,7 @@ "id": "directory.orgunits.update", "path": "customer/{customerId}/orgunits{/orgUnitPath*}", "httpMethod": "PUT", - "description": "Update Organization Unit", + "description": "Update organizational unit", "parameters": { "customerId": { "type": "string", @@ -4294,7 +4525,7 @@ }, "orgUnitPath": { "type": "string", - "description": "Full path of the organization unit or its Id", + "description": "Full path of the organizational unit or its ID", "required": true, "repeated": true, "location": "path" @@ -4344,6 +4575,28 @@ } } }, + "resolvedAppAccessSettings": { + "methods": { + "GetSettings": { + "id": "directory.resolvedAppAccessSettings.GetSettings", + "path": "resolvedappaccesssettings", + "httpMethod": "GET", + "description": "Retrieves resolved app access settings of the logged in user.", + "response": { + "$ref": "AppAccessCollections" + } + }, + "ListTrustedApps": { + "id": "directory.resolvedAppAccessSettings.ListTrustedApps", + "path": "trustedapps", + "httpMethod": "GET", + "description": "Retrieves the list of apps trusted by the admin of the logged in user.", + "response": { + "$ref": "TrustedApps" + } + } + } + }, "resources": { "resources": { "calendars": { @@ -4473,7 +4726,7 @@ "id": "directory.resources.calendars.patch", "path": "customer/{customer}/resources/calendars/{calendarResourceId}", "httpMethod": "PATCH", - "description": "Updates a calendar resource. This method supports patch semantics.", + "description": "Updates a calendar resource.\n\nThis method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved. This method supports patch semantics.", "parameters": { "calendarResourceId": { "type": "string", @@ -4506,7 +4759,7 @@ "id": "directory.resources.calendars.update", "path": "customer/{customer}/resources/calendars/{calendarResourceId}", "httpMethod": "PUT", - "description": "Updates a calendar resource.", + "description": "Updates a calendar resource.\n\nThis method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved.", "parameters": { "calendarResourceId": { "type": "string", @@ -4881,7 +5134,7 @@ }, "schemaKey": { "type": "string", - "description": "Name or immutable Id of the schema", + "description": "Name or immutable ID of the schema", "required": true, "location": "path" } @@ -4908,7 +5161,7 @@ }, "schemaKey": { "type": "string", - "description": "Name or immutable Id of the schema", + "description": "Name or immutable ID of the schema", "required": true, "location": "path" } @@ -4989,7 +5242,7 @@ }, "schemaKey": { "type": "string", - "description": "Name or immutable Id of the schema.", + "description": "Name or immutable ID of the schema.", "required": true, "location": "path" } @@ -5022,7 +5275,7 @@ }, "schemaKey": { "type": "string", - "description": "Name or immutable Id of the schema.", + "description": "Name or immutable ID of the schema.", "required": true, "location": "path" } @@ -5137,7 +5390,7 @@ "parameters": { "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" } @@ -5178,7 +5431,7 @@ }, "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" }, @@ -5362,7 +5615,7 @@ "parameters": { "userKey": { "type": "string", - "description": "Email or immutable Id of the user as admin", + "description": "Email or immutable ID of the user as admin", "required": true, "location": "path" } @@ -5385,7 +5638,7 @@ "parameters": { "userKey": { "type": "string", - "description": "Email or immutable Id of the user. If Id, it should match with id of user object", + "description": "Email or immutable ID of the user. If ID, it should match with id of user object", "required": true, "location": "path" } @@ -5434,7 +5687,7 @@ "parameters": { "userKey": { "type": "string", - "description": "Email or immutable Id of the user. If Id, it should match with id of user object", + "description": "Email or immutable ID of the user. If ID, it should match with id of user object", "required": true, "location": "path" } @@ -5605,7 +5858,7 @@ }, "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" } @@ -5627,7 +5880,7 @@ "parameters": { "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" } @@ -5667,7 +5920,7 @@ }, "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" } @@ -5707,7 +5960,7 @@ }, "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" } @@ -5742,7 +5995,7 @@ "parameters": { "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" } @@ -5762,7 +6015,7 @@ "parameters": { "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" } @@ -5786,7 +6039,7 @@ "parameters": { "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" } @@ -5812,7 +6065,7 @@ "parameters": { "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" } @@ -5844,7 +6097,7 @@ "parameters": { "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" } @@ -5864,7 +6117,7 @@ "parameters": { "userKey": { "type": "string", - "description": "Email or immutable Id of the user", + "description": "Email or immutable ID of the user", "required": true, "location": "path" } diff --git a/etc/api/admin/reports_v1/admin-api.json b/etc/api/admin/reports_v1/admin-api.json index b37a057687..448edaf075 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/YvMEbSpUd5h8xmSpskCE_HPECco\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/ihRyJbFbPCCQX3d-n__-D1aHPn0\"", "discoveryVersion": "v1", "id": "admin:reports_v1", "name": "admin", "canonicalName": "reports", "version": "reports_v1", - "revision": "20170622", + "revision": "20171204", "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", @@ -22,7 +22,7 @@ "basePath": "/admin/reports/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "admin/reports/v1/", - "batchPath": "batch", + "batchPath": "batch/admin/reports_v1", "parameters": { "alt": { "type": "string", @@ -309,6 +309,11 @@ "description": "Obfuscated customer id for the record.", "readOnly": true }, + "entityId": { + "type": "string", + "description": "Object key. Only relevant if entity.type = \"OBJECT\" Note: external-facing name of report is \"Entities\" rather than \"Objects\".", + "readOnly": true + }, "profileId": { "type": "string", "description": "Obfuscated user id for the record.", @@ -316,12 +321,12 @@ }, "type": { "type": "string", - "description": "The type of item, can be a customer or user.", + "description": "The type of item, can be customer, user, or entity (aka. object).", "readOnly": true }, "userEmail": { "type": "string", - "description": "user's email.", + "description": "user's email. Only relevant if entity.type = \"USER\"", "readOnly": true } } @@ -675,6 +680,79 @@ } } }, + "entityUsageReports": { + "methods": { + "get": { + "id": "reports.entityUsageReports.get", + "path": "usage/{entityType}/{entityKey}/dates/{date}", + "httpMethod": "GET", + "description": "Retrieves a report which is a collection of properties / statistics for a set of objects.", + "parameters": { + "customerId": { + "type": "string", + "description": "Represents the customer for which the data is to be fetched.", + "pattern": "C.+", + "location": "query" + }, + "date": { + "type": "string", + "description": "Represents the date in yyyy-mm-dd format for which the data is to be fetched.", + "required": true, + "pattern": "(\\d){4}-(\\d){2}-(\\d){2}", + "location": "path" + }, + "entityKey": { + "type": "string", + "description": "Represents the key of object for which the data should be filtered.", + "required": true, + "location": "path" + }, + "entityType": { + "type": "string", + "description": "Type of object. Should be one of - gplus_communities.", + "required": true, + "pattern": "(gplus_communities)", + "location": "path" + }, + "filters": { + "type": "string", + "description": "Represents the set of filters including parameter operator value.", + "pattern": "(((gplus)):[a-z0-9_]+[\u003c,\u003c=,==,\u003e=,\u003e,!=][^,]+,)*(((gplus)):[a-z0-9_]+[\u003c,\u003c=,==,\u003e=,\u003e,!=][^,]+)", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return. Maximum allowed is 1000", + "format": "uint32", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page.", + "location": "query" + }, + "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": "(((gplus)):[^,]+,)*(((gplus)):[^,]+)", + "location": "query" + } + }, + "parameterOrder": [ + "entityType", + "entityKey", + "date" + ], + "response": { + "$ref": "UsageReports" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.reports.usage.readonly" + ] + } + } + }, "userUsageReport": { "methods": { "get": { diff --git a/etc/api/adsense/v1.4/adsense-api.json b/etc/api/adsense/v1.4/adsense-api.json index 2b410eaafe..fa3ef3fdb2 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/KcNIBZHjmrxC6P-EEua8ut8cKOA\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/TTXWgFbjrx98gGXeBWLzHzeUQ9s\"", "discoveryVersion": "v1", "id": "adsense:v1.4", "name": "adsense", "canonicalName": "AdSense", "version": "v1.4", - "revision": "20170925", + "revision": "20171211", "title": "AdSense Management API", "description": "Accesses AdSense publishers' inventory and generates performance reports.", "ownerDomain": "google.com", diff --git a/etc/api/adsensehost/v4.1/adsensehost-api.json b/etc/api/adsensehost/v4.1/adsensehost-api.json index 6e6fecefbc..525ab7e96c 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/iemUiWYyEAAnHZQnYAy7r56NBIk\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/NyT1DTQF4vZhuR57A8Mt2b6CZc4\"", "discoveryVersion": "v1", "id": "adsensehost:v4.1", "name": "adsensehost", "canonicalName": "AdSense Host", "version": "v4.1", - "revision": "20170925", + "revision": "20171211", "title": "AdSense Host API", "description": "Generates performance reports, generates ad codes, and provides publisher management capabilities for AdSense Hosts.", "ownerDomain": "google.com", diff --git a/etc/api/analyticsreporting/v4/analyticsreporting-api.json b/etc/api/analyticsreporting/v4/analyticsreporting-api.json index 96844adece..0c0941566d 100644 --- a/etc/api/analyticsreporting/v4/analyticsreporting-api.json +++ b/etc/api/analyticsreporting/v4/analyticsreporting-api.json @@ -3,11 +3,11 @@ "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" + }, + "https://www.googleapis.com/auth/analytics": { + "description": "View and manage your Google Analytics data" } } } @@ -22,10 +22,6 @@ "reports": { "methods": { "batchGet": { - "request": { - "$ref": "GetReportsRequest" - }, - "description": "Returns the Analytics data.", "response": { "$ref": "GetReportsResponse" }, @@ -37,58 +33,88 @@ ], "parameters": {}, "flatPath": "v4/reports:batchGet", + "path": "v4/reports:batchGet", "id": "analyticsreporting.reports.batchGet", - "path": "v4/reports:batchGet" + "description": "Returns the Analytics data.", + "request": { + "$ref": "GetReportsRequest" + } } } } }, "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": { + "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": { + "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" + "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" }, - "callback": { + "fields": { "location": "query", - "description": "JSONP", + "description": "Selector specifying which fields to include in a partial response.", "type": "string" }, "$.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": { + "type": "string", + "location": "query", + "description": "JSONP" + }, "alt": { - "enum": [ - "json", - "media", - "proto" - ], "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", @@ -97,38 +123,12 @@ ], "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" + "default": "json", + "enum": [ + "json", + "media", + "proto" + ] } }, "version": "v4", @@ -137,107 +137,223 @@ "description": "Accesses Analytics report data.", "kind": "discovery#restDescription", "basePath": "", - "id": "analyticsreporting:v4", - "revision": "20170925", "documentationLink": "https://developers.google.com/analytics/devguides/reporting/core/v4/", + "revision": "20171108", + "id": "analyticsreporting:v4", "discoveryVersion": "v1", "version_module": true, "schemas": { - "GetReportsRequest": { - "description": "The batch request containing multiple report request.", + "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.", + "type": "array", + "items": { + "$ref": "SegmentSequenceStep" + } + } + }, + "id": "SequenceSegment" + }, + "SegmentMetricFilter": { + "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": { + "description": "Specifies is the operation to perform to compare the metric. The default\nis `EQUAL`.", + "type": "string", + "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" + ] + }, + "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", + "description": "Metric filter to be used in a segment filter clause.", + "type": "object" + }, + "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.", + "type": "array", + "items": { + "$ref": "PivotValueRegion" + } + }, + "values": { + "description": "Each value corresponds to each Metric in the request.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "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": { + "type": "boolean", + "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)" + } + }, + "id": "CohortGroup" + }, + "GetReportsRequest": { "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" + } + }, + "useResourceQuotas": { + "description": "Enables\n[resource based quotas](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4),\n(defaults to `False`). If this field is set to `True` the\nper view (profile) quotas are governed by the computational\ncost of the request. Note that using cost based quotas will\nhigher enable sampling rates. (10 Million for `SMALL`,\n100M for `LARGE`. See the\n[limits and quotas documentation](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4) for details.", + "type": "boolean" } }, - "id": "GetReportsRequest" + "id": "GetReportsRequest", + "description": "The batch request containing multiple report request.", + "type": "object" }, "Pivot": { "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": { "maxGroupCount": { - "format": "int32", "description": "Specifies the maximum number of groups to return.\nThe default value is 10, also the maximum value is 1,000.", + "format": "int32", "type": "integer" }, "startGroup": { - "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.", + "format": "int32", "type": "integer" }, "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" - }, - "type": "array" + } + }, + "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" - }, - "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." + "dimensionValues": { + "description": "The values for the dimensions in the pivot.", + "type": "array", + "items": { + "type": "string" + } }, "dimensionNames": { "description": "The name of the dimensions in the pivot response.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, - "dimensionValues": { - "description": "The values for the dimensions in the pivot.", - "items": { - "type": "string" - }, - "type": "array" + "metric": { + "description": "The metric header for the metric in the pivot.", + "$ref": "MetricHeaderEntry" } }, - "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" + "id": "PivotHeaderEntry" }, "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": { + "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" + }, + "simpleSegment": { + "$ref": "SimpleSegment", + "description": "A Simple segment conditions consist of one or more dimension/metric\nconditions that can be combined" + }, "sequenceSegment": { "$ref": "SequenceSegment", "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": { - "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": { - "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.", @@ -245,29 +361,23 @@ "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": [ @@ -277,97 +387,111 @@ "Currency metric.", "Percentage metric.", "Time metric in `HH:MM:SS` format." + ], + "enum": [ + "METRIC_TYPE_UNSPECIFIED", + "INTEGER", + "FLOAT", + "CURRENCY", + "PERCENT", + "TIME" ] } }, - "id": "MetricHeaderEntry", - "description": "Header for the metrics.", - "type": "object" + "id": "MetricHeaderEntry" + }, + "ResourceQuotasRemaining": { + "description": "The resource quota tokens remaining for the property after the request is\ncompleted.", + "type": "object", + "properties": { + "hourlyQuotaTokensRemaining": { + "description": "Hourly resource quota tokens remaining.", + "format": "int32", + "type": "integer" + }, + "dailyQuotaTokensRemaining": { + "description": "Daily resource quota remaining remaining.", + "format": "int32", + "type": "integer" + } + }, + "id": "ResourceQuotasRemaining" }, "ReportData": { - "id": "ReportData", "description": "The data part of the report.", "type": "object", "properties": { - "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." + "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" + } + }, + "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" + } + }, + "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": { + "type": "string", + "format": "int64" + } + }, + "rowCount": { + "description": "Total number of matching rows for this query.", + "format": "int32", + "type": "integer" }, "rows": { "description": "There's one ReportRow for every unique combination of dimensions.", + "type": "array", "items": { "$ref": "ReportRow" - }, - "type": "array" + } }, - "rowCount": { - "format": "int32", - "description": "Total number of matching rows for this query.", - "type": "integer" + "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" }, "dataLastRefreshed": { - "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.", + "format": "google-datetime", "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.", - "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.", - "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`.", @@ -396,57 +520,43 @@ "description": "How to match the dimension to the expression. The default is REGEXP.", "type": "string" }, - "dimensionName": { - "type": "string", - "description": "The dimension to filter on. A DimensionFilter must contain a dimension." + "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" + } } }, - "id": "DimensionFilter" + "id": "DimensionFilter", + "description": "Dimension filter specifies the filtering options on a dimension.", + "type": "object" }, "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": { "dynamicSegment": { - "$ref": "DynamicSegment", - "description": "A dynamic segment definition in the request." + "description": "A dynamic segment definition in the request.", + "$ref": "DynamicSegment" }, "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." + "id": "Segment" }, "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": { + "type": "string", "enumDescriptions": [ "If the sort order is unspecified, the default is ascending.", "Ascending sort. The field will be sorted in an ascending manner.", @@ -457,19 +567,41 @@ "ASCENDING", "DESCENDING" ], - "description": "The sorting order for the field.", + "description": "The sorting order for the field." + }, + "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": { + "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" + ], + "description": "The order type. The default orderType is `VALUE`." } }, "id": "OrderBy" }, "SegmentDimensionFilter": { - "description": "Dimension filter specifies the filtering options on a dimension.", "type": "object", "properties": { "minComparisonValue": { - "description": "Minimum comparison values for `BETWEEN` match type.", - "type": "string" + "type": "string", + "description": "Minimum comparison values for `BETWEEN` match type." }, "maxComparisonValue": { "description": "Maximum comparison values for `BETWEEN` match type.", @@ -480,7 +612,6 @@ "type": "string" }, "operator": { - "description": "The operator to use to match the dimension with the expressions.", "type": "string", "enumDescriptions": [ "If the match type is unspecified, it is treated as a REGEXP.", @@ -505,62 +636,58 @@ "NUMERIC_LESS_THAN", "NUMERIC_GREATER_THAN", "NUMERIC_BETWEEN" - ] + ], + "description": "The operator to use to match the dimension with the expressions." }, "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" + "type": "boolean", + "description": "Should the match be case sensitive, ignored for `IN_LIST` operator." } }, - "id": "SegmentDimensionFilter" + "id": "SegmentDimensionFilter", + "description": "Dimension filter specifies the filtering options on a dimension." }, "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": { - "enumDescriptions": [ - "Unspecified match type is treated as precedes.", - "Operator indicates that the previous step precedes the next step.", - "Operator indicates that the previous step immediately precedes the next\nstep." - ], "enum": [ "UNSPECIFIED_MATCH_TYPE", "PRECEDES", "IMMEDIATELY_PRECEDES" ], "description": "Specifies if the step immediately precedes or can be any time before the\nnext step.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Unspecified match type is treated as precedes.", + "Operator indicates that the previous step precedes the next step.", + "Operator indicates that the previous step immediately precedes the next\nstep." + ] } }, - "id": "SegmentSequenceStep" + "id": "SegmentSequenceStep", + "description": "A segment sequence definition.", + "type": "object" }, "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.", @@ -577,12 +704,18 @@ "CURRENCY", "PERCENT", "TIME" - ], - "description": "Specifies how the metric expression should be formatted, for example\n`INTEGER`." + ] + }, + "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" } }, - "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." + "id": "Metric" }, "PivotValueRegion": { "id": "PivotValueRegion", @@ -591,47 +724,47 @@ "properties": { "values": { "description": "The values of the metrics in each of the pivot regions.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } } } }, "Report": { + "description": "The data response corresponding to the request.", + "type": "object", "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." + }, + "nextPageToken": { + "type": "string", + "description": "Page token to retrieve the next page of results in the list." } }, - "id": "Report", - "description": "The data response corresponding to the request.", - "type": "object" + "id": "Report" }, "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" - }, "pivotHeaderEntries": { "description": "A single pivot section header.", + "type": "array", "items": { "$ref": "PivotHeaderEntry" - }, - "type": "array" + } + }, + "totalPivotGroupsCount": { + "description": "The total number of groups for this pivot.", + "format": "int32", + "type": "integer" } }, "id": "PivotHeader" @@ -651,87 +784,22 @@ }, "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": { + "id": "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.", + "type": "array", "items": { "$ref": "MetricFilterClause" - }, - "type": "array" + } }, "pageSize": { - "type": "integer", + "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", - "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." + "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.", @@ -741,45 +809,45 @@ "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." }, + "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" }, - "type": "array" + "description": "The metrics requested.\nRequests must specify at least one metric. Requests can have a\ntotal of 10 metrics." }, "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" - }, - "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.", + "type": "array", "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.", + "type": "array", "items": { "$ref": "Segment" - }, - "type": "array" + } }, "samplingLevel": { "enumDescriptions": [ @@ -796,21 +864,86 @@ ], "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" + }, + "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" + }, + "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" } - }, - "id": "ReportRequest" + } + }, + "MetricFilter": { + "id": "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": { + "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" + ], + "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." + }, + "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" + } + } }, "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" }, - "type": "array" + "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." }, "name": { "description": "Name of the dimension to fetch, for example `ga:browser`.", @@ -819,22 +952,13 @@ }, "id": "Dimension" }, - "SimpleSegment": { - "description": "A Simple segment conditions consist of one or more dimension/metric\nconditions that can be combined.", + "DynamicSegment": { "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": { + "sessionSegment": { + "description": "Session Segment to select sessions to include in the segment.", + "$ref": "SegmentDefinition" + }, "name": { "description": "The name of the dynamic segment.", "type": "string" @@ -842,36 +966,44 @@ "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" + "description": "Dynamic segment definition for defining the segment within the request.\nA segment can select users, sessions or both." + }, + "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" }, "ColumnHeader": { + "id": "ColumnHeader", + "description": "Column headers.", + "type": "object", "properties": { - "metricHeader": { - "description": "Metric headers for the metrics in the response.", - "$ref": "MetricHeader" - }, "dimensions": { - "description": "The dimension names in the response.", + "type": "array", "items": { "type": "string" }, - "type": "array" + "description": "The dimension names in the response." + }, + "metricHeader": { + "description": "Metric headers for the metrics in the response.", + "$ref": "MetricHeader" } - }, - "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": { @@ -887,19 +1019,61 @@ "$ref": "SegmentDimensionFilter", "description": "Dimension Filter for the segment definition." } + }, + "id": "SegmentFilterClause" + }, + "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" + }, + "Cohort": { + "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", + "properties": { + "name": { + "description": "A unique name for the cohort. If not defined name will be auto-generated\nwith values cohort_[1234...].", + "type": "string" + }, + "dateRange": { + "$ref": "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." + }, + "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" + ] + } } }, "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" - }, - "type": "array" - }, "operator": { "enumDescriptions": [ "Unspecified operator. It is treated as an `OR`.", @@ -913,246 +1087,102 @@ ], "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" }, - "ReportRow": { - "description": "A row in the report.", - "type": "object", - "properties": { - "dimensions": { - "description": "List of requested dimensions.", - "items": { - "type": "string" - }, - "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": { + "id": "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" - }, - "type": "array" + } } - }, - "id": "OrFiltersForSegment" + } }, "MetricHeader": { + "id": "MetricHeader", + "description": "The headers for the metrics.", "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.", + "type": "array", "items": { "$ref": "PivotHeader" - }, - "type": "array" + } + }, + "metricHeaderEntries": { + "description": "Headers for the metrics in the response.", + "type": "array", + "items": { + "$ref": "MetricHeaderEntry" + } } - }, - "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": { + "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", - "enumDescriptions": [ - "Unspecified operator. It is treated as an `OR`.", - "The logical `OR` operator.", - "The logical `AND` operator." - ] + "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": { + "resourceQuotasRemaining": { + "$ref": "ResourceQuotasRemaining", + "description": "The amount of resource quota remaining for the property." + }, "reports": { "description": "Responses corresponding to each of the request.", + "type": "array", "items": { "$ref": "Report" - }, - "type": "array" + } + }, + "queryCost": { + "description": "The amount of resource quota tokens deducted to execute the query. Includes\nall responses.", + "format": "int32", + "type": "integer" } }, - "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" + "id": "GetReportsResponse" } }, "icons": { diff --git a/etc/api/androiddeviceprovisioning/v1/androiddeviceprovisioning-api.json b/etc/api/androiddeviceprovisioning/v1/androiddeviceprovisioning-api.json index a950be2693..9860ac9c94 100644 --- a/etc/api/androiddeviceprovisioning/v1/androiddeviceprovisioning-api.json +++ b/etc/api/androiddeviceprovisioning/v1/androiddeviceprovisioning-api.json @@ -1,80 +1,19 @@ { - "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", + "ownerName": "Google", "version_module": true, "resources": { "partners": { "resources": { "devices": { "methods": { - "claimAsync": { - "description": "Claim devices asynchronously.", + "updateMetadataAsync": { + "path": "v1/partners/{+partnerId}/devices:updateMetadataAsync", + "id": "androiddeviceprovisioning.partners.devices.updateMetadataAsync", "request": { - "$ref": "ClaimDevicesRequest" + "$ref": "UpdateDeviceMetadataInBatchRequest" }, - "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": { + "description": "Set metadata in batch asynchronously.", "response": { "$ref": "Operation" }, @@ -92,74 +31,7 @@ "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." + "flatPath": "v1/partners/{partnersId}/devices:updateMetadataAsync" }, "get": { "description": "Get a device.", @@ -184,12 +56,10 @@ "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" }, + "description": "Unclaim the device identified by the `device_id` or the `deviceIdentifier`.", "response": { "$ref": "Empty" }, @@ -199,43 +69,47 @@ "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": { + "type": "string", "location": "path", "description": "ID of the partner.", - "pattern": "^[^/]+$", - "format": "int64", - "type": "string", - "required": true + "pattern": "^[^/]+$" } }, - "flatPath": "v1/partners/{partnersId}/devices:findByOwner", - "id": "androiddeviceprovisioning.partners.devices.findByOwner", + "flatPath": "v1/partners/{partnersId}/devices:unclaim", + "path": "v1/partners/{+partnerId}/devices:unclaim", + "id": "androiddeviceprovisioning.partners.devices.unclaim" + }, + "findByOwner": { "path": "v1/partners/{+partnerId}/devices:findByOwner", + "id": "androiddeviceprovisioning.partners.devices.findByOwner", + "description": "Find devices by ownership.", "request": { "$ref": "FindDevicesByOwnerRequest" }, - "description": "Find devices by ownership." + "response": { + "$ref": "FindDevicesByOwnerResponse" + }, + "parameterOrder": [ + "partnerId" + ], + "httpMethod": "POST", + "parameters": { + "partnerId": { + "format": "int64", + "required": true, + "type": "string", + "location": "path", + "description": "ID of the partner.", + "pattern": "^[^/]+$" + } + }, + "flatPath": "v1/partners/{partnersId}/devices:findByOwner" }, "claim": { + "path": "v1/partners/{+partnerId}/devices:claim", + "id": "androiddeviceprovisioning.partners.devices.claim", "description": "Claim the device identified by device identifier.", "request": { "$ref": "ClaimDeviceRequest" @@ -253,20 +127,130 @@ "description": "ID of the partner.", "pattern": "^[^/]+$", "format": "int64", + "type": "string", + "required": true + } + }, + "flatPath": "v1/partners/{partnersId}/devices:claim" + }, + "claimAsync": { + "request": { + "$ref": "ClaimDevicesRequest" + }, + "description": "Claim devices asynchronously.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "partnerId" + ], + "httpMethod": "POST", + "parameters": { + "partnerId": { + "format": "int64", + "type": "string", + "required": true, + "location": "path", + "description": "Partner ID.", + "pattern": "^[^/]+$" + } + }, + "flatPath": "v1/partners/{partnersId}/devices:claimAsync", + "path": "v1/partners/{+partnerId}/devices:claimAsync", + "id": "androiddeviceprovisioning.partners.devices.claimAsync" + }, + "findByIdentifier": { + "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", + "request": { + "$ref": "FindDevicesByDeviceIdentifierRequest" + }, + "description": "Find devices by device identifier.", + "response": { + "$ref": "FindDevicesByDeviceIdentifierResponse" + }, + "parameterOrder": [ + "partnerId" + ], + "httpMethod": "POST" + }, + "unclaimAsync": { + "parameters": { + "partnerId": { + "location": "path", + "description": "Partner ID.", + "pattern": "^[^/]+$", + "format": "int64", "required": true, "type": "string" } }, - "flatPath": "v1/partners/{partnersId}/devices:claim", - "path": "v1/partners/{+partnerId}/devices:claim", - "id": "androiddeviceprovisioning.partners.devices.claim" + "flatPath": "v1/partners/{partnersId}/devices:unclaimAsync", + "path": "v1/partners/{+partnerId}/devices:unclaimAsync", + "id": "androiddeviceprovisioning.partners.devices.unclaimAsync", + "request": { + "$ref": "UnclaimDevicesRequest" + }, + "description": "Unclaim devices asynchronously.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "partnerId" + ], + "httpMethod": "POST" + }, + "metadata": { + "httpMethod": "POST", + "parameterOrder": [ + "metadataOwnerId", + "deviceId" + ], + "response": { + "$ref": "DeviceMetadata" + }, + "parameters": { + "metadataOwnerId": { + "description": "The owner of the newly set metadata. Set this to the partner ID.", + "pattern": "^[^/]+$", + "format": "int64", + "required": true, + "type": "string", + "location": "path" + }, + "deviceId": { + "location": "path", + "description": "ID of the partner.", + "pattern": "^[^/]+$", + "format": "int64", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/partners/{partnersId}/devices/{devicesId}/metadata", + "id": "androiddeviceprovisioning.partners.devices.metadata", + "path": "v1/partners/{+metadataOwnerId}/devices/{+deviceId}/metadata", + "request": { + "$ref": "UpdateDeviceMetadataRequest" + }, + "description": "Update the metadata." } } }, "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" }, @@ -280,38 +264,39 @@ "description": "The ID of the partner.", "pattern": "^[^/]+$", "format": "int64", + "type": "string", + "required": true + } + }, + "flatPath": "v1/partners/{partnersId}/customers", + "path": "v1/partners/{+partnerId}/customers", + "id": "androiddeviceprovisioning.partners.customers.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." + }, + "create": { + "parameters": { + "parent": { + "pattern": "^partners/[^/]+$", + "location": "path", + "description": "Required. The parent resource ID in the format `partners/[PARTNER_ID]` that\nidentifies the reseller.", "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", + "id": "androiddeviceprovisioning.partners.customers.create", + "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.", "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." + "response": { + "$ref": "Company" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST" } } } @@ -320,55 +305,35 @@ "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" + "type": "string", + "pattern": "^operations/.+$", + "location": "path" } }, "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." + "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", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + } } } } }, "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", + "default": "true", "location": "query" }, "fields": { @@ -376,6 +341,11 @@ "type": "string", "location": "query" }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" + }, "$.xgafv": { "enumDescriptions": [ "v1 error format", @@ -390,9 +360,9 @@ "type": "string" }, "callback": { - "location": "query", "description": "JSONP", - "type": "string" + "type": "string", + "location": "query" }, "alt": { "enum": [ @@ -410,280 +380,93 @@ "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": { + "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": { + "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", + "default": "true" + }, + "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" } }, "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": { + "description": "Request to set metadata for a device.", + "type": "object", "properties": { "deviceMetadata": { - "description": "The metdata to set.", - "$ref": "DeviceMetadata" + "$ref": "DeviceMetadata", + "description": "The metdata to set." } }, - "id": "UpdateDeviceMetadataRequest", - "description": "Request to set metadata for a device.", - "type": "object" + "id": "UpdateDeviceMetadataRequest" }, "PartnerUnclaim": { + "id": "PartnerUnclaim", + "description": "Identifies one unclaim request.", + "type": "object", "properties": { "deviceIdentifier": { - "$ref": "DeviceIdentifier", - "description": "Device identifier of the device." + "description": "Device identifier of the device.", + "$ref": "DeviceIdentifier" }, "sectionType": { + "description": "Section type to unclaim.", + "type": "string", "enumDescriptions": [ "Unspecified section type.", - "Zero touch section type." + "Zero-touch enrollment 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" + "type": "object", + "properties": {}, + "id": "Empty" }, "FindDevicesByDeviceIdentifierResponse": { + "id": "FindDevicesByDeviceIdentifierResponse", + "description": "Response containing found devices.", + "type": "object", "properties": { "devices": { "description": "Found devices.", @@ -696,13 +479,30 @@ "description": "Page token of the next page.", "type": "string" } - }, - "id": "FindDevicesByDeviceIdentifierResponse", - "description": "Response containing found devices.", - "type": "object" + } }, "PartnerClaim": { + "id": "PartnerClaim", + "description": "Identifies one claim request.", + "type": "object", "properties": { + "sectionType": { + "description": "Section type to claim.", + "type": "string", + "enumDescriptions": [ + "Unspecified section type.", + "Zero-touch enrollment section type." + ], + "enum": [ + "SECTION_TYPE_UNSPECIFIED", + "SECTION_TYPE_ZERO_TOUCH" + ] + }, + "customerId": { + "description": "Customer ID to claim for.", + "format": "int64", + "type": "string" + }, "deviceIdentifier": { "$ref": "DeviceIdentifier", "description": "Device identifier of the device." @@ -710,33 +510,25 @@ "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": { + "sectionType": { + "description": "The section type to unclaim for.", + "type": "string", + "enumDescriptions": [ + "Unspecified section type.", + "Zero-touch enrollment section type." + ], + "enum": [ + "SECTION_TYPE_UNSPECIFIED", + "SECTION_TYPE_ZERO_TOUCH" + ] + }, "deviceId": { "description": "The device ID returned by `ClaimDevice`.", "format": "int64", @@ -745,37 +537,27 @@ "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": { + "description": "Metadata entries that can be attached to a `Device`. To learn more, read\n[Device metadata](/zero-touch/guides/metadata).", + "type": "object", "properties": { "entries": { + "description": "Metadata entries recorded as key-value pairs.", + "type": "object", "additionalProperties": { "type": "string" - }, - "description": "Metadata entries", - "type": "object" + } } }, - "id": "DeviceMetadata", - "description": "A key-value pair of the device metadata.", - "type": "object" + "id": "DeviceMetadata" }, "DevicesLongRunningOperationResponse": { + "description": "Long running operation response.", + "type": "object", "properties": { "successCount": { "description": "Number of succeesfully processed ones.", @@ -790,42 +572,47 @@ } } }, - "id": "DevicesLongRunningOperationResponse", - "description": "Long running operation response.", - "type": "object" + "id": "DevicesLongRunningOperationResponse" }, "DeviceClaim": { + "description": "A record of a device claimed by a reseller for a customer. Devices claimed\nfor zero-touch enrollment have a claim with the type\n`SECTION_TYPE_ZERO_TOUCH`. To learn more, read\n[Claim devices for customers](/zero-touch/guides/how-it-works#claim).", + "type": "object", "properties": { "sectionType": { + "description": "Output only. The type of claim made on the device.", + "type": "string", "enumDescriptions": [ "Unspecified section type.", - "Zero touch section type." + "Zero-touch enrollment section type." ], "enum": [ "SECTION_TYPE_UNSPECIFIED", "SECTION_TYPE_ZERO_TOUCH" - ], - "description": "Section type of the device claim.", - "type": "string" + ] }, "ownerCompanyId": { - "description": "Owner ID.", + "description": "The ID of the Customer that purchased the device.", "format": "int64", "type": "string" } }, - "id": "DeviceClaim", - "description": "Information about a device claimed for a partner.", - "type": "object" + "id": "DeviceClaim" }, "PerDeviceStatusInBatch": { + "description": "Stores the processing result for each device.", + "type": "object", "properties": { - "deviceId": { - "description": "Device ID of the device if process succeeds.", - "format": "int64", - "type": "string" - }, "status": { + "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." + ], "enum": [ "SINGLE_DEVICE_STATUS_UNSPECIFIED", "SINGLE_DEVICE_STATUS_UNKNOWN_ERROR", @@ -837,17 +624,7 @@ "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." - ] + "type": "string" }, "errorIdentifier": { "description": "Error identifier.", @@ -856,13 +633,33 @@ "errorMessage": { "description": "Error message.", "type": "string" + }, + "deviceId": { + "description": "Device ID of the device if process succeeds.", + "format": "int64", + "type": "string" } }, - "id": "PerDeviceStatusInBatch", - "description": "Stores the processing result for each device.", - "type": "object" + "id": "PerDeviceStatusInBatch" + }, + "ClaimDevicesRequest": { + "id": "ClaimDevicesRequest", + "description": "Request to claim devices asynchronously in batch.", + "type": "object", + "properties": { + "claims": { + "description": "List of claims.", + "type": "array", + "items": { + "$ref": "PartnerClaim" + } + } + } }, "FindDevicesByOwnerRequest": { + "id": "FindDevicesByOwnerRequest", + "description": "Request to find devices by customers.", + "type": "object", "properties": { "pageToken": { "description": "Page token.", @@ -871,7 +668,7 @@ "sectionType": { "enumDescriptions": [ "Unspecified section type.", - "Zero touch section type." + "Zero-touch enrollment section type." ], "enum": [ "SECTION_TYPE_UNSPECIFIED", @@ -893,67 +690,19 @@ "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`." + "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`.", + "$ref": "Status" }, "metadata": { "additionalProperties": { @@ -966,11 +715,43 @@ "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": "This field will contain a `DevicesLongRunningOperationResponse` object if the operation is created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } } }, "id": "Operation" }, + "DeviceIdentifier": { + "description": "Encapsulates hardware and product IDs to identify a manufactured device. To\nlearn more, read [Identifiers](/zero-touch/guides/identifiers).", + "type": "object", + "properties": { + "imei": { + "description": "The device’s IMEI number. Validated on input.", + "type": "string" + }, + "meid": { + "description": "The device’s MEID number.", + "type": "string" + }, + "manufacturer": { + "description": "Required. The device manufacturer’s name. Matches the device's built-in\nvalue returned from `android.os.Build.MANUFACTURER`. Allowed values are\nlisted in [manufacturer names](/zero-touch/resources/manufacturer-names).", + "type": "string" + }, + "serialNumber": { + "description": "The manufacturer's serial number for the device. This value might not be\nunique.", + "type": "string" + } + }, + "id": "DeviceIdentifier" + }, "UnclaimDevicesRequest": { + "id": "UnclaimDevicesRequest", "description": "Request to unclaim devices asynchronously in batch.", "type": "object", "properties": { @@ -981,15 +762,12 @@ "$ref": "PartnerUnclaim" } } - }, - "id": "UnclaimDevicesRequest" + } }, "FindDevicesByDeviceIdentifierRequest": { + "description": "Request to find devices.", + "type": "object", "properties": { - "deviceIdentifier": { - "$ref": "DeviceIdentifier", - "description": "The device identifier to search." - }, "pageToken": { "description": "Page token.", "type": "string" @@ -998,14 +776,24 @@ "description": "Number of devices to show.", "format": "int64", "type": "string" + }, + "deviceIdentifier": { + "$ref": "DeviceIdentifier", + "description": "The device identifier to search." } }, - "id": "FindDevicesByDeviceIdentifierRequest", - "description": "Request to find devices.", - "type": "object" + "id": "FindDevicesByDeviceIdentifierRequest" }, "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": { + "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" @@ -1014,33 +802,19 @@ "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": { + "type": "object", "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": { + "description": "Operation the server received for every device.", + "type": "object", "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." @@ -1048,34 +822,260 @@ "result": { "$ref": "PerDeviceStatusInBatch", "description": "Processing result for every device." + }, + "claim": { + "description": "Request to claim a device.", + "$ref": "PartnerClaim" + }, + "updateMetadata": { + "$ref": "UpdateMetadataArguments", + "description": "Request to set metadata for a device." } }, - "id": "OperationPerDevice", - "description": "Operation the server received for every device.", - "type": "object" + "id": "OperationPerDevice" }, "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" } + }, + "nextPageToken": { + "description": "Page token of the next page.", + "type": "string" } }, "id": "FindDevicesByOwnerResponse" + }, + "ClaimDeviceRequest": { + "id": "ClaimDeviceRequest", + "description": "Request message to claim a device on behalf of a customer.", + "type": "object", + "properties": { + "deviceIdentifier": { + "$ref": "DeviceIdentifier", + "description": "The device identifier of the device to claim." + }, + "sectionType": { + "description": "The section to claim.", + "type": "string", + "enumDescriptions": [ + "Unspecified section type.", + "Zero-touch enrollment section type." + ], + "enum": [ + "SECTION_TYPE_UNSPECIFIED", + "SECTION_TYPE_ZERO_TOUCH" + ] + }, + "customerId": { + "description": "The customer to claim for.", + "format": "int64", + "type": "string" + } + } + }, + "DevicesLongRunningOperationMetadata": { + "id": "DevicesLongRunningOperationMetadata", + "description": "Long running operation metadata.", + "type": "object", + "properties": { + "processingStatus": { + "description": "The overall processing status.", + "type": "string", + "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" + ] + }, + "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" + } + } + }, + "UpdateDeviceMetadataInBatchRequest": { + "id": "UpdateDeviceMetadataInBatchRequest", + "description": "Request to update device metadata in batch.", + "type": "object", + "properties": { + "updates": { + "description": "List of metadata updates.", + "type": "array", + "items": { + "$ref": "UpdateMetadataArguments" + } + } + } + }, + "ListCustomersResponse": { + "id": "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" + } + } + } + }, + "ClaimDeviceResponse": { + "id": "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" + } + } + }, + "UpdateMetadataArguments": { + "id": "UpdateMetadataArguments", + "description": "Identifies metdata updates to one device.", + "type": "object", + "properties": { + "deviceIdentifier": { + "$ref": "DeviceIdentifier", + "description": "Device identifier." + }, + "deviceMetadata": { + "$ref": "DeviceMetadata", + "description": "The metadata to update." + }, + "deviceId": { + "description": "Device ID of the device.", + "format": "int64", + "type": "string" + } + } + }, + "Device": { + "description": "An Android device registered for zero-touch enrollment.", + "type": "object", + "properties": { + "claims": { + "description": "Output only. The provisioning claims for a device. Devices claimed for\nzero-touch enrollment have a claim with the type `SECTION_TYPE_ZERO_TOUCH`.\nCall\n`partners.devices.unclaim`\nor\n`partners.devices.unclaimAsync`\nto remove the device from zero-touch enrollment.", + "type": "array", + "items": { + "$ref": "DeviceClaim" + } + }, + "deviceIdentifier": { + "$ref": "DeviceIdentifier", + "description": "The hardware IDs that identify a manufactured device. To learn more, read\n[Identifiers](/zero-touch/guides/identifiers)." + }, + "deviceMetadata": { + "description": "The metadata attached to the device. Structured as key-value pairs. To\nlearn more, read [Device metadata](/zero-touch/guides/metadata).", + "$ref": "DeviceMetadata" + }, + "name": { + "description": "Output only. The API resource name in the format\n`partners/[PARTNER_ID]/devices/[DEVICE_ID]`. Assigned by the server.", + "type": "string" + }, + "deviceId": { + "description": "Output only. The ID of the device. Assigned by the server.", + "format": "int64", + "type": "string" + }, + "configuration": { + "description": "Not available to resellers.", + "type": "string" + } + }, + "id": "Device" + }, + "CreateCustomerRequest": { + "id": "CreateCustomerRequest", + "description": "Request message to create a customer.", + "type": "object", + "properties": { + "customer": { + "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.", + "$ref": "Company" + } + } + }, + "Company": { + "id": "Company", + "description": "A customer resource in the zero-touch enrollment API.", + "type": "object", + "properties": { + "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" + }, + "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" + }, + "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" + } + } } }, - "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://androiddeviceprovisioning.googleapis.com/", + "canonicalName": "Android Provisioning Partner", + "kind": "discovery#restDescription", + "servicePath": "", + "description": "Automates reseller integration into zero-touch enrollment by assigning devices to customers and creating device reports.", + "rootUrl": "https://androiddeviceprovisioning.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "androiddeviceprovisioning", + "batchPath": "batch", + "revision": "20171202", + "documentationLink": "https://developers.google.com/zero-touch/", + "id": "androiddeviceprovisioning:v1", + "title": "Android Device Provisioning Partner API" } diff --git a/etc/api/androidenterprise/v1/androidenterprise-api.json b/etc/api/androidenterprise/v1/androidenterprise-api.json index 333a7d6ae3..c1d4a86638 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/sBqnEugV9meeDd_JBciPAzCelAY\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/-HO9dhVgxPgZ9hKtuist_vTUbZU\"", "discoveryVersion": "v1", "id": "androidenterprise:v1", "name": "androidenterprise", "canonicalName": "Android Enterprise", "version": "v1", - "revision": "20170922", + "revision": "20171206", "title": "Google Play EMM API", "description": "Manages the deployment of apps to Android for Work users.", "ownerDomain": "google.com", @@ -268,6 +268,10 @@ "type": "object", "description": "This represents a single version of the app.", "properties": { + "track": { + "type": "string", + "description": "The track that this app was published in. For example if track is \"alpha\", this is an alpha version of the app." + }, "versionCode": { "type": "integer", "description": "Unique increasing identifier for the app version.", @@ -311,10 +315,33 @@ } } }, + "ConfigurationVariables": { + "id": "ConfigurationVariables", + "type": "object", + "description": "A configuration variables resource contains the managed configuration settings ID to be applied to a single user, as well as the variable set that is attributed to the user. The variable set will be used to replace placeholders in the managed configuration settings.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#configurationVariables\".", + "default": "androidenterprise#configurationVariables" + }, + "mcmId": { + "type": "string", + "description": "The ID of the managed configurations settings." + }, + "variableSet": { + "type": "array", + "description": "The variable set that is attributed to the user.", + "items": { + "$ref": "VariableSet" + } + } + } + }, "Device": { "id": "Device", "type": "object", - "description": "A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise user.\n\nThis collection cannot be modified via the API. It is automatically populated as devices are set up to be managed.", + "description": "A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise user.", "properties": { "androidId": { "type": "string", @@ -328,6 +355,10 @@ "managementType": { "type": "string", "description": "Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations.\n\nPossible values include: \n- \"managedDevice\", a device that has the EMM's device policy controller (DPC) as the device owner. \n- \"managedProfile\", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC. \n- \"containerApp\", no longer used (deprecated). \n- \"unmanagedProfile\", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC." + }, + "policy": { + "$ref": "Policy", + "description": "The policy enforced on the device." } } }, @@ -493,7 +524,7 @@ "GroupLicense": { "id": "GroupLicense", "type": "object", - "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.", + "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. In 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", @@ -655,8 +686,12 @@ "ManagedConfiguration": { "id": "ManagedConfiguration", "type": "object", - "description": "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.", + "description": "A managed configuration resource contains the set of managed properties defined by the app developer in the app's managed configurations schema, as well as any configuration variables defined for the user.", "properties": { + "configurationVariables": { + "$ref": "ConfigurationVariables", + "description": "Contains the ID of the managed configuration profile and the set of configuration variables (if any) defined for the user." + }, "kind": { "type": "string", "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#managedConfiguration\".", @@ -713,6 +748,52 @@ } } }, + "ManagedConfigurationsSettings": { + "id": "ManagedConfigurationsSettings", + "type": "object", + "description": "A managed configurations settings resource contains the set of managed properties that have been configured for an Android app to be applied to a set of users. The app's developer would have defined configurable properties in the managed configurations schema.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#managedConfigurationsSettings\".", + "default": "androidenterprise#managedConfigurationsSettings" + }, + "managedProperty": { + "type": "array", + "description": "The set of managed properties for this configuration.", + "items": { + "$ref": "ManagedProperty" + } + }, + "mcmId": { + "type": "string", + "description": "The ID of the managed configurations settings." + }, + "name": { + "type": "string", + "description": "The name of the managed configurations settings." + } + } + }, + "ManagedConfigurationsSettingsListResponse": { + "id": "ManagedConfigurationsSettingsListResponse", + "type": "object", + "description": "The managed configurations settings for a product.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#managedConfigurationsSettingsListResponse\".", + "default": "androidenterprise#managedConfigurationsSettingsListResponse" + }, + "managedConfigurationsSettings": { + "type": "array", + "description": "A managed configurations settings for an app that may be assigned to a group of users in an enterprise.", + "items": { + "$ref": "ManagedConfigurationsSettings" + } + } + } + }, "ManagedProperty": { "id": "ManagedProperty", "type": "object", @@ -926,6 +1007,24 @@ } } }, + "Policy": { + "id": "Policy", + "type": "object", + "description": "The device policy for a given managed device.", + "properties": { + "productAvailabilityPolicy": { + "type": "string", + "description": "The availability granted to the device for the specified products. \"all\" gives the device access to all products, regardless of approval status. \"allApproved\" entitles the device to access all products that are approved for the enterprise. \"allApproved\" and \"all\" do not enable automatic visibility of \"alpha\" or \"beta\" tracks. \"whitelist\" grants the device access the products specified in productPolicy[]. Only products that are approved or products that were previously approved (products with revoked approval) by the enterprise can be whitelisted. If no value is provided, the availability set at the user level is applied by default." + }, + "productPolicy": { + "type": "array", + "description": "The list of product policies.", + "items": { + "$ref": "ProductPolicy" + } + } + } + }, "Product": { "id": "Product", "type": "object", @@ -942,6 +1041,32 @@ "type": "string", "description": "The name of the author of the product (for example, the app developer)." }, + "availableCountries": { + "type": "array", + "description": "The countries which this app is available in.", + "items": { + "type": "string" + } + }, + "availableTracks": { + "type": "array", + "description": "The tracks that are visible to the enterprise.", + "items": { + "type": "string" + } + }, + "category": { + "type": "string", + "description": "The app category (e.g. RACING, SOCIAL, etc.)" + }, + "contentRating": { + "type": "string", + "description": "The content rating for this app." + }, + "description": { + "type": "string", + "description": "A localized promotional description, if available." + }, "detailsUrl": { "type": "string", "description": "A link to the (consumer) Google Play details page for the product." @@ -959,6 +1084,23 @@ "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#product\".", "default": "androidenterprise#product" }, + "lastUpdatedTimestampMillis": { + "type": "string", + "description": "The time (in milliseconds since epoch) when application was last published. (Timestamp is approximate within 7 days of actual publish time.)", + "format": "int64" + }, + "minAndroidSdkVersion": { + "type": "integer", + "description": "The minimum Android SDK necessary to run the app.", + "format": "int32" + }, + "permissions": { + "type": "array", + "description": "The permissions required for this app.", + "items": { + "$ref": "ProductPermission" + } + }, "productId": { "type": "string", "description": "A string of the form app:\u003cpackage name\u003e. For example, app:com.google.android.gm represents the Gmail app." @@ -967,10 +1109,21 @@ "type": "string", "description": "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)." }, + "recentChanges": { + "type": "string", + "description": "A description of the recent changes made to the app." + }, "requiresContainerApp": { "type": "boolean", "description": "Deprecated." }, + "screenshotUrls": { + "type": "array", + "description": "A list of screenshot links representing the app.", + "items": { + "type": "string" + } + }, "signingCertificate": { "$ref": "ProductSigningCertificate", "description": "The certificate used to sign this product." @@ -1057,6 +1210,24 @@ } } }, + "ProductPolicy": { + "id": "ProductPolicy", + "type": "object", + "description": "The policy for a product.", + "properties": { + "productId": { + "type": "string", + "description": "The ID of the product. For example, \"app:com.google.android.gm\"." + }, + "tracks": { + "type": "array", + "description": "Grants visibility to the specified track(s) of the product to the device. The track available to the device is based on the following order of preference: alpha, beta, production. For example, if an app has a prod version, a beta version and an alpha version and the enterprise has been granted visibility to both the alpha and beta tracks, if tracks is {\"beta\", \"production\"} then the beta version of the app is made available to the device. If there are no app versions in the specified track adding the \"alpha\" and \"beta\" values to the list of tracks will have no effect. Note that the enterprise requires access to alpha and/or beta tracks before users can be granted visibility to apps in those tracks.\n\nThe allowed sets are: {} (considered equivalent to {\"production\"}) {\"production\"} {\"beta\", \"production\"} {\"alpha\", \"beta\", \"production\"} The order of elements is not relevant. Any other set of tracks will be rejected with an error.", + "items": { + "type": "string" + } + } + } + }, "ProductSet": { "id": "ProductSet", "type": "object", @@ -1077,6 +1248,13 @@ "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. 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." + }, + "productVisibility": { + "type": "array", + "description": "Additional list of product IDs making up the product set. Unlike the productID array, in this list It's possible to specify which tracks (alpha, beta, production) of a product are visible to the user. See ProductVisibility and its fields for more information. Specifying the same product ID both here and in the productId array is not allowed and it will result in an error.", + "items": { + "$ref": "ProductVisibility" + } } } }, @@ -1094,6 +1272,24 @@ } } }, + "ProductVisibility": { + "id": "ProductVisibility", + "type": "object", + "description": "A product to be made visible to a user.", + "properties": { + "productId": { + "type": "string", + "description": "The product ID to make visible to the user. Required for each item in the productVisibility list." + }, + "tracks": { + "type": "array", + "description": "Grants visibility to the specified track(s) of the product to the user. The track available to the user is based on the following order of preference: alpha, beta, production. For example, if an app has a prod version, a beta version and an alpha version and the enterprise has been granted visibility to both the alpha and beta tracks, if tracks is {\"beta\", \"production\"} the user will be able to install the app and they will get the beta version of the app. If there are no app versions in the specified track adding the \"alpha\" and \"beta\" values to the list of tracks will have no effect. Note that the enterprise requires access to alpha and/or beta tracks before users can be granted visibility to apps in those tracks.\n\nThe allowed sets are: {} (considered equivalent to {\"production\"}) {\"production\"} {\"beta\", \"production\"} {\"alpha\", \"beta\", \"production\"} The order of elements is not relevant. Any other set of tracks will be rejected with an error.", + "items": { + "type": "string" + } + } + } + }, "ProductsApproveRequest": { "id": "ProductsApproveRequest", "type": "object", @@ -1449,6 +1645,26 @@ } } } + }, + "VariableSet": { + "id": "VariableSet", + "type": "object", + "description": "A variable set is a key-value pair of EMM-provided placeholders and its corresponding value, which is attributed to a user. For example, $FIRSTNAME could be a placeholder, and its value could be Alice. Placeholders should start with a '$' sign and should be alphanumeric only.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#variableSet\".", + "default": "androidenterprise#variableSet" + }, + "placeholder": { + "type": "string", + "description": "The placeholder string; defined by EMM." + }, + "userValue": { + "type": "string", + "description": "The value of the placeholder, specific to the user." + } + } } }, "resources": { @@ -1558,6 +1774,51 @@ "https://www.googleapis.com/auth/androidenterprise" ] }, + "patch": { + "id": "androidenterprise.devices.patch", + "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", + "httpMethod": "PATCH", + "description": "Updates the device policy. This method supports patch semantics.", + "parameters": { + "deviceId": { + "type": "string", + "description": "The ID of the device.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "Mask that identifies which fields to update. If not set, all modifiable fields will be modified.\n\nWhen set in a query parameter, this field should be specified as updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "deviceId" + ], + "request": { + "$ref": "Device" + }, + "response": { + "$ref": "Device" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, "setState": { "id": "androidenterprise.devices.setState", "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state", @@ -1597,6 +1858,51 @@ "scopes": [ "https://www.googleapis.com/auth/androidenterprise" ] + }, + "update": { + "id": "androidenterprise.devices.update", + "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", + "httpMethod": "PUT", + "description": "Updates the device policy", + "parameters": { + "deviceId": { + "type": "string", + "description": "The ID of the device.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "Mask that identifies which fields to update. If not set, all modifiable fields will be modified.\n\nWhen set in a query parameter, this field should be specified as updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "deviceId" + ], + "request": { + "$ref": "Device" + }, + "response": { + "$ref": "Device" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] } } }, @@ -2870,7 +3176,7 @@ "id": "androidenterprise.managedconfigurationsforuser.patch", "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", "httpMethod": "PATCH", - "description": "Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics.", + "description": "Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. This method supports patch semantics.", "parameters": { "enterpriseId": { "type": "string", @@ -2910,7 +3216,7 @@ "id": "androidenterprise.managedconfigurationsforuser.update", "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", "httpMethod": "PUT", - "description": "Adds or updates a per-user managed configuration for an app for the specified user.", + "description": "Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties.", "parameters": { "enterpriseId": { "type": "string", @@ -2948,6 +3254,40 @@ } } }, + "managedconfigurationssettings": { + "methods": { + "list": { + "id": "androidenterprise.managedconfigurationssettings.list", + "path": "enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings", + "httpMethod": "GET", + "description": "Lists all the managed configurations settings for the specified app. Only the ID and the name is set.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "productId": { + "type": "string", + "description": "The ID of the product for which the managed configurations settings applies to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "productId" + ], + "response": { + "$ref": "ManagedConfigurationsSettingsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + }, "permissions": { "methods": { "get": { @@ -3937,6 +4277,33 @@ "https://www.googleapis.com/auth/androidenterprise" ] }, + "revokeDeviceAccess": { + "id": "androidenterprise.users.revokeDeviceAccess", + "path": "enterprises/{enterpriseId}/users/{userId}/deviceAccess", + "httpMethod": "DELETE", + "description": "Revokes access to all devices currently provisioned to the user. The user will no longer be able to use the managed Play store on any of their managed devices.\n\nThis call only works with EMM-managed accounts.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, "revokeToken": { "id": "androidenterprise.users.revokeToken", "path": "enterprises/{enterpriseId}/users/{userId}/token", diff --git a/etc/api/androidmanagement/v1/androidmanagement-api.json b/etc/api/androidmanagement/v1/androidmanagement-api.json index d26c4af830..69a6e06ade 100644 --- a/etc/api/androidmanagement/v1/androidmanagement-api.json +++ b/etc/api/androidmanagement/v1/androidmanagement-api.json @@ -670,7 +670,7 @@ "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.", + "description": "The resource name of the user that owns this device in the form enterprises/{enterpriseId}/users/{userId}.", "type": "string" }, "disabledReason": { @@ -678,7 +678,7 @@ "$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.", + "description": "The name of the policy that is intended to be applied to the device. If empty, the policy_name for the user that owns this device 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": { @@ -911,6 +911,21 @@ }, "id": "Status" }, + "AlwaysOnVpnPackage": { + "description": "Configuration for an always-on VPN connection.", + "type": "object", + "properties": { + "packageName": { + "description": "The package name of the VPN app.", + "type": "string" + }, + "lockdownEnabled": { + "description": "Disallows networking when the VPN is not connected.", + "type": "boolean" + } + }, + "id": "AlwaysOnVpnPackage" + }, "ApplicationPolicy": { "description": "Policy for an individual app.", "type": "object", @@ -990,6 +1005,33 @@ }, "id": "ApplicationPermission" }, + "ProxyInfo": { + "description": "Configuration info for an HTTP proxy. For a direct proxy, set the host, port, and excluded_hosts fields. For a PAC script proxy, set the pac_uri field.", + "type": "object", + "properties": { + "host": { + "description": "The host of the direct proxy.", + "type": "string" + }, + "port": { + "description": "The port of the direct proxy.", + "type": "integer", + "format": "int32" + }, + "excludedHosts": { + "description": "For a direct proxy, the hosts for which the proxy is bypassed. The host names may contain wildcards such as *.example.com.", + "type": "array", + "items": { + "type": "string" + } + }, + "pacUri": { + "description": "The URI of the PAC script used to configure the proxy.", + "type": "string" + } + }, + "id": "ProxyInfo" + }, "ManagedProperty": { "description": "Managed property.", "type": "object", @@ -1214,6 +1256,20 @@ }, "id": "NonComplianceDetail" }, + "PackageNameList": { + "description": "A list of package names.", + "type": "object", + "properties": { + "packageNames": { + "description": "A list of package names.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "PackageNameList" + }, "ListDevicesResponse": { "description": "Response to a request to list devices for a given enterprise.", "type": "object", @@ -1261,84 +1317,34 @@ "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.", + "outgoingCallsDisabled": { + "description": "Whether outgoing calls are disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", "type": "boolean" }, - "passwordRequirements": { - "description": "Password requirements.", - "$ref": "PasswordRequirements" - }, - "modifyAccountsDisabled": { - "description": "Whether adding or removing accounts is disabled.", + "screenCaptureDisabled": { + "description": "Whether screen capture is disabled.", "type": "boolean" }, - "statusReportingSettings": { - "description": "Status reporting settings", - "$ref": "StatusReportingSettings" + "bluetoothDisabled": { + "description": "Whether bluetooth is disabled. Prefer this setting over bluetooth_config_disabled because bluetooth_config_disabled can be bypassed by the user. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "installAppsDisabled": { + "description": "Whether user installation of apps is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" }, "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.", + "modifyAccountsDisabled": { + "description": "Whether adding or removing accounts 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": [ @@ -1358,26 +1364,48 @@ "type": "string" } }, - "cameraDisabled": { - "description": "Whether all cameras on the device are disabled.", + "networkResetDisabled": { + "description": "Whether resetting network settings is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", "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.", + "shortSupportMessage": { + "description": "A message displayed to the user in the settings screen wherever functionality has been disabled by the admin. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "$ref": "UserFacingMessage" + }, + "wifiConfigDisabled": { + "description": "Whether configuring WiFi access points is disabled.", "type": "boolean" }, - "debuggingFeaturesAllowed": { - "description": "Whether the user is allowed to enable debugging features.", + "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" }, - "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" + "keyguardDisabledFeatures": { + "description": "Disabled keyguard customizations, such as widgets. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "enumDescriptions": [ + "This value is ignored.", + "Disable the camera on secure keyguard screens (e.g. PIN).", + "Disable showing all notifications on secure keyguard screens.", + "Disable unredacted notifications on secure keyguard screens.", + "Ignore trust agent state on secure keyguard screens.", + "Disable fingerprint sensor on keyguard secure screens.", + "Disable text entry into notifications on secure keyguard screens.", + "Disable all current and future keyguard customizations." + ], + "type": "array", + "items": { + "enum": [ + "KEYGUARD_DISABLED_FEATURE_UNSPECIFIED", + "CAMERA", + "NOTIFICATIONS", + "UNREDACTED_NOTIFICATIONS", + "TRUST_AGENTS", + "DISABLE_FINGERPRINT", + "DISABLE_REMOTE_INPUT", + "ALL_FEATURES" + ], + "type": "string" + } }, "defaultPermissionPolicy": { "description": "The default permission policy for requests for runtime permissions.", @@ -1395,20 +1423,64 @@ ], "type": "string" }, - "persistentPreferredActivities": { - "description": "Default intent handler activities.", - "type": "array", - "items": { - "$ref": "PersistentPreferredActivity" - } + "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" }, - "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.", + "safeBootDisabled": { + "description": "Whether rebooting the device into safe boot is disabled.", "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" + "setUserIconDisabled": { + "description": "Whether changing the user icon is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "recommendedGlobalProxy": { + "description": "The network-independent global HTTP proxy. Typically proxies should be configured per-network in open_network_configuration. However for unusual configurations like general internal filtering a global HTTP proxy may be useful. If the proxy is not accessible, network access may break. The global proxy is only a recommendation and some apps may ignore it. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "$ref": "ProxyInfo" + }, + "applications": { + "description": "Policy applied to apps.", + "type": "array", + "items": { + "$ref": "ApplicationPolicy" + } + }, + "outgoingBeamDisabled": { + "description": "Whether using NFC to beam out data from apps is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "credentialsConfigDisabled": { + "description": "Whether configuring user credentials is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "autoTimeRequired": { + "description": "Whether auto time is required, which prevents the user from manually setting the date and time.", + "type": "boolean" + }, + "smsDisabled": { + "description": "Whether sending or receiving SMS messages is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "permittedInputMethods": { + "description": "If present, only input methods provided by packages in this list are permitted. If this field is present, but the list is empty, then only system input methods are permitted. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "$ref": "PackageNameList" + }, + "adjustVolumeDisabled": { + "description": "Whether adjusting the master volume is disabled.", + "type": "boolean" + }, + "accountTypesWithManagementDisabled": { + "description": "Account types that cannot be managed by the user. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "array", + "items": { + "type": "string" + } + }, + "vpnConfigDisabled": { + "description": "Whether configuring VPN is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" }, "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.", @@ -1417,22 +1489,144 @@ "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" + "alwaysOnVpnPackage": { + "description": "Configuration for an always-on VPN connection. Use with vpn_config_disabled to prevent modification of this setting. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "$ref": "AlwaysOnVpnPackage" }, - "screenCaptureDisabled": { - "description": "Whether screen capture is disabled.", + "tetheringConfigDisabled": { + "description": "Whether configuring tethering and portable hotspots is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", "type": "boolean" }, + "name": { + "description": "The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}", + "type": "string" + }, + "uninstallAppsDisabled": { + "description": "Whether user uninstallation of applications is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "funDisabled": { + "description": "Whether the user is allowed to have fun. Controls whether the Easter egg game in Settings is disabled.", + "type": "boolean" + }, + "openNetworkConfiguration": { + "description": "Network configuration for the device. See configure networks for more information.", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "type": "object" + }, + "unmuteMicrophoneDisabled": { + "description": "Whether the microphone is muted and adjusting microphone volume is disabled.", + "type": "boolean" + }, + "systemUpdate": { + "description": "The system update policy, which controls how OS updates are applied. If the update type is WINDOWED, the update window will automatically apply to Play app updates as well.", + "$ref": "SystemUpdate" + }, "keyguardDisabled": { "description": "Whether the keyguard is disabled.", "type": "boolean" }, + "mountPhysicalMediaDisabled": { + "description": "Whether the user mounting physical external media is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "ensureVerifyAppsEnabled": { + "description": "Whether application verification is forced to be enabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "mobileNetworksConfigDisabled": { + "description": "Whether configuring mobile networks is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "dataRoamingDisabled": { + "description": "Whether roaming data services are disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "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" + }, + "longSupportMessage": { + "description": "A message displayed to the user in the device administators settings screen. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "$ref": "UserFacingMessage" + }, + "cameraDisabled": { + "description": "Whether all cameras on the device are disabled.", + "type": "boolean" + }, + "passwordRequirements": { + "description": "Password requirements.", + "$ref": "PasswordRequirements" + }, + "setWallpaperDisabled": { + "description": "Whether changing the wallpaper is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "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" + }, + "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" + } + }, + "statusReportingSettings": { + "description": "Status reporting settings", + "$ref": "StatusReportingSettings" + }, "addUserDisabled": { "description": "Whether adding new users and profiles is disabled.", "type": "boolean" + }, + "bluetoothContactSharingDisabled": { + "description": "Whether bluetooth contact sharing is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "bluetoothConfigDisabled": { + "description": "Whether configuring bluetooth is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "cellBroadcastsConfigDisabled": { + "description": "Whether configuring cell broadcast is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "usbFileTransferDisabled": { + "description": "Whether transferring files over USB is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "removeUserDisabled": { + "description": "Whether removing other users 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" + }, + "createWindowsDisabled": { + "description": "Whether creating windows besides app windows is disabled. \u003ci\u003eRequires the beta version of the Android Device Policy app.\u003c/i\u003e", + "type": "boolean" + }, + "persistentPreferredActivities": { + "description": "Default intent handler activities.", + "type": "array", + "items": { + "$ref": "PersistentPreferredActivity" + } + }, + "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" } }, "id": "Policy" @@ -1640,7 +1834,7 @@ "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.", + "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_name for the user that owns the device is applied. If user_name also isn't specified, the policy defaults to enterprises/{enterpriseId}/policies/default. 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": { @@ -1963,6 +2157,7 @@ "description": "The required password quality.", "enum": [ "PASSWORD_QUALITY_UNSPECIFIED", + "BIOMETRIC_WEAK", "SOMETHING", "NUMERIC", "NUMERIC_COMPLEX", @@ -1972,6 +2167,7 @@ ], "enumDescriptions": [ "There are no requirements for the password.", + "There must be at least low-security biometric recognition technology to secure the device. This includes technologies that can recognize the identity of an individual to about a 3 digit PIN (false detection is less than 1 in 1,000).", "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.", @@ -2178,7 +2374,7 @@ "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.", + "Install automatically within a daily maintenance window. 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" @@ -2252,7 +2448,7 @@ "id": "HardwareStatus" } }, - "revision": "20170918", + "revision": "20171127", "basePath": "", "icons": { "x32": "http://www.google.com/images/icons/product/search-32.gif", diff --git a/etc/api/androidpublisher/v1.1/androidpublisher-api.json b/etc/api/androidpublisher/v1.1/androidpublisher-api.json index a9b442f12b..580f67d4c3 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/EKUDjWuy8xhU5dHne-WullXJgWw\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/VxIc5srE4gMSXl83OJ7lOi7ZNVw\"", "discoveryVersion": "v1", "id": "androidpublisher:v1.1", "name": "androidpublisher", "canonicalName": "Android Publisher", "version": "v1.1", - "revision": "20170913", + "revision": "20171030", "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.1/applications/", "rootUrl": "https://www.googleapis.com/", "servicePath": "androidpublisher/v1.1/applications/", - "batchPath": "batch", + "batchPath": "batch/androidpublisher/v1.1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/androidpublisher/v1/androidpublisher-api.json b/etc/api/androidpublisher/v1/androidpublisher-api.json index 6090f92a60..7f9a070f85 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/Ex2nsAPYjRP0NRWSGg4yyxwNJ18\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/xBYE5dsDkH9Dr1-OQbrbXKASDg8\"", "discoveryVersion": "v1", "id": "androidpublisher:v1", "name": "androidpublisher", "canonicalName": "Android Publisher", "version": "v1", - "revision": "20170913", + "revision": "20171030", "title": "Google Play Developer API", "description": "Lets Android application developers access their Google Play accounts.", "ownerDomain": "google.com", diff --git a/etc/api/androidpublisher/v2/androidpublisher-api.json b/etc/api/androidpublisher/v2/androidpublisher-api.json index d537259540..0910ba5169 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/QjVvqrUMRW1tTVdJHVqdnKd9gLQ\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/6dRjzWCszNTQjv1EQoJBlq-Xgrs\"", "discoveryVersion": "v1", "id": "androidpublisher:v2", "name": "androidpublisher", "canonicalName": "Android Publisher", "version": "v2", - "revision": "20170913", + "revision": "20171030", "title": "Google Play Developer API", "description": "Lets Android application developers access their Google Play accounts.", "ownerDomain": "google.com", @@ -21,7 +21,7 @@ "basePath": "/androidpublisher/v2/applications/", "rootUrl": "https://www.googleapis.com/", "servicePath": "androidpublisher/v2/applications/", - "batchPath": "batch", + "batchPath": "batch/androidpublisher/v2", "parameters": { "alt": { "type": "string", @@ -601,88 +601,6 @@ } } }, - "InappproductsBatchRequest": { - "id": "InappproductsBatchRequest", - "type": "object", - "properties": { - "entrys": { - "type": "array", - "items": { - "$ref": "InappproductsBatchRequestEntry" - } - } - } - }, - "InappproductsBatchRequestEntry": { - "id": "InappproductsBatchRequestEntry", - "type": "object", - "properties": { - "batchId": { - "type": "integer", - "format": "uint32" - }, - "inappproductsinsertrequest": { - "$ref": "InappproductsInsertRequest" - }, - "inappproductsupdaterequest": { - "$ref": "InappproductsUpdateRequest" - }, - "methodName": { - "type": "string" - } - } - }, - "InappproductsBatchResponse": { - "id": "InappproductsBatchResponse", - "type": "object", - "properties": { - "entrys": { - "type": "array", - "items": { - "$ref": "InappproductsBatchResponseEntry" - } - }, - "kind": { - "type": "string", - "description": "Identifies what kind of resource this is. Value: the fixed string \"androidpublisher#inappproductsBatchResponse\".", - "default": "androidpublisher#inappproductsBatchResponse" - } - } - }, - "InappproductsBatchResponseEntry": { - "id": "InappproductsBatchResponseEntry", - "type": "object", - "properties": { - "batchId": { - "type": "integer", - "format": "uint32" - }, - "inappproductsinsertresponse": { - "$ref": "InappproductsInsertResponse" - }, - "inappproductsupdateresponse": { - "$ref": "InappproductsUpdateResponse" - } - } - }, - "InappproductsInsertRequest": { - "id": "InappproductsInsertRequest", - "type": "object", - "properties": { - "inappproduct": { - "$ref": "InAppProduct" - } - } - }, - "InappproductsInsertResponse": { - "id": "InappproductsInsertResponse", - "type": "object", - "properties": { - "inappproduct": { - "$ref": "InAppProduct" - } - } - }, "InappproductsListResponse": { "id": "InappproductsListResponse", "type": "object", @@ -706,24 +624,6 @@ } } }, - "InappproductsUpdateRequest": { - "id": "InappproductsUpdateRequest", - "type": "object", - "properties": { - "inappproduct": { - "$ref": "InAppProduct" - } - } - }, - "InappproductsUpdateResponse": { - "id": "InappproductsUpdateResponse", - "type": "object", - "properties": { - "inappproduct": { - "$ref": "InAppProduct" - } - } - }, "Listing": { "id": "Listing", "type": "object", @@ -3051,20 +2951,6 @@ }, "inappproducts": { "methods": { - "batch": { - "id": "androidpublisher.inappproducts.batch", - "path": "inappproducts/batch", - "httpMethod": "POST", - "request": { - "$ref": "InappproductsBatchRequest" - }, - "response": { - "$ref": "InappproductsBatchResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/androidpublisher" - ] - }, "delete": { "id": "androidpublisher.inappproducts.delete", "path": "{packageName}/inappproducts/{sku}", diff --git a/etc/api/api-list.yaml b/etc/api/api-list.yaml index 55575441ff..34a63cc1ce 100644 --- a/etc/api/api-list.yaml +++ b/etc/api/api-list.yaml @@ -3,6 +3,8 @@ # DO NOT EDIT !!! api: list: + abusiveexperiencereport: + - v1 acceleratedmobilepageurl: - v1 adexchangebuyer: @@ -69,6 +71,8 @@ api: - v1beta1 cloudfunctions: - v1 + cloudiot: + - v1 cloudkms: - v1 - v1beta1 @@ -112,14 +116,10 @@ api: - v2 - v2beta2 dfareporting: - - v2.1 - - v2.2 - - v2.3 - - v2.4 - - v2.5 - - v2.6 - - v2.7 - v2.8 + - v3.0 + dialogflow: + - v2beta1 discovery: - v1 dlp: @@ -139,6 +139,8 @@ api: - v1 firebaserules: - v1 + firestore: + - v1beta1 fitness: - v1 freebase: @@ -190,6 +192,7 @@ api: oauth2: - v2 oslogin: + - v1 - v1beta pagespeedonline: - v2 @@ -205,6 +208,8 @@ api: - v1 plusdomains: - v1 + poly: + - v1 prediction: - v1.6 proximitybeacon: @@ -231,6 +236,8 @@ api: - v1 searchconsole: - v1 + serviceconsumermanagement: + - v1 servicecontrol: - v1 servicemanagement: @@ -275,6 +282,8 @@ api: - v1 toolresults: - v1beta3 + tpu: + - v1alpha1 translate: - v2 urlshortener: diff --git a/etc/api/appengine/v1/appengine-api.json b/etc/api/appengine/v1/appengine-api.json index 082c4027a0..79de5355ab 100644 --- a/etc/api/appengine/v1/appengine-api.json +++ b/etc/api/appengine/v1/appengine-api.json @@ -1,15 +1,20 @@ { - "discoveryVersion": "v1", + "rootUrl": "https://appengine.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "appengine", + "batchPath": "batch", + "id": "appengine:v1", + "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", + "revision": "20171208", + "title": "Google App Engine Admin API", "ownerName": "Google", + "discoveryVersion": "v1", "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" }, @@ -17,69 +22,40 @@ "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": "v1/apps/{appsId}:repair", - "id": "appengine.apps.repair", - "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": "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" - ] + ], + "flatPath": "v1/apps/{appsId}:repair", + "path": "v1/apps/{appsId}:repair", + "id": "appengine.apps.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." }, "get": { "description": "Gets information about an application.", "httpMethod": "GET", - "parameterOrder": [ - "appsId" - ], "response": { "$ref": "Application" }, + "parameterOrder": [ + "appsId" + ], "parameters": { "appsId": { "location": "path", "description": "Part of `name`. Name of the Application resource to get. Example: apps/myapp.", - "type": "string", - "required": true + "required": true, + "type": "string" } }, "scopes": [ @@ -88,17 +64,50 @@ "https://www.googleapis.com/auth/cloud-platform.read-only" ], "flatPath": "v1/apps/{appsId}", - "path": "v1/apps/{appsId}", - "id": "appengine.apps.get" + "id": "appengine.apps.get", + "path": "v1/apps/{appsId}" }, - "create": { - "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/).", + "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.", + "httpMethod": "PATCH", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "updateMask": { + "location": "query", + "description": "Standard field mask for the set of fields to be updated.", + "format": "google-fieldmask", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the Application resource to update. Example: apps/myapp.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/apps/{appsId}", + "id": "appengine.apps.patch", + "path": "v1/apps/{appsId}" + }, + "create": { + "flatPath": "v1/apps", + "id": "appengine.apps.create", + "path": "v1/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/).", "httpMethod": "POST", "parameterOrder": [], "response": { @@ -114,11 +123,7 @@ "domainMappings": { "methods": { "delete": { - "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" }, @@ -126,32 +131,105 @@ "appsId", "domainMappingsId" ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], + "httpMethod": "DELETE", "parameters": { "appsId": { "description": "Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com.", - "type": "string", "required": true, + "type": "string", "location": "path" }, "domainMappingsId": { "location": "path", "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", - "required": true + "required": true, + "type": "string" } - } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/apps/{appsId}/domainMappings/{domainMappingsId}", + "path": "v1/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.delete" + }, + "list": { + "response": { + "$ref": "ListDomainMappingsResponse" + }, + "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": { + "pageSize": { + "location": "query", + "description": "Maximum results to return per page.", + "format": "int32", + "type": "integer" + }, + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "required": true, + "type": "string", + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "type": "string" + } + }, + "flatPath": "v1/apps/{appsId}/domainMappings", + "path": "v1/apps/{appsId}/domainMappings", + "id": "appengine.apps.domainMappings.list", + "description": "Lists the domain mappings on an application." + }, + "get": { + "response": { + "$ref": "DomainMapping" + }, + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com.", + "required": true, + "type": "string" + }, + "domainMappingsId": { + "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}/domainMappings/{domainMappingsId}", + "path": "v1/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.get", + "description": "Gets the specified domain mapping." }, "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.", + "id": "appengine.apps.domainMappings.patch", "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.", "response": { "$ref": "Operation" }, @@ -163,102 +241,29 @@ "parameters": { "appsId": { "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com.", - "type": "string", "required": true, + "type": "string", "location": "path" }, "domainMappingsId": { + "location": "path", "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", "required": true, - "location": "path" + "type": "string" }, "updateMask": { "location": "query", - "format": "google-fieldmask", "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" - ] - }, - "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." + "flatPath": "v1/apps/{appsId}/domainMappings/{domainMappingsId}" }, "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" }, @@ -266,152 +271,296 @@ "appsId" ], "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "parameters": { "appsId": { "location": "path", "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "required": true, + "type": "string" + }, + "overrideStrategy": { + "enum": [ + "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY", + "STRICT", + "OVERRIDE" + ], + "description": "Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected.", "type": "string", - "required": true + "location": "query" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], "flatPath": "v1/apps/{appsId}/domainMappings", + "path": "v1/apps/{appsId}/domainMappings", "id": "appengine.apps.domainMappings.create", - "path": "v1/apps/{appsId}/domainMappings" + "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" + } + } + } + }, + "firewall": { + "resources": { + "ingressRules": { + "methods": { + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListIngressRulesResponse" + }, + "parameterOrder": [ + "appsId" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules.", + "required": true, + "type": "string" + }, + "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" + }, + "matchingAddress": { + "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", + "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}/firewall/ingressRules", + "id": "appengine.apps.firewall.ingressRules.list", + "path": "v1/apps/{appsId}/firewall/ingressRules", + "description": "Lists the firewall rules of an application." + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "FirewallRule" + }, + "parameters": { + "appsId": { + "description": "Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/apps/{appsId}/firewall/ingressRules", + "id": "appengine.apps.firewall.ingressRules.create", + "path": "v1/apps/{appsId}/firewall/ingressRules", + "request": { + "$ref": "FirewallRule" + }, + "description": "Creates a firewall rule for the application." + }, + "get": { + "description": "Gets the specified firewall rule.", + "response": { + "$ref": "FirewallRule" + }, + "parameterOrder": [ + "appsId", + "ingressRulesId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100.", + "required": true, + "type": "string" + }, + "ingressRulesId": { + "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": "v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "path": "v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "id": "appengine.apps.firewall.ingressRules.get" + }, + "patch": { + "flatPath": "v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "path": "v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "id": "appengine.apps.firewall.ingressRules.patch", + "description": "Updates the specified firewall rule.", + "request": { + "$ref": "FirewallRule" + }, + "response": { + "$ref": "FirewallRule" + }, + "parameterOrder": [ + "appsId", + "ingressRulesId" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "ingressRulesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Standard field mask for the set of fields to be updated.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100.", + "required": true, + "type": "string" + } + } + }, + "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", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1/apps/{appsId}/firewall/ingressRules:batchUpdate", + "path": "v1/apps/{appsId}/firewall/ingressRules:batchUpdate", + "id": "appengine.apps.firewall.ingressRules.batchUpdate" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "appsId", + "ingressRulesId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100.", + "required": true, + "type": "string" + }, + "ingressRulesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "path": "v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "id": "appengine.apps.firewall.ingressRules.delete", + "description": "Deletes the specified firewall rule." + } + } } } }, "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": { + "id": "appengine.apps.locations.list", + "path": "v1/apps/{appsId}/locations", "description": "Lists information about the supported locations for this service.", - "response": { - "$ref": "ListLocationsResponse" - }, + "httpMethod": "GET", "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" - ], + "response": { + "$ref": "ListLocationsResponse" + }, "parameters": { "filter": { + "location": "query", "description": "The standard list filter.", - "type": "string", - "location": "query" + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. The resource that owns the locations collection, if applicable.", + "required": true, + "type": "string" }, "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 + "format": "int32", + "type": "integer", + "location": "query" } }, "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" + "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/{authorizedCertificatesId}", - "id": "appengine.apps.authorizedCertificates.patch", - "path": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}" + "flatPath": "v1/apps/{appsId}/locations" }, "get": { - "description": "Gets the specified SSL certificate.", "response": { - "$ref": "AuthorizedCertificate" + "$ref": "Location" }, "parameterOrder": [ "appsId", - "authorizedCertificatesId" + "locationsId" ], "httpMethod": "GET", "scopes": [ @@ -420,56 +569,84 @@ "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", + "description": "Part of `name`. Resource name for the location.", "required": true, + "type": "string", "location": "path" }, - "view": { - "enum": [ - "BASIC_CERTIFICATE", - "FULL_CERTIFICATE" - ], - "description": "Controls the set of fields returned in the GET response.", - "type": "string", - "location": "query" + "locationsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" } }, - "flatPath": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", - "id": "appengine.apps.authorizedCertificates.get", - "path": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}" + "flatPath": "v1/apps/{appsId}/locations/{locationsId}", + "path": "v1/apps/{appsId}/locations/{locationsId}", + "id": "appengine.apps.locations.get", + "description": "Get information about a location." + } + } + }, + "authorizedCertificates": { + "methods": { + "delete": { + "path": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.delete", + "description": "Deletes the specified SSL certificate.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "httpMethod": "DELETE", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345.", + "required": true, + "type": "string" + }, + "authorizedCertificatesId": { + "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}/authorizedCertificates/{authorizedCertificatesId}" }, "list": { - "response": { - "$ref": "ListAuthorizedCertificatesResponse" - }, + "description": "Lists all SSL certificates the user is authorized to administer.", + "httpMethod": "GET", "parameterOrder": [ "appsId" ], - "httpMethod": "GET", + "response": { + "$ref": "ListAuthorizedCertificatesResponse" + }, "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.", + "required": true, "type": "string", - "required": true + "location": "path" + }, + "pageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string", + "location": "query" }, "pageSize": { "location": "query", - "format": "int32", "description": "Maximum results to return per page.", + "format": "int32", "type": "integer" }, "view": { @@ -489,28 +666,109 @@ ], "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." + "path": "v1/apps/{appsId}/authorizedCertificates" }, - "create": { - "httpMethod": "POST", - "parameterOrder": [ - "appsId" - ], + "get": { "response": { "$ref": "AuthorizedCertificate" }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345.", + "required": true, + "type": "string", + "location": "path" + }, + "view": { + "enum": [ + "BASIC_CERTIFICATE", + "FULL_CERTIFICATE" + ], + "description": "Controls the set of fields returned in the GET response.", + "type": "string", + "location": "query" + }, + "authorizedCertificatesId": { + "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": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "path": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.get", + "description": "Gets the specified SSL certificate." + }, + "patch": { + "path": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.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", "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", + "authorizedCertificatesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", "required": true, + "type": "string" + }, + "updateMask": { + "location": "query", + "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.", + "format": "google-fieldmask", + "type": "string" + }, + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345.", + "required": true, + "type": "string", "location": "path" } }, + "flatPath": "v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}" + }, + "create": { + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "POST", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "flatPath": "v1/apps/{appsId}/authorizedCertificates", "path": "v1/apps/{appsId}/authorizedCertificates", "id": "appengine.apps.authorizedCertificates.create", @@ -518,329 +776,218 @@ "$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": { + "list": { + "description": "Lists all the services in the application.", + "response": { + "$ref": "ListServicesResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "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" + }, + "pageSize": { + "location": "query", + "description": "Maximum results to return per page.", + "format": "int32", + "type": "integer" } }, - "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}" + "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", + "path": "v1/apps/{appsId}/services", + "id": "appengine.apps.services.list" + }, + "get": { + "flatPath": "v1/apps/{appsId}/services/{servicesId}", + "path": "v1/apps/{appsId}/services/{servicesId}", + "id": "appengine.apps.services.get", + "description": "Gets the current configuration of the specified service.", + "response": { + "$ref": "Service" + }, + "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": { + "servicesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string", + "location": "path" }, - "patch": { + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", + "required": true, + "type": "string", + "location": "path" + } + } + }, + "patch": { + "flatPath": "v1/apps/{appsId}/services/{servicesId}", + "path": "v1/apps/{appsId}/services/{servicesId}", + "id": "appengine.apps.services.patch", + "description": "Updates the configuration of the specified service.", + "request": { + "$ref": "Service" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "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/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", + "location": "query" + }, + "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" + }, + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default.", + "required": true, + "type": "string", + "location": "path" + } + } + }, + "delete": { + "id": "appengine.apps.services.delete", + "path": "v1/apps/{appsId}/services/{servicesId}", + "description": "Deletes the specified service and all enclosed versions.", + "httpMethod": "DELETE", + "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 requested. 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}" + } + }, + "resources": { + "versions": { + "methods": { + "list": { "response": { - "$ref": "Operation" + "$ref": "ListVersionsResponse" }, "parameterOrder": [ "appsId", - "servicesId", - "versionsId" + "servicesId" ], - "httpMethod": "PATCH", + "httpMethod": "GET", "parameters": { - "updateMask": { + "appsId": { + "description": "Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default.", + "required": true, + "type": "string", + "location": "path" + }, + "pageToken": { "location": "query", - "format": "google-fieldmask", - "description": "Standard field mask for the set of fields to be updated.", + "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" + ] + }, "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", + "description": "Part of `parent`. See documentation of `appsId`.", "required": true, - "location": "path" - }, - "versionsId": { - "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", - "required": true, - "location": "path" + "type": "string" } }, "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" + "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}", - "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" - } + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions", + "path": "v1/apps/{appsId}/services/{servicesId}/versions", + "id": "appengine.apps.services.versions.list", + "description": "Lists the versions of a service." }, "get": { - "id": "appengine.apps.services.versions.get", + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}", "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.", "response": { "$ref": "Version" @@ -857,99 +1004,93 @@ "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": { + "location": "path", "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", "required": true, - "location": "path" + "type": "string" }, "appsId": { "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", - "type": "string", "required": true, + "type": "string", "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" + }, + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" }, "view": { "enum": [ "BASIC", "FULL" ], - "description": "Controls the set of fields returned in the List response.", + "description": "Controls the set of fields returned in the Get 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.", + "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.\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" }, "response": { "$ref": "Operation" }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "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" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1.", + "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" + }, + "create": { + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions", + "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" @@ -958,219 +1099,346 @@ "parameters": { "servicesId": { "description": "Part of `parent`. See documentation of `appsId`.", - "type": "string", "required": true, + "type": "string", "location": "path" }, "appsId": { + "location": "path", "description": "Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default.", - "type": "string", "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes an existing Version resource.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "httpMethod": "DELETE", + "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": { + "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": "v1/apps/{appsId}/services/{servicesId}/versions" + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "id": "appengine.apps.services.versions.delete" + } + }, + "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", + "parameters": { + "servicesId": { + "description": "Part of `parent`. See documentation of `appsId`.", + "required": true, + "type": "string", + "location": "path" + }, + "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": { + "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" + }, + "versionsId": { + "description": "Part of `parent`. 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": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances", + "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances", + "id": "appengine.apps.services.versions.instances.list" + }, + "get": { + "description": "Gets instance information.", + "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": { + "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" + }, + "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" + } + }, + "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" + }, + "debug": { + "id": "appengine.apps.services.versions.instances.debug", + "path": "v1/apps/{appsId}/services/{servicesId}/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.", + "httpMethod": "POST", + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "response": { + "$ref": "Operation" + }, + "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": { + "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" + }, + "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" + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "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" + }, + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "id": "appengine.apps.services.versions.instances.delete", + "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "description": "Stops a running instance." + } + } } } } - }, - "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`.", - "type": "string", - "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.get", - "description": "Gets the current configuration of the specified service." - }, - "list": { - "description": "Lists all the services in the application.", - "httpMethod": "GET", - "parameterOrder": [ - "appsId" - ], - "response": { - "$ref": "ListServicesResponse" - }, - "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}/services", - "path": "v1/apps/{appsId}/services", - "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.", + "httpMethod": "GET", "response": { "$ref": "ListAuthorizedDomainsResponse" }, "parameterOrder": [ "appsId" ], - "httpMethod": "GET", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "required": true, + "type": "string" + }, + "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" + } + }, "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 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}/authorizedDomains" + "flatPath": "v1/apps/{appsId}/authorizedDomains", + "id": "appengine.apps.authorizedDomains.list", + "path": "v1/apps/{appsId}/authorizedDomains" } } }, "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 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": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. The name of the operation's parent resource.", + "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" + } + }, + "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" + }, "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" }, @@ -1186,63 +1454,22 @@ ], "parameters": { "appsId": { - "location": "path", "description": "Part of `name`. The name of the operation resource.", + "required": true, "type": "string", - "required": true + "location": "path" }, "operationsId": { "location": "path", "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", - "required": true + "required": true, + "type": "string" } }, "flatPath": "v1/apps/{appsId}/operations/{operationsId}", + "path": "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" + "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." } } } @@ -1250,33 +1477,46 @@ } }, "parameters": { - "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "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": { "location": "query", "description": "Returns response with indentations and line breaks.", - "default": "true", - "type": "boolean" + "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" }, - "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" @@ -1285,9 +1525,12 @@ "enum": [ "1", "2" - ], - "description": "V1 error format.", - "type": "string" + ] + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" }, "alt": { "enumDescriptions": [ @@ -1305,1048 +1548,39 @@ ], "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": { + "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": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" - }, - "bearer_token": { - "description": "OAuth bearer token.", - "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", - "properties": { - "scriptPath": { - "description": "Path to the script from the application root directory.", - "type": "string" - } - }, - "id": "ScriptHandler" - }, - "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" - }, - "OperationMetadataExperimental": { - "description": "Metadata for the given google.longrunning.Operation.", - "type": "object", - "properties": { - "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" - }, - "user": { - "description": "User who requested this operation.@OutputOnly", - "type": "string" - } - }, - "id": "OperationMetadataExperimental" - }, - "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": { - "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" - ], - "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", - "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", - "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.v1beta.Versions.CreateVersion.@OutputOnly", - "type": "string" - }, - "endTime": { - "format": "google-datetime", - "description": "Time that this operation completed.@OutputOnly", - "type": "string" - } - }, - "id": "OperationMetadataV1Beta" - }, - "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" - }, - "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": { - "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": { - "properties": { - "volumeType": { - "description": "Underlying volume type, e.g. 'tmpfs'.", - "type": "string" - }, - "sizeGb": { - "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.", - "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": "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": { - "description": "Rules to match an HTTP request and dispatch that request to a service.", - "type": "object", - "properties": { - "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" - }, - "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": { - "description": "Response message for Versions.ListVersions.", - "type": "object", - "properties": { - "versions": { - "description": "The versions belonging to the requested service.", - "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": { - "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" - }, - "DomainMapping": { - "description": "A domain serving an App Engine application.", - "type": "object", - "properties": { - "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" - }, - "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": { - "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" - }, - "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" - }, - "cpuUtilization": { - "$ref": "CpuUtilization", - "description": "Target scaling by CPU usage." - }, - "diskUtilization": { - "description": "Target scaling by disk usage.", - "$ref": "DiskUtilization" - }, - "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 service.", - "type": "integer" - }, - "maxTotalInstances": { - "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": { - "name": { - "description": "Name of the library. Example: \"django\".", - "type": "string" - }, "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.", @@ -2354,37 +1588,39 @@ }, "locations": { "description": "A list of locations that matches the specified filter in the request.", + "type": "array", "items": { "$ref": "Location" - }, - "type": "array" + } } }, - "id": "ListLocationsResponse" + "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" + "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" }, "RequestUtilization": { "description": "Target scaling by request utilization. Only applicable for VM runtimes.", "type": "object", "properties": { "targetRequestCountPerSecond": { - "format": "int32", "description": "Target requests per second.", + "format": "int32", "type": "integer" }, "targetConcurrentRequests": { - "format": "int32", "description": "Target number of concurrent requests.", + "format": "int32", "type": "integer" } }, @@ -2394,68 +1630,6 @@ "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.", - "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.", - "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": "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.", @@ -2475,6 +1649,68 @@ "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": { + "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." + ], + "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" + ] + }, + "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" + }, + "script": { + "$ref": "ScriptHandler", + "description": "Executes a script to handle the request that matches this URL pattern." + }, + "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" } }, "id": "UrlMap" @@ -2483,31 +1719,21 @@ "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" + }, + "configId": { + "description": "Endpoints service configuration id as specified by the Service Management API. For example \"2016-09-19r1\"", + "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" @@ -2523,15 +1749,23 @@ "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", - "description": "This resource represents a long-running operation that is the result of a network API call.", - "type": "object" + "id": "Operation" }, "ApiConfigHandler": { - "description": "Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers.", - "type": "object", "properties": { "securityLevel": { "description": "Security (HTTPS) enforcement for this URL.", @@ -2590,19 +1824,31 @@ "type": "string" } }, - "id": "ApiConfigHandler" + "id": "ApiConfigHandler", + "description": "Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers.", + "type": "object" }, "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.", + "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" }, "expiration": { - "format": "google-duration", "description": "Time a static file served by this handler should be cached by web proxies and browsers.", + "format": "google-duration", "type": "string" }, "applicationReadable": { @@ -2615,122 +1861,77 @@ }, "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" } }, - "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" + }, + "DiskUtilization": { + "description": "Target scaling by disk usage. Only applicable for VM runtimes.", + "type": "object", + "properties": { + "targetWriteOpsPerSecond": { + "description": "Target ops written per second.", + "format": "int32", + "type": "integer" + }, + "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" + } + }, + "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": { - "maxInstances": { - "format": "int32", - "description": "Maximum number of instances to create for this version.", - "type": "integer" - }, "idleTimeout": { - "format": "google-duration", "description": "Duration of time after the last request that an instance must wait before the instance is shut down.", + "format": "google-duration", "type": "string" + }, + "maxInstances": { + "description": "Maximum number of instances to create for this version.", + "format": "int32", + "type": "integer" } }, "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": { + "description": "Target scaling by CPU usage.", + "type": "object", "properties": { "aggregationWindowLength": { - "format": "google-duration", "description": "Period of time over which CPU utilization is calculated.", + "format": "google-duration", "type": "string" }, "targetUtilization": { - "format": "double", "description": "Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1.", + "format": "double", "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" + "id": "CpuUtilization" }, "IdentityAwareProxy": { "description": "Identity-Aware Proxy", "type": "object", "properties": { - "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" @@ -2738,17 +1939,52 @@ "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" } }, "id": "IdentityAwareProxy" }, + "Status": { + "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.", + "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 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" + }, "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": { - "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.", + "format": "int32", "type": "integer" } }, @@ -2758,18 +1994,20 @@ "description": "Metadata for the given google.cloud.location.Location.", "type": "object", "properties": { - "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" + }, + "flexibleEnvironmentAvailable": { + "description": "App Engine Flexible Environment is available in the given location.@OutputOnly", + "type": "boolean" } }, "id": "LocationMetadata" }, "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", @@ -2784,9 +2022,7 @@ "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" + "id": "Service" }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", @@ -2798,23 +2034,52 @@ }, "operations": { "description": "A list of operations that matches the specified filter in the request.", + "type": "array", "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": { + "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" + }, + "priority": { + "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.", + "format": "int32", + "type": "integer" + }, + "action": { + "enum": [ + "UNSPECIFIED_ACTION", + "ALLOW", + "DENY" + ], + "description": "The action to take on matched requests.", + "type": "string", + "enumDescriptions": [ + "", + "Matching requests are allowed.", + "Matching requests are denied." + ] + } + }, + "id": "FirewallRule" + }, "OperationMetadata": { "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" - }, "user": { "description": "User who requested this operation.@OutputOnly", "type": "string" @@ -2828,13 +2093,18 @@ "type": "string" }, "endTime": { - "format": "google-datetime", "description": "Timestamp that this operation completed.@OutputOnly", + "format": "google-datetime", "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" @@ -2843,16 +2113,16 @@ "description": "Response message for AuthorizedCertificates.ListAuthorizedCertificates.", "type": "object", "properties": { + "certificates": { + "description": "The SSL certificates the user is authorized to administer.", + "type": "array", + "items": { + "$ref": "AuthorizedCertificate" + } + }, "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" @@ -2869,27 +2139,9 @@ "type": "object" }, "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" - }, - "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" @@ -2899,14 +2151,32 @@ "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" + }, + "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": "OperationMetadataV1", - "description": "Metadata for the given google.longrunning.Operation.", - "type": "object" + "id": "OperationMetadataV1" }, "SslSettings": { "description": "SSL configuration for a DomainMapping resource.", @@ -2923,10 +2193,6 @@ "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.", @@ -2945,6 +2211,10 @@ "description": "Error condition this handler applies to.", "type": "string" }, + "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" @@ -2953,42 +2223,50 @@ "id": "ErrorHandler" }, "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" + "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.", + "type": "array", + "items": { + "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" + "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" }, "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" + "id": "Network", + "description": "Extra network settings. Only applicable for App Engine flexible environment versions", + "type": "object" }, "Application": { - "description": "An Application resource contains the top-level configuration of an App Engine application. Next tag: 20", + "description": "An Application resource contains the top-level configuration of an App Engine application.", "type": "object", "properties": { + "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" + }, "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.", + "format": "google-duration", "type": "string" }, "locationId": { @@ -2996,12 +2274,6 @@ "type": "string" }, "servingStatus": { - "enum": [ - "UNSPECIFIED", - "SERVING", - "USER_DISABLED", - "SYSTEM_DISABLED" - ], "description": "Serving status of this application.", "type": "string", "enumDescriptions": [ @@ -3009,6 +2281,12 @@ "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": { @@ -3016,16 +2294,16 @@ "type": "string" }, "featureSettings": { - "description": "The feature specific settings to be used in the application.", - "$ref": "FeatureSettings" + "$ref": "FeatureSettings", + "description": "The feature specific settings to be used in the application." + }, + "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" }, - "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" @@ -3036,18 +2314,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.", - "type": "string" - }, - "name": { - "description": "Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly", - "type": "string" + } } }, "id": "Application" @@ -3056,17 +2326,9 @@ "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" - }, - "vmName": { - "description": "Name of the virtual machine where this instance lives. 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", + "format": "float", "type": "number" }, "vmId": { @@ -3082,8 +2344,8 @@ "type": "string" }, "averageLatency": { - "format": "int32", "description": "Average latency (ms) over the last minute.@OutputOnly", + "format": "int32", "type": "integer" }, "id": { @@ -3091,20 +2353,21 @@ "type": "string" }, "memoryUsage": { - "format": "int64", "description": "Total memory in use (bytes).@OutputOnly", + "format": "int64", "type": "string" }, "vmIp": { "description": "The IP address of this instance. Only applicable for instances in App Engine flexible environment.@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": { + "description": "Availability of the instance.@OutputOnly", + "type": "string", "enumDescriptions": [ "", "", @@ -3114,17 +2377,16 @@ "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" + "errors": { + "description": "Number of errors since this instance was started.@OutputOnly", + "format": "int32", + "type": "integer" }, "startTime": { - "format": "google-datetime", "description": "Time that this instance was started.@OutputOnly", + "format": "google-datetime", "type": "string" }, "vmDebugEnabled": { @@ -3132,19 +2394,1066 @@ "type": "boolean" }, "requests": { - "format": "int32", "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" + }, + "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" + }, + "LivenessCheck": { + "properties": { + "initialDelay": { + "description": "The initial delay before starting to execute the checks.", + "format": "google-duration", + "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": { + "description": "Number of consecutive successful checks required before considering the VM healthy.", + "format": "uint32", + "type": "integer" + }, + "checkInterval": { + "description": "Interval between health checks.", + "format": "google-duration", + "type": "string" + }, + "failureThreshold": { + "description": "Number of consecutive failed checks required before considering the VM unhealthy.", + "format": "uint32", + "type": "integer" + }, + "timeout": { + "description": "Time before the check is considered failed.", + "format": "google-duration", + "type": "string" + } + }, + "id": "LivenessCheck", + "description": "Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances.", + "type": "object" + }, + "BatchUpdateIngressRulesRequest": { + "description": "Request message for Firewall.BatchUpdateIngressRules.", + "type": "object", + "properties": { + "ingressRules": { + "description": "A list of FirewallRules to replace the existing set.", + "type": "array", + "items": { + "$ref": "FirewallRule" + } + } + }, + "id": "BatchUpdateIngressRulesRequest" + }, + "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": { + "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" + } + }, + "id": "Location", + "description": "A resource that represents Google Cloud Platform location.", + "type": "object" + }, + "NetworkUtilization": { + "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" + } + }, + "id": "NetworkUtilization", + "description": "Target scaling by network usage. Only applicable for VM runtimes.", + "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": { + "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" + }, + "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" + } + }, + "id": "HealthCheck" + }, + "ReadinessCheck": { + "description": "Readiness checking configuration for VM instances. Unhealthy instances are removed from traffic rotation.", + "type": "object", + "properties": { + "failureThreshold": { + "description": "Number of consecutive failed checks required before removing traffic.", + "format": "uint32", + "type": "integer" + }, + "timeout": { + "description": "Time before the check is considered failed.", + "format": "google-duration", + "type": "string" + }, + "appStartTimeout": { + "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.", + "format": "google-duration", + "type": "string" + }, + "path": { + "description": "The request path.", + "type": "string" + }, + "host": { + "description": "Host header to send when performing a HTTP Readiness check. Example: \"myapp.appspot.com\"", + "type": "string" + }, + "successThreshold": { + "description": "Number of consecutive successful checks required before receiving traffic.", + "format": "uint32", + "type": "integer" + }, + "checkInterval": { + "description": "Interval between health checks.", + "format": "google-duration", + "type": "string" + } + }, + "id": "ReadinessCheck" + }, + "StandardSchedulerSettings": { + "description": "Scheduler settings for standard environment.", + "type": "object", + "properties": { + "targetCpuUtilization": { + "description": "Target CPU utilization ratio to maintain when scaling.", + "format": "double", + "type": "number" + }, + "targetThroughputUtilization": { + "description": "Target throughput utilization ratio to maintain when scaling", + "format": "double", + "type": "number" + }, + "maxInstances": { + "description": "Maximum number of instances for an app version. Set to a non-positive value (0 by convention) to disable max_instances configuration.", + "format": "int32", + "type": "integer" + }, + "minInstances": { + "description": "Minimum number of instances for an app version. Set to a non-positive value (0 by convention) to disable min_instances configuration.", + "format": "int32", + "type": "integer" + } + }, + "id": "StandardSchedulerSettings" + }, + "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": { + "properties": { + "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" + }, + "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": "OperationMetadataV1Beta5", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object" + }, + "Version": { + "description": "A Version resource is a specific set of source code and configuration files that are deployed into a service.", + "type": "object", + "properties": { + "network": { + "$ref": "Network", + "description": "Extra network settings. Only applicable for App Engine flexible environment versions." + }, + "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": { + "$ref": "AutomaticScaling", + "description": "Automatic scaling is based on request rate, response latencies, and other application metrics." + }, + "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": { + "$ref": "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." + }, + "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": { + "$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": { + "$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": { + "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" + }, + "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": { + "$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" + }, + "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." + } + }, + "id": "Version" + }, + "RepairApplicationRequest": { + "description": "Request message for 'Applications.RepairApplication'.", + "type": "object", + "properties": {}, + "id": "RepairApplicationRequest" + }, + "CertificateRawData": { + "properties": { + "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" + }, + "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" + } + }, + "id": "CertificateRawData", + "description": "An SSL certificate obtained from a certificate authority.", + "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" + }, + "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": { + "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": "FileInfo" + }, + "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": { + "description": "Full path to the AuthorizedDomain resource in the API. Example: apps/myapp/authorizedDomains/example.com.@OutputOnly", + "type": "string" + } + }, + "id": "AuthorizedDomain" + }, + "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 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" + ], + "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" + } + } + }, + "id": "TrafficSplit" + }, + "OperationMetadataV1Beta": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "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": { + "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" + }, + "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" + }, + "ListIngressRulesResponse": { + "description": "Response message for Firewall.ListIngressRules.", + "type": "object", + "properties": { + "ingressRules": { + "description": "The ingress FirewallRules for this application.", + "type": "array", + "items": { + "$ref": "FirewallRule" + } + }, + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + } + }, + "id": "ListIngressRulesResponse" + }, + "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" + } + }, + "id": "ListServicesResponse" + }, + "Deployment": { + "properties": { + "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": { + "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", + "description": "Code and application artifacts used to deploy a version to App Engine.", + "type": "object" + }, + "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" + }, + "BatchUpdateIngressRulesResponse": { + "description": "Response message for Firewall.UpdateAllIngressRules.", + "type": "object", + "properties": { + "ingressRules": { + "description": "The full list of ingress FirewallRules for this application.", + "type": "array", + "items": { + "$ref": "FirewallRule" + } + } + }, + "id": "BatchUpdateIngressRulesResponse" + }, + "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", + "type": "number" + }, + "name": { + "description": "Unique name for the volume.", + "type": "string" + } + }, + "id": "Volume" + }, + "ListInstancesResponse": { + "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" + } + }, + "id": "ListInstancesResponse" + }, + "ListDomainMappingsResponse": { + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "domainMappings": { + "description": "The domain mappings for the application.", + "type": "array", + "items": { + "$ref": "DomainMapping" + } + } + }, + "id": "ListDomainMappingsResponse", + "description": "Response message for DomainMappings.ListDomainMappings.", + "type": "object" + }, + "OperationMetadataV1Alpha": { + "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" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "description": "Time that this operation completed.@OutputOnly", + "format": "google-datetime", + "type": "string" + } + }, + "id": "OperationMetadataV1Alpha" + }, + "UrlDispatchRule": { + "description": "Rules to match an HTTP request and dispatch that request to a service.", + "type": "object", + "properties": { + "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" + }, + "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": { + "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.", + "type": "array", + "items": { + "$ref": "Version" + } + } + }, + "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.", + "type": "array", + "items": { + "$ref": "AuthorizedDomain" + } + } + }, + "id": "ListAuthorizedDomainsResponse" + }, + "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" + }, + "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" + }, + "DomainMapping": { + "properties": { + "id": { + "description": "Relative name of the domain serving the application. Example: example.com.", + "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", + "type": "array", + "items": { + "$ref": "ResourceRecord" + } + }, + "name": { + "description": "Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.@OutputOnly", + "type": "string" + }, + "sslSettings": { + "description": "SSL configuration for this domain. If unconfigured, this domain will not serve with SSL.", + "$ref": "SslSettings" + } + }, + "id": "DomainMapping", + "description": "A domain serving an App Engine application.", + "type": "object" + }, + "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": { + "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" + } + }, + "id": "ZipInfo" + }, + "AutomaticScaling": { + "properties": { + "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", + "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." + }, + "diskUtilization": { + "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", + "type": "string" + }, + "requestUtilization": { + "description": "Target scaling by request utilization.", + "$ref": "RequestUtilization" + }, + "maxIdleInstances": { + "description": "Maximum number of idle instances that should be maintained for this version.", + "format": "int32", + "type": "integer" + }, + "standardSchedulerSettings": { + "$ref": "StandardSchedulerSettings", + "description": "Scheduler settings for standard environment." + } + }, + "id": "AutomaticScaling", + "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", + "type": "object" + }, + "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", + "type": "array", + "items": { + "type": "string" + } + }, + "expireTime": { + "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", + "format": "google-datetime", + "type": "string" + }, + "name": { + "description": "Full path to the AuthorizedCertificate resource in the API. Example: apps/myapp/authorizedCertificates/12345.@OutputOnly", + "type": "string" + }, + "domainMappingsCount": { + "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", + "format": "int32", + "type": "integer" + }, + "domainNames": { + "description": "Topmost applicable domains of this certificate. This certificate applies to these domains and their subdomains. Example: example.com.@OutputOnly", + "type": "array", + "items": { + "type": "string" + } + }, + "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" + } + }, + "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": { + "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." + ], + "enum": [ + "RECORD_TYPE_UNSPECIFIED", + "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" + } + }, + "id": "ResourceRecord" } }, - "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://appengine.googleapis.com/", "auth": { @@ -3162,16 +3471,7 @@ } } }, - "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": "20170914", - "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", - "id": "appengine:v1", - "title": "Google App Engine Admin API" + "description": "The App Engine Admin API enables developers to provision and manage their App Engine applications.", + "servicePath": "" } diff --git a/etc/api/appengine/v1alpha/appengine-api.json b/etc/api/appengine/v1alpha/appengine-api.json index 2986c8ae65..d3e3423de1 100644 --- a/etc/api/appengine/v1alpha/appengine-api.json +++ b/etc/api/appengine/v1alpha/appengine-api.json @@ -1,65 +1,630 @@ { + "basePath": "", + "ownerDomain": "google.com", + "name": "appengine", + "batchPath": "batch", + "revision": "20171208", + "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", + "id": "appengine:v1alpha", + "title": "Google App Engine Admin API", + "ownerName": "Google", + "discoveryVersion": "v1", + "resources": { + "apps": { + "resources": { + "authorizedDomains": { + "methods": { + "list": { + "response": { + "$ref": "ListAuthorizedDomainsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "required": true, + "type": "string" + }, + "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" + } + }, + "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", + "description": "Lists all domains the user is authorized to administer." + } + } + }, + "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 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.", + "httpMethod": "GET", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "parameters": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "appsId": { + "description": "Part of `name`. The name of the operation's parent resource.", + "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": "v1alpha/apps/{appsId}/operations", + "id": "appengine.apps.operations.list", + "path": "v1alpha/apps/{appsId}/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": [ + "appsId", + "operationsId" + ], + "parameters": { + "appsId": { + "description": "Part of `name`. The name of the operation resource.", + "required": true, + "type": "string", + "location": "path" + }, + "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": "v1alpha/apps/{appsId}/operations/{operationsId}", + "id": "appengine.apps.operations.get", + "path": "v1alpha/apps/{appsId}/operations/{operationsId}" + } + } + }, + "locations": { + "methods": { + "list": { + "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.", + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "filter": { + "description": "The standard list filter.", + "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": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "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" + ] + }, + "get": { + "flatPath": "v1alpha/apps/{appsId}/locations/{locationsId}", + "path": "v1alpha/apps/{appsId}/locations/{locationsId}", + "id": "appengine.apps.locations.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": { + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string", + "location": "path" + }, + "appsId": { + "description": "Part of `name`. Resource name for the location.", + "required": true, + "type": "string", + "location": "path" + } + } + } + } + }, + "domainMappings": { + "methods": { + "delete": { + "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.", + "httpMethod": "DELETE", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "parameters": { + "domainMappingsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "appsId": { + "description": "Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}" + }, + "list": { + "response": { + "$ref": "ListDomainMappingsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "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" + } + }, + "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", + "path": "v1alpha/apps/{appsId}/domainMappings", + "id": "appengine.apps.domainMappings.list", + "description": "Lists the domain mappings on an application." + }, + "get": { + "id": "appengine.apps.domainMappings.get", + "path": "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}", + "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.", + "required": true, + "type": "string" + }, + "domainMappingsId": { + "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": "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}" + }, + "patch": { + "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.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "httpMethod": "PATCH", + "parameters": { + "domainMappingsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string", + "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": { + "description": "Standard field mask for the set of fields to be updated.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}", + "path": "v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.patch" + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "overrideStrategy": { + "location": "query", + "enum": [ + "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY", + "STRICT", + "OVERRIDE" + ], + "description": "Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected.", + "type": "string" + }, + "noManagedCertificate": { + "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.", + "type": "boolean" + }, + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "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": { + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "parameters": { + "authorizedCertificatesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string", + "location": "path" + }, + "appsId": { + "description": "Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345.", + "required": true, + "type": "string", + "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}", + "description": "Deletes the specified SSL certificate." + }, + "list": { + "response": { + "$ref": "ListAuthorizedCertificatesResponse" + }, + "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": { + "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" + }, + "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_CERTIFICATE", + "FULL_CERTIFICATE" + ] + } + }, + "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." + }, + "get": { + "flatPath": "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "path": "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.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": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345.", + "required": true, + "type": "string" + }, + "view": { + "location": "query", + "enum": [ + "BASIC_CERTIFICATE", + "FULL_CERTIFICATE" + ], + "description": "Controls the set of fields returned in the GET response.", + "type": "string" + }, + "authorizedCertificatesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + } + } + }, + "patch": { + "id": "appengine.apps.authorizedCertificates.patch", + "path": "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "request": { + "$ref": "AuthorizedCertificate" + }, + "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.", + "httpMethod": "PATCH", + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameters": { + "authorizedCertificatesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "updateMask": { + "location": "query", + "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.", + "format": "google-fieldmask", + "type": "string" + }, + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}" + }, + "create": { + "request": { + "$ref": "AuthorizedCertificate" + }, + "description": "Uploads the specified SSL certificate.", + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "POST", + "parameters": { + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha/apps/{appsId}/authorizedCertificates", + "path": "v1alpha/apps/{appsId}/authorizedCertificates", + "id": "appengine.apps.authorizedCertificates.create" + } + } + } + } + } + }, "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" + "type": "string", + "location": "query" }, "uploadType": { - "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" - }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" + "type": "string", + "location": "query" }, "$.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": { "enum": [ "json", @@ -82,204 +647,87 @@ "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": "API key. 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": "Available 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" + }, + "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.", + "type": "boolean", + "default": "true" } }, "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.", + "OperationMetadataV1Beta5": { + "description": "Metadata for the given google.longrunning.Operation.", "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", + "format": "google-datetime", + "type": "string" + }, + "endTime": { + "description": "Timestamp that this operation completed.@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/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", + "method": { + "description": "API method name that initiated this operation. Example: google.appengine.v1beta5.Version.CreateVersion.@OutputOnly", "type": "string" } - } + }, + "id": "OperationMetadataV1Beta5" }, "ListLocationsResponse": { "description": "The response message for Locations.ListLocations.", "type": "object", "properties": { "nextPageToken": { - "type": "string", - "description": "The standard List next-page token." + "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" - }, - "type": "array", - "description": "A list of locations that matches the specified filter in the request." + } } }, "id": "ListLocationsResponse" @@ -288,12 +736,18 @@ "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": { + "enum": [ + "UNSPECIFIED_STATUS", + "OK", + "PENDING", + "FAILED_RETRYING_INTERNAL", + "FAILED_RETRYING_NOT_VISIBLE", + "FAILED_PERMANENTLY_NOT_VISIBLE", + "FAILED_RETRYING_CAA_FORBIDDEN", + "FAILED_RETRYING_CAA_CHECKING" + ], + "description": "Status of certificate management. Refers to the most recent certificate acquisition or renewal attempt.@OutputOnly", "type": "string", "enumDescriptions": [ "", @@ -301,45 +755,58 @@ "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" + "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.", + "Most recent renewal failed due to an explicit CAA record that does not include the in-use CA, Let's Encrypt. Renewals will continue to fail until the CAA is reconfigured. The last successfully provisioned certificate may still be serving.", + "Most recent renewal failed due to a CAA retrieval failure. This means that the domain's DNS provider does not properly handle CAA records, failing requests for CAA records when no CAA records are defined. Renewals will continue to fail until the DNS provider is changed or a CAA record is added for the given domain. The last successfully provisioned certificate may still be serving." + ] + }, + "lastRenewalTime": { + "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", + "format": "google-datetime", + "type": "string" } }, "id": "ManagedCertificate" }, + "SslSettings": { + "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", + "description": "SSL configuration for a DomainMapping resource.", + "type": "object" + }, "OperationMetadataV1": { "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" - }, - "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", + "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" @@ -349,57 +816,39 @@ "type": "string" }, "endTime": { - "format": "google-datetime", "description": "Time that this operation completed.@OutputOnly", + "format": "google-datetime", "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" + }, + "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" } }, "id": "CertificateRawData" }, "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": { - "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." + "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.", @@ -416,13 +865,15 @@ }, "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." + "id": "Operation" }, "ListDomainMappingsResponse": { - "id": "ListDomainMappingsResponse", "description": "Response message for DomainMappings.ListDomainMappings.", "type": "object", "properties": { @@ -432,17 +883,30 @@ }, "domainMappings": { "description": "The domain mappings for the application.", + "type": "array", "items": { "$ref": "DomainMapping" - }, - "type": "array" + } } - } + }, + "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", + "type": "array", + "items": { + "type": "string" + } + }, + "insertTime": { + "description": "Time that this operation was created.@OutputOnly", + "format": "google-datetime", + "type": "string" + }, "target": { "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", "type": "string" @@ -460,53 +924,54 @@ "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.", + "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": { - "insertTime": { - "format": "google-datetime", - "description": "Time that this operation was created.@OutputOnly", - "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.", + "type": "array", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + } }, - "endTime": { - "format": "google-datetime", - "description": "Time that this operation completed.@OutputOnly", - "type": "string" + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", + "type": "integer" }, - "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", + "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" + }, + "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" }, "ListAuthorizedDomainsResponse": { "description": "Response message for AuthorizedDomains.ListAuthorizedDomains.", @@ -518,92 +983,47 @@ }, "domains": { "description": "The authorized domains belonging to the user.", + "type": "array", "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" + "type": "object", + "properties": {}, + "id": "Empty" }, "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" + "id": { + "description": "Relative name of the domain serving the application. Example: example.com.", + "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", + "type": "array", + "items": { + "$ref": "ResourceRecord" + } }, "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." + "sslSettings": { + "$ref": "SslSettings", + "description": "SSL configuration for this domain. If unconfigured, this domain will not serve with SSL." } }, "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", @@ -613,22 +1033,26 @@ "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" }, "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", + "type": "string" }, "target": { "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", @@ -647,23 +1071,17 @@ "type": "string" }, "endTime": { - "format": "google-datetime", "description": "Time that this operation completed.@OutputOnly", + "format": "google-datetime", "type": "string" } }, - "id": "OperationMetadataV1Beta", - "description": "Metadata for the given google.longrunning.Operation." + "id": "OperationMetadataV1Beta" }, "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" @@ -673,24 +1091,178 @@ "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." + "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" + } + }, + "id": "Location" + }, + "AuthorizedCertificate": { + "properties": { + "displayName": { + "description": "The user-specified display name of the certificate. This is not guaranteed to be unique. Example: My Certificate.", + "type": "string" + }, + "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" + }, + "certificateRawData": { + "$ref": "CertificateRawData", + "description": "The SSL certificate serving the AuthorizedCertificate resource. This must be obtained independently from a certificate authority." + }, + "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", + "type": "array", + "items": { + "type": "string" + } + }, + "expireTime": { + "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", + "format": "google-datetime", + "type": "string" + }, + "name": { + "description": "Full path to the AuthorizedCertificate resource in the API. Example: apps/myapp/authorizedCertificates/12345.@OutputOnly", + "type": "string" + }, + "domainMappingsCount": { + "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", + "format": "int32", + "type": "integer" + }, + "domainNames": { + "description": "Topmost applicable domains of this certificate. This certificate applies to these domains and their subdomains. Example: example.com.@OutputOnly", + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "description": "Relative name of the certificate. This is a unique value autogenerated on AuthorizedCertificate resource creation. Example: 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": { + "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": { + "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" + ], + "description": "Resource record type. Example: AAAA.", + "type": "string" + }, + "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" + }, + "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": "Location", - "description": "A resource that represents Google Cloud Platform location.", + "id": "ListOperationsResponse" + }, + "OperationMetadata": { + "properties": { + "endTime": { + "description": "Timestamp that this operation completed.@OutputOnly", + "format": "google-datetime", + "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" + }, + "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.", + "type": "object" + }, + "ListAuthorizedCertificatesResponse": { + "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.", + "type": "array", + "items": { + "$ref": "AuthorizedCertificate" + } + } + }, + "id": "ListAuthorizedCertificatesResponse", + "description": "Response message for AuthorizedCertificates.ListAuthorizedCertificates.", "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" }, + "protocol": "rest", "version": "v1alpha", "baseUrl": "https://appengine.googleapis.com/", "auth": { @@ -708,595 +1280,8 @@ } } }, - "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" - } - } - } - } - } - } + "description": "The App Engine Admin API enables developers to provision and manage their App Engine applications.", + "servicePath": "", + "rootUrl": "https://appengine.googleapis.com/" } diff --git a/etc/api/appengine/v1beta/appengine-api.json b/etc/api/appengine/v1beta/appengine-api.json index 97e2decb93..9a5f7da155 100644 --- a/etc/api/appengine/v1beta/appengine-api.json +++ b/etc/api/appengine/v1beta/appengine-api.json @@ -1,536 +1,42 @@ { + "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" + } + } + } + }, + "kind": "discovery#restDescription", + "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", + "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", + "id": "appengine:v1beta", + "revision": "20171208", + "title": "Google App Engine Admin API", + "ownerName": "Google", + "discoveryVersion": "v1", "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", + "description": "Deletes an existing Version resource.", "response": { "$ref": "Operation" }, @@ -539,131 +45,38 @@ "servicesId", "versionsId" ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], + "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/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" }, + "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`.", - "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 + "type": "string" } }, - "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" + "https://www.googleapis.com/auth/cloud-platform" ], - "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." + "id": "appengine.apps.services.versions.delete" }, "list": { + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions", + "id": "appengine.apps.services.versions.list", + "description": "Lists the versions of a service.", "response": { "$ref": "ListVersionsResponse" }, @@ -678,20 +91,20 @@ "https://www.googleapis.com/auth/cloud-platform.read-only" ], "parameters": { + "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" }, - "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.", + "format": "int32", "type": "integer", "location": "query" }, @@ -705,16 +118,109 @@ "type": "string" }, "servicesId": { + "location": "path", "description": "Part of `parent`. See documentation of `appsId`.", - "type": "string", "required": true, + "type": "string" + } + }, + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions" + }, + "get": { + "response": { + "$ref": "Version" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "httpMethod": "GET", + "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" + } + }, + "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}", + "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." + }, + "patch": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "httpMethod": "PATCH", + "parameters": { + "versionsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Standard field mask for the set of fields to be updated.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1.", + "required": true, + "type": "string", "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." + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}", + "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." }, "create": { "httpMethod": "POST", @@ -725,26 +231,26 @@ "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 + "required": true, + "type": "string" }, "appsId": { + "location": "path", "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" + "type": "string" } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions", - "path": "v1beta/apps/{appsId}/services/{servicesId}/versions", "id": "appengine.apps.services.versions.create", + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions", "request": { "$ref": "Version" }, @@ -754,6 +260,150 @@ "resources": { "instances": { "methods": { + "debug": { + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", + "path": "v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug", + "id": "appengine.apps.services.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" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "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" + }, + "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" + } + } + }, + "delete": { + "description": "Stops a running instance.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "httpMethod": "DELETE", + "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": { + "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" + } + }, + "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" + }, + "list": { + "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).", + "response": { + "$ref": "ListInstancesResponse" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "httpMethod": "GET", + "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 Version resource. Example: apps/myapp/services/default/versions/v1.", + "required": true, + "type": "string" + }, + "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" + } + }, + "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" + }, "get": { "response": { "$ref": "Instance" @@ -765,201 +415,51 @@ "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": { - "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, - "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", + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.", "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 + "type": "string" }, "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" + "type": "string" }, "versionsId": { - "location": "path", "description": "Part of `name`. See documentation of `appsId`.", + "required": true, "type": "string", - "required": true - }, - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", - "required": true + "location": "path" } }, "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." + "id": "appengine.apps.services.versions.instances.get", + "description": "Gets instance information." } } } } } - } - }, - "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" + "$ref": "ListServicesResponse" }, "parameterOrder": [ "appsId" @@ -967,35 +467,234 @@ "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", + "format": "int32", + "type": "integer", "location": "query" }, "appsId": { + "location": "path", "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", - "type": "string", "required": true, - "location": "path" + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "Continuation token for fetching the next page of results.", + "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": "v1beta/apps/{appsId}/services", + "path": "v1beta/apps/{appsId}/services", + "id": "appengine.apps.services.list", + "description": "Lists all the services in the application." + }, + "get": { + "description": "Gets the current configuration of the specified service.", + "response": { + "$ref": "Service" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "GET", + "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" + } + }, + "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" + }, + "patch": { + "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.", + "httpMethod": "PATCH", + "parameterOrder": [ + "appsId", + "servicesId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "updateMask": { + "location": "query", + "description": "Standard field mask for the set of fields to be updated.", + "format": "google-fieldmask", + "type": "string" + }, + "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": { + "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", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" ] + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "appsId", + "servicesId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/services/{servicesId}", + "id": "appengine.apps.services.delete", + "path": "v1beta/apps/{appsId}/services/{servicesId}", + "description": "Deletes the specified service and all enclosed versions." + } + } + }, + "authorizedDomains": { + "methods": { + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListAuthorizedDomainsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "parameters": { + "appsId": { + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "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" + } + }, + "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}/authorizedDomains", + "id": "appengine.apps.authorizedDomains.list", + "path": "v1beta/apps/{appsId}/authorizedDomains", + "description": "Lists all domains the user is authorized to administer." } } }, "operations": { "methods": { + "list": { + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. The name of the operation's parent resource.", + "required": true, + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "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/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta/apps/{appsId}/operations", + "path": "v1beta/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 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." + }, "get": { + "id": "appengine.apps.operations.get", + "path": "v1beta/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" }, @@ -1003,181 +702,34 @@ "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`.", + "required": true, "type": "string", - "required": true + "location": "path" }, "appsId": { "location": "path", "description": "Part of `name`. The name of the operation resource.", - "type": "string", - "required": true + "required": true, + "type": "string" } }, - "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" + "flatPath": "v1beta/apps/{appsId}/operations/{operationsId}" } } }, "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": { + "path": "v1beta/apps/{appsId}/domainMappings", + "id": "appengine.apps.domainMappings.list", "description": "Lists the domain mappings on an application.", "response": { "$ref": "ListDomainMappingsResponse" @@ -1187,22 +739,22 @@ ], "httpMethod": "GET", "parameters": { - "pageSize": { - "format": "int32", - "description": "Maximum results to return per page.", - "type": "integer", - "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" }, - "appsId": { - "location": "path", - "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", - "type": "string", - "required": true + "pageSize": { + "description": "Maximum results to return per page.", + "format": "int32", + "type": "integer", + "location": "query" } }, "scopes": [ @@ -1210,15 +762,82 @@ "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" + "flatPath": "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": { + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "response": { "$ref": "DomainMapping" }, + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com.", + "required": true, + "type": "string" + }, + "domainMappingsId": { + "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": "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.get", + "path": "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}", + "description": "Gets the specified domain mapping." + }, + "patch": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "domainMappingsId" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "domainMappingsId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "updateMask": { + "location": "query", + "description": "Standard field mask for the set of fields to be updated.", + "format": "google-fieldmask", + "type": "string" + }, + "appsId": { + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com.", + "required": true, + "type": "string", + "location": "path" + } + }, + "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" + } + }, + "create": { "response": { "$ref": "Operation" }, @@ -1228,18 +847,63 @@ "httpMethod": "POST", "parameters": { "appsId": { + "location": "path", "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", - "type": "string", "required": true, - "location": "path" + "type": "string" + }, + "overrideStrategy": { + "location": "query", + "enum": [ + "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY", + "STRICT", + "OVERRIDE" + ], + "description": "Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected.", + "type": "string" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "flatPath": "v1beta/apps/{appsId}/domainMappings", + "path": "v1beta/apps/{appsId}/domainMappings", "id": "appengine.apps.domainMappings.create", - "path": "v1beta/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." + }, + "delete": { + "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", + "parameters": { + "domainMappingsId": { + "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 delete. Example: apps/myapp/domainMappings/example.com.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}", + "path": "v1beta/apps/{appsId}/domainMappings/{domainMappingsId}", + "id": "appengine.apps.domainMappings.delete" } } }, @@ -1247,95 +911,67 @@ "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": { + "response": { + "$ref": "Empty" + }, "parameterOrder": [ "appsId", "ingressRulesId" ], - "response": { - "$ref": "Empty" - }, "httpMethod": "DELETE", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100.", + "required": true, + "type": "string", + "location": "path" + }, + "ingressRulesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + } + }, "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}", + "id": "appengine.apps.firewall.ingressRules.delete", "description": "Deletes the specified firewall rule." }, "list": { - "description": "Lists the firewall rules of an application.", - "httpMethod": "GET", - "parameterOrder": [ - "appsId" - ], "response": { "$ref": "ListIngressRulesResponse" }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", "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, + "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" + }, + "matchingAddress": { + "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", + "location": "query" } }, "scopes": [ @@ -1345,36 +981,38 @@ ], "flatPath": "v1beta/apps/{appsId}/firewall/ingressRules", "path": "v1beta/apps/{appsId}/firewall/ingressRules", - "id": "appengine.apps.firewall.ingressRules.list" + "id": "appengine.apps.firewall.ingressRules.list", + "description": "Lists the firewall rules of an application." }, "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" - }, + "httpMethod": "POST", "parameterOrder": [ "appsId" ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], + "response": { + "$ref": "FirewallRule" + }, "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 + "required": true, + "type": "string" } - } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/firewall/ingressRules", + "id": "appengine.apps.firewall.ingressRules.create", + "path": "v1beta/apps/{appsId}/firewall/ingressRules" }, "get": { + "description": "Gets the specified firewall rule.", "httpMethod": "GET", "response": { "$ref": "FirewallRule" @@ -1383,37 +1021,30 @@ "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 + "required": true, + "type": "string" }, "ingressRulesId": { "location": "path", "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", - "required": true + "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": "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." + "path": "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}" }, "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" }, @@ -1422,83 +1053,447 @@ "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 + "required": true, + "type": "string" }, "ingressRulesId": { "location": "path", "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Standard field mask for the set of fields to be updated.", + "format": "google-fieldmask", "type": "string", - "required": true + "location": "query" } }, - "flatPath": "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "path": "v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}", + "id": "appengine.apps.firewall.ingressRules.patch", + "request": { + "$ref": "FirewallRule" + }, + "description": "Updates the specified firewall rule." + }, + "batchUpdate": { + "httpMethod": "POST", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "BatchUpdateIngressRulesResponse" + }, + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules.", + "required": true, + "type": "string" + } + }, + "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", + "request": { + "$ref": "BatchUpdateIngressRulesRequest" + }, + "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." } } } } + }, + "locations": { + "methods": { + "list": { + "description": "Lists information about the supported locations for this service.", + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "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" + } + }, + "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}/locations", + "path": "v1beta/apps/{appsId}/locations", + "id": "appengine.apps.locations.list" + }, + "get": { + "flatPath": "v1beta/apps/{appsId}/locations/{locationsId}", + "path": "v1beta/apps/{appsId}/locations/{locationsId}", + "id": "appengine.apps.locations.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": { + "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" + } + } + } + } + }, + "authorizedCertificates": { + "methods": { + "list": { + "flatPath": "v1beta/apps/{appsId}/authorizedCertificates", + "path": "v1beta/apps/{appsId}/authorizedCertificates", + "id": "appengine.apps.authorizedCertificates.list", + "description": "Lists all SSL certificates the user is authorized to administer.", + "response": { + "$ref": "ListAuthorizedCertificatesResponse" + }, + "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": { + "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_CERTIFICATE", + "FULL_CERTIFICATE" + ] + }, + "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" + } + } + }, + "get": { + "description": "Gets the specified SSL certificate.", + "httpMethod": "GET", + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345.", + "required": true, + "type": "string" + }, + "view": { + "location": "query", + "enum": [ + "BASIC_CERTIFICATE", + "FULL_CERTIFICATE" + ], + "description": "Controls the set of fields returned in the GET response.", + "type": "string" + }, + "authorizedCertificatesId": { + "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": "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.get", + "path": "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}" + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameters": { + "updateMask": { + "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.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345.", + "required": true, + "type": "string" + }, + "authorizedCertificatesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string", + "location": "path" + } + }, + "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}", + "request": { + "$ref": "AuthorizedCertificate" + }, + "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." + }, + "create": { + "description": "Uploads the specified SSL certificate.", + "request": { + "$ref": "AuthorizedCertificate" + }, + "response": { + "$ref": "AuthorizedCertificate" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `parent`. Name of the parent Application resource. Example: apps/myapp.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta/apps/{appsId}/authorizedCertificates", + "path": "v1beta/apps/{appsId}/authorizedCertificates", + "id": "appengine.apps.authorizedCertificates.create" + }, + "delete": { + "description": "Deletes the specified SSL certificate.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "appsId", + "authorizedCertificatesId" + ], + "httpMethod": "DELETE", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345.", + "required": true, + "type": "string", + "location": "path" + }, + "authorizedCertificatesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "path": "v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}", + "id": "appengine.apps.authorizedCertificates.delete" + } + } + } + }, + "methods": { + "create": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps", + "path": "v1beta/apps", + "id": "appengine.apps.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/)." + }, + "repair": { + "flatPath": "v1beta/apps/{appsId}:repair", + "path": "v1beta/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.", + "request": { + "$ref": "RepairApplicationRequest" + }, + "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", + "required": true, + "type": "string", + "location": "path" + } + } + }, + "get": { + "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.", + "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": "v1beta/apps/{appsId}", + "path": "v1beta/apps/{appsId}", + "id": "appengine.apps.get" + }, + "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", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the Application resource to update. Example: apps/myapp.", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Standard field mask for the set of fields to be updated.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta/apps/{appsId}", + "path": "v1beta/apps/{appsId}", + "id": "appengine.apps.patch" } } } }, "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", @@ -1516,8 +1511,8 @@ }, "pp": { "description": "Pretty-print response.", - "default": "true", "type": "boolean", + "default": "true", "location": "query" }, "oauth_token": { @@ -1536,27 +1531,1166 @@ "location": "query" }, "prettyPrint": { - "location": "query", "description": "Returns response with indentations and line breaks.", + "type": "boolean", "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" + }, + "$.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", + "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": { - "ListServicesResponse": { - "description": "Response message for Services.ListServices.", + "IdentityAwareProxy": { + "properties": { + "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" + }, + "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" + } + }, + "id": "IdentityAwareProxy", + "description": "Identity-Aware Proxy", + "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": { + "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 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" + } + } + }, + "id": "Status" + }, + "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" + } + }, + "id": "ManualScaling" + }, + "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" + } + }, + "id": "LocationMetadata" + }, + "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": { + "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", + "description": "The response message for Operations.ListOperations.", + "type": "object" + }, + "FirewallRule": { + "properties": { + "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" + }, + "priority": { + "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.", + "format": "int32", + "type": "integer" + }, + "action": { + "enumDescriptions": [ + "", + "Matching requests are allowed.", + "Matching requests are denied." + ], + "enum": [ + "UNSPECIFIED_ACTION", + "ALLOW", + "DENY" + ], + "description": "The action to take on matched requests.", + "type": "string" + }, + "description": { + "description": "An optional string description of this rule. This field has a maximum length of 100 characters.", + "type": "string" + } + }, + "id": "FirewallRule", + "description": "A single firewall rule that is evaluated against incoming traffic and provides an action to take on matched requests.", + "type": "object" + }, + "OperationMetadata": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "insertTime": { + "description": "Timestamp 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/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", + "type": "string" + }, + "operationType": { + "description": "Type of this operation. Deprecated, use method field instead. Example: \"create_version\".@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.", + "type": "array", + "items": { + "$ref": "AuthorizedCertificate" + } + } + }, + "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" + }, + "useContainerOptimizedOs": { + "description": "If true, use Container-Optimized OS (https://cloud.google.com/container-optimized-os/) base image for VMs, rather than a base Debian image.", + "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": { + "description": "Custom static error page to be served when an error occurs.", + "type": "object", + "properties": { + "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" + }, + "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" + } + }, + "id": "ErrorHandler" + }, + "SslSettings": { + "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" + }, + "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" + }, + "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" + } + }, + "id": "SslSettings", + "description": "SSL configuration for a DomainMapping resource.", + "type": "object" + }, + "OperationMetadataV1": { + "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" + }, + "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": { + "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": "OperationMetadataV1" + }, + "Network": { + "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. Only applicable for App Engine flexible environment versions.", + "type": "array", + "items": { + "type": "string" + } + }, + "instanceTag": { + "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 App Engine flexible environment application.", + "type": "string" + }, + "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" + }, + "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. Up to 20 dispatch rules can be supported.@OutputOnly", + "type": "array", + "items": { + "$ref": "UrlDispatchRule" + } + }, + "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": { + "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": { + "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": { + "$ref": "FeatureSettings", + "description": "The feature specific settings to be used in the application." + }, + "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" + }, + "defaultBucket": { + "description": "Google Cloud Storage bucket that can be used by this application to store content.@OutputOnly", + "type": "string" + } + }, + "id": "Application" + }, + "Instance": { + "description": "An Instance resource is the computing unit that App Engine uses to automatically scale an application.", + "type": "object", + "properties": { + "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" + }, + "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": { + "description": "Average latency (ms) over the last minute.@OutputOnly", + "format": "int32", + "type": "integer" + }, + "id": { + "description": "Relative name of the instance within the version. Example: instance-1.@OutputOnly", + "type": "string" + }, + "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" + }, + "errors": { + "description": "Number of errors since this instance was started.@OutputOnly", + "format": "int32", + "type": "integer" + }, + "availability": { + "enumDescriptions": [ + "", + "", + "" + ], + "enum": [ + "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": { + "description": "Time that this instance was started.@OutputOnly", + "format": "google-datetime", + "type": "string" + }, + "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" + }, + "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" + }, + "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": { + "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" + }, + "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" + } + }, + "id": "LivenessCheck" + }, + "BatchUpdateIngressRulesRequest": { + "properties": { + "ingressRules": { + "description": "A list of FirewallRules to replace the existing set.", + "type": "array", + "items": { + "$ref": "FirewallRule" + } + } + }, + "id": "BatchUpdateIngressRulesRequest", + "description": "Request message for Firewall.BatchUpdateIngressRules.", + "type": "object" + }, + "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" + } + } + }, + "id": "Location" + }, + "NetworkUtilization": { + "description": "Target scaling by network usage. Only applicable for VM runtimes.", + "type": "object", + "properties": { + "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" + }, + "targetSentBytesPerSecond": { + "description": "Target bytes sent per second.", + "format": "int32", + "type": "integer" + } + }, + "id": "NetworkUtilization" + }, + "HealthCheck": { + "properties": { + "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" + }, + "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", + "type": "integer" + }, + "restartThreshold": { + "description": "Number of consecutive failed health checks required before an instance is restarted.", + "format": "uint32", + "type": "integer" + } + }, + "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" + }, + "ReadinessCheck": { + "description": "Readiness checking configuration for VM instances. Unhealthy instances are removed from traffic rotation.", + "type": "object", + "properties": { + "appStartTimeout": { + "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.", + "format": "google-duration", + "type": "string" + }, + "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" + }, + "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" + } + }, + "id": "ReadinessCheck" + }, + "DebugInstanceRequest": { + "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", + "description": "Request message for Instances.DebugInstance.", + "type": "object" + }, + "StandardSchedulerSettings": { + "description": "Scheduler settings for standard environment.", + "type": "object", + "properties": { + "targetThroughputUtilization": { + "description": "Target throughput utilization ratio to maintain when scaling", + "format": "double", + "type": "number" + }, + "maxInstances": { + "description": "Maximum number of instances for an app version. Set to a non-positive value (0 by convention) to disable max_instances configuration.", + "format": "int32", + "type": "integer" + }, + "minInstances": { + "description": "Minimum number of instances for an app version. Set to a non-positive value (0 by convention) to disable min_instances configuration.", + "format": "int32", + "type": "integer" + }, + "targetCpuUtilization": { + "description": "Target CPU utilization ratio to maintain when scaling.", + "format": "double", + "type": "number" + } + }, + "id": "StandardSchedulerSettings" + }, + "OperationMetadataV1Beta5": { + "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", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object" + }, + "Version": { + "properties": { + "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/v1beta/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": { + "$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": { + "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": { + "$ref": "Network", + "description": "Extra network settings. Only applicable for App Engine flexible environment versions." + }, + "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": { + "$ref": "AutomaticScaling", + "description": "Automatic scaling is based on request rate, response latencies, and other application metrics." + }, + "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": { + "$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": { + "$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." + }, + "versionUrl": { + "description": "Serving URL for this version. Example: \"https://myversion-dot-myservice-dot-myapp.appspot.com\"@OutputOnly", + "type": "string" + }, + "vm": { + "description": "Whether to deploy this version in a container on a virtual machine.", + "type": "boolean" + }, + "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": { + "description": "Time that this version was created.@OutputOnly", + "format": "google-datetime", + "type": "string" + }, + "inboundServices": { + "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" + }, + "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" + } + }, + "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": { + "properties": {}, + "id": "RepairApplicationRequest", + "description": "Request message for 'Applications.RepairApplication'.", + "type": "object" + }, + "BuildInfo": { + "properties": { + "cloudBuildId": { + "description": "The Google Cloud Container Builder build id. Example: \"f966068f-08b2-42c8-bdfe-74137dff2bf9\"", + "type": "string" + } + }, + "id": "BuildInfo", + "description": "Google Cloud Container Builder build information.", + "type": "object" + }, + "CertificateRawData": { + "description": "An SSL certificate obtained from a certificate authority.", + "type": "object", + "properties": { + "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" + }, + "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" + } + }, + "id": "CertificateRawData" + }, + "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": { + "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": "FileInfo" + }, + "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" + }, + "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": { + "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": { + "enum": [ + "UNSPECIFIED", + "COOKIE", + "IP", + "RANDOM" + ], + "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." + ] + }, + "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" + } + }, + "id": "TrafficSplit" + }, + "OperationMetadataV1Beta": { + "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" + }, + "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": { + "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", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object" + }, + "ListServicesResponse": { + "description": "Response message for Services.ListServices.", + "type": "object", + "properties": { "services": { "description": "The services belonging to the requested application.", + "type": "array", "items": { "$ref": "Service" - }, - "type": "array" + } + }, + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" } }, "id": "ListServicesResponse" @@ -1567,10 +2701,10 @@ "properties": { "ingressRules": { "description": "The ingress FirewallRules for this application.", + "type": "array", "items": { "$ref": "FirewallRule" - }, - "type": "array" + } }, "nextPageToken": { "description": "Continuation token for fetching the next page of results.", @@ -1583,26 +2717,26 @@ "description": "Machine resources for a version.", "type": "object", "properties": { - "memoryGb": { + "volumes": { + "description": "User specified volumes.", + "type": "array", + "items": { + "$ref": "Volume" + } + }, + "diskGb": { + "description": "Disk size (GB) needed.", "format": "double", - "description": "Memory (GB) needed.", "type": "number" }, "cpu": { - "format": "double", "description": "Number of CPU cores needed.", + "format": "double", "type": "number" }, - "volumes": { - "description": "User specified volumes.", - "items": { - "$ref": "Volume" - }, - "type": "array" - }, - "diskGb": { + "memoryGb": { + "description": "Memory (GB) needed.", "format": "double", - "description": "Disk size (GB) needed.", "type": "number" } }, @@ -1617,11 +2751,11 @@ "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" - } + }, + "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": { "description": "The zip file for this deployment, if this is a zip deployment.", @@ -1638,44 +2772,55 @@ "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": { - "format": "double", "description": "Volume size in gigabytes.", + "format": "double", "type": "number" }, "name": { "description": "Unique name for the volume.", "type": "string" - }, - "volumeType": { - "description": "Underlying volume type, e.g. 'tmpfs'.", - "type": "string" } }, "id": "Volume" }, "BatchUpdateIngressRulesResponse": { + "description": "Response message for Firewall.UpdateAllIngressRules.", + "type": "object", "properties": { "ingressRules": { "description": "The full list of ingress FirewallRules for this application.", + "type": "array", "items": { "$ref": "FirewallRule" - }, - "type": "array" + } } }, - "id": "BatchUpdateIngressRulesResponse", - "description": "Response message for Firewall.UpdateAllIngressRules.", - "type": "object" + "id": "BatchUpdateIngressRulesResponse" }, "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", + "format": "google-datetime", "type": "string" }, "status": { + "enum": [ + "MANAGEMENT_STATUS_UNSPECIFIED", + "OK", + "PENDING", + "FAILED_RETRYING_NOT_VISIBLE", + "FAILED_PERMANENT", + "FAILED_RETRYING_CAA_FORBIDDEN", + "FAILED_RETRYING_CAA_CHECKING" + ], "description": "Status of certificate management. Refers to the most recent certificate acquisition or renewal attempt.@OutputOnly", "type": "string", "enumDescriptions": [ @@ -1683,22 +2828,17 @@ "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" + "All renewal attempts have been exhausted, likely due to an invalid DNS setup.", + "Most recent renewal failed due to an explicit CAA record that does not include the in-use CA, Let's Encrypt. Renewals will continue to fail until the CAA is reconfigured. The last successfully provisioned certificate may still be serving.", + "Most recent renewal failed due to a CAA retrieval failure. This means that the domain's DNS provider does not properly handle CAA records, failing requests for CAA records when no CAA records are defined. Renewals will continue to fail until the DNS provider is changed or a CAA record is added for the given domain. The last successfully provisioned certificate may still be serving." ] } }, - "id": "ManagedCertificate", - "description": "A certificate managed by App Engine.", - "type": "object" + "id": "ManagedCertificate" }, "ListInstancesResponse": { + "description": "Response message for Instances.ListInstances.", + "type": "object", "properties": { "nextPageToken": { "description": "Continuation token for fetching the next page of results.", @@ -1706,15 +2846,13 @@ }, "instances": { "description": "The instances belonging to the requested version.", + "type": "array", "items": { "$ref": "Instance" - }, - "type": "array" + } } }, - "id": "ListInstancesResponse", - "description": "Response message for Instances.ListInstances.", - "type": "object" + "id": "ListInstancesResponse" }, "ListDomainMappingsResponse": { "description": "Response message for DomainMappings.ListDomainMappings.", @@ -1722,10 +2860,10 @@ "properties": { "domainMappings": { "description": "The domain mappings for the application.", + "type": "array", "items": { "$ref": "DomainMapping" - }, - "type": "array" + } }, "nextPageToken": { "description": "Continuation token for fetching the next page of results.", @@ -1735,19 +2873,17 @@ "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", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "insertTime": { - "format": "google-datetime", "description": "Time that this operation was created.@OutputOnly", + "format": "google-datetime", "type": "string" }, "user": { @@ -1767,25 +2903,27 @@ "type": "string" }, "endTime": { - "format": "google-datetime", "description": "Time that this operation completed.@OutputOnly", + "format": "google-datetime", "type": "string" } }, - "id": "OperationMetadataV1Alpha" + "id": "OperationMetadataV1Alpha", + "description": "Metadata for the given google.longrunning.Operation.", + "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.", + "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" }, - "domain": { - "description": "Domain name to match against. The wildcard \"*\" is supported if specified before a period: \"*.\".Defaults to matching all domains: \"*\".", + "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" } }, @@ -1797,16 +2935,16 @@ "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.", "type": "string" - }, - "versions": { - "description": "The versions belonging to the requested service.", - "items": { - "$ref": "Version" - }, - "type": "array" } }, "id": "ListVersionsResponse" @@ -1821,24 +2959,39 @@ }, "domains": { "description": "The authorized domains belonging to the user.", + "type": "array", "items": { "$ref": "AuthorizedDomain" - }, - "type": "array" + } } }, "id": "ListAuthorizedDomainsResponse" }, - "ApiEndpointHandler": { - "description": "Uses Google Cloud Endpoints to handle requests.", + "DomainMapping": { + "description": "A domain serving an App Engine application.", "type": "object", "properties": { - "scriptPath": { - "description": "Path to the script from the application root directory.", + "id": { + "description": "Relative name of the domain serving the application. Example: example.com.", "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", + "type": "array", + "items": { + "$ref": "ResourceRecord" + } + }, + "name": { + "description": "Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.@OutputOnly", + "type": "string" + }, + "sslSettings": { + "$ref": "SslSettings", + "description": "SSL configuration for this domain. If unconfigured, this domain will not serve with SSL." } }, - "id": "ApiEndpointHandler" + "id": "DomainMapping" }, "Empty": { "properties": {}, @@ -1846,62 +2999,28 @@ "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": { + "ApiEndpointHandler": { "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", + "scriptPath": { + "description": "Path to the script from the application root directory.", "type": "string" } }, - "id": "DomainMapping", - "description": "A domain serving an App Engine application.", + "id": "ApiEndpointHandler", + "description": "Uses Google Cloud Endpoints to handle requests.", "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.", + "format": "google-duration", "type": "string" }, "requestUtilization": { @@ -1909,32 +3028,51 @@ "description": "Target scaling by request utilization." }, "maxIdleInstances": { - "format": "int32", "description": "Maximum number of idle instances that should be maintained for this version.", + "format": "int32", "type": "integer" }, "standardSchedulerSettings": { - "description": "Scheduler settings for standard environment.", - "$ref": "StandardSchedulerSettings" + "$ref": "StandardSchedulerSettings", + "description": "Scheduler settings for standard environment." }, "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.", + "format": "int32", "type": "integer" }, "maxTotalInstances": { - "format": "int32", "description": "Maximum number of instances that should be started to handle requests.", + "format": "int32", "type": "integer" }, "minTotalInstances": { - "format": "int32", "description": "Minimum number of instances that should be maintained for this version.", + "format": "int32", "type": "integer" }, "networkUtilization": { - "description": "Target scaling by network usage.", - "$ref": "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": { + "description": "Target scaling by CPU usage.", + "$ref": "CpuUtilization" } }, "id": "AutomaticScaling" @@ -1948,25 +3086,39 @@ "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.", + "format": "int32", "type": "integer" } }, "id": "ZipInfo" }, "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": { + "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" + }, + "certificateRawData": { + "$ref": "CertificateRawData", + "description": "The SSL certificate serving the AuthorizedCertificate resource. This must be obtained independently from a certificate authority." + }, "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", + "type": "array", "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", + "format": "google-datetime", "type": "string" }, "name": { @@ -1974,37 +3126,23 @@ "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", + "format": "int32", "type": "integer" }, "domainNames": { "description": "Topmost applicable domains of this certificate. This certificate applies to these domains and their subdomains. Example: example.com.@OutputOnly", + "type": "array", "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" + "id": "AuthorizedCertificate" }, "ResourceRecord": { "description": "A DNS resource record.", @@ -2036,8 +3174,6 @@ "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\".", @@ -2048,7 +3184,9 @@ "type": "string" } }, - "id": "Library" + "id": "Library", + "description": "Third-party Python runtime library that is required by the application.", + "type": "object" }, "ListLocationsResponse": { "description": "The response message for Locations.ListLocations.", @@ -2060,10 +3198,10 @@ }, "locations": { "description": "A list of locations that matches the specified filter in the request.", + "type": "array", "items": { "$ref": "Location" - }, - "type": "array" + } } }, "id": "ListLocationsResponse" @@ -2083,14 +3221,14 @@ "description": "Target scaling by request utilization. Only applicable for VM runtimes.", "type": "object", "properties": { - "targetConcurrentRequests": { + "targetRequestCountPerSecond": { + "description": "Target requests per second.", "format": "int32", - "description": "Target number of concurrent requests.", "type": "integer" }, - "targetRequestCountPerSecond": { + "targetConcurrentRequests": { + "description": "Target number of concurrent requests.", "format": "int32", - "description": "Target requests per second.", "type": "integer" } }, @@ -2100,54 +3238,35 @@ "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" + }, + "configId": { + "description": "Endpoints service configuration id as specified by the Service Management API. For example \"2016-09-19r1\"By default, the Endpoints service configuration id is fixed and config_id must be specified. To keep the Endpoints service configuration id updated with each rollout, specify RolloutStrategy.MANAGED and omit config_id.", + "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." + "description": "Uses API Endpoints to handle requests.", + "$ref": "ApiEndpointHandler" }, "staticFiles": { - "$ref": "StaticFilesHandler", - "description": "Returns the contents of a file, such as an image, as the response." + "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", @@ -2156,18 +3275,9 @@ "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." - ] + "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.", @@ -2181,45 +3291,57 @@ "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", - "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": { + "type": "string" + }, + "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": { - "enum": [ - "LOGIN_UNSPECIFIED", - "LOGIN_OPTIONAL", - "LOGIN_ADMIN", - "LOGIN_REQUIRED" - ], - "description": "Level of login required to access this resource. Defaults to optional.", + "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" ] - }, + } + }, + "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" + }, + "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" @@ -2243,22 +3365,38 @@ ] }, "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" + "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": "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": "ApiConfigHandler" @@ -2267,25 +3405,9 @@ "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" + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." }, "metadata": { "additionalProperties": { @@ -2294,6 +3416,22 @@ }, "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" + }, + "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" } }, "id": "Operation" @@ -2303,8 +3441,8 @@ "type": "object", "properties": { "expiration": { - "format": "google-duration", "description": "Time a static file served by this handler should be cached by web proxies and browsers.", + "format": "google-duration", "type": "string" }, "applicationReadable": { @@ -2338,45 +3476,45 @@ "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.", + "format": "int32", + "type": "integer" + }, + "targetReadOpsPerSecond": { + "description": "Target ops read per seconds.", + "format": "int32", "type": "integer" }, "targetWriteOpsPerSecond": { - "format": "int32", "description": "Target ops written per second.", + "format": "int32", "type": "integer" } }, - "id": "DiskUtilization" + "id": "DiskUtilization", + "description": "Target scaling by disk usage. Only applicable for VM runtimes.", + "type": "object" }, "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.", + "format": "int32", "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", + "type": "string" } }, "id": "BasicScaling" @@ -2386,1173 +3524,24 @@ "type": "object", "properties": { "aggregationWindowLength": { - "format": "google-duration", "description": "Period of time over which CPU utilization is calculated.", + "format": "google-duration", "type": "string" }, "targetUtilization": { - "format": "double", "description": "Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1.", + "format": "double", "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" }, + "protocol": "rest", "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" + "baseUrl": "https://appengine.googleapis.com/" } diff --git a/etc/api/appengine/v1beta4/appengine-api.json b/etc/api/appengine/v1beta4/appengine-api.json index 4c59c075c5..f4704ee00c 100644 --- a/etc/api/appengine/v1beta4/appengine-api.json +++ b/etc/api/appengine/v1beta4/appengine-api.json @@ -1,75 +1,10 @@ { - "ownerName": "Google", "discoveryVersion": "v1", + "ownerName": "Google", "resources": { "apps": { "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" - } - }, - "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)" - }, - "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" - }, - "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" }, @@ -79,16 +14,203 @@ }, "parameterOrder": [], "httpMethod": "POST", + "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "parameters": {} + "flatPath": "v1beta4/apps", + "path": "v1beta4/apps", + "id": "appengine.apps.create" + }, + "get": { + "flatPath": "v1beta4/apps/{appsId}", + "id": "appengine.apps.get", + "path": "v1beta4/apps/{appsId}", + "description": "Gets information about an application.", + "httpMethod": "GET", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "Application" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "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" + }, + "appsId": { + "description": "Part of `name`. Name of the application to get. Example: apps/myapp.", + "required": true, + "type": "string", + "location": "path" + } + } + }, + "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)", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "PATCH", + "parameters": { + "mask": { + "description": "Standard field mask for the set of fields to be updated.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, + "appsId": { + "description": "Part of `name`. Name of the Application resource to update. Example: apps/myapp.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta4/apps/{appsId}", + "path": "v1beta4/apps/{appsId}", + "id": "appengine.apps.patch" } }, "resources": { + "operations": { + "methods": { + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. The name of the operation's parent resource.", + "required": true, + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "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/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "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." + }, + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "appsId", + "operationsId" + ], + "response": { + "$ref": "Operation" + }, + "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": "v1beta4/apps/{appsId}/operations/{operationsId}", + "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." + } + } + }, "locations": { "methods": { + "list": { + "path": "v1beta4/apps/{appsId}/locations", + "id": "appengine.apps.locations.list", + "description": "Lists information about the supported locations for this service.", + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "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" + } + }, + "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}/locations" + }, "get": { + "description": "Get information about a location.", "response": { "$ref": "Location" }, @@ -97,80 +219,34 @@ "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": { + "location": "path", "description": "Part of `name`. Resource name for the location.", - "type": "string", "required": true, - "location": "path" + "type": "string" }, "locationsId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", + "required": true, "type": "string", - "required": true + "location": "path", + "description": "Part of `name`. See documentation of `appsId`." } }, - "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" - }, - "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": { - "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": { - "format": "int32", - "description": "The standard list page size.", - "type": "integer", - "location": "query" - } - }, - "flatPath": "v1beta4/apps/{appsId}/locations", - "id": "appengine.apps.locations.list", - "path": "v1beta4/apps/{appsId}/locations", - "description": "Lists information about the supported locations for this service." + "flatPath": "v1beta4/apps/{appsId}/locations/{locationsId}", + "path": "v1beta4/apps/{appsId}/locations/{locationsId}", + "id": "appengine.apps.locations.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": "Operation" }, @@ -179,106 +255,27 @@ "modulesId" ], "httpMethod": "DELETE", + "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.", + "required": true, "type": "string", - "required": true + "location": "path" }, "modulesId": { "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", "required": true, + "type": "string", "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." + "id": "appengine.apps.modules.delete", + "description": "Deletes the specified module and all enclosed versions." }, "get": { "description": "Gets the current configuration of the specified module.", @@ -293,14 +290,14 @@ "parameters": { "appsId": { "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default.", - "type": "string", "required": true, + "type": "string", "location": "path" }, "modulesId": { "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", "required": true, + "type": "string", "location": "path" } }, @@ -310,186 +307,169 @@ "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}" + "path": "v1beta4/apps/{appsId}/modules/{modulesId}", + "id": "appengine.apps.modules.get" + }, + "list": { + "description": "Lists all the modules in the application.", + "response": { + "$ref": "ListModulesResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp.", + "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" + } + }, + "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", + "path": "v1beta4/apps/{appsId}/modules", + "id": "appengine.apps.modules.list" + }, + "patch": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "modulesId" + ], + "httpMethod": "PATCH", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default.", + "required": true, + "type": "string" + }, + "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" + }, + "modulesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "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": "v1beta4/apps/{appsId}/modules/{modulesId}", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}", + "id": "appengine.apps.modules.patch", + "request": { + "$ref": "Module" + }, + "description": "Updates the configuration of the specified module." } }, "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" - }, + "httpMethod": "POST", "parameterOrder": [ "appsId", "modulesId" ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], + "response": { + "$ref": "Operation" + }, "parameters": { "appsId": { "location": "path", "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default.", - "type": "string", - "required": true + "required": true, + "type": "string" }, "modulesId": { "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", "required": true, + "type": "string", "location": "path" } - } - }, - "delete": { - "httpMethod": "DELETE", - "parameterOrder": [ - "appsId", - "modulesId", - "versionsId" - ], - "response": { - "$ref": "Operation" }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", + "id": "appengine.apps.modules.versions.create", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions" + }, + "delete": { "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.", + "required": true, + "type": "string" + }, + "modulesId": { + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, "type": "string", - "required": true + "location": "path" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string", + "location": "path" } }, "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" - ], + "description": "Deletes an existing version.", "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" + "modulesId", + "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": { - "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" + "httpMethod": "DELETE" }, "get": { + "httpMethod": "GET", "response": { "$ref": "Version" }, @@ -498,13 +478,24 @@ "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" + "type": "string", + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1." + }, + "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", @@ -514,18 +505,6 @@ ], "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": [ @@ -537,59 +516,111 @@ "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." + }, + "list": { + "response": { + "$ref": "ListVersionsResponse" + }, + "parameterOrder": [ + "appsId", + "modulesId" + ], + "httpMethod": "GET", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/modules/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" + }, + "modulesId": { + "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 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": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", + "id": "appengine.apps.modules.versions.list", + "description": "Lists the versions of a module." + }, + "patch": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "modulesId", + "versionsId" + ], + "httpMethod": "PATCH", + "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": { + "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" + } + }, + "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", + "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/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." } }, "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" @@ -601,41 +632,91 @@ "instancesId" ], "httpMethod": "DELETE", - "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": { + "required": true, + "type": "string", + "location": "path", + "description": "Part of `name`. See documentation of `appsId`." + }, + "modulesId": { "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" + "type": "string" }, "versionsId": { "location": "path", "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", - "required": true + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}", + "id": "appengine.apps.modules.versions.instances.delete", + "description": "Stops a running instance." + }, + "get": { + "description": "Gets instance information.", + "response": { + "$ref": "Instance" + }, + "parameterOrder": [ + "appsId", + "modulesId", + "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": { + "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`.", - "type": "string", "required": true, + "type": "string", + "location": "path" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string", "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." + "id": "appengine.apps.modules.versions.instances.get" }, "list": { + "flatPath": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances", + "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" @@ -647,48 +728,49 @@ ], "httpMethod": "GET", "parameters": { + "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": { + "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/modules/default/versions/v1.", + "required": true, + "type": "string", + "location": "path" + }, "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": { + "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": "Instance" + "$ref": "Operation" }, "parameterOrder": [ "appsId", @@ -696,157 +778,60 @@ "versionsId", "instancesId" ], - "httpMethod": "GET", + "httpMethod": "POST", "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`.", - "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, + "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`.", - "type": "string", - "required": true - }, - "modulesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", - "required": true + "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" + "https://www.googleapis.com/auth/cloud-platform" ], - "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." + "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" } } } } } } - }, - "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": { - "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 - } - }, - "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": { - "description": "Part of `name`. The name of the operation's parent resource.", - "type": "string", - "required": true, - "location": "path" - }, - "pageSize": { - "location": "query", - "format": "int32", - "description": "The standard list page size.", - "type": "integer" - } - }, - "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." - } - } } } } }, "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": { "location": "query", "description": "Pretty-print response.", - "default": "true", - "type": "boolean" + "type": "boolean", + "default": "true" }, "oauth_token": { + "location": "query", "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" + "type": "string" }, "bearer_token": { "location": "query", @@ -854,14 +839,14 @@ "type": "string" }, "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.", - "default": "true", "type": "boolean", + "default": "true", "location": "query" }, "uploadType": { @@ -870,29 +855,35 @@ "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", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + }, + "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", @@ -900,637 +891,42 @@ ], "location": "query", "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], + "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" + }, + "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" } }, "schemas": { - "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", - "ERROR_CODE_DEFAULT", - "ERROR_CODE_OVER_QUOTA", - "ERROR_CODE_DOS_API_DENIAL", - "ERROR_CODE_TIMEOUT" - ], - "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." - ] - }, - "staticFile": { - "description": "Static file content to be served for this error.", - "type": "string" - } - }, - "id": "ErrorHandler" - }, - "OperationMetadataV1": { - "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.v1.Versions.CreateVersion.@OutputOnly", - "type": "string" - }, - "endTime": { - "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": { - "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": { - "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" - }, - "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" - }, - "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" - }, - "location": { - "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" - }, - "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 module 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": { - "description": "Extra network settings. Only applicable for VM runtimes.", - "type": "object", - "properties": { - "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" - }, - "Instance": { - "description": "An Instance resource is the computing unit that App Engine uses to automatically scale an application.", - "type": "object", - "properties": { - "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" - }, - "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" - }, - "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" - }, - "errors": { - "format": "uint32", - "description": "Number of errors since this instance was started.@OutputOnly", - "type": "integer" - }, - "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" - }, - "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" - }, - "name": { - "description": "Full path to the Module resource in the API. Example: apps/myapp/modules/default.@OutputOnly", - "type": "string" - } - }, - "id": "Module", - "description": "A Module resource is a logical component of an application that can share state and communicate in a secure fashion with other modules. For example, an application that handles customer requests might include separate modules to handle tasks such as backend data analysis or API requests from mobile devices. Each module has a collection of versions that define a specific set of code used to implement the functionality of that module.", - "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" - } - }, - "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" - }, - "AutomaticScaling": { - "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", - "type": "object", - "properties": { - "cpuUtilization": { - "$ref": "CpuUtilization", - "description": "Target scaling by CPU usage." - }, - "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" - }, - "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": { - "$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" - }, - "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": { - "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": { - "format": "google-duration", - "description": "Time a static file served by this handler should be cached.", - "type": "string" - }, - "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": "StaticDirectoryHandler" - }, - "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": { - "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" - } - }, - "id": "Location", - "description": "A resource that represents Google Cloud Platform location.", - "type": "object" - }, - "NetworkUtilization": { - "description": "Target scaling by network usage. Only applicable for VM runtimes.", - "type": "object", - "properties": { - "targetReceivedPacketsPerSec": { - "format": "int32", - "description": "Target packets received per second.", - "type": "integer" - }, - "targetSentBytesPerSec": { - "format": "int32", - "description": "Target bytes sent per second.", - "type": "integer" - }, - "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" - }, - "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" - } - }, - "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": { - "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", - "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": { - "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" - } - }, - "id": "OperationMetadataV1Beta5", - "description": "Metadata for the given google.longrunning.Operation.", - "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" + "id": "ListLocationsResponse", + "description": "The response message for Locations.ListLocations." }, "Version": { "description": "A Version resource is a specific set of source code and configuration files that are deployed into a module.", @@ -1538,26 +934,26 @@ "properties": { "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": { - "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.", + "format": "google-duration", "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", + "format": "google-datetime", "type": "string" }, "nobuildFilesRegex": { @@ -1565,34 +961,34 @@ "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" + "$ref": "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." }, "runtime": { - "description": "Desired runtime. Example: python27.", - "type": "string" + "type": "string", + "description": "Desired runtime. Example: python27." }, "id": { "description": "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-\".", "type": "string" }, "envVariables": { + "type": "object", "additionalProperties": { "type": "string" }, - "description": "Environment variables made available to the application.Only returned in GET requests if view=FULL is set.", - "type": "object" + "description": "Environment variables made available to the application.Only returned in GET requests if view=FULL is set." }, "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.", @@ -1600,30 +996,30 @@ }, "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." + "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", + "$ref": "AutomaticScaling" }, "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" + "type": "boolean", + "description": "Whether multiple requests can be dispatched to this version at once." }, "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.", - "$ref": "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." }, "name": { "description": "Full path to the Version resource in the API. Example: apps/myapp/modules/default/versions/v1.@OutputOnly", @@ -1633,13 +1029,17 @@ "$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" }, "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" + "type": "string", + "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." }, "servingStatus": { "enumDescriptions": [ @@ -1656,31 +1056,18 @@ "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" + "$ref": "Deployment", + "description": "Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set." }, "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.", + "type": "array", "items": { + "type": "string", "enum": [ "INBOUND_SERVICE_UNSPECIFIED", "INBOUND_SERVICE_MAIL", @@ -1691,16 +1078,28 @@ "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" } }, "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": { @@ -1708,20 +1107,21 @@ "type": "string" } }, - "id": "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." }, "RequestUtilization": { "description": "Target scaling by request utilization. Only applicable for VM runtimes.", "type": "object", "properties": { - "targetConcurrentRequests": { + "targetRequestCountPerSec": { + "description": "Target requests per second.", "format": "int32", - "description": "Target number of concurrent requests.", "type": "integer" }, - "targetRequestCountPerSec": { + "targetConcurrentRequests": { + "description": "Target number of concurrent requests.", "format": "int32", - "description": "Target requests per second.", "type": "integer" } }, @@ -1731,6 +1131,14 @@ "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": { + "staticDirectory": { + "$ref": "StaticDirectoryHandler", + "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." + }, + "staticFiles": { + "$ref": "StaticFilesHandler", + "description": "Returns the contents of a file, such as an image, as the response." + }, "redirectHttpResponseCode": { "enum": [ "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED", @@ -1750,7 +1158,6 @@ ] }, "securityLevel": { - "description": "Security (HTTPS) enforcement for this URL.", "type": "string", "enumDescriptions": [ "Not specified.", @@ -1765,33 +1172,80 @@ "SECURE_NEVER", "SECURE_OPTIONAL", "SECURE_ALWAYS" - ] + ], + "description": "Security (HTTPS) enforcement for this URL." }, "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", - "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." - ] + "type": "string" }, "script": { - "description": "Executes a script to handle the request that matches this URL pattern.", - "$ref": "ScriptHandler" + "$ref": "ScriptHandler", + "description": "Executes a script to handle the request that matches this URL pattern." }, "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": { + "description": "Uses API Endpoints to handle requests.", + "$ref": "ApiEndpointHandler" + } + }, + "id": "UrlMap" + }, + "EndpointsApiService": { + "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\"By default, the Endpoints service configuration id is fixed and config_id must be specified. To keep the Endpoints service configuration id updated with each rollout, specify RolloutStrategy.MANAGED and omit config_id.", + "type": "string" + } + }, + "id": "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" + }, + "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": { + "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.", @@ -1805,30 +1259,11 @@ "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.", @@ -1842,7 +1277,9 @@ "SECURE_NEVER", "SECURE_OPTIONAL", "SECURE_ALWAYS" - ] + ], + "description": "Security (HTTPS) enforcement for this URL.", + "type": "string" }, "authFailAction": { "enumDescriptions": [ @@ -1857,40 +1294,14 @@ ], "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": "ApiConfigHandler", - "description": "Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers.", - "type": "object" + "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.", @@ -1914,12 +1325,53 @@ }, "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" }, - "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", "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'.", + "type": "string" + } + }, + "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": { + "type": "boolean", + "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." + }, + "httpHeaders": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "HTTP headers to use for all responses from these URLs." + }, "uploadPathRegex": { "description": "Regular expression that matches the file paths for all files that should be referenced by this handler.", "type": "string" @@ -1935,46 +1387,9 @@ "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" - }, - "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" } }, - "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" + "id": "StaticFilesHandler" }, "ScriptHandler": { "description": "Executes a script to handle the request that matches the URL pattern.", @@ -1991,85 +1406,56 @@ "description": "Target scaling by disk usage. Only applicable for VM runtimes.", "type": "object", "properties": { + "targetReadOpsPerSec": { + "type": "integer", + "description": "Target ops read per second.", + "format": "int32" + }, "targetReadBytesPerSec": { - "format": "int32", "description": "Target bytes read per second.", + "format": "int32", "type": "integer" }, "targetWriteOpsPerSec": { - "format": "int32", "description": "Target ops written per second.", + "format": "int32", "type": "integer" }, "targetWriteBytesPerSec": { - "format": "int32", "description": "Target bytes written per second.", - "type": "integer" - }, - "targetReadOpsPerSec": { "format": "int32", - "description": "Target ops read per second.", "type": "integer" } }, "id": "DiskUtilization" }, "BasicScaling": { + "id": "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": { - "format": "int32", "description": "Maximum number of instances to create for this version.", + "format": "int32", "type": "integer" }, "idleTimeout": { - "format": "google-duration", "description": "Duration of time after the last request that an instance must wait before the instance is shut down.", + "format": "google-duration", "type": "string" } - }, - "id": "BasicScaling" - }, - "OperationMetadataExperimental": { - "description": "Metadata for the given google.longrunning.Operation.", - "type": "object", - "properties": { - "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" - }, - "user": { - "description": "User who requested this operation.@OutputOnly", - "type": "string" - } - }, - "id": "OperationMetadataExperimental" + } }, "CpuUtilization": { "properties": { "aggregationWindowLength": { - "format": "google-duration", "description": "Period of time over which CPU utilization is calculated.", + "format": "google-duration", "type": "string" }, "targetUtilization": { - "format": "double", "description": "Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1.", + "format": "double", "type": "number" } }, @@ -2077,34 +1463,9 @@ "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": { "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", @@ -2115,43 +1476,48 @@ "type": "string" }, "oauth2ClientSecretSha256": { - "description": "Hex-encoded SHA-256 hash of the client secret.@OutputOnly", - "type": "string" + "type": "string", + "description": "Hex-encoded SHA-256 hash of the client secret.@OutputOnly" }, "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", - "description": "Identity-Aware Proxy", - "type": "object" + "id": "IdentityAwareProxy" }, - "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.", + "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": { - "instances": { - "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" - }, - "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" + "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" } }, + "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" + } + }, + "id": "Status" + }, + "TrafficSplit": { + "description": "Traffic routing configuration for versions within a single module. Traffic splits define how traffic directed to the module is assigned to versions.", + "type": "object", + "properties": { "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.", @@ -2161,52 +1527,71 @@ "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": { + "type": "number", + "format": "double" + }, + "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", - "description": "Traffic routing configuration for versions within a single module. Traffic splits define how traffic directed to the module is assigned to versions.", - "type": "object" + "id": "TrafficSplit" + }, + "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", + "type": "integer" + } + }, + "id": "ManualScaling" }, "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" + "type": "boolean", + "description": "App Engine Standard Environment is available in the given location.@OutputOnly" }, "flexibleEnvironmentAvailable": { "description": "App Engine Flexible Environment is available in the given location.@OutputOnly", "type": "boolean" } - }, - "id": "LocationMetadata" + } }, "OperationMetadataV1Beta": { - "description": "Metadata for the given google.longrunning.Operation.", "type": "object", "properties": { "insertTime": { - "format": "google-datetime", "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" - }, - "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" }, + "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" @@ -2216,15 +1601,15 @@ "type": "string" }, "endTime": { - "format": "google-datetime", "description": "Time that this operation completed.@OutputOnly", + "format": "google-datetime", "type": "string" } }, - "id": "OperationMetadataV1Beta" + "id": "OperationMetadataV1Beta", + "description": "Metadata for the given google.longrunning.Operation." }, "ListModulesResponse": { - "description": "Response message for Modules.ListModules.", "type": "object", "properties": { "nextPageToken": { @@ -2233,56 +1618,59 @@ }, "modules": { "description": "The modules belonging to the requested application.", + "type": "array", "items": { "$ref": "Module" - }, - "type": "array" + } } }, - "id": "ListModulesResponse" + "id": "ListModulesResponse", + "description": "Response message for Modules.ListModules." }, "Resources": { + "description": "Machine resources for a version.", + "type": "object", "properties": { "volumes": { "description": "User specified volumes.", + "type": "array", "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.", + "format": "double", + "type": "number" + }, + "memoryGb": { + "description": "Memory (GB) needed.", + "format": "double", "type": "number" } }, - "id": "Resources", - "description": "Machine resources for a version.", - "type": "object" + "id": "Resources" }, "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." }, + "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" @@ -2291,33 +1679,29 @@ "type": "object" } }, - "id": "Deployment", - "description": "Code and application artifacts used to deploy a version to App Engine.", - "type": "object" + "id": "Deployment" }, "Volume": { + "id": "Volume", "description": "Volumes mounted within the app container. Only applicable for VM runtimes.", "type": "object", "properties": { + "volumeType": { + "type": "string", + "description": "Underlying volume type, e.g. 'tmpfs'." + }, "sizeGb": { - "format": "double", "description": "Volume size in gigabytes.", + "format": "double", "type": "number" }, "name": { "description": "Unique name for the volume.", "type": "string" - }, - "volumeType": { - "description": "Underlying volume type, e.g. 'tmpfs'.", - "type": "string" } - }, - "id": "Volume" + } }, "ListOperationsResponse": { - "description": "The response message for Operations.ListOperations.", - "type": "object", "properties": { "nextPageToken": { "description": "The standard List next-page token.", @@ -2325,36 +1709,40 @@ }, "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": { "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", + "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/modules/default.@OutputOnly", + "type": "string" + }, "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", + "format": "google-datetime", "type": "string" }, "operationType": { @@ -2362,27 +1750,629 @@ "type": "string" } }, - "id": "OperationMetadata", - "description": "Metadata for the given google.longrunning.Operation.", - "type": "object" + "id": "OperationMetadata" }, "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" + }, + "instances": { + "description": "The instances belonging to the requested version.", + "type": "array", + "items": { + "$ref": "Instance" + } } }, - "id": "ListInstancesResponse" + "id": "ListInstancesResponse", + "description": "Response message for Instances.ListInstances.", + "type": "object" + }, + "ErrorHandler": { + "description": "Custom static error page to be served when an error occurs.", + "type": "object", + "properties": { + "errorCode": { + "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", + "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." + ] + }, + "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" + } + }, + "id": "ErrorHandler" + }, + "OperationMetadataV1": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "warning": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Durable messages that persist on every operation poll. @OutputOnly" + }, + "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": { + "type": "string", + "description": "Ephemeral message that may change every time the operation is polled. @OutputOnly" + }, + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1.Versions.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "description": "Time that this operation completed.@OutputOnly", + "format": "google-datetime", + "type": "string" + } + }, + "id": "OperationMetadataV1" + }, + "OperationMetadataV1Alpha": { + "id": "OperationMetadataV1Alpha", + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", + "properties": { + "method": { + "description": "API method that initiated this operation. Example: google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly", + "type": "string" + }, + "endTime": { + "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" + }, + "user": { + "type": "string", + "description": "User who requested this operation.@OutputOnly" + }, + "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" + } + } + }, + "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" + }, + "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" + }, + "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 module 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" + }, + "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" + }, + "defaultCookieExpiration": { + "description": "Cookie expiration policy for this application.", + "format": "google-duration", + "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" + }, + "location": { + "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" + }, + "defaultBucket": { + "description": "Google Cloud Storage bucket that can be used by this application to store content.@OutputOnly", + "type": "string" + } + }, + "id": "Application" + }, + "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": { + "type": "string", + "description": "Domain name to match against. The wildcard \"*\" is supported if specified before a period: \"*.\".Defaults to matching all domains: \"*\"." + }, + "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" + }, + "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" + }, + "vmId": { + "type": "string", + "description": "Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly" + }, + "qps": { + "type": "number", + "description": "Average queries per second (QPS) over the last minute.@OutputOnly", + "format": "float" + }, + "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" + }, + "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", + "type": "integer" + }, + "id": { + "type": "string", + "description": "Relative name of the instance within the version. Example: instance-1.@OutputOnly" + }, + "memoryUsage": { + "description": "Total memory in use (bytes).@OutputOnly", + "format": "int64", + "type": "string" + }, + "vmIp": { + "description": "The IP address of this instance. 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": { + "type": "string", + "enumDescriptions": [ + "", + "", + "" + ], + "enum": [ + "UNSPECIFIED", + "RESIDENT", + "DYNAMIC" + ], + "description": "Availability of the instance.@OutputOnly" + }, + "vmStatus": { + "description": "Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" + } + }, + "id": "Instance" + }, + "ListVersionsResponse": { + "description": "Response message for Versions.ListVersions.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Continuation token for fetching the next page of results.", + "type": "string" + }, + "versions": { + "type": "array", + "items": { + "$ref": "Version" + }, + "description": "The versions belonging to the requested module." + } + }, + "id": "ListVersionsResponse" + }, + "Module": { + "description": "A Module resource is a logical component of an application that can share state and communicate in a secure fashion with other modules. For example, an application that handles customer requests might include separate modules to handle tasks such as backend data analysis or API requests from mobile devices. Each module has a collection of versions that define a specific set of code used to implement the functionality of that module.", + "type": "object", + "properties": { + "name": { + "description": "Full path to the Module resource in the API. Example: apps/myapp/modules/default.@OutputOnly", + "type": "string" + }, + "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" + } + }, + "id": "Module" + }, + "ApiEndpointHandler": { + "id": "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" + } + } + }, + "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": { + "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" + }, + "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" + } + }, + "id": "StaticDirectoryHandler" + }, + "AutomaticScaling": { + "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", + "type": "object", + "properties": { + "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": { + "type": "string", + "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" + }, + "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": { + "description": "Target scaling by CPU usage.", + "$ref": "CpuUtilization" + }, + "diskUtilization": { + "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", + "type": "string" + }, + "requestUtilization": { + "description": "Target scaling by request utilization.", + "$ref": "RequestUtilization" + }, + "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" + }, + "minTotalInstances": { + "description": "Minimum number of instances that should be maintained for this version.", + "format": "int32", + "type": "integer" + } + }, + "id": "AutomaticScaling" + }, + "NetworkUtilization": { + "description": "Target scaling by network usage. Only applicable for VM runtimes.", + "type": "object", + "properties": { + "targetReceivedBytesPerSec": { + "description": "Target bytes received per second.", + "format": "int32", + "type": "integer" + }, + "targetSentPacketsPerSec": { + "description": "Target packets sent per second.", + "format": "int32", + "type": "integer" + }, + "targetSentBytesPerSec": { + "description": "Target bytes sent per second.", + "format": "int32", + "type": "integer" + }, + "targetReceivedPacketsPerSec": { + "description": "Target packets received per second.", + "format": "int32", + "type": "integer" + } + }, + "id": "NetworkUtilization" + }, + "Location": { + "description": "A resource that represents Google Cloud Platform location.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Resource name for the location, which may vary between implementations. For example: \"projects/example-project/locations/us-east1\"" + }, + "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": { + "description": "Cross-service attributes for the location. For example\n{\"cloud.googleapis.com/region\": \"us-east1\"}\n", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "id": "Location" + }, + "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": { + "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" + }, + "host": { + "description": "Host header to send when performing an HTTP health check. Example: \"myapp.appspot.com\"", + "type": "string" + }, + "restartThreshold": { + "description": "Number of consecutive failed health checks required before an instance is restarted.", + "format": "uint32", + "type": "integer" + }, + "healthyThreshold": { + "type": "integer", + "description": "Number of consecutive successful health checks required before receiving traffic.", + "format": "uint32" + } + }, + "id": "HealthCheck" + }, + "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" + }, + "SourceReference": { + "id": "SourceReference", + "description": "Reference to a particular snapshot of the source tree used to build and deploy the application.", + "type": "object", + "properties": { + "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" + } + } + }, + "OperationMetadataV1Beta5": { + "properties": { + "method": { + "description": "API method name that initiated this operation. Example: google.appengine.v1beta5.Version.CreateVersion.@OutputOnly", + "type": "string" + }, + "insertTime": { + "type": "string", + "description": "Timestamp that this operation was created.@OutputOnly", + "format": "google-datetime" + }, + "endTime": { + "description": "Timestamp that this operation completed.@OutputOnly", + "format": "google-datetime", + "type": "string" + }, + "user": { + "description": "User who requested this operation.@OutputOnly", + "type": "string" + }, + "target": { + "type": "string", + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly" + } + }, + "id": "OperationMetadataV1Beta5", + "description": "Metadata for the given google.longrunning.Operation.", + "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" + } + }, + "id": "Library" } }, "icons": { @@ -2415,8 +2405,8 @@ "ownerDomain": "google.com", "name": "appengine", "batchPath": "batch", + "revision": "20171208", "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/v1beta5/appengine-api.json b/etc/api/appengine/v1beta5/appengine-api.json index cfd1eee629..1af50f7123 100644 --- a/etc/api/appengine/v1beta5/appengine-api.json +++ b/etc/api/appengine/v1beta5/appengine-api.json @@ -1,42 +1,10 @@ { - "ownerName": "Google", + "title": "Google App Engine Admin API", "discoveryVersion": "v1", + "ownerName": "Google", "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": { @@ -46,27 +14,67 @@ "appsId" ], "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "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" + "type": "boolean", + "location": "query" }, "appsId": { "location": "path", "description": "Part of `name`. Name of the application to get. Example: apps/myapp.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta5/apps/{appsId}", + "path": "v1beta5/apps/{appsId}", + "id": "appengine.apps.get" + }, + "patch": { + "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)", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "PATCH", + "parameters": { + "mask": { + "description": "Standard field mask for the set of fields to be updated.", + "format": "google-fieldmask", "type": "string", - "required": true + "location": "query" + }, + "appsId": { + "description": "Part of `name`. Name of the Application resource to update. Example: apps/myapp.", + "required": true, + "type": "string", + "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1beta5/apps/{appsId}", - "id": "appengine.apps.get", - "path": "v1beta5/apps/{appsId}" + "flatPath": "v1beta5/apps/{appsId}" }, "create": { + "flatPath": "v1beta5/apps", + "path": "v1beta5/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" + }, "response": { "$ref": "Operation" }, @@ -75,321 +83,161 @@ "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/)." + "parameters": {} } }, "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" - }, + "delete": { + "description": "Deletes an existing 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": { + "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.", - "type": "string", "required": true, + "type": "string", "location": "path" }, "versionsId": { + "location": "path", "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" + "type": "string" } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "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." + "id": "appengine.apps.services.versions.delete" + }, + "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.", + "httpMethod": "GET", + "response": { + "$ref": "Version" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId" + ], + "parameters": { + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "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": { + "description": "Controls the set of fields returned in the Get response.", + "type": "string", + "location": "query", + "enum": [ + "BASIC", + "FULL" + ] + } + }, + "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}", + "id": "appengine.apps.services.versions.get", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}" + }, + "list": { + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions", + "id": "appengine.apps.services.versions.list", + "description": "Lists the versions of a service.", + "response": { + "$ref": "ListVersionsResponse" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "GET", + "parameters": { + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. 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": { + "location": "query", + "enum": [ + "BASIC", + "FULL" + ], + "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" + ] }, "patch": { + "path": "v1beta5/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/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.", "response": { "$ref": "Operation" }, @@ -401,149 +249,214 @@ "httpMethod": "PATCH", "parameters": { "servicesId": { - "location": "path", "description": "Part of `name`. See documentation of `appsId`.", + "required": true, "type": "string", - "required": true + "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", - "required": true - }, - "mask": { - "format": "google-fieldmask", - "description": "Standard field mask for the set of fields to be updated.", - "type": "string", - "location": "query" + "location": "path" }, "versionsId": { "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", "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" } }, "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.", + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}" + }, + "create": { + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions", + "id": "appengine.apps.services.versions.create", "request": { "$ref": "Version" - } - }, - "list": { - "description": "Lists the versions of a service.", + }, + "description": "Deploys new code and resource files to a new version.", "response": { - "$ref": "ListVersionsResponse" + "$ref": "Operation" }, "parameterOrder": [ "appsId", "servicesId" ], - "httpMethod": "GET", + "httpMethod": "POST", "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" + "appsId": { + "description": "Part of `name`. Name of the resource to update. For example: \"apps/myapp/services/default\".", + "required": true, + "type": "string", + "location": "path" }, "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.", + "required": true, "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" + "https://www.googleapis.com/auth/cloud-platform" ], - "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." + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions" } }, "resources": { "instances": { "methods": { + "debug": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "httpMethod": "POST", + "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/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" + } + }, + "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." + }, + "delete": { + "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" + }, + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "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. For 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" + } + }, + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}" + }, + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "appsId", + "servicesId", + "versionsId", + "instancesId" + ], + "response": { + "$ref": "Instance" + }, + "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": { + "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": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "id": "appengine.apps.services.versions.instances.get", + "path": "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}", + "description": "Gets instance information." + }, "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" }, @@ -559,192 +472,240 @@ "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`.", + "appsId": { + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1.", + "required": true, "type": "string", - "required": true - }, - "servicesId": { - "location": "path", - "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", - "required": true + "location": "path" }, "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.", + "pageSize": { + "location": "query", + "description": "Maximum results to return per page.", + "format": "int32", + "type": "integer" + }, + "versionsId": { + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, "type": "string", - "required": true + "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", + "path": "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." + "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 the specified service and all enclosed versions.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "appsId", + "servicesId" + ], + "httpMethod": "DELETE", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", + "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": "v1beta5/apps/{appsId}/services/{servicesId}", + "path": "v1beta5/apps/{appsId}/services/{servicesId}", + "id": "appengine.apps.services.delete" + }, + "get": { + "response": { + "$ref": "Service" + }, + "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": { + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp/services/default.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta5/apps/{appsId}/services/{servicesId}", + "path": "v1beta5/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", + "parameters": { + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource requested. Example: apps/myapp.", + "required": true, + "type": "string" + }, + "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" + } + }, + "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", + "path": "v1beta5/apps/{appsId}/services", + "id": "appengine.apps.services.list" + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "appsId", + "servicesId" + ], + "response": { + "$ref": "Operation" + }, + "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/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" + }, + "servicesId": { + "location": "path", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. Name of the resource to update. Example: apps/myapp/services/default.", + "required": true, + "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}", + "request": { + "$ref": "Service" + }, + "description": "Updates the configuration of the specified service." + } } }, "operations": { "methods": { + "list": { + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "appsId" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "appsId": { + "location": "path", + "description": "Part of `name`. The name of the operation's parent resource.", + "required": true, + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "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", + "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 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." + }, "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" }, @@ -760,61 +721,101 @@ ], "parameters": { "appsId": { + "location": "path", "description": "Part of `name`. The name of the operation resource.", - "type": "string", "required": true, - "location": "path" + "type": "string" }, "operationsId": { "description": "Part of `name`. See documentation of `appsId`.", - "type": "string", "required": true, + "type": "string", "location": "path" } }, - "flatPath": "v1beta5/apps/{appsId}/operations/{operationsId}" - }, + "flatPath": "v1beta5/apps/{appsId}/operations/{operationsId}", + "path": "v1beta5/apps/{appsId}/operations/{operationsId}", + "id": "appengine.apps.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." + } + } + }, + "locations": { + "methods": { "list": { "response": { - "$ref": "ListOperationsResponse" + "$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": { - "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.", + "format": "int32", "type": "integer" }, "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" } }, - "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." + "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", + "path": "v1beta5/apps/{appsId}/locations", + "id": "appengine.apps.locations.list", + "description": "Lists information about the supported locations for this service." + }, + "get": { + "flatPath": "v1beta5/apps/{appsId}/locations/{locationsId}", + "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" + ] } } } @@ -830,38 +831,44 @@ "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" + "type": "boolean", + "default": "true" }, "uploadType": { "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "type": "string", "location": "query" }, - "callback": { - "description": "JSONP", - "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": { "location": "query", - "enum": [ - "1", - "2" - ] + "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": [ @@ -869,17 +876,6 @@ "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": { @@ -887,29 +883,142 @@ "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" + "type": "boolean", + "default": "true" }, "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" + "type": "string", + "location": "query" } }, "schemas": { + "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" + } + }, + "id": "CpuUtilization" + }, + "IdentityAwareProxy": { + "properties": { + "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" + }, + "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" + } + }, + "id": "IdentityAwareProxy", + "description": "Identity-Aware Proxy", + "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": { + "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" + } + }, + "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" + } + }, + "id": "Status" + }, + "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": { + "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" + } + }, + "id": "TrafficSplit" + }, + "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" + } + }, + "id": "ManualScaling" + }, "LocationMetadata": { "description": "Metadata for the given google.cloud.location.Location.", "type": "object", @@ -929,29 +1038,25 @@ "description": "Metadata for the given google.longrunning.Operation.", "type": "object", "properties": { - "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", + "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", + "format": "google-datetime", "type": "string" }, "user": { @@ -961,80 +1066,104 @@ "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" } }, "id": "OperationMetadataV1Beta" }, "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" + "id": "ListServicesResponse" + }, + "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.", + "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" }, "Deployment": { "description": "Code and application artifacts used to deploy a version to App Engine.", "type": "object", "properties": { + "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" - }, - "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" + } }, "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" - }, - "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" + } } }, "id": "Deployment" }, - "Resources": { + "Volume": { "properties": { - "memoryGb": { + "sizeGb": { + "description": "Volume size in gigabytes.", "format": "double", - "description": "Memory (GB) needed.", "type": "number" }, - "cpu": { - "format": "double", - "description": "Number of CPU cores needed.", - "type": "number" + "name": { + "description": "Unique name for the volume.", + "type": "string" }, - "volumes": { - "description": "Volumes mounted within the app container.", - "items": { - "$ref": "Volume" - }, - "type": "array" - }, - "diskGb": { - "format": "double", - "description": "Disk size (GB) needed.", - "type": "number" + "volumeType": { + "description": "Underlying volume type, e.g. 'tmpfs'.", + "type": "string" } }, - "id": "Resources", - "description": "Machine resources for a version.", + "id": "Volume", + "description": "Volumes mounted within the app container. Only applicable for VM runtimes.", "type": "object" }, "Service": { @@ -1056,27 +1185,9 @@ }, "id": "Service" }, - "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": { - "format": "double", - "description": "Volume size in gigabytes.", - "type": "number" - }, - "name": { - "description": "Unique name for the volume.", - "type": "string" - } - }, - "id": "Volume" - }, "ListOperationsResponse": { + "description": "The response message for Operations.ListOperations.", + "type": "object", "properties": { "nextPageToken": { "description": "The standard List next-page token.", @@ -1084,25 +1195,16 @@ }, "operations": { "description": "A list of operations that matches the specified filter in the request.", + "type": "array", "items": { "$ref": "Operation" - }, - "type": "array" + } } }, - "id": "ListOperationsResponse", - "description": "The response message for Operations.ListOperations.", - "type": "object" + "id": "ListOperationsResponse" }, "OperationMetadata": { - "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" - }, "user": { "description": "User who requested this operation.@OutputOnly", "type": "string" @@ -1116,31 +1218,38 @@ "type": "string" }, "endTime": { - "format": "google-datetime", "description": "Timestamp that this operation completed.@OutputOnly", + "format": "google-datetime", "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" + "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.", + "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" @@ -1149,11 +1258,14 @@ "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", @@ -1162,14 +1274,11 @@ "ERROR_CODE_TIMEOUT" ], "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." - ] + "type": "string" + }, + "mimeType": { + "description": "MIME type of file. Defaults to text/html.", + "type": "string" }, "staticFile": { "description": "Static file content to be served for this error.", @@ -1182,14 +1291,14 @@ "properties": { "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", + "format": "google-datetime", "type": "string" }, "user": { @@ -1209,8 +1318,8 @@ "type": "string" }, "endTime": { - "format": "google-datetime", "description": "Time that this operation completed.@OutputOnly", + "format": "google-datetime", "type": "string" } }, @@ -1219,22 +1328,19 @@ "type": "object" }, "OperationMetadataV1Alpha": { + "description": "Metadata for the given google.longrunning.Operation.", + "type": "object", "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", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "insertTime": { - "format": "google-datetime", "description": "Time that this operation was created.@OutputOnly", + "format": "google-datetime", "type": "string" }, "user": { @@ -1252,16 +1358,60 @@ "method": { "description": "API method that initiated this operation. Example: google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly", "type": "string" + }, + "endTime": { + "description": "Time that this operation completed.@OutputOnly", + "format": "google-datetime", + "type": "string" } }, - "id": "OperationMetadataV1Alpha", - "description": "Metadata for the given google.longrunning.Operation.", + "id": "OperationMetadataV1Alpha" + }, + "Network": { + "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" + }, + "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" + }, + "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" }, "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" }, @@ -1269,13 +1419,13 @@ "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.", + "defaultCookieExpiration": { + "description": "Cookie expiration policy for this application.", + "format": "google-duration", "type": "string" }, - "defaultCookieExpiration": { - "format": "google-duration", - "description": "Cookie expiration policy for this application.", + "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": { @@ -1289,79 +1439,36 @@ "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": { - "description": "Extra network settings. Only applicable for VM runtimes.", + "UrlDispatchRule": { + "description": "Rules to match an HTTP request and dispatch that request to a service.", "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 Flex app.", + "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" }, - "instanceTag": { - "description": "Tag to apply to the VM instance during creation.", + "domain": { + "description": "Domain name to match against. The wildcard \"*\" is supported if specified before a period: \"*.\".Defaults to matching all domains: \"*\".", "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.", + "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" } }, - "id": "Network" + "id": "UrlDispatchRule" }, "Instance": { "description": "An Instance resource is the computing unit that App Engine uses to automatically scale an application.", "type": "object", "properties": { - "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" - }, - "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/services/default/versions/v1/instances/instance-1.@OutputOnly", - "type": "string" - }, "averageLatency": { - "format": "int32", "description": "Average latency (ms) over the last minute.@OutputOnly", + "format": "int32", "type": "integer" }, "id": { @@ -1369,18 +1476,17 @@ "type": "string" }, "memoryUsage": { - "format": "int64", "description": "Total memory in use (bytes).@OutputOnly", + "format": "int64", "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" + "vmStatus": { + "description": "Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "string" }, "availability": { "enum": [ @@ -1396,13 +1502,14 @@ "" ] }, - "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" }, "requests": { - "format": "int32", "description": "Number of requests since this instance was started.@OutputOnly", + "format": "int32", "type": "integer" }, "appEngineRelease": { @@ -1410,48 +1517,50 @@ "type": "string" }, "startTimestamp": { - "format": "google-datetime", "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" + }, + "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" + }, + "vmUnlocked": { + "description": "Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly", + "type": "boolean" } }, "id": "Instance" }, - "UrlDispatchRule": { - "description": "Rules to match an HTTP request and dispatch that request to a service.", - "type": "object", - "properties": { - "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" - }, - "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": { "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.", "type": "string" - }, - "versions": { - "description": "The versions belonging to the requested service.", - "items": { - "$ref": "Version" - }, - "type": "array" } }, "id": "ListVersionsResponse", @@ -1473,14 +1582,18 @@ "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", "type": "object", "properties": { + "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.", + "format": "google-duration", "type": "string" }, "maxIdleInstances": { - "format": "int32", "description": "Maximum number of idle instances that should be maintained for this version.", + "format": "int32", "type": "integer" }, "requestUtilization": { @@ -1488,46 +1601,42 @@ "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.", + "format": "int32", "type": "integer" }, "maxTotalInstances": { - "format": "int32", "description": "Maximum number of instances that should be started to handle requests.", + "format": "int32", "type": "integer" }, "minTotalInstances": { - "format": "int32", "description": "Minimum number of instances that should be maintained for this version.", + "format": "int32", "type": "integer" }, "networkUtilization": { "description": "Target scaling by network usage.", "$ref": "NetworkUtilization" }, - "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.", + "format": "google-duration", "type": "string" }, + "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" + }, "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.", + "format": "google-duration", "type": "string" }, "cpuUtilization": { - "$ref": "CpuUtilization", - "description": "Target scaling by CPU usage." - }, - "diskUtilization": { - "description": "Target scaling by disk usage.", - "$ref": "DiskUtilization" + "description": "Target scaling by CPU usage.", + "$ref": "CpuUtilization" } }, "id": "AutomaticScaling" @@ -1537,23 +1646,23 @@ "type": "object", "properties": { "targetReceivedBytesPerSec": { - "format": "int32", "description": "Target bytes received per second.", + "format": "int32", "type": "integer" }, "targetSentPacketsPerSec": { - "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.", + "format": "int32", + "type": "integer" + }, + "targetReceivedPacketsPerSec": { + "description": "Target packets received per second.", + "format": "int32", "type": "integer" } }, @@ -1563,6 +1672,17 @@ "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" @@ -1574,17 +1694,6 @@ }, "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" @@ -1593,6 +1702,31 @@ "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": { + "description": "Number of consecutive successful health checks required before receiving traffic.", + "format": "uint32", + "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" + }, + "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" @@ -1600,50 +1734,10 @@ "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" } }, "id": "HealthCheck" }, - "SourceReference": { - "description": "Reference to a particular snapshot of the source tree used to build and deploy the application.", - "type": "object", - "properties": { - "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" - }, "DebugInstanceRequest": { "properties": { "sshKey": { @@ -1655,51 +1749,68 @@ "description": "Request message for Instances.DebugInstance.", "type": "object" }, - "Library": { - "description": "Third-party Python runtime library that is required by the application.", - "type": "object", + "SourceReference": { "properties": { - "version": { - "description": "Version of the library to select, or \"latest\".", + "repository": { + "description": "URI string identifying the repository. Example: \"https://source.developers.google.com/p/app-123/r/default\"", "type": "string" }, - "name": { - "description": "Name of the library. Example: \"django\".", + "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": "Library" + "id": "SourceReference", + "description": "Reference to a particular snapshot of the source tree used to build and deploy the application.", + "type": "object" }, "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", + "format": "google-datetime", "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", + "format": "google-datetime", "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", + "target": { + "description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly", "type": "string" } }, "id": "OperationMetadataV1Beta5" }, + "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" + }, "ListLocationsResponse": { + "description": "The response message for Locations.ListLocations.", + "type": "object", "properties": { "nextPageToken": { "description": "The standard List next-page token.", @@ -1707,155 +1818,46 @@ }, "locations": { "description": "A list of locations that matches the specified filter in the request.", + "type": "array", "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" + "id": "ListLocationsResponse" }, "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": { - "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" - }, - "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 from serving. 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" - }, "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": { - "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.", + "format": "google-duration", "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 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" @@ -1892,55 +1894,162 @@ }, "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": { + "description": "Automatic scaling is based on request rate, response latencies, and other application metrics.", + "$ref": "AutomaticScaling" + }, + "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" + }, + "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": { + "$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" + }, + "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 from serving. 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" + ] + }, + "deployment": { + "$ref": "Deployment", + "description": "Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set." + }, + "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." + }, + "inboundServices": { + "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" + }, + "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." + ] } }, "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" + }, "RequestUtilization": { "description": "Target scaling by request utilization. Only applicable for VM runtimes.", "type": "object", "properties": { - "targetConcurrentRequests": { + "targetRequestCountPerSec": { + "description": "Target requests per second.", "format": "int32", - "description": "Target number of concurrent requests.", "type": "integer" }, - "targetRequestCountPerSec": { + "targetConcurrentRequests": { + "description": "Target number of concurrent requests.", "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": { + "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", @@ -1949,16 +2058,16 @@ "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." - ] + "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", @@ -1967,16 +2076,11 @@ "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." - ] + "type": "string" }, "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.", @@ -1986,19 +2090,19 @@ "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": "Executes a script to handle the request that matches this URL pattern.", - "$ref": "ScriptHandler" + "$ref": "ScriptHandler", + "description": "Executes a script to handle the request that matches this URL pattern." }, "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.", @@ -2010,21 +2114,26 @@ "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" }, + "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\"By default, the Endpoints service configuration id is fixed and config_id must be specified. To keep the Endpoints service configuration id updated with each rollout, specify RolloutStrategy.MANAGED and omit config_id.", + "type": "string" + } + }, + "id": "EndpointsApiService" + }, "ApiConfigHandler": { "description": "Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers.", "type": "object", @@ -2034,6 +2143,12 @@ "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 action given in auth_fail_action is taken." + ], "enum": [ "LOGIN_UNSPECIFIED", "LOGIN_OPTIONAL", @@ -2041,19 +2156,20 @@ "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." - ] + "type": "string" }, "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", @@ -2062,14 +2178,7 @@ "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." - ] + "type": "string" }, "authFailAction": { "enumDescriptions": [ @@ -2089,11 +2198,9 @@ "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.", @@ -2107,21 +2214,23 @@ "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": { + "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" - }, - "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" + "id": "Operation" }, "FileInfo": { "description": "Single source file that is part of the version to be deployed. Each source file that is deployed must be specified separately.", @@ -2146,16 +2255,21 @@ "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" }, "httpHeaders": { - "description": "HTTP headers to use for all responses from these URLs.", - "type": "object", "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.", @@ -2172,206 +2286,64 @@ "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" }, "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", - "description": "Executes a script to handle the request that matches the URL pattern.", - "type": "object" + "id": "ScriptHandler" + }, + "DiskUtilization": { + "description": "Target scaling by disk usage. Only applicable for VM runtimes.", + "type": "object", + "properties": { + "targetWriteBytesPerSec": { + "description": "Target bytes written per second.", + "format": "int32", + "type": "integer" + }, + "targetReadOpsPerSec": { + "description": "Target ops read per second.", + "format": "int32", + "type": "integer" + }, + "targetReadBytesPerSec": { + "description": "Target bytes read per second.", + "format": "int32", + "type": "integer" + }, + "targetWriteOpsPerSec": { + "description": "Target ops written per second.", + "format": "int32", + "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": { "maxInstances": { - "format": "int32", "description": "Maximum number of instances to create for this version.", + "format": "int32", "type": "integer" }, "idleTimeout": { - "format": "google-duration", "description": "Duration of time after the last request that an instance must wait before the instance is shut down.", + "format": "google-duration", "type": "string" } }, "id": "BasicScaling" - }, - "DiskUtilization": { - "description": "Target scaling by disk usage. Only applicable for VM runtimes.", - "type": "object", - "properties": { - "targetReadOpsPerSec": { - "format": "int32", - "description": "Target ops read per second.", - "type": "integer" - }, - "targetReadBytesPerSec": { - "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": { - "description": "Metadata for the given google.longrunning.Operation.", - "type": "object", - "properties": { - "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" - }, - "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", @@ -2396,16 +2368,15 @@ } } }, - "servicePath": "", - "description": "The App Engine Admin API enables developers to provision and manage their App Engine applications.", "kind": "discovery#restDescription", + "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:v1beta5", + "revision": "20171208", "documentationLink": "https://cloud.google.com/appengine/docs/admin-api/", - "revision": "20170914", - "title": "Google App Engine Admin API" + "id": "appengine:v1beta5" } diff --git a/etc/api/appsactivity/v1/appsactivity-api.json b/etc/api/appsactivity/v1/appsactivity-api.json index 2f18078768..24ef932342 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/w7NCayi3_pNAp4Ux8jkCMtBwaIM\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/xZ3PWWweD7cKnq3JhviTJwoQwLk\"", "discoveryVersion": "v1", "id": "appsactivity:v1", "name": "appsactivity", "version": "v1", - "revision": "20170921", + "revision": "20171207", "title": "G Suite Activity API", "description": "Provides a historical view of activity.", "ownerDomain": "google.com", diff --git a/etc/api/appstate/v1/appstate-api.json b/etc/api/appstate/v1/appstate-api.json index 46ed3affc0..0f651864ed 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/sPKhgH8GZHaw4C3xgNYIIazdfPU\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/lmDs6aA0qIx7-jGEac2TXZTTp7I\"", "discoveryVersion": "v1", "id": "appstate:v1", "name": "appstate", "canonicalName": "App State", "version": "v1", - "revision": "20170925", + "revision": "20171207", "title": "Google App State API", "description": "The Google App State API.", "ownerDomain": "google.com", diff --git a/etc/api/bigquery/v2/bigquery-api.json b/etc/api/bigquery/v2/bigquery-api.json index 1cc101f22e..b5925614c7 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/6KmyniE-DVTht1WBAWvasoVbs7Y\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/RHgdSKr7KDuh1e1sszGVdMKFPWE\"", "discoveryVersion": "v1", "id": "bigquery:v2", "name": "bigquery", "version": "v2", - "revision": "20170917", + "revision": "20171202", "title": "BigQuery API", "description": "A data platform for customers to create, manage, share and query data.", "ownerDomain": "google.com", @@ -413,6 +413,11 @@ "id": "ExplainQueryStage", "type": "object", "properties": { + "completedParallelInputs": { + "type": "string", + "description": "Number of parallel input segments completed.", + "format": "int64" + }, "computeMsAvg": { "type": "string", "description": "Milliseconds the average shard spent on CPU-bound tasks.", @@ -442,6 +447,11 @@ "type": "string", "description": "Human-readable name for stage." }, + "parallelInputs": { + "type": "string", + "description": "Number of parallel input segments to be processed.", + "format": "int64" + }, "readMsAvg": { "type": "string", "description": "Milliseconds the average shard spent reading input.", @@ -897,7 +907,7 @@ }, "schemaUpdateOptions": { "type": "array", - "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.", + "description": "Allows the schema of the destination 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" } @@ -920,7 +930,7 @@ }, "timePartitioning": { "$ref": "TimePartitioning", - "description": "[Experimental] If specified, configures time-based partitioning for the destination table." + "description": "If specified, configures time-based partitioning for the destination table." }, "writeDisposition": { "type": "string", @@ -994,7 +1004,7 @@ }, "schemaUpdateOptions": { "type": "array", - "description": "[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.", + "description": "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.", "items": { "type": "string" } @@ -1008,7 +1018,7 @@ }, "timePartitioning": { "$ref": "TimePartitioning", - "description": "[Experimental] If specified, configures time-based partitioning for the destination table." + "description": "If specified, configures time-based partitioning for the destination table." }, "useLegacySql": { "type": "boolean", @@ -1205,6 +1215,19 @@ "type": "boolean", "description": "[Output-only] Whether the query result was fetched from the query cache." }, + "ddlOperationPerformed": { + "type": "string", + "description": "[Output-only, Experimental] The DDL operation performed, possibly dependent on the pre-existence of the DDL target. Possible values (new values might be added in the future): \"CREATE\": The query created the DDL target. \"SKIP\": No-op. Example cases: the query is CREATE TABLE IF NOT EXISTS while the table already exists, or the query is DROP TABLE IF EXISTS while the table does not exist. \"REPLACE\": The query replaced the DDL target. Example case: the query is CREATE OR REPLACE TABLE, and the table already exists. \"DROP\": The query deleted the DDL target." + }, + "ddlTargetTable": { + "$ref": "TableReference", + "description": "[Output-only, Experimental] The DDL target table. Present only for CREATE/DROP TABLE/VIEW queries." + }, + "estimatedBytesProcessed": { + "type": "string", + "description": "[Output-only] The original estimate of bytes processed for the job.", + "format": "int64" + }, "numDmlAffectedRows": { "type": "string", "description": "[Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.", @@ -1230,7 +1253,7 @@ }, "statementType": { "type": "string", - "description": "[Output-only, Experimental] The type of query statement, if valid." + "description": "[Output-only, Experimental] The type of query statement, if valid. Possible values (new values might be added in the future): \"SELECT\": SELECT query. \"INSERT\": INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language \"UPDATE\": UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language \"DELETE\": DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language \"CREATE_TABLE\": CREATE [OR REPLACE] TABLE without AS SELECT. \"CREATE_TABLE_AS_SELECT\": CREATE [OR REPLACE] TABLE ... AS SELECT ... \"DROP_TABLE\": DROP TABLE query. \"CREATE_VIEW\": CREATE [OR REPLACE] VIEW ... AS SELECT ... \"DROP_VIEW\": DROP VIEW query." }, "totalBytesBilled": { "type": "string", @@ -1712,7 +1735,7 @@ }, "timePartitioning": { "$ref": "TimePartitioning", - "description": "[Experimental] If specified, configures time-based partitioning for this table." + "description": "If specified, configures time-based partitioning for this table." }, "type": { "type": "string", @@ -1888,6 +1911,16 @@ "items": { "type": "object", "properties": { + "creationTime": { + "type": "string", + "description": "The time when this table was created, in milliseconds since the epoch.", + "format": "int64" + }, + "expirationTime": { + "type": "string", + "description": "[Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.", + "format": "int64" + }, "friendlyName": { "type": "string", "description": "The user-friendly name for this table." @@ -1914,7 +1947,7 @@ }, "timePartitioning": { "$ref": "TimePartitioning", - "description": "[Experimental] The time-based partitioning for this table." + "description": "The time-based partitioning for this table." }, "type": { "type": "string", diff --git a/etc/api/bigquerydatatransfer/v1/bigquerydatatransfer-api.json b/etc/api/bigquerydatatransfer/v1/bigquerydatatransfer-api.json index 3ffea66867..faa04d9842 100644 --- a/etc/api/bigquerydatatransfer/v1/bigquerydatatransfer-api.json +++ b/etc/api/bigquerydatatransfer/v1/bigquerydatatransfer-api.json @@ -1,32 +1,54 @@ { - "ownerDomain": "google.com", - "name": "bigquerydatatransfer", - "batchPath": "batch", - "title": "BigQuery Data Transfer API", "ownerName": "Google", "resources": { "projects": { "resources": { "locations": { "methods": { - "get": { + "list": { + "flatPath": "v1/projects/{projectsId}/locations", + "path": "v1/{+name}/locations", + "id": "bigquerydatatransfer.projects.locations.list", + "description": "Lists information about the supported locations for this service.", + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "description": "The standard list page size.", + "format": "int32", + "type": "integer" + }, + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "name": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The resource that owns the locations collection, if applicable.", + "required": true, + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + } + }, "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}", + ] + }, + "get": { "description": "Get information about a location.", "response": { "$ref": "Location" @@ -34,113 +56,44 @@ "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" + "parameters": { + "name": { + "location": "path", + "description": "Resource name for the location.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.locations.get" } }, "resources": { - "transferConfigs": { + "dataSources": { "methods": { - "delete": { - "id": "bigquerydatatransfer.projects.locations.transferConfigs.delete", - "path": "v1/{+name}", - "description": "Deletes a data transfer configuration,\nincluding any associated transfer runs and logs.", + "checkValidCreds": { "response": { - "$ref": "Empty" + "$ref": "CheckValidCredsResponse" }, "parameterOrder": [ "name" ], - "httpMethod": "DELETE", + "httpMethod": "POST", "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", + "description": "The data source in the form:\n`projects/{project_id}/dataSources/{data_source_id}`", "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 + "pattern": "^projects/[^/]+/locations/[^/]+/dataSources/[^/]+$" } }, "scopes": [ @@ -148,130 +101,202 @@ "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." + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataSources/{dataSourcesId}:checkValidCreds", + "path": "v1/{+name}:checkValidCreds", + "id": "bigquerydatatransfer.projects.locations.dataSources.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." }, + "get": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/dataSources/{dataSourcesId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.locations.dataSources.get", + "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": { + "location": "path", + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/dataSources/{data_source_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/dataSources/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "list": { + "path": "v1/{+parent}/dataSources", + "id": "bigquerydatatransfer.projects.locations.dataSources.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": { + "pageToken": { + "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.", + "type": "string" + }, + "pageSize": { + "location": "query", + "description": "Page size. The default page size is the maximum value of 1000 results.", + "format": "int32", + "type": "integer" + }, + "parent": { + "location": "path", + "description": "The BigQuery project id for which data sources should be returned.\nMust be in the form: `projects/{project_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$" + } + }, + "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" + } + } + }, + "transferConfigs": { + "methods": { "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" }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], "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", + "description": "The BigQuery project id where the transfer configuration should be created.\nMust be in the format /projects/{project_id}/locations/{location_id}\nIf specified location and location of the destination bigquery dataset\ndo not match - the request will fail.", "required": true, - "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$", + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$", "location": "path" } }, - "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}:scheduleRuns", - "id": "bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns", - "path": "v1/{+parent}:scheduleRuns" + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs", + "path": "v1/{+parent}/transferConfigs", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.create" }, - "patch": { - "httpMethod": "PATCH", + "scheduleRuns": { + "httpMethod": "POST", "parameterOrder": [ - "name" + "parent" ], "response": { - "$ref": "TransferConfig" + "$ref": "ScheduleTransferRunsResponse" }, "parameters": { - "name": { - "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$", + "parent": { "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.", + "description": "Transfer configuration name in the form:\n`projects/{project_id}/transferConfigs/{config_id}`.", + "required": true, "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" + "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}:scheduleRuns", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns", + "path": "v1/{+parent}:scheduleRuns", + "request": { + "$ref": "ScheduleTransferRunsRequest" + }, + "description": "Creates transfer runs for a time range [start_time, 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." + }, + "patch": { "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" + }, + "response": { + "$ref": "TransferConfig" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "authorizationCode": { + "description": "Optional OAuth2 authorization code to use with this transfer configuration.\nIf it is provided, the transfer configuration will be associated with the\nauthorizing 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": { + "location": "query", + "description": "Required list of fields to be updated in this request.", + "format": "google-fieldmask", + "type": "string" + }, + "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.", + "required": true, + "type": "string" + } } }, "get": { "description": "Returns information about a data transfer config.", - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], "response": { "$ref": "TransferConfig" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", "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 + "required": true, + "type": "string" } }, "scopes": [ @@ -282,38 +307,136 @@ "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}", "path": "v1/{+name}", "id": "bigquerydatatransfer.projects.locations.transferConfigs.get" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "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}`", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.delete", + "description": "Deletes a data transfer configuration,\nincluding any associated transfer runs and logs." + }, + "list": { + "description": "Returns information about all data transfers in the project.", + "response": { + "$ref": "ListTransferConfigsResponse" + }, + "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": { + "parent": { + "location": "path", + "description": "The BigQuery project id for which data sources\nshould be returned: `projects/{project_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$" + }, + "dataSourceIds": { + "description": "When specified, only configurations of requested data sources are returned.", + "type": "string", + "repeated": true, + "location": "query" + }, + "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": { + "description": "Page size. The default page size is the maximum value of 1000 results.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs", + "path": "v1/{+parent}/transferConfigs", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.list" } }, "resources": { "runs": { "methods": { "delete": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}/runs/{runsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.runs.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/[^/]+$" - } - }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", "scopes": [ "https://www.googleapis.com/auth/bigquery", "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}/runs/{runsId}", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$", + "location": "path", + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`", + "required": true, + "type": "string" + } + } + }, + "get": { + "id": "bigquerydatatransfer.projects.locations.transferConfigs.runs.get", "path": "v1/{+name}", - "id": "bigquerydatatransfer.projects.locations.transferConfigs.runs.delete" + "description": "Returns information about the particular transfer run.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "TransferRun" + }, + "parameters": { + "name": { + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/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" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}/runs/{runsId}" }, "list": { + "description": "Returns information about running and completed jobs.", "response": { "$ref": "ListTransferRunsResponse" }, @@ -321,29 +444,10 @@ "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", @@ -351,56 +455,46 @@ "CANCELLED" ], "description": "When specified, only transfer runs with requested states are returned.", - "type": "string" + "type": "string", + "repeated": true, + "location": "query" + }, + "pageSize": { + "description": "Page size. The default page size is the maximum value of 1000 results.", + "format": "int32", + "type": "integer", + "location": "query" }, "runAttempt": { - "description": "Indicates how run attempts are to be pulled.", - "type": "string", "location": "query", "enum": [ "RUN_ATTEMPT_UNSPECIFIED", "LATEST" - ] + ], + "description": "Indicates how run attempts are to be pulled.", + "type": "string" }, "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}`.", + "required": true, "type": "string", - "required": true + "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+$", + "location": "path" + }, + "pageToken": { + "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", + "location": "query" } }, - "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." + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/transferConfigs/{transferConfigsId}/runs", + "path": "v1/{+parent}/runs", + "id": "bigquerydatatransfer.projects.locations.transferConfigs.runs.list" } }, "resources": { @@ -408,35 +502,26 @@ "methods": { "list": { "description": "Returns user facing log messages for the data transfer run.", - "httpMethod": "GET", "response": { "$ref": "ListTransferLogsResponse" }, "parameterOrder": [ "parent" ], + "httpMethod": "GET", "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", + "location": "query", "description": "Page size. The default page size is the maximum value of 1000 results.", - "type": "integer", - "location": "query" + "format": "int32", + "type": "integer" }, "messageTypes": { - "description": "Message types to return. If not populated - INFO, WARNING and ERROR\nmessages are returned.", - "type": "string", "repeated": true, "location": "query", "enum": [ @@ -444,7 +529,16 @@ "INFO", "WARNING", "ERROR" - ] + ], + "description": "Message types to return. If not populated - INFO, WARNING and ERROR\nmessages are returned.", + "type": "string" + }, + "parent": { + "location": "path", + "description": "Transfer run name in the form:\n`projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/transferConfigs/[^/]+/runs/[^/]+$" } }, "scopes": [ @@ -461,491 +555,38 @@ } } } - }, - "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": { + "get": { + "id": "bigquerydatatransfer.projects.dataSources.get", + "path": "v1/{+name}", + "description": "Retrieves a supported data source and returns its settings,\nwhich can be used for UI rendering.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "DataSource" + }, + "parameters": { + "name": { + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/dataSources/{data_source_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/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" + ], + "flatPath": "v1/projects/{projectsId}/dataSources/{dataSourcesId}" + }, "list": { "description": "Lists supported data sources and returns their settings,\nwhich can be used for UI rendering.", "response": { @@ -961,61 +602,37 @@ "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, + "type": "string", "pattern": "^projects/[^/]+$", "location": "path" + }, + "pageToken": { + "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.", + "type": "string", + "location": "query" + }, + "pageSize": { + "description": "Page size. The default page size is the maximum value of 1000 results.", + "format": "int32", + "type": "integer", + "location": "query" } }, "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." + "path": "v1/{+parent}/dataSources", + "id": "bigquerydatatransfer.projects.dataSources.list" }, "checkValidCreds": { + "flatPath": "v1/projects/{projectsId}/dataSources/{dataSourcesId}:checkValidCreds", + "path": "v1/{+name}:checkValidCreds", + "id": "bigquerydatatransfer.projects.dataSources.checkValidCreds", + "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.", "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" }, @@ -1030,16 +647,393 @@ ], "parameters": { "name": { + "location": "path", "description": "The data source in the form:\n`projects/{project_id}/dataSources/{data_source_id}`", - "type": "string", "required": true, - "pattern": "^projects/[^/]+/dataSources/[^/]+$", + "type": "string", + "pattern": "^projects/[^/]+/dataSources/[^/]+$" + } + } + } + } + }, + "transferConfigs": { + "methods": { + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "TransferConfig" + }, + "parameters": { + "updateMask": { + "location": "query", + "description": "Required list of fields to be updated in this request.", + "format": "google-fieldmask", + "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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/transferConfigs/[^/]+$", + "location": "path" + }, + "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\nauthorizing 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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}", + "id": "bigquerydatatransfer.projects.transferConfigs.patch", + "path": "v1/{+name}", + "request": { + "$ref": "TransferConfig" + }, + "description": "Updates a data transfer configuration.\nAll fields must be set, even if they are not updated." + }, + "get": { + "description": "Returns information about a data transfer config.", + "response": { + "$ref": "TransferConfig" + }, + "parameterOrder": [ + "name" + ], + "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": { + "name": { + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/transferConfigs/[^/]+$", "location": "path" } }, - "flatPath": "v1/projects/{projectsId}/dataSources/{dataSourcesId}:checkValidCreds", - "id": "bigquerydatatransfer.projects.dataSources.checkValidCreds", - "path": "v1/{+name}:checkValidCreds" + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.transferConfigs.get" + }, + "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}`", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}", + "id": "bigquerydatatransfer.projects.transferConfigs.delete", + "path": "v1/{+name}" + }, + "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.", + "response": { + "$ref": "ListTransferConfigsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "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": { + "description": "Page size. The default page size is the maximum value of 1000 results.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The BigQuery project id for which data sources\nshould be returned: `projects/{project_id}`.", + "required": true, + "type": "string" + }, + "dataSourceIds": { + "description": "When specified, only configurations of requested data sources are returned.", + "type": "string", + "repeated": true, + "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" + ] + }, + "create": { + "response": { + "$ref": "TransferConfig" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "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" + }, + "parent": { + "description": "The BigQuery project id where the transfer configuration should be created.\nMust be in the format /projects/{project_id}/locations/{location_id}\nIf specified location and location of the destination bigquery dataset\ndo not match - the request will fail.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/transferConfigs", + "path": "v1/{+parent}/transferConfigs", + "id": "bigquerydatatransfer.projects.transferConfigs.create", + "description": "Creates a new data transfer configuration.", + "request": { + "$ref": "TransferConfig" + } + }, + "scheduleRuns": { + "id": "bigquerydatatransfer.projects.transferConfigs.scheduleRuns", + "path": "v1/{+parent}:scheduleRuns", + "request": { + "$ref": "ScheduleTransferRunsRequest" + }, + "description": "Creates transfer runs for a time range [start_time, 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.", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ScheduleTransferRunsResponse" + }, + "parameters": { + "parent": { + "description": "Transfer configuration name in the form:\n`projects/{project_id}/transferConfigs/{config_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/transferConfigs/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}:scheduleRuns" + } + }, + "resources": { + "runs": { + "methods": { + "get": { + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}/runs/{runsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.transferConfigs.runs.get", + "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}`", + "required": true, + "type": "string", + "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" + ] + }, + "list": { + "path": "v1/{+parent}/runs", + "id": "bigquerydatatransfer.projects.transferConfigs.runs.list", + "description": "Returns information about running and completed jobs.", + "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": { + "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", + "location": "query" + }, + "states": { + "description": "When specified, only transfer runs with requested states are returned.", + "type": "string", + "repeated": true, + "location": "query", + "enum": [ + "TRANSFER_STATE_UNSPECIFIED", + "PENDING", + "RUNNING", + "SUCCEEDED", + "FAILED", + "CANCELLED" + ] + }, + "pageSize": { + "description": "Page size. The default page size is the maximum value of 1000 results.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "runAttempt": { + "location": "query", + "enum": [ + "RUN_ATTEMPT_UNSPECIFIED", + "LATEST" + ], + "description": "Indicates how run attempts are to be pulled.", + "type": "string" + }, + "parent": { + "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}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/transferConfigs/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}/runs" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$", + "location": "path", + "description": "The field will contain name of the resource requested, for example:\n`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/transferConfigs/{transferConfigsId}/runs/{runsId}", + "path": "v1/{+name}", + "id": "bigquerydatatransfer.projects.transferConfigs.runs.delete", + "description": "Deletes the specified transfer run." + } + }, + "resources": { + "transferLogs": { + "methods": { + "list": { + "response": { + "$ref": "ListTransferLogsResponse" + }, + "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": { + "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", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "Page size. The default page size is the maximum value of 1000 results.", + "format": "int32", + "type": "integer" + }, + "messageTypes": { + "enum": [ + "MESSAGE_SEVERITY_UNSPECIFIED", + "INFO", + "WARNING", + "ERROR" + ], + "description": "Message types to return. If not populated - INFO, WARNING and ERROR\nmessages are returned.", + "type": "string", + "repeated": true, + "location": "query" + }, + "parent": { + "description": "Transfer run name in the form:\n`projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/transferConfigs/[^/]+/runs/[^/]+$", + "location": "path" + } + }, + "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." + } + } + } + } } } } @@ -1047,33 +1041,44 @@ } }, "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", - "location": "query" + "type": "string" }, "fields": { - "type": "string", - "location": "query", - "description": "Selector specifying which fields to include in a partial response." - }, - "callback": { - "description": "JSONP", + "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", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ] + "location": "query" }, "alt": { "enum": [ @@ -1091,26 +1096,26 @@ "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" }, + "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", - "type": "boolean" + "location": "query" }, "oauth_token": { "location": "query", @@ -1118,20 +1123,9 @@ "type": "string" }, "bearer_token": { + "description": "OAuth 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" + "location": "query" } }, "version": "v1", @@ -1140,53 +1134,14 @@ "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", + "documentationLink": "https://cloud.google.com/bigquery/", + "revision": "20171208", "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" @@ -1199,18 +1154,16 @@ "description": "Indicates whether the data source supports multiple transfers\nto different BigQuery targets.", "type": "boolean" }, + "defaultDataRefreshWindowDays": { + "description": "Default data refresh window on days.\nOnly meaningful when `data_refresh_type` = `SLIDING_WINDOW`.", + "format": "int32", + "type": "integer" + }, "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.", @@ -1220,7 +1173,9 @@ "TRANSFER_TYPE_UNSPECIFIED", "BATCH", "STREAMING" - ] + ], + "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" }, "description": { "description": "User friendly data source description string.", @@ -1230,20 +1185,20 @@ "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" }, + "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", + "type": "array", + "items": { + "type": "string" + } + }, "minimumScheduleInterval": { - "format": "google-duration", "description": "The minimum interval between two consecutive scheduled runs.", + "format": "google-duration", "type": "string" }, "clientId": { @@ -1265,50 +1220,105 @@ "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." + "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.", + "type": "boolean" }, "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.", + "format": "int32", "type": "integer" + }, + "dataRefreshType": { + "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." + ], + "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" + }, + "parameters": { + "description": "Data source parameters.", + "type": "array", + "items": { + "$ref": "DataSourceParameter" + } } }, "id": "DataSource", "description": "Represents data source metadata. Metadata is sufficient to\nrender UI and request proper OAuth tokens.", "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 is a common set of\nmessage 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" + }, "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\"`.", + "format": "google-datetime", "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\"`.", + "format": "google-datetime", "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": {} + "properties": {}, + "id": "Empty" }, "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\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" @@ -1318,72 +1328,29 @@ "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": { + "type": "object", "additionalProperties": { - "type": "string" - }, - "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}", - "type": "object" + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } } }, "id": "Location" }, "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", "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": { + "description": "Output only. State of the most recently updated transfer run.", + "type": "string", "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.", @@ -1392,14 +1359,15 @@ ], "enum": [ "TRANSFER_STATE_UNSPECIFIED", - "INACTIVE", "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED" - ], - "description": "State of the most recently updated transfer run.\nOutput only.", + ] + }, + "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" }, "destinationDatasetId": { @@ -1407,44 +1375,59 @@ "type": "string" }, "userId": { + "description": "Output only. Unique ID of the user on whose behalf transfer is done.\nApplicable only to data sources that do not support service accounts.\nWhen set to 0, the data source service account credentials are used.\nMay be negative. Note, that this identifier is not stable.\nIt may change over time even for the same user.", "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.", + "params": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Data transfer specific parameters.", + "type": "object" + }, + "datasetRegion": { + "description": "Output only. Region in which BigQuery dataset is located.", "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": { + }, + "displayName": { + "description": "User specified display name for the data transfer.", + "type": "string" + }, + "nextRunTime": { + "description": "Output only. Next time when data transfer will run.", "format": "google-datetime", - "description": "Last time the data transfer run state was updated.\nOutput only.", "type": "string" }, + "disabled": { + "description": "Is this config disabled. When set to true, no runs are scheduled\nfor a given transfer.", + "type": "boolean" + }, "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.", + "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" }, - "runTime": { + "updateTime": { + "description": "Output only. Data transfer modification time. Ignored by server on input.", "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" }, + "dataRefreshWindowDays": { + "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.", + "format": "int32", + "type": "integer" + } + }, + "id": "TransferConfig" + }, + "TransferRun": { + "description": "Represents a data transfer run.\nNext id: 25", + "type": "object", + "properties": { "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.", @@ -1453,19 +1436,13 @@ ], "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.", + "description": "Data transfer run state. Ignored for input requests.", "type": "string" }, "name": { @@ -1476,6 +1453,11 @@ "description": "The BigQuery target dataset id.", "type": "string" }, + "userId": { + "description": "Output only. Unique ID of the user on whose behalf transfer is done.\nApplicable only to data sources that do not support service accounts.\nWhen set to 0, the data source service account credentials are used.\nMay be negative. Note, that this identifier is not stable.\nIt may change over time even for the same user.", + "format": "int64", + "type": "string" + }, "params": { "additionalProperties": { "description": "Properties of the object.", @@ -1485,27 +1467,44 @@ "type": "object" }, "endTime": { + "description": "Output only. Time when transfer run ended.\nParameter ignored by server for input requests.", "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": { + "description": "Output only. Time when transfer run was started.\nParameter ignored by server for input requests.", "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.", + "format": "google-datetime", + "type": "string" + }, + "errorStatus": { + "description": "Status of the transfer run.", + "$ref": "Status" + }, + "updateTime": { + "description": "Output only. Last time the data transfer run state was updated.", + "format": "google-datetime", + "type": "string" + }, + "schedule": { + "description": "Output only. Describes the schedule of this transfer run if it was\ncreated as part of a regular schedule. For batch transfer runs that are\nscheduled manually, this is empty.\nNOTE: the system might choose to delay the schedule depending on the\ncurrent load, so `schedule_time` doesn't always matches this.", + "type": "string" + }, + "runTime": { + "description": "For batch transfer runs, specifies the date and time that\ndata should be ingested.", + "format": "google-datetime", + "type": "string" + }, + "dataSourceId": { + "description": "Output only. Data source id.", "type": "string" } }, - "id": "TransferRun", - "description": "Represents a data transfer run." + "id": "TransferRun" }, "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.", @@ -1514,7 +1513,6 @@ "id": "CheckValidCredsRequest" }, "CheckValidCredsResponse": { - "id": "CheckValidCredsResponse", "description": "A response indicating whether the credentials exist and are valid.", "type": "object", "properties": { @@ -1522,7 +1520,8 @@ "description": "If set to `true`, the credentials exist and are valid.", "type": "boolean" } - } + }, + "id": "CheckValidCredsResponse" }, "ScheduleTransferRunsResponse": { "description": "A response to schedule transfer runs for a time range.", @@ -1530,24 +1529,44 @@ "properties": { "runs": { "description": "The transfer runs that were scheduled.", + "type": "array", "items": { "$ref": "TransferRun" - }, - "type": "array" + } } }, "id": "ScheduleTransferRunsResponse" }, + "ListTransferLogsResponse": { + "properties": { + "nextPageToken": { + "description": "Output only. 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.", + "type": "string" + }, + "transferMessages": { + "description": "Output only. The stored pipeline transfer messages.", + "type": "array", + "items": { + "$ref": "TransferMessage" + } + } + }, + "id": "ListTransferLogsResponse", + "description": "The returned list transfer run messages.", + "type": "object" + }, "TransferMessage": { - "id": "TransferMessage", "description": "Represents a user facing message for a particular data transfer run.", "type": "object", "properties": { - "messageText": { - "description": "Message text.", + "messageTime": { + "description": "Time when message was logged.", + "format": "google-datetime", "type": "string" }, "severity": { + "description": "Message severity.", + "type": "string", "enumDescriptions": [ "No severity specified.", "Informational message.", @@ -1559,77 +1578,59 @@ "INFO", "WARNING", "ERROR" - ], - "description": "Message severity.", - "type": "string" + ] }, - "messageTime": { - "format": "google-datetime", - "description": "Time when message was logged.", + "messageText": { + "description": "Message text.", "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" - } - } + }, + "id": "TransferMessage" }, "ListDataSourcesResponse": { - "id": "ListDataSourcesResponse", "description": "Returns list of supported data sources and their metadata.", "type": "object", "properties": { "dataSources": { + "description": "List of supported data sources and their transfer settings.", + "type": "array", "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.", + "description": "Output only. 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.", "type": "string" } - } + }, + "id": "ListDataSourcesResponse" }, "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": { + "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" + }, "description": { "description": "Parameter description.", "type": "string" }, "allowedValues": { "description": "All possible values for the parameter.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } + }, + "minValue": { + "description": "For integer and double values specifies minimum allowed value.", + "format": "double", + "type": "number" }, "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" @@ -1647,12 +1648,12 @@ "type": "boolean" }, "displayName": { - "type": "string", - "description": "Parameter display name in the user interface." + "description": "Parameter display name in the user interface.", + "type": "string" }, "immutable": { - "type": "boolean", - "description": "Cannot be changed after initial creation." + "description": "Cannot be changed after initial creation.", + "type": "boolean" }, "validationDescription": { "description": "Description of the requirements for this field, in case the user input does\nnot fulfill the regex pattern or min/max values.", @@ -1660,26 +1661,17 @@ }, "fields": { "description": "When parameter is a record, describes child fields.", + "type": "array", "items": { "$ref": "DataSourceParameter" - }, - "type": "array" + } }, "maxValue": { - "format": "double", "description": "For integer and double values specifies maxminum allowed value.", + "format": "double", "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", @@ -1690,72 +1682,102 @@ "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" + "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." + ] } }, - "id": "ListTransferRunsResponse", - "description": "The returned list of pipelines in the project.", + "id": "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" }, "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.", + "type": "array", "items": { "$ref": "Location" - }, - "type": "array" + } }, "nextPageToken": { "description": "The standard List next-page token.", "type": "string" } }, - "id": "ListLocationsResponse", - "description": "The response message for Locations.ListLocations." + "id": "ListLocationsResponse" + }, + "ListTransferRunsResponse": { + "description": "The returned list of pipelines in the project.", + "type": "object", + "properties": { + "transferRuns": { + "description": "Output only. The stored pipeline transfer runs.", + "type": "array", + "items": { + "$ref": "TransferRun" + } + }, + "nextPageToken": { + "description": "Output only. 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.", + "type": "string" + } + }, + "id": "ListTransferRunsResponse" + }, + "ListTransferConfigsResponse": { + "properties": { + "transferConfigs": { + "description": "Output only. The stored pipeline transfer configurations.", + "type": "array", + "items": { + "$ref": "TransferConfig" + } + }, + "nextPageToken": { + "description": "Output only. 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.", + "type": "string" + } + }, + "id": "ListTransferConfigsResponse", + "description": "The returned list of pipelines in the project.", + "type": "object" } }, - "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" + }, "canonicalName": "BigQuery Data Transfer", "auth": { "oauth2": { "scopes": { + "https://www.googleapis.com/auth/bigquery": { + "description": "View and manage your data in Google BigQuery" + }, "https://www.googleapis.com/auth/cloud-platform.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/" + "rootUrl": "https://bigquerydatatransfer.googleapis.com/", + "ownerDomain": "google.com", + "name": "bigquerydatatransfer", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "BigQuery Data Transfer API" } diff --git a/etc/api/calendar/v3/calendar-api.json b/etc/api/calendar/v3/calendar-api.json index 20afa5a389..20714cb666 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/VYSEPWa0diltjt4R-I-9BxST4qQ\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/scONkfl8xf1hlctGIhfPw6jkAJ8\"", "discoveryVersion": "v1", "id": "calendar:v3", "name": "calendar", "version": "v3", - "revision": "20170919", + "revision": "20171205", "title": "Calendar API", "description": "Manipulates events and other calendar data.", "ownerDomain": "google.com", @@ -1253,6 +1253,11 @@ "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", "required": true, "location": "path" + }, + "sendNotifications": { + "type": "boolean", + "description": "Whether to send notifications about the calendar sharing change. Optional. The default is True.", + "location": "query" } }, "parameterOrder": [ @@ -1331,6 +1336,11 @@ "description": "ACL rule identifier.", "required": true, "location": "path" + }, + "sendNotifications": { + "type": "boolean", + "description": "Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True.", + "location": "query" } }, "parameterOrder": [ @@ -1364,6 +1374,11 @@ "description": "ACL rule identifier.", "required": true, "location": "path" + }, + "sendNotifications": { + "type": "boolean", + "description": "Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True.", + "location": "query" } }, "parameterOrder": [ diff --git a/etc/api/classroom/v1/classroom-api.json b/etc/api/classroom/v1/classroom-api.json index 14b3630672..3bc58c1fbe 100644 --- a/etc/api/classroom/v1/classroom-api.json +++ b/etc/api/classroom/v1/classroom-api.json @@ -1,510 +1,31 @@ { + "basePath": "", "ownerDomain": "google.com", "name": "classroom", "batchPath": "batch", - "id": "classroom:v1", + "revision": "20171211", "documentationLink": "https://developers.google.com/classroom/", - "revision": "20170926", + "id": "classroom:v1", "title": "Google Classroom API", - "ownerName": "Google", "discoveryVersion": "v1", + "ownerName": "Google", "resources": { - "invitations": { - "methods": { - "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" - }, - "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" - }, - "accept": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "id" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/classroom.rosters" - ], - "parameters": { - "id": { - "location": "path", - "description": "Identifier of the invitation to accept.", - "type": "string", - "required": true - } - }, - "flatPath": "v1/invitations/{id}:accept", - "id": "classroom.invitations.accept", - "path": "v1/invitations/{id}: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" - }, - "parameterOrder": [ - "id" - ], - "httpMethod": "DELETE", - "scopes": [ - "https://www.googleapis.com/auth/classroom.rosters" - ], - "parameters": { - "id": { - "location": "path", - "description": "Identifier of the invitation to delete.", - "type": "string", - "required": true - } - }, - "flatPath": "v1/invitations/{id}", - "id": "classroom.invitations.delete", - "path": "v1/invitations/{id}" - } - } - }, - "registrations": { - "methods": { - "delete": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "registrationId" - ], - "httpMethod": "DELETE", - "parameters": { - "registrationId": { - "location": "path", - "description": "The `registration_id` of the `Registration` to be deleted.", - "type": "string", - "required": true - } - }, - "scopes": [ - "https://www.googleapis.com/auth/classroom.rosters", - "https://www.googleapis.com/auth/classroom.rosters.readonly" - ], - "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": "Registration" - }, - "parameterOrder": [], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/classroom.rosters", - "https://www.googleapis.com/auth/classroom.rosters.readonly" - ], - "parameters": {}, - "flatPath": "v1/registrations", - "id": "classroom.registrations.create", - "path": "v1/registrations", - "request": { - "$ref": "Registration" - }, - "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": { - "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", - "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/userProfiles/{userId}", - "id": "classroom.userProfiles.get", - "path": "v1/userProfiles/{userId}", - "description": "Returns a user profile.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access\nthis user profile, if no profile exists with the requested ID, or for\naccess errors." - } - }, - "resources": { - "guardianInvitations": { - "methods": { - "patch": { - "path": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}", - "id": "classroom.userProfiles.guardianInvitations.patch", - "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.", - "httpMethod": "PATCH", - "parameterOrder": [ - "studentId", - "invitationId" - ], - "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.", - "type": "string", - "required": true, - "location": "path" - }, - "studentId": { - "description": "The ID of the student whose guardian invitation is to be modified.", - "type": "string", - "required": true, - "location": "path" - } - }, - "flatPath": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}" - }, - "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)", - "type": "string", - "required": true - } - }, - "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" - }, - "parameterOrder": [ - "studentId", - "guardianId" - ], - "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", - "type": "string", - "required": true - }, - "guardianId": { - "location": "path", - "description": "The `id` field from a `Guardian`.", - "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" }, + "parameterOrder": [ + "id" + ], + "httpMethod": "DELETE", "parameters": { "id": { + "location": "path", "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" + "type": "string" } }, "scopes": [ @@ -512,35 +33,35 @@ ], "flatPath": "v1/courses/{id}", "path": "v1/courses/{id}", - "id": "classroom.courses.delete" + "id": "classroom.courses.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." }, "list": { - "httpMethod": "GET", + "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.", "response": { "$ref": "ListCoursesResponse" }, "parameterOrder": [], + "httpMethod": "GET", "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", + "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" }, - "pageToken": { + "teacherId": { "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.", + "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" }, - "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": [ @@ -555,16 +76,17 @@ "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" + "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": { + "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", + "location": "query" } - }, - "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": { @@ -576,61 +98,29 @@ }, "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}" + "flatPath": "v1/courses", + "path": "v1/courses", + "id": "classroom.courses.create" }, "get": { - "response": { - "$ref": "Course" - }, + "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.", + "httpMethod": "GET", "parameterOrder": [ "id" ], - "httpMethod": "GET", + "response": { + "$ref": "Course" + }, "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 + "required": true, + "type": "string" } }, "scopes": [ @@ -639,28 +129,60 @@ ], "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." + "path": "v1/courses/{id}" }, - "update": { - "httpMethod": "PUT", + "patch": { + "request": { + "$ref": "Course" + }, + "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", + "httpMethod": "PATCH", "parameterOrder": [ "id" ], "response": { "$ref": "Course" }, + "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" + }, + "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* `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,...`", + "format": "google-fieldmask", + "type": "string" + } + }, "scopes": [ "https://www.googleapis.com/auth/classroom.courses" ], + "flatPath": "v1/courses/{id}", + "id": "classroom.courses.patch", + "path": "v1/courses/{id}" + }, + "update": { + "response": { + "$ref": "Course" + }, + "parameterOrder": [ + "id" + ], + "httpMethod": "PUT", "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 + "required": true, + "type": "string" } }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ], "flatPath": "v1/courses/{id}", "path": "v1/courses/{id}", "id": "classroom.courses.update", @@ -671,22 +193,165 @@ } }, "resources": { - "announcements": { + "teachers": { "methods": { - "list": { - "httpMethod": "GET", - "parameterOrder": [ - "courseId" - ], + "get": { + "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.", "response": { - "$ref": "ListAnnouncementsResponse" + "$ref": "Teacher" }, + "parameterOrder": [ + "courseId", + "userId" + ], + "httpMethod": "GET", "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": { + "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", + "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", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ], + "flatPath": "v1/courses/{courseId}/teachers/{userId}", + "path": "v1/courses/{courseId}/teachers/{userId}", + "id": "classroom.courses.teachers.get" + }, + "list": { + "response": { + "$ref": "ListTeachersResponse" + }, + "parameterOrder": [ + "courseId" + ], + "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": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "required": true, "type": "string", - "required": true + "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" + } + }, + "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}/teachers", + "path": "v1/courses/{courseId}/teachers", + "id": "classroom.courses.teachers.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." + }, + "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": { + "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.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": { + "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.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "courseId", + "userId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters" + ], + "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": { + "location": "path", + "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" + } + }, + "flatPath": "v1/courses/{courseId}/teachers/{userId}", + "path": "v1/courses/{courseId}/teachers/{userId}", + "id": "classroom.courses.teachers.delete" + } + } + }, + "announcements": { + "methods": { + "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.", + "response": { + "$ref": "ListAnnouncementsResponse" + }, + "parameterOrder": [ + "courseId" + ], + "httpMethod": "GET", + "parameters": { + "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": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "required": true, + "type": "string", + "location": "path" }, "announcementStates": { "location": "query", @@ -700,21 +365,15 @@ "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" + "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" } }, "scopes": [ @@ -723,14 +382,13 @@ ], "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." + "id": "classroom.courses.announcements.list" }, "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" }, + "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", "response": { "$ref": "Announcement" }, @@ -741,8 +399,8 @@ "parameters": { "courseId": { "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "type": "string", "required": true, + "type": "string", "location": "path" } }, @@ -750,14 +408,14 @@ "https://www.googleapis.com/auth/classroom.announcements" ], "flatPath": "v1/courses/{courseId}/announcements", - "id": "classroom.courses.announcements.create", - "path": "v1/courses/{courseId}/announcements" + "path": "v1/courses/{courseId}/announcements", + "id": "classroom.courses.announcements.create" }, "modifyAssignees": { + "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.", "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": "Announcement" }, @@ -772,63 +430,22 @@ "parameters": { "courseId": { "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "type": "string", "required": true, + "type": "string", "location": "path" }, "id": { - "location": "path", "description": "Identifier of the announcement.", + "required": true, "type": "string", - "required": true + "location": "path" } }, "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" + "path": "v1/courses/{courseId}/announcements/{id}:modifyAssignees", + "id": "classroom.courses.announcements.modifyAssignees" }, "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" }, @@ -841,14 +458,14 @@ "courseId": { "location": "path", "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "type": "string", - "required": true + "required": true, + "type": "string" }, "id": { + "location": "path", "description": "Identifier of the announcement.", - "type": "string", "required": true, - "location": "path" + "type": "string" } }, "scopes": [ @@ -856,12 +473,51 @@ "https://www.googleapis.com/auth/classroom.announcements.readonly" ], "flatPath": "v1/courses/{courseId}/announcements/{id}", + "path": "v1/courses/{courseId}/announcements/{id}", "id": "classroom.courses.announcements.get", - "path": "v1/courses/{courseId}/announcements/{id}" + "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." + }, + "patch": { + "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", + "response": { + "$ref": "Announcement" + }, + "parameterOrder": [ + "courseId", + "id" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "location": "query", + "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`", + "format": "google-fieldmask", + "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" + }, + "id": { + "location": "path", + "description": "Identifier of the announcement.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.announcements" + ], + "flatPath": "v1/courses/{courseId}/announcements/{id}", + "path": "v1/courses/{courseId}/announcements/{id}", + "id": "classroom.courses.announcements.patch" }, "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" @@ -871,94 +527,65 @@ "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}" + "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 announcement to delete.\nThis identifier is a Classroom-assigned identifier.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/courses/{courseId}/announcements/{id}", + "path": "v1/courses/{courseId}/announcements/{id}", + "id": "classroom.courses.announcements.delete" } } }, "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": { + "response": { + "$ref": "ListCourseAliasesResponse" + }, "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" + }, + "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" + }, + "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", + "id": "classroom.courses.aliases.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." }, "create": { @@ -966,27 +593,58 @@ "request": { "$ref": "CourseAlias" }, - "httpMethod": "POST", - "parameterOrder": [ - "courseId" - ], "response": { "$ref": "CourseAlias" }, + "parameterOrder": [ + "courseId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ], "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, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1/courses/{courseId}/aliases", + "path": "v1/courses/{courseId}/aliases", + "id": "classroom.courses.aliases.create" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "courseId", + "alias" + ], + "httpMethod": "DELETE", + "parameters": { + "courseId": { + "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", + "location": "path" + }, + "alias": { + "description": "Alias to delete.\nThis may not be the Classroom-assigned identifier.", + "required": true, + "type": "string", "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" + "flatPath": "v1/courses/{courseId}/aliases/{alias}", + "path": "v1/courses/{courseId}/aliases/{alias}", + "id": "classroom.courses.aliases.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)." } } }, @@ -994,7 +652,6 @@ "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" }, @@ -1002,28 +659,66 @@ "courseId", "userId" ], + "httpMethod": "DELETE", + "parameters": { + "userId": { + "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", + "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" ], - "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" }, + "get": { + "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.", + "response": { + "$ref": "Student" + }, + "parameterOrder": [ + "courseId", + "userId" + ], + "httpMethod": "GET", + "parameters": { + "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" + }, + "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", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ] + }, "list": { + "flatPath": "v1/courses/{courseId}/students", + "path": "v1/courses/{courseId}/students", + "id": "classroom.courses.students.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" @@ -1039,16 +734,16 @@ "type": "string" }, "pageSize": { - "format": "int32", + "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.", - "type": "integer", - "location": "query" + "format": "int32", + "type": "integer" }, "courseId": { + "location": "path", "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "type": "string", "required": true, - "location": "path" + "type": "string" } }, "scopes": [ @@ -1056,115 +751,50 @@ "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.", + "flatPath": "v1/courses/{courseId}/students", + "path": "v1/courses/{courseId}/students", + "id": "classroom.courses.students.create", "request": { "$ref": "Student" }, - "httpMethod": "POST", - "parameterOrder": [ - "courseId" - ], + "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.", "response": { "$ref": "Student" }, + "parameterOrder": [ + "courseId" + ], + "httpMethod": "POST", "parameters": { + "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.", + "required": true, + "type": "string" + }, "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": { + "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" @@ -1180,29 +810,24 @@ "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": { - "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" - }, "orderBy": { "location": "query", "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" }, + "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.", + "format": "int32", "type": "integer", "location": "query" }, "courseWorkStates": { + "location": "query", "enum": [ "COURSE_WORK_STATE_UNSPECIFIED", "PUBLISHED", @@ -1211,17 +836,20 @@ ], "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" + "repeated": true + }, + "courseId": { + "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", + "required": true, + "type": "string", + "location": "path" } - }, - "flatPath": "v1/courses/{courseId}/courseWork", - "id": "classroom.courses.courseWork.list", - "path": "v1/courses/{courseId}/courseWork" + } }, "create": { - "id": "classroom.courses.courseWork.create", + "flatPath": "v1/courses/{courseId}/courseWork", "path": "v1/courses/{courseId}/courseWork", + "id": "classroom.courses.courseWork.create", "request": { "$ref": "CourseWork" }, @@ -1233,40 +861,39 @@ "courseId" ], "httpMethod": "POST", - "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.", - "type": "string", "required": true, - "location": "path" + "type": "string" } }, - "flatPath": "v1/courses/{courseId}/courseWork" + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.students" + ] }, "modifyAssignees": { - "response": { - "$ref": "CourseWork" - }, + "httpMethod": "POST", "parameterOrder": [ "courseId", "id" ], - "httpMethod": "POST", + "response": { + "$ref": "CourseWork" + }, "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 + "required": true, + "type": "string" }, "id": { "location": "path", "description": "Identifier of the coursework.", - "type": "string", - "required": true + "required": true, + "type": "string" } }, "scopes": [ @@ -1275,53 +902,53 @@ "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" }, + "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." + }, + "patch": { + "httpMethod": "PATCH", "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" - ], + "response": { + "$ref": "CourseWork" + }, "parameters": { + "updateMask": { + "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\n* `title`\n* `description`\n* `state`\n* `due_date`\n* `due_time`\n* `max_points`\n* `scheduled_time`\n* `submission_modification_mode`", + "format": "google-fieldmask", + "type": "string" + }, "courseId": { + "location": "path", "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "type": "string", "required": true, - "location": "path" + "type": "string" }, "id": { + "location": "path", "description": "Identifier of the course work.", - "type": "string", "required": true, - "location": "path" + "type": "string" } }, - "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": { + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.students" + ], "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.", + "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." + }, + "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.", "response": { "$ref": "CourseWork" }, @@ -1329,153 +956,67 @@ "courseId", "id" ], - "httpMethod": "PATCH", - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.students" - ], + "httpMethod": "GET", "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, + "type": "string", "location": "path" }, "id": { + "location": "path", "description": "Identifier of the course work.", - "type": "string", "required": true, - "location": "path" + "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" + ], + "flatPath": "v1/courses/{courseId}/courseWork/{id}", + "path": "v1/courses/{courseId}/courseWork/{id}", + "id": "classroom.courses.courseWork.get" + }, + "delete": { + "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.", + "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.", + "required": true, + "type": "string" + }, + "id": { + "location": "path", + "description": "Identifier of the course work to delete.\nThis identifier is a Classroom-assigned identifier.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.students" + ] } }, "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": { + "get": { "response": { "$ref": "StudentSubmission" }, @@ -1484,38 +1025,39 @@ "courseWorkId", "id" ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/classroom.coursework.me", - "https://www.googleapis.com/auth/classroom.coursework.students" - ], + "httpMethod": "GET", "parameters": { - "courseId": { - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "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" + }, "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 + "description": "Identifier of the student submission.", + "required": true, + "type": "string" } }, - "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." + "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}", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}", + "id": "classroom.courses.courseWork.studentSubmissions.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." }, "patch": { "request": { @@ -1531,51 +1073,227 @@ "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.", + "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\n* `draft_grade`\n* `assigned_grade`", + "format": "google-fieldmask", "type": "string", + "location": "query" + }, + "courseWorkId": { + "location": "path", + "description": "Identifier of the course work.", "required": true, - "location": "path" + "type": "string" }, "courseId": { + "location": "path", "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "type": "string", "required": true, - "location": "path" + "type": "string" }, "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`", + "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}", - "id": "classroom.courses.courseWork.studentSubmissions.patch", - "path": "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.", + "return": { + "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.", + "request": { + "$ref": "ReturnStudentSubmissionRequest" + }, "response": { - "$ref": "StudentSubmission" + "$ref": "Empty" }, "parameterOrder": [ "courseId", "courseWorkId", "id" ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.students" + ], + "parameters": { + "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" + }, + "id": { + "description": "Identifier of the student submission.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return", + "id": "classroom.courses.courseWork.studentSubmissions.return" + }, + "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": { + "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" + }, + "id": { + "location": "path", + "description": "Identifier of the student submission.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.me" + ] + }, + "turnIn": { + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn", + "id": "classroom.courses.courseWork.studentSubmissions.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", + "parameters": { + "courseWorkId": { + "description": "Identifier of the course work.", + "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" + }, + "id": { + "description": "Identifier of the student submission.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.coursework.me" + ] + }, + "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.", + "response": { + "$ref": "ListStudentSubmissionsResponse" + }, + "parameterOrder": [ + "courseId", + "courseWorkId" + ], "httpMethod": "GET", + "parameters": { + "late": { + "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", + "location": "query", + "enum": [ + "LATE_VALUES_UNSPECIFIED", + "LATE_ONLY", + "NOT_LATE_ONLY" + ] + }, + "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": { + "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": { + "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": { + "location": "path", + "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.", + "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.coursework.me", "https://www.googleapis.com/auth/classroom.coursework.me.readonly", @@ -1584,33 +1302,20 @@ "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}" + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions", + "id": "classroom.courses.courseWork.studentSubmissions.list" }, - "return": { + "modifyAttachments": { + "flatPath": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments", + "path": "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments", + "id": "classroom.courses.courseWork.studentSubmissions.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" + }, "response": { - "$ref": "Empty" + "$ref": "StudentSubmission" }, "parameterOrder": [ "courseId", @@ -1619,235 +1324,565 @@ ], "httpMethod": "POST", "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.", - "type": "string", - "required": true + "required": true, + "type": "string" }, "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, + "type": "string", "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." + } } } } } + } + } + }, + "userProfiles": { + "methods": { + "get": { + "description": "Returns a user profile.\n\nThis method returns the following error codes:\n\n* `PERMISSION_DENIED` if the requesting user is not permitted to access\nthis user profile, if no profile exists with the requested ID, or for\naccess errors.", + "httpMethod": "GET", + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "UserProfile" + }, + "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", + "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/userProfiles/{userId}", + "id": "classroom.userProfiles.get", + "path": "v1/userProfiles/{userId}" + } + }, + "resources": { + "guardianInvitations": { + "methods": { + "list": { + "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": { + "description": "If specified, only results with the specified `invited_email_address`\nwill be returned.", + "type": "string", + "location": "query" + }, + "states": { + "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", + "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" + } + }, + "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." + }, + "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", + "parameters": { + "invitationId": { + "location": "path", + "description": "The `id` field of the `GuardianInvitation` being requested.", + "required": true, + "type": "string" + }, + "studentId": { + "location": "path", + "description": "The ID of the student whose guardian invitation is being requested.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.guardianlinks.students", + "https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly" + ], + "flatPath": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}", + "path": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}", + "id": "classroom.userProfiles.guardianInvitations.get" + }, + "patch": { + "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.", + "response": { + "$ref": "GuardianInvitation" + }, + "parameterOrder": [ + "studentId", + "invitationId" + ], + "httpMethod": "PATCH", + "parameters": { + "invitationId": { + "location": "path", + "description": "The `id` field of the `GuardianInvitation` to be modified.", + "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* `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": { + "location": "path", + "description": "The ID of the student whose guardian invitation is to be modified.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.guardianlinks.students" + ], + "flatPath": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}", + "path": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}", + "id": "classroom.userProfiles.guardianInvitations.patch" + }, + "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" + }, + "response": { + "$ref": "GuardianInvitation" + }, + "parameterOrder": [ + "studentId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/classroom.guardianlinks.students" + ], + "parameters": { + "studentId": { + "description": "ID of the student (in standard format)", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1/userProfiles/{studentId}/guardianInvitations", + "path": "v1/userProfiles/{studentId}/guardianInvitations", + "id": "classroom.userProfiles.guardianInvitations.create" + } + } }, - "teachers": { + "guardians": { "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.", + "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.", "response": { - "$ref": "ListTeachersResponse" + "$ref": "ListGuardiansResponse" }, "parameterOrder": [ - "courseId" + "studentId" ], "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" + "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" }, "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", - "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": { + "studentId": { "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "type": "string", - "required": true + "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, + "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\nmust be otherwise identical to the one that resulted in this token.", + "type": "string" } - } + }, + "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" + ] }, "get": { - "response": { - "$ref": "Teacher" - }, - "parameterOrder": [ - "courseId", - "userId" - ], + "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", - "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" + "studentId", + "guardianId" ], "response": { - "$ref": "Teacher" + "$ref": "Guardian" }, "parameters": { - "courseId": { + "studentId": { "location": "path", - "description": "Identifier of the course.\nThis identifier can be either the Classroom-assigned identifier or an\nalias.", - "type": "string", - "required": true + "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, + "type": "string" + }, + "guardianId": { + "location": "path", + "description": "The `id` field from a `Guardian`.", + "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" + "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/courses/{courseId}/teachers", - "path": "v1/courses/{courseId}/teachers", - "id": "classroom.courses.teachers.create" + "flatPath": "v1/userProfiles/{studentId}/guardians/{guardianId}", + "id": "classroom.userProfiles.guardians.get", + "path": "v1/userProfiles/{studentId}/guardians/{guardianId}" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "studentId", + "guardianId" + ], + "httpMethod": "DELETE", + "parameters": { + "guardianId": { + "description": "The `id` field from a `Guardian`.", + "required": true, + "type": "string", + "location": "path" + }, + "studentId": { + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.guardianlinks.students" + ], + "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`." } } } } + }, + "registrations": { + "methods": { + "create": { + "flatPath": "v1/registrations", + "id": "classroom.registrations.create", + "path": "v1/registrations", + "request": { + "$ref": "Registration" + }, + "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.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "Registration" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/classroom.push-notifications", + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ] + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "registrationId" + ], + "httpMethod": "DELETE", + "parameters": { + "registrationId": { + "description": "The `registration_id` of the `Registration` to be deleted.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.push-notifications", + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ], + "flatPath": "v1/registrations/{registrationId}", + "path": "v1/registrations/{registrationId}", + "id": "classroom.registrations.delete", + "description": "Deletes a `Registration`, causing Classroom to stop sending notifications\nfor that `Registration`." + } + } + }, + "invitations": { + "methods": { + "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" + }, + "parameterOrder": [ + "id" + ], + "httpMethod": "GET", + "parameters": { + "id": { + "location": "path", + "description": "Identifier of the invitation to return.", + "required": true, + "type": "string" + } + }, + "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" + }, + "list": { + "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.", + "response": { + "$ref": "ListInvitationsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "userId": { + "location": "query", + "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" + }, + "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" + }, + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ] + }, + "create": { + "request": { + "$ref": "Invitation" + }, + "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.", + "response": { + "$ref": "Invitation" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters" + ], + "flatPath": "v1/invitations", + "path": "v1/invitations", + "id": "classroom.invitations.create" + }, + "accept": { + "httpMethod": "POST", + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "id": { + "description": "Identifier of the invitation to accept.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters" + ], + "flatPath": "v1/invitations/{id}:accept", + "id": "classroom.invitations.accept", + "path": "v1/invitations/{id}: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": { + "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.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "id" + ], + "httpMethod": "DELETE", + "parameters": { + "id": { + "location": "path", + "description": "Identifier of the invitation to delete.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters" + ] + } + } } }, "parameters": { - "fields": { + "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": "Selector specifying which fields to include in a partial response.", + "description": "Pretty-print response.", + "type": "boolean", + "default": "true" + }, + "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.", + "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" + }, "callback": { - "location": "query", "description": "JSONP", - "type": "string" + "type": "string", + "location": "query" }, "$.xgafv": { "description": "V1 error format.", @@ -1863,7 +1898,6 @@ ] }, "alt": { - "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -1876,11 +1910,7 @@ "json", "media", "proto" - ] - }, - "access_token": { - "location": "query", - "description": "OAuth access token.", + ], "type": "string" }, "key": { @@ -1888,47 +1918,570 @@ "type": "string", "location": "query" }, - "quotaUser": { + "access_token": { "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": "OAuth access token.", "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" - }, - "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": { + "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.", + "type": "object", "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" + "late": { + "description": "Whether this submission is late.\n\nRead-only.", + "type": "boolean" }, + "draftGrade": { + "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.", + "format": "double", + "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.", + "A short answer question.", + "A multiple-choice question." + ], + "enum": [ + "COURSE_WORK_TYPE_UNSPECIFIED", + "ASSIGNMENT", + "SHORT_ANSWER_QUESTION", + "MULTIPLE_CHOICE_QUESTION" + ] + }, + "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", + "type": "string" + }, + "state": { + "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", + "CREATED", + "TURNED_IN", + "RETURNED", + "RECLAIMED_BY_STUDENT" + ], + "description": "State of this submission.\n\nRead-only.", + "type": "string" + }, + "userId": { + "description": "Identifier for the student that owns this submission.\n\nRead-only.", + "type": "string" + }, + "courseWorkId": { + "description": "Identifier for the course work this corresponds to.\n\nRead-only.", + "type": "string" + }, + "courseId": { + "description": "Identifier of the course.\n\nRead-only.", + "type": "string" + }, + "id": { + "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.", + "type": "array", + "items": { + "$ref": "SubmissionHistory" + } + }, + "assignedGrade": { + "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.", + "format": "double", + "type": "number" + }, + "multipleChoiceSubmission": { + "description": "Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION.", + "$ref": "MultipleChoiceSubmission" + }, + "assignmentSubmission": { + "$ref": "AssignmentSubmission", + "description": "Submission content when course_work_type is ASSIGNMENT.\n\nStudents can modify this content using\ngoogle.classroom.Work.ModifyAttachments." + }, + "shortAnswerSubmission": { + "description": "Submission content when course_work_type is SHORT_ANSWER_QUESTION.", + "$ref": "ShortAnswerSubmission" + }, + "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", + "type": "string" + }, + "alternateLink": { + "description": "Absolute link to the submission in the Classroom web UI.\n\nRead-only.", + "type": "string" + } + }, + "id": "StudentSubmission" + }, + "ListStudentSubmissionsResponse": { + "description": "Response when listing student submissions.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", + "type": "string" + }, + "studentSubmissions": { + "description": "Student work that matches the request.", + "type": "array", + "items": { + "$ref": "StudentSubmission" + } + } + }, + "id": "ListStudentSubmissionsResponse" + }, + "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" + } + } + }, + "id": "ModifyAttachmentsRequest" + }, + "YouTubeVideo": { + "description": "YouTube video item.", + "type": "object", + "properties": { + "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": { + "description": "YouTube API resource ID.", + "type": "string" + } + }, + "id": "YouTubeVideo" + }, + "ListInvitationsResponse": { + "description": "Response when listing invitations.", + "type": "object", + "properties": { + "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.", + "type": "array", + "items": { + "$ref": "Invitation" + } + } + }, + "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": { + "invitationId": { + "description": "Unique identifier for this invitation.\n\nRead-only.", + "type": "string" + }, + "studentId": { + "description": "ID of the student (in standard format)", + "type": "string" + }, + "state": { + "enumDescriptions": [ + "Should never be returned.", + "The invitation is active and awaiting a response.", + "The invitation is no longer active. It may have been accepted, declined,\nwithdrawn or it may have expired." + ], + "enum": [ + "GUARDIAN_INVITATION_STATE_UNSPECIFIED", + "PENDING", + "COMPLETE" + ], + "description": "The state that this invitation is in.", + "type": "string" + }, + "invitedEmailAddress": { + "description": "Email address that the invitation was sent to.\nThis field is only visible to domain administrators.", + "type": "string" + }, + "creationTime": { + "description": "The time that this invitation was created.\n\nRead-only.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "GuardianInvitation" + }, + "StateHistory": { + "description": "The history of each state this submission has been in.", + "type": "object", + "properties": { + "state": { + "description": "The workflow pipeline stage.", + "type": "string", + "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" + ] + }, + "stateTimestamp": { + "description": "When the submission entered this state.", + "format": "google-datetime", + "type": "string" + }, + "actorUserId": { + "description": "The teacher or student who made the change", + "type": "string" + } + }, + "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": { + "title": { + "description": "Title for this set.", + "type": "string" + }, + "materials": { + "description": "Materials attached to this set.", + "type": "array", + "items": { + "$ref": "CourseMaterial" + } + } + }, + "id": "CourseMaterialSet" + }, + "ListTeachersResponse": { + "description": "Response when listing teachers.", + "type": "object", + "properties": { + "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.", + "type": "array", + "items": { + "$ref": "Teacher" + } + } + }, + "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" + }, + "title": { + "description": "Title of the target of the URL.\n\nRead-only.", + "type": "string" + } + }, + "id": "Link" + }, + "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" + }, + "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" + }, + "fullName": { + "description": "The user's full name formed by concatenating the first and last name\nvalues.\n\nRead-only.", + "type": "string" + } + }, + "id": "Name" + }, + "Assignment": { + "description": "Additional details for assignments.", + "type": "object", + "properties": { + "studentWorkFolder": { + "description": "Drive folder where attachments from student submissions are placed.\nThis is only populated for course teachers and administrators.", + "$ref": "DriveFolder" + } + }, + "id": "Assignment" + }, + "SharedDriveFile": { + "description": "Drive file that is used as material for course work.", + "type": "object", + "properties": { + "driveFile": { + "description": "Drive file details.", + "$ref": "DriveFile" + }, + "shareMode": { + "description": "Mechanism by which students access the Drive item.", + "type": "string", + "enumDescriptions": [ + "No sharing mode specified. This should never be returned.", + "Students can view the shared file.", + "Students can edit the shared file.", + "Students have a personal copy of the shared file." + ], + "enum": [ + "UNKNOWN_SHARE_MODE", + "VIEW", + "EDIT", + "STUDENT_COPY" + ] + } + }, + "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" + }, + "ModifyAnnouncementAssigneesRequest": { + "description": "Request to modify assignee mode and options of an announcement.", + "type": "object", + "properties": { + "assigneeMode": { + "description": "Mode of the announcement describing whether it will be accessible by all\nstudents or specified individual 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" + ] + }, + "modifyIndividualStudentsOptions": { + "description": "Set which students can view or cannot view the announcement.\nMust be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`.", + "$ref": "ModifyIndividualStudentsOptions" + } + }, + "id": "ModifyAnnouncementAssigneesRequest" + }, + "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": { + "courseId": { + "description": "Identifier of the course.\n\nRead-only.", + "type": "string" + }, + "profile": { + "description": "Global user information for the teacher.\n\nRead-only.", + "$ref": "UserProfile" + }, + "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" + } + }, + "id": "Teacher" + }, + "GradeHistory": { + "description": "The history of each grade on this submission.", + "type": "object", + "properties": { + "pointsEarned": { + "description": "The numerator of the grade at this time in the submission grade history.", + "format": "double", + "type": "number" + }, + "actorUserId": { + "description": "The teacher who made the grade change.", + "type": "string" + }, + "gradeTimestamp": { + "description": "When the grade of the submission was changed.", + "format": "google-datetime", + "type": "string" + }, + "gradeChangeType": { + "description": "The type of grade change at this time in the submission grade history.", + "type": "string", + "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" + ] + }, + "maxPoints": { + "description": "The denominator of the grade at this time in the submission grade\nhistory.", + "format": "double", + "type": "number" + } + }, + "id": "GradeHistory" + }, + "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.", + "type": "array", + "items": { + "$ref": "Attachment" + } + } + }, + "id": "AssignmentSubmission" + }, + "Material": { + "description": "Material attached to course work.\n\nWhen creating attachments, setting the `form` field is not supported.", + "type": "object", + "properties": { + "driveFile": { + "$ref": "SharedDriveFile", + "description": "Google Drive file material." + }, + "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" + }, + "Feed": { + "description": "A class of notifications that an application can register to receive.\nFor example: \"all roster changes for a domain\".", + "type": "object", + "properties": { "feedType": { + "description": "The type of feed.", + "type": "string", "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.", @@ -1938,19 +2491,27 @@ "FEED_TYPE_UNSPECIFIED", "DOMAIN_ROSTER_CHANGES", "COURSE_ROSTER_CHANGES" - ], - "description": "The type of feed.", - "type": "string" + ] + }, + "courseRosterChangesInfo": { + "$ref": "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`." } }, - "id": "Feed", - "description": "A class of notifications that an application can register to receive.\nFor example: \"all roster changes for a domain\".", - "type": "object" + "id": "Feed" }, "Student": { "description": "Student in a course.", "type": "object", "properties": { + "profile": { + "description": "Global user information for the student.\n\nRead-only.", + "$ref": "UserProfile" + }, + "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" + }, "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" @@ -1958,14 +2519,6 @@ "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" @@ -1974,10 +2527,6 @@ "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" @@ -1987,6 +2536,8 @@ "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.", @@ -1998,8 +2549,10 @@ "STUDENT", "TEACHER", "OWNER" - ], - "description": "Role to invite the user to have.\nMust not be `COURSE_ROLE_UNSPECIFIED`.", + ] + }, + "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" } }, @@ -2021,104 +2574,108 @@ }, "courseWork": { "description": "Course work items that match the request.", + "type": "array", "items": { "$ref": "CourseWork" - }, - "type": "array" + } } }, "id": "ListCourseWorkResponse" }, "Attachment": { + "description": "Attachment added to student assignment work.\n\nWhen creating attachments, setting the `form` field is not supported.", + "type": "object", "properties": { + "driveFile": { + "description": "Google Drive file attachment.", + "$ref": "DriveFile" + }, + "youTubeVideo": { + "description": "Youtube video attachment.", + "$ref": "YouTubeVideo" + }, "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" + "description": "Link attachment.", + "$ref": "Link" } }, - "id": "Attachment", - "description": "Attachment added to student assignment work.\n\nWhen creating attachments, setting the `form` field is not supported.", - "type": "object" + "id": "Attachment" }, "ListAnnouncementsResponse": { + "description": "Response when listing course work.", + "type": "object", "properties": { + "announcements": { + "description": "Announcement items that match the request.", + "type": "array", + "items": { + "$ref": "Announcement" + } + }, "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" + "id": "ListAnnouncementsResponse" }, "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.", + "format": "int32", "type": "integer" }, "nanos": { - "format": "int32", "description": "Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.", + "format": "int32", "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.", + "format": "int32", "type": "integer" }, "minutes": { - "format": "int32", "description": "Minutes of hour of day. Must be from 0 to 59.", + "format": "int32", "type": "integer" } }, "id": "TimeOfDay" }, "ListCoursesResponse": { + "description": "Response when listing courses.", + "type": "object", "properties": { "courses": { "description": "Courses that match the list request.", + "type": "array", "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" + "id": "ListCoursesResponse" }, "Form": { "description": "Google Forms item.", "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" @@ -2130,16 +2687,18 @@ "formUrl": { "description": "URL of the form.", "type": "string" - }, - "title": { - "description": "Title of the Form.\n\nRead-only.", - "type": "string" } }, "id": "Form" }, "ModifyCourseWorkAssigneesRequest": { + "description": "Request to modify assignee mode and options of a coursework.", + "type": "object", "properties": { + "modifyIndividualStudentsOptions": { + "$ref": "ModifyIndividualStudentsOptions", + "description": "Set which students are assigned or not assigned to the coursework.\nMust be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`." + }, "assigneeMode": { "enumDescriptions": [ "No mode specified. This is never returned.", @@ -2153,15 +2712,9 @@ ], "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" + "id": "ModifyCourseWorkAssigneesRequest" }, "ListGuardiansResponse": { "description": "Response when listing guardians.", @@ -2173,10 +2726,10 @@ }, "guardians": { "description": "Guardians on this page of results that met the criteria specified in\nthe request.", + "type": "array", "items": { "$ref": "Guardian" - }, - "type": "array" + } } }, "id": "ListGuardiansResponse" @@ -2192,6 +2745,24 @@ }, "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", @@ -2202,46 +2773,52 @@ }, "guardianInvitations": { "description": "Guardian invitations that matched the list request.", + "type": "array", "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.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } } }, "id": "IndividualStudentsOptions" }, + "Registration": { + "description": "An instruction to Classroom to send notifications from the `feed` to the\nprovided `destination`.", + "type": "object", + "properties": { + "registrationId": { + "description": "A server-generated unique identifier for this `Registration`.\n\nRead-only.", + "type": "string" + }, + "cloudPubsubTopic": { + "description": "The Cloud Pub/Sub topic that notifications are to be sent to.", + "$ref": "CloudPubsubTopic" + }, + "expiryTime": { + "description": "The time until which the `Registration` is effective.\n\nThis is a read-only field assigned by the server.", + "format": "google-datetime", + "type": "string" + }, + "feed": { + "description": "Specification for the class of notifications that Classroom should deliver\nto the `destination`.", + "$ref": "Feed" + } + }, + "id": "Registration" + }, "MultipleChoiceSubmission": { "description": "Student work for a multiple-choice question.", "type": "object", @@ -2253,49 +2830,25 @@ }, "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" + "$ref": "DriveFile", + "description": "Google Drive file attachment." + }, + "youTubeVideo": { + "description": "Youtube video attachment.", + "$ref": "YouTubeVideo" }, "form": { "$ref": "Form", "description": "Google Forms attachment." }, "link": { - "$ref": "Link", - "description": "Link atatchment." + "description": "Link atatchment.", + "$ref": "Link" } }, "id": "CourseMaterial" @@ -2306,10 +2859,10 @@ "properties": { "choices": { "description": "Possible choices.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } } }, "id": "MultipleChoiceQuestion" @@ -2318,14 +2871,6 @@ "description": "A Course in Classroom.", "type": "object", "properties": { - "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" - }, "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" @@ -2342,17 +2887,17 @@ "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" }, - "courseMaterialSets": { - "description": "Sets of materials that appear on the \"about\" page of this course.\n\nRead-only.", - "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" }, + "courseMaterialSets": { + "description": "Sets of materials that appear on the \"about\" page of this course.\n\nRead-only.", + "type": "array", + "items": { + "$ref": "CourseMaterialSet" + } + }, "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" @@ -2362,8 +2907,8 @@ "type": "string" }, "updateTime": { - "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.", + "format": "google-datetime", "type": "string" }, "alternateLink": { @@ -2407,15 +2952,29 @@ "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.", + "format": "google-datetime", "type": "string" + }, + "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": { + "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" } }, "id": "Course" }, "DriveFile": { + "description": "Representation of a Google Drive file.", + "type": "object", "properties": { + "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" @@ -2427,15 +2986,9 @@ "id": { "description": "Drive API resource ID.", "type": "string" - }, - "title": { - "description": "Title of the Drive item.\n\nRead-only.", - "type": "string" } }, - "id": "DriveFile", - "description": "Representation of a Google Drive file.", - "type": "object" + "id": "DriveFile" }, "ReturnStudentSubmissionRequest": { "description": "Request to return a student submission.", @@ -2464,20 +3017,36 @@ "description": "Course work created by a teacher for students of the course.", "type": "object", "properties": { + "courseId": { + "description": "Identifier of the course.\n\nRead-only.", + "type": "string" + }, + "id": { + "description": "Classroom-assigned identifier of this course work, unique per course.\n\nRead-only.", + "type": "string" + }, + "dueTime": { + "$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": { + "description": "Title of this course work.\nThe title must be a valid UTF-8 string containing between 1 and 3000\ncharacters.", + "type": "string" + }, + "materials": { + "description": "Additional materials.\n\nCourseWork must have no more than 20 material items.", + "type": "array", + "items": { + "$ref": "Material" + } + }, "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": { - "format": "google-datetime", "description": "Timestamp of the most recent change to this course work.\n\nRead-only.", + "format": "google-datetime", "type": "string" }, "assigneeMode": { @@ -2499,11 +3068,21 @@ "type": "string" }, "maxPoints": { - "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.", + "format": "double", "type": "number" }, + "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.", + "$ref": "MultipleChoiceQuestion" + }, + "assignment": { + "description": "Assignment details.\nThis is populated only when `work_type` is `ASSIGNMENT`.\n\nRead-only.", + "$ref": "Assignment" + }, "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.", @@ -2515,45 +3094,37 @@ "ASSIGNMENT", "SHORT_ANSWER_QUESTION", "MULTIPLE_CHOICE_QUESTION" - ], - "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": { "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.", + "format": "google-datetime", "type": "string" }, "creationTime": { - "format": "google-datetime", "description": "Timestamp when this course work was created.\n\nRead-only.", + "format": "google-datetime", "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" + "$ref": "Date", + "description": "Optional date, in UTC, that submissions for this this course work are due.\nThis must be specified if `due_time` is specified." }, "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" + "$ref": "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." }, "creatorUserId": { "description": "Identifier for the user that created the coursework.\n\nRead-only.", "type": "string" }, "state": { + "description": "Status of this course work.\nIf unspecified, the default state is `DRAFT`.", + "type": "string", "enumDescriptions": [ "No state specified. This is never returned.", "Status for work that has been published.\nThis is the default state.", @@ -2565,9 +3136,7 @@ "PUBLISHED", "DRAFT", "DELETED" - ], - "description": "Status of this course work.\nIf unspecified, the default state is `DRAFT`.", - "type": "string" + ] }, "submissionModificationMode": { "enumDescriptions": [ @@ -2582,73 +3151,37 @@ ], "description": "Setting to determine when students are allowed to modify submissions.\nIf unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`.", "type": "string" - }, - "courseId": { - "description": "Identifier of the course.\n\nRead-only.", - "type": "string" - }, - "id": { - "description": "Classroom-assigned identifier of this course work, unique per course.\n\nRead-only.", - "type": "string" - }, - "dueTime": { - "$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": { - "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.", + "studentId": { + "description": "Identifier for the student to whom the guardian relationship applies.", "type": "string" }, "guardianId": { "description": "Identifier for the guardian.", "type": "string" }, + "invitedEmailAddress": { + "description": "The email address to which the initial guardian invitation was sent.\nThis field is only visible to domain administrators.", + "type": "string" + }, "guardianProfile": { "description": "User profile for the guardian.", "$ref": "UserProfile" - }, - "studentId": { - "description": "Identifier for the student to whom the guardian relationship applies.", - "type": "string" } }, - "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" - }, - "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" + "id": "Guardian" }, "UserProfile": { + "description": "Global information for a user.", + "type": "object", "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" @@ -2663,58 +3196,44 @@ }, "permissions": { "description": "Global permissions of the user.\n\nRead-only.", + "type": "array", "items": { "$ref": "GlobalPermission" - }, - "type": "array" + } }, "name": { "$ref": "Name", "description": "Name of the user.\n\nRead-only." + }, + "id": { + "description": "Identifier of the user.\n\nRead-only.", + "type": "string" } }, - "id": "UserProfile", - "description": "Global information for a user.", - "type": "object" + "id": "UserProfile" + }, + "ListStudentsResponse": { + "description": "Response when listing students.", + "type": "object", + "properties": { + "students": { + "description": "Students who match the list request.", + "type": "array", + "items": { + "$ref": "Student" + } + }, + "nextPageToken": { + "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", + "type": "string" + } + }, + "id": "ListStudentsResponse" }, "Announcement": { "description": "Announcement created by a teacher for students of the course", "type": "object", "properties": { - "scheduledTime": { - "format": "google-datetime", - "description": "Optional timestamp when this announcement is scheduled to be published.", - "type": "string" - }, - "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", - "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" @@ -2729,18 +3248,14 @@ }, "materials": { "description": "Additional materials.\n\nAnnouncements must have no more than 20 material items.", + "type": "array", "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.", + "format": "google-datetime", "type": "string" }, "assigneeMode": { @@ -2756,30 +3271,68 @@ ], "description": "Assignee mode of the announcement.\nIf unspecified, the default value is `ALL_STUDENTS`.", "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" + }, + "scheduledTime": { + "description": "Optional timestamp when this announcement is scheduled to be published.", + "format": "google-datetime", + "type": "string" + }, + "creationTime": { + "description": "Timestamp when this announcement was created.\n\nRead-only.", + "format": "google-datetime", + "type": "string" + }, + "individualStudentsOptions": { + "$ref": "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." + }, + "creatorUserId": { + "description": "Identifier for the user that created the announcement.\n\nRead-only.", + "type": "string" + }, + "state": { + "description": "Status of this announcement.\nIf unspecified, the default state is `DRAFT`.", + "type": "string", + "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." + ], + "enum": [ + "ANNOUNCEMENT_STATE_UNSPECIFIED", + "PUBLISHED", + "DRAFT", + "DELETED" + ] } }, "id": "Announcement" }, "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", "properties": { "addStudentIds": { "description": "Ids of students to be added as having access to this\ncoursework/announcement.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "removeStudentIds": { "description": "Ids of students to be removed from having access to this\ncoursework/announcement.", + "type": "array", "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" + "id": "ModifyIndividualStudentsOptions" }, "DriveFolder": { "description": "Representation of a Google Drive folder.", @@ -2805,8 +3358,8 @@ "type": "object", "properties": { "gradeHistory": { - "description": "The grade history information of the submission, if present.", - "$ref": "GradeHistory" + "$ref": "GradeHistory", + "description": "The grade history information of the submission, if present." }, "stateHistory": { "$ref": "StateHistory", @@ -2825,556 +3378,6 @@ } }, "id": "ShortAnswerSubmission" - }, - "ListStudentSubmissionsResponse": { - "description": "Response when listing student submissions.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "Token identifying the next page of results to return. If empty, no further\nresults are available.", - "type": "string" - }, - "studentSubmissions": { - "description": "Student work that matches the request.", - "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.", - "type": "object", - "properties": { - "late": { - "description": "Whether this submission is late.\n\nRead-only.", - "type": "boolean" - }, - "draftGrade": { - "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": { - "enumDescriptions": [ - "No work type specified. This is never returned.", - "An assignment.", - "A short answer question.", - "A multiple-choice question." - ], - "enum": [ - "COURSE_WORK_TYPE_UNSPECIFIED", - "ASSIGNMENT", - "SHORT_ANSWER_QUESTION", - "MULTIPLE_CHOICE_QUESTION" - ], - "description": "Type of course work this submission is for.\n\nRead-only.", - "type": "string" - }, - "creationTime": { - "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": { - "enum": [ - "SUBMISSION_STATE_UNSPECIFIED", - "NEW", - "CREATED", - "TURNED_IN", - "RETURNED", - "RECLAIMED_BY_STUDENT" - ], - "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.", - "type": "string" - }, - "courseWorkId": { - "description": "Identifier for the course work this corresponds to.\n\nRead-only.", - "type": "string" - }, - "courseId": { - "description": "Identifier of the course.\n\nRead-only.", - "type": "string" - }, - "id": { - "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": { - "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": { - "$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.\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": { - "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": { - "description": "Absolute link to the submission in the Classroom web UI.\n\nRead-only.", - "type": "string" - } - }, - "id": "StudentSubmission" - }, - "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.", - "items": { - "$ref": "Attachment" - }, - "type": "array" - } - }, - "id": "ModifyAttachmentsRequest" - }, - "YouTubeVideo": { - "properties": { - "id": { - "description": "YouTube API resource ID.", - "type": "string" - }, - "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", - "description": "YouTube video item.", - "type": "object" - }, - "ListInvitationsResponse": { - "description": "Response when listing invitations.", - "type": "object", - "properties": { - "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": { - "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": { - "description": "The state that this invitation is in.", - "type": "string", - "enumDescriptions": [ - "Should never be returned.", - "The invitation is active and awaiting a response.", - "The invitation is no longer active. It may have been accepted, declined,\nwithdrawn or it may have expired." - ], - "enum": [ - "GUARDIAN_INVITATION_STATE_UNSPECIFIED", - "PENDING", - "COMPLETE" - ] - }, - "studentId": { - "description": "ID of the student (in standard format)", - "type": "string" - } - }, - "id": "GuardianInvitation" - }, - "StateHistory": { - "description": "The history of each state this submission has been in.", - "type": "object", - "properties": { - "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" - }, - "stateTimestamp": { - "format": "google-datetime", - "description": "When the submission entered this state.", - "type": "string" - }, - "actorUserId": { - "description": "The teacher or student who made the change", - "type": "string" - } - }, - "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" - } - }, - "id": "CourseMaterialSet" - }, - "ListTeachersResponse": { - "description": "Response when listing teachers.", - "type": "object", - "properties": { - "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" - }, - "title": { - "description": "Title of the target of the URL.\n\nRead-only.", - "type": "string" - } - }, - "id": "Link" - }, - "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" - }, - "Name": { - "properties": { - "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": { - "description": "Drive folder where attachments from student submissions are placed.\nThis is only populated for course teachers and administrators.", - "$ref": "DriveFolder" - } - }, - "id": "Assignment" - }, - "SharedDriveFile": { - "description": "Drive file that is used as material for course work.", - "type": "object", - "properties": { - "shareMode": { - "description": "Mechanism by which students access the Drive item.", - "type": "string", - "enumDescriptions": [ - "No sharing mode specified. This should never be returned.", - "Students can view the shared file.", - "Students can edit the shared file.", - "Students have a personal copy of the shared file." - ], - "enum": [ - "UNKNOWN_SHARE_MODE", - "VIEW", - "EDIT", - "STUDENT_COPY" - ] - }, - "driveFile": { - "$ref": "DriveFile", - "description": "Drive file details." - } - }, - "id": "SharedDriveFile" - }, - "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" - }, - "ModifyAnnouncementAssigneesRequest": { - "properties": { - "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": "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", @@ -3387,12 +3390,24 @@ "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.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.announcements": { + "description": "View and manage announcements in Google Classroom" }, "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.readonly": { "description": "View announcements in Google Classroom" }, @@ -3420,30 +3435,20 @@ "https://www.googleapis.com/auth/classroom.coursework.me": { "description": "Manage your course work and view your grades in Google Classroom" }, + "https://www.googleapis.com/auth/classroom.push-notifications": { + "description": "Receive notifications about your Google Classroom data" + }, "https://www.googleapis.com/auth/classroom.rosters": { "description": "Manage your Google Classroom class rosters" }, "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.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": "" + "description": "Manages classes, rosters, and invitations in Google Classroom.", + "servicePath": "", + "rootUrl": "https://classroom.googleapis.com/" } diff --git a/etc/api/cloudbuild/v1/cloudbuild-api.json b/etc/api/cloudbuild/v1/cloudbuild-api.json index 870ea76eb2..066c38d28b 100644 --- a/etc/api/cloudbuild/v1/cloudbuild-api.json +++ b/etc/api/cloudbuild/v1/cloudbuild-api.json @@ -1,24 +1,813 @@ { + "title": "Google Cloud Container Builder API", + "ownerName": "Google", + "resources": { + "operations": { + "methods": { + "cancel": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "required": true, + "type": "string", + "pattern": "^operations/.+$", + "location": "path" + } + }, + "flatPath": "v1/operations/{operationsId}:cancel", + "path": "v1/{+name}:cancel", + "id": "cloudbuild.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`.", + "request": { + "$ref": "CancelOperationRequest" + } + }, + "list": { + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "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.", + "type": "string", + "location": "query" + }, + "name": { + "description": "The name of the operation's parent resource.", + "required": true, + "type": "string", + "pattern": "^operations$", + "location": "path" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/operations", + "path": "v1/{+name}", + "id": "cloudbuild.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." + }, + "get": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^operations/.+$", + "location": "path", + "description": "The name of the operation resource." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/operations/{operationsId}", + "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." + } + } + }, + "projects": { + "resources": { + "builds": { + "methods": { + "get": { + "response": { + "$ref": "Build" + }, + "parameterOrder": [ + "projectId", + "id" + ], + "httpMethod": "GET", + "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}", + "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": { + "type": "string", + "location": "query", + "description": "The raw filter text to constrain the results." + }, + "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": { + "required": true, + "type": "string", + "location": "path", + "description": "ID of the project." + } + }, + "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": { + "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" + }, + "httpMethod": "POST", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "Operation" + }, + "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", + "id": "cloudbuild.projects.builds.create", + "path": "v1/projects/{projectId}/builds" + }, + "cancel": { + "request": { + "$ref": "CancelBuildRequest" + }, + "description": "Cancels a requested build in progress.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "id" + ], + "response": { + "$ref": "Build" + }, + "parameters": { + "projectId": { + "required": true, + "type": "string", + "location": "path", + "description": "ID of the project." + }, + "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}:cancel", + "id": "cloudbuild.projects.builds.cancel", + "path": "v1/projects/{projectId}/builds/{id}:cancel" + }, + "retry": { + "flatPath": "v1/projects/{projectId}/builds/{id}:retry", + "path": "v1/projects/{projectId}/builds/{id}:retry", + "id": "cloudbuild.projects.builds.retry", + "request": { + "$ref": "RetryBuildRequest" + }, + "description": "Creates a new build based on the given build.\n\nThis API creates a new build using the original build request, which may\nor may not result in an identical build.\n\nFor triggered builds:\n\n* Triggered builds resolve to a precise revision, so a retry of a triggered\nbuild will result in a build that uses the same revision.\n\nFor non-triggered builds that specify RepoSource:\n\n* If the original build built from the tip of a branch, the retried build\nwill build from the tip of that branch, which may not be the same revision\nas the original build.\n* If the original build specified a commit sha or revision ID, the retried\nbuild will use the identical source.\n\nFor builds that specify StorageSource:\n\n* If the original build pulled source from Cloud Storage without specifying\nthe generation of the object, the new build will use the current object,\nwhich may be different from the original build source.\n* If the original build pulled source from Cloud Storage and specified the\ngeneration of the object, the new build will attempt to use the same\nobject, which may or may not be available depending on the bucket's\nlifecycle management settings.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "id" + ], + "httpMethod": "POST", + "parameters": { + "id": { + "required": true, + "type": "string", + "location": "path", + "description": "Build ID of the original build." + }, + "projectId": { + "location": "path", + "description": "ID of the project.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "triggers": { + "methods": { + "delete": { + "description": "Deletes an BuildTrigger by its project ID and trigger ID.\n\nThis API is experimental.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "projectId", + "triggerId" + ], + "httpMethod": "DELETE", + "parameters": { + "triggerId": { + "description": "ID of the BuildTrigger to delete.", + "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.delete" + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ListBuildTriggersResponse" + }, + "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", + "id": "cloudbuild.projects.triggers.list", + "path": "v1/projects/{projectId}/triggers", + "description": "Lists existing BuildTrigger.\n\nThis API is experimental." + }, + "create": { + "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.", + "required": true, + "type": "string", + "location": "path" + } + }, + "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" + } + }, + "run": { + "request": { + "$ref": "RepoSource" + }, + "description": "Runs a BuildTrigger at a particular source revision.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "triggerId" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "location": "path", + "description": "ID of the project.", + "required": true, + "type": "string" + }, + "triggerId": { + "location": "path", + "description": "ID of the trigger.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/triggers/{triggerId}:run", + "path": "v1/projects/{projectId}/triggers/{triggerId}:run", + "id": "cloudbuild.projects.triggers.run" + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "projectId", + "triggerId" + ], + "response": { + "$ref": "BuildTrigger" + }, + "parameters": { + "triggerId": { + "location": "path", + "description": "ID of the BuildTrigger to update.", + "required": true, + "type": "string" + }, + "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}", + "id": "cloudbuild.projects.triggers.patch", + "path": "v1/projects/{projectId}/triggers/{triggerId}", + "request": { + "$ref": "BuildTrigger" + }, + "description": "Updates an BuildTrigger by its project ID and trigger ID.\n\nThis API is experimental." + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "BuildTrigger" + }, + "parameterOrder": [ + "projectId", + "triggerId" + ], + "parameters": { + "triggerId": { + "description": "ID of the BuildTrigger to get.", + "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}", + "id": "cloudbuild.projects.triggers.get", + "path": "v1/projects/{projectId}/triggers/{triggerId}", + "description": "Gets information about a BuildTrigger.\n\nThis API is experimental." + } + } + } + } + } + }, + "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" + }, + "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" + }, + "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": { + "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": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "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" + ] + } + }, + "version": "v1", + "baseUrl": "https://cloudbuild.googleapis.com/", + "servicePath": "", + "description": "Builds container images in the cloud.", + "kind": "discovery#restDescription", + "basePath": "", + "revision": "20171205", + "documentationLink": "https://cloud.google.com/container-builder/docs/", + "id": "cloudbuild: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 `{}`.", + "Source": { "type": "object", - "properties": {}, - "id": "Empty" + "properties": { + "storageSource": { + "$ref": "StorageSource", + "description": "If provided, get the source from this location in Google Cloud Storage." + }, + "repoSource": { + "$ref": "RepoSource", + "description": "If provided, get source from this location in a Cloud Repo." + } + }, + "id": "Source", + "description": "Source describes the location of the source in a supported storage\nservice." + }, + "RetryBuildRequest": { + "id": "RetryBuildRequest", + "description": "RetryBuildRequest specifies a build to retry.", + "type": "object", + "properties": {} + }, + "BuildOperationMetadata": { + "description": "Metadata for build operations.", + "type": "object", + "properties": { + "build": { + "$ref": "Build", + "description": "The build that the operation is tracking." + } + }, + "id": "BuildOperationMetadata" + }, + "SourceProvenance": { + "id": "SourceProvenance", + "description": "Provenance of the source. Ways to find the original source, or verify that\nsome source was used for this build.", + "type": "object", + "properties": { + "resolvedRepoSource": { + "$ref": "RepoSource", + "description": "A copy of the build's source.repo_source, if exists, with any\nrevisions resolved." + }, + "resolvedStorageSource": { + "$ref": "StorageSource", + "description": "A copy of the build's source.storage_source, if exists, with any\ngenerations resolved." + }, + "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", + "additionalProperties": { + "$ref": "FileHashes" + } + } + } + }, + "CancelOperationRequest": { + "id": "CancelOperationRequest", + "description": "The request message for Operations.CancelOperation.", + "type": "object", + "properties": {} + }, + "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": { + "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": { + "$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": { + "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." + } + } + }, + "BuildStep": { + "properties": { + "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.", + "type": "string" + }, + "entrypoint": { + "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" + }, + "id": { + "type": "string", + "description": "Optional unique identifier for this build step, used in wait_for to\nreference this build step as a dependency." + }, + "secretEnv": { + "type": "array", + "items": { + "type": "string" + }, + "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." + }, + "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.", + "type": "array", + "items": { + "$ref": "Volume" + } + }, + "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": { + "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", + "items": { + "type": "string" + } + }, + "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" + } + } + }, + "id": "BuildStep", + "description": "BuildStep describes a step to perform in the build pipeline.", + "type": "object" + }, + "RepoSource": { + "type": "object", + "properties": { + "commitSha": { + "type": "string", + "description": "Explicit commit SHA to build." + }, + "dir": { + "description": "Directory, relative to the source root, in which to run the build.", + "type": "string" + }, + "branchName": { + "description": "Name of the branch to build.", + "type": "string" + }, + "tagName": { + "type": "string", + "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" + } + }, + "id": "RepoSource", + "description": "RepoSource describes the location of the source in a Google Cloud Source\nRepository." + }, + "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": { + "description": "Collection of file hashes.", + "type": "array", + "items": { + "$ref": "Hash" + } + } + }, + "id": "FileHashes" + }, + "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": { + "type": "array", + "items": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "type": "object" + }, + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." + } + }, + "id": "Status" }, "BuildTrigger": { + "id": "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" + }, + "description": { + "description": "Human-readable description of this trigger.", + "type": "string" + }, "disabled": { "description": "If true, the trigger will never result in a build.", "type": "boolean" }, "createTime": { - "format": "google-datetime", "description": "Time when the trigger was created.\n\n@OutputOnly", + "format": "google-datetime", "type": "string" }, "triggerTemplate": { @@ -34,43 +823,18 @@ "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" + "description": "Contents of the build template.", + "$ref": "Build" } - }, - "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.", + "statusDetail": { + "description": "Customer-readable message about the current status.\n@OutputOnly", "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.", @@ -90,18 +854,21 @@ "INTERNAL_ERROR", "TIMEOUT", "CANCELLED" - ] + ], + "description": "Status of the build.\n@OutputOnly", + "type": "string" }, - "statusDetail": { - "description": "Customer-readable message about the current status.\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", "type": "string" }, "secrets": { - "description": "Secrets to decrypt using Cloud KMS.", + "type": "array", "items": { "$ref": "Secret" }, - "type": "array" + "description": "Secrets to decrypt using Cloud KMS." }, "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`.", @@ -113,10 +880,10 @@ }, "steps": { "description": "Describes the operations to be performed on the workspace.", + "type": "array", "items": { "$ref": "BuildStep" - }, - "type": "array" + } }, "buildTriggerId": { "description": "The ID of the BuildTrigger that triggered this build, if it was\ntriggered automatically.\n@OutputOnly", @@ -128,72 +895,82 @@ }, "tags": { "description": "Tags for annotation of a Build. These are not docker tags.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } + }, + "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.", - "type": "object" + "description": "Substitutions data for Build resource." }, - "startTime": { - "format": "google-datetime", - "description": "Time at which execution of the build was started.\n@OutputOnly", - "type": "string" + "createTime": { + "type": "string", + "description": "Time at which the request to create the build was received.\n@OutputOnly", + "format": "google-datetime" }, "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.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "projectId": { "description": "ID of the project.\n@OutputOnly.", "type": "string" }, + "finishTime": { + "type": "string", + "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" + }, "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" + "source": { + "$ref": "Source", + "description": "Describes where to find the source files to build." + }, + "options": { + "description": "Special options for this build.", + "$ref": "BuildOptions" } }, - "id": "Build" + "id": "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" }, "CancelBuildRequest": { - "description": "Request to cancel an ongoing build.", - "type": "object", "properties": {}, - "id": "CancelBuildRequest" + "id": "CancelBuildRequest", + "description": "Request to cancel an ongoing build.", + "type": "object" }, "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" + }, + "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" } }, "id": "Volume" @@ -208,52 +985,78 @@ }, "builds": { "description": "Builds will be sorted by create_time, descending.", + "type": "array", "items": { "$ref": "Build" - }, - "type": "array" + } } }, "id": "ListBuildsResponse" }, "ListOperationsResponse": { - "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.", + "type": "array", "items": { "$ref": "Operation" - }, - "type": "array" - }, - "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" + "id": "ListOperationsResponse", + "description": "The response message for Operations.ListOperations.", + "type": "object" }, "BuildOptions": { "description": "Optional arguments to enable specific features of builds.", "type": "object", "properties": { + "machineType": { + "description": "GCE VM size to run the build on.", + "type": "string", + "enumDescriptions": [ + "Standard machine type.", + "Highcpu machine with 8 CPUs.", + "Highcpu machine with 32 CPUs." + ], + "enum": [ + "UNSPECIFIED", + "N1_HIGHCPU_8", + "N1_HIGHCPU_32" + ] + }, + "logStreamingOption": { + "enumDescriptions": [ + "Service may automatically determine build log streaming behavior.", + "Build logs should be streamed to Google Cloud Storage.", + "Build logs should not be streamed to Google Cloud Storage; they will be\nwritten when the build is completed." + ], + "enum": [ + "STREAM_DEFAULT", + "STREAM_ON", + "STREAM_OFF" + ], + "description": "LogStreamingOption to define build log streaming behavior to Google Cloud\nStorage.", + "type": "string" + }, + "requestedVerifyOption": { + "enumDescriptions": [ + "Not a verifiable build. (default)", + "Verified build." + ], + "enum": [ + "NOT_VERIFIED", + "VERIFIED" + ], + "description": "Requested verifiability options.", + "type": "string" + }, "substitutionOption": { + "type": "string", "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." @@ -262,35 +1065,27 @@ "MUST_MATCH", "ALLOW_LOOSE" ], - "description": "SubstitutionOption to allow unmatch substitutions.", + "description": "SubstitutionOption to allow unmatch substitutions." + }, + "diskSizeGb": { + "description": "Requested disk size for the VM that runs the build. Note that this is *NOT*\n\"disk free\"; some of the space will be used by the operating system and\nbuild utilities. Also note that this is the minimum disk size that will be\nallocated for the build -- the build may run with a larger disk than\nrequested. At present, the maximum disk size is 1000GB; builds that request\nmore than the maximum are rejected with an error.", + "format": "int64", "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.", + "type": "array", "items": { + "type": "string", "enum": [ "NONE", "SHA256" - ], - "type": "string" + ] }, - "type": "array", "enumDescriptions": [ "No hash requested.", "Use a sha256 hash." - ] + ], + "description": "Requested hash for SourceProvenance." } }, "id": "BuildOptions" @@ -299,81 +1094,42 @@ "description": "StorageSource describes the location of the source in an archive file in\nGoogle Cloud Storage.", "type": "object", "properties": { + "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": { - "format": "int64", "description": "Google Cloud Storage generation for the object. If the generation is\nomitted, the latest generation will be used.", + "format": "int64", "type": "string" }, "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" } }, "id": "StorageSource" }, "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.", + "type": "array", "items": { "type": "string" }, - "type": "array" + "description": "List of build step digests, in order corresponding to build step indices." }, "images": { "description": "Images that were built as a part of the build.", + "type": "array", "items": { "$ref": "BuiltImage" - }, - "type": "array" + } } }, - "id": "Results" - }, - "BuildOperationMetadata": { - "description": "Metadata for build operations.", - "type": "object", - "properties": { - "build": { - "description": "The build that the operation is tracking.", - "$ref": "Build" - } - }, - "id": "BuildOperationMetadata" - }, - "SourceProvenance": { - "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." - }, - "resolvedStorageSource": { - "$ref": "StorageSource", - "description": "A copy of the build's source.storage_source, if exists, with any\ngenerations resolved." - } - }, - "id": "SourceProvenance" - }, - "CancelOperationRequest": { - "description": "The request message for Operations.CancelOperation.", - "type": "object", - "properties": {}, - "id": "CancelOperationRequest" + "id": "Results", + "description": "Results describes the artifacts created by the build pipeline.", + "type": "object" }, "ListBuildTriggersResponse": { "description": "Response containing existing BuildTriggers.", @@ -381,49 +1137,14 @@ "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.", - "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": { - "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" - }, "BuiltImage": { "description": "BuiltImage describes an image built by the pipeline.", "type": "object", @@ -439,96 +1160,18 @@ }, "id": "BuiltImage" }, - "BuildStep": { - "description": "BuildStep describes a step to perform in the build pipeline.", - "type": "object", - "properties": { - "entrypoint": { - "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.", - "items": { - "type": "string" - }, - "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.", - "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.", - "type": "string" - } - }, - "id": "BuildStep" - }, - "RepoSource": { - "description": "RepoSource describes the location of the source in a Google Cloud Source\nRepository.", - "type": "object", - "properties": { - "branchName": { - "description": "Name of the branch to build.", - "type": "string" - }, - "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": { + "value": { + "description": "The hash value.", + "format": "byte", + "type": "string" + }, "type": { + "description": "The type of hash that was performed.", + "type": "string", "enumDescriptions": [ "No hash requested.", "Use a sha256 hash." @@ -536,82 +1179,40 @@ "enum": [ "NONE", "SHA256" - ], - "description": "The type of hash that was performed.", - "type": "string" - }, - "value": { - "format": "byte", - "description": "The hash value.", - "type": "string" + ] } }, "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": { - "description": "Collection of file hashes.", - "items": { - "$ref": "Hash" - }, - "type": "array" - } - }, - "id": "FileHashes" - }, "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": { + "kmsKeyName": { + "description": "Cloud KMS key name to use to decrypt these envs.", + "type": "string" + }, "secretEnv": { + "type": "object", "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" + "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." } }, - "id": "Secret" + "id": "Secret", + "description": "Secret pairs a set of secret environment variables containing encrypted\nvalues with the Cloud KMS key to use to decrypt the value." }, - "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": { "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" + "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 `{}`." } }, "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 Build", @@ -627,495 +1228,5 @@ "rootUrl": "https://cloudbuild.googleapis.com/", "ownerDomain": "google.com", "name": "cloudbuild", - "batchPath": "batch", - "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" + "batchPath": "batch" } diff --git a/etc/api/clouddebugger/v2/clouddebugger-api.json b/etc/api/clouddebugger/v2/clouddebugger-api.json index e534a8b4bf..df9459c4d7 100644 --- a/etc/api/clouddebugger/v2/clouddebugger-api.json +++ b/etc/api/clouddebugger/v2/clouddebugger-api.json @@ -1,637 +1,9 @@ { - "version": "v2", - "baseUrl": "https://clouddebugger.googleapis.com/", - "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": "20170919", - "discoveryVersion": "v1", - "version_module": true, - "schemas": { - "GitSourceContext": { - "type": "object", - "properties": { - "revisionId": { - "type": "string", - "description": "Git commit hash.\nrequired." - }, - "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." - }, - "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." - }, - "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": { - "$ref": "AliasContext", - "description": "An alias, which may be a branch or tag." - }, - "revisionId": { - "type": "string", - "description": "A revision ID." - }, - "aliasName": { - "type": "string", - "description": "The name of an alias (branch, tag, etc.)." - } - }, - "id": "CloudRepoSourceContext" - }, - "RegisterDebuggeeResponse": { - "description": "Response for registering a debuggee.", - "type": "object", - "properties": { - "debuggee": { - "$ref": "Debuggee", - "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" - }, - "RegisterDebuggeeRequest": { - "description": "Request to register a debuggee.", - "type": "object", - "properties": { - "debuggee": { - "$ref": "Debuggee", - "description": "Debuggee information to register.\nThe fields `project`, `uniquifier`, `description` and `agent_version`\nof the debuggee must be set." - } - }, - "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" - }, - "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": { - "refersTo": { - "type": "string", - "enumDescriptions": [ - "Status doesn't refer to any particular input.", - "Status applies to the breakpoint and is related to its location.", - "Status applies to the breakpoint and is related to its condition.", - "Status applies to the breakpoint and is related to its expressions.", - "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)." - ], - "enum": [ - "UNSPECIFIED", - "BREAKPOINT_SOURCE_LOCATION", - "BREAKPOINT_CONDITION", - "BREAKPOINT_EXPRESSION", - "BREAKPOINT_AGE", - "VARIABLE_NAME", - "VARIABLE_VALUE" - ], - "description": "Reference to which the message applies." - }, - "description": { - "$ref": "FormatMessage", - "description": "Status message text." - }, - "isError": { - "type": "boolean", - "description": "Distinguishes errors from informational messages." - } - }, - "id": "StatusMessage" - } - }, + "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": "Cloud Debugger", "auth": { "oauth2": { @@ -652,141 +24,38 @@ "title": "Stackdriver Debugger API", "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" - ], + "parameterOrder": [], + "httpMethod": "GET", "parameters": { - "project": { - "location": "query", - "description": "Project number of a Google Cloud project whose debuggees to list.", - "type": "string" - }, "clientVersion": { + "type": "string", "location": "query", - "description": "The client version making the call.\nSchema: `domain/type/version` (e.g., `google.com/intellij/v1`).", - "type": "string" + "description": "The client version making the call.\nSchema: `domain/type/version` (e.g., `google.com/intellij/v1`)." }, "includeInactive": { "type": "boolean", "location": "query", "description": "When set to `true`, the result includes all debuggees. Otherwise, the\nresult includes only debuggees that are active." + }, + "project": { + "type": "string", + "location": "query", + "description": "Project number of a Google Cloud project whose debuggees to list." } }, + "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" @@ -795,6 +64,39 @@ "resources": { "breakpoints": { "methods": { + "set": { + "httpMethod": "POST", + "parameterOrder": [ + "debuggeeId" + ], + "response": { + "$ref": "SetBreakpointResponse" + }, + "parameters": { + "debuggeeId": { + "location": "path", + "description": "ID of the debuggee where the breakpoint is to be set.", + "required": true, + "type": "string" + }, + "clientVersion": { + "type": "string", + "location": "query", + "description": "The client version making the call.\nSchema: `domain/type/version` (e.g., `google.com/intellij/v1`)." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ], + "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints/set", + "id": "clouddebugger.debugger.debuggees.breakpoints.set", + "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/set", + "request": { + "$ref": "Breakpoint" + }, + "description": "Sets the breakpoint to the debuggee." + }, "delete": { "response": { "$ref": "Empty" @@ -804,85 +106,103 @@ "breakpointId" ], "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ], "parameters": { + "debuggeeId": { + "location": "path", + "description": "ID of the debuggee whose breakpoint to delete.", + "required": true, + "type": "string" + }, "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.", + "required": true, "type": "string", - "required": true - }, - "debuggeeId": { "location": "path", - "description": "ID of the debuggee whose breakpoint to delete.", - "type": "string", - "required": true + "description": "ID of the breakpoint to delete." } }, - "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}", + "id": "clouddebugger.debugger.debuggees.breakpoints.delete", "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" - ], + "get": { "response": { - "$ref": "SetBreakpointResponse" + "$ref": "GetBreakpointResponse" }, + "parameterOrder": [ + "debuggeeId", + "breakpointId" + ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud_debugger" ], "parameters": { + "debuggeeId": { + "required": true, + "type": "string", + "location": "path", + "description": "ID of the debuggee whose breakpoint to get." + }, "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.", + "breakpointId": { + "required": true, "type": "string", - "required": true + "location": "path", + "description": "ID of the breakpoint to get." } - } + }, + "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", + "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", + "id": "clouddebugger.debugger.debuggees.breakpoints.get", + "description": "Gets breakpoint information." }, "list": { + "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints", + "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints", + "id": "clouddebugger.debugger.debuggees.breakpoints.list", "description": "Lists all breakpoints for the debuggee.", - "httpMethod": "GET", - "parameterOrder": [ - "debuggeeId" - ], "response": { "$ref": "ListBreakpointsResponse" }, + "parameterOrder": [ + "debuggeeId" + ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud_debugger" ], "parameters": { - "clientVersion": { + "debuggeeId": { + "required": true, "type": "string", + "location": "path", + "description": "ID of the debuggee whose breakpoints to list." + }, + "waitToken": { "location": "query", - "description": "The client version making the call.\nSchema: `domain/type/version` (e.g., `google.com/intellij/v1`)." + "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" + }, + "clientVersion": { + "location": "query", + "description": "The client version making the call.\nSchema: `domain/type/version` (e.g., `google.com/intellij/v1`).", + "type": "string" }, "action.value": { "location": "query", @@ -907,59 +227,111 @@ "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`." - }, + } + } + } + } + } + } + } + } + }, + "controller": { + "resources": { + "debuggees": { + "methods": { + "register": { + "flatPath": "v2/controller/debuggees/register", + "path": "v2/controller/debuggees/register", + "id": "clouddebugger.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.", + "response": { + "$ref": "RegisterDebuggeeResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ] + } + }, + "resources": { + "breakpoints": { + "methods": { + "list": { + "flatPath": "v2/controller/debuggees/{debuggeeId}/breakpoints", + "path": "v2/controller/debuggees/{debuggeeId}/breakpoints", + "id": "clouddebugger.controller.debuggees.breakpoints.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": { "debuggeeId": { - "location": "path", - "description": "ID of the debuggee whose breakpoints to list.", + "required": true, "type": "string", - "required": true + "location": "path", + "description": "Identifies the debuggee." + }, + "successOnTimeout": { + "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.", + "type": "boolean" }, "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`." + "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\"`." } }, - "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" + ] + }, + "update": { + "flatPath": "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}", + "id": "clouddebugger.controller.debuggees.breakpoints.update", + "path": "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}", + "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.", + "httpMethod": "PUT", + "parameterOrder": [ + "debuggeeId", + "id" ], + "response": { + "$ref": "UpdateActiveBreakpointResponse" + }, "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.", + "description": "Identifies the debuggee being debugged.", + "required": true, + "type": "string" + }, + "id": { + "required": true, "type": "string", - "required": true + "location": "path", + "description": "Breakpoint identifier, unique in the scope of the debuggee." } }, - "flatPath": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", - "id": "clouddebugger.debugger.debuggees.breakpoints.get", - "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", - "description": "Gets breakpoint information." + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ] } } } @@ -969,16 +341,47 @@ } }, "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": { + "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" + "type": "boolean", + "default": "true" }, "oauth_token": { - "type": "string", "location": "query", - "description": "OAuth 2.0 token for the current user." + "description": "OAuth 2.0 token for the current user.", + "type": "string" }, "bearer_token": { "type": "string", @@ -991,25 +394,20 @@ "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." }, "prettyPrint": { - "default": "true", "type": "boolean", + "default": "true", "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", + "fields": { "location": "query", - "description": "JSONP" + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" }, "$.xgafv": { "location": "query", @@ -1024,36 +422,638 @@ "v2 error format" ] }, - "alt": { + "callback": { "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" - ] + "description": "JSONP", + "type": "string" + } + }, + "version": "v2", + "baseUrl": "https://clouddebugger.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Examines the call stack and variables of a running application without stopping or slowing it down.\n", + "servicePath": "", + "basePath": "", + "revision": "20171016", + "documentationLink": "http://cloud.google.com/debugger", + "id": "clouddebugger:v2", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "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": { + "type": "string", + "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.`" + } + }, + "id": "FormatMessage" }, - "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." + "ExtendedSourceContext": { + "type": "object", + "properties": { + "context": { + "$ref": "SourceContext", + "description": "Any source context." + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Labels with user defined metadata." + } + }, + "id": "ExtendedSourceContext", + "description": "An ExtendedSourceContext is a SourceContext combined with additional\ndetails describing the context." }, - "access_token": { - "type": "string", - "location": "query", - "description": "OAuth access token." + "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.", + "type": "array", + "items": { + "$ref": "Debuggee" + } + } + }, + "id": "ListDebuggeesResponse", + "description": "Response for listing debuggees." }, - "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." + "AliasContext": { + "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", + "description": "An alias to a repo revision." + }, + "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": { + "type": "object", + "properties": { + "line": { + "description": "Line inside the file. The first line in the file has the value `1`.", + "format": "int32", + "type": "integer" + }, + "path": { + "type": "string", + "description": "Path to the source file within the source context of the target binary." + } + }, + "id": "SourceLocation", + "description": "Represents a location in the source code." + }, + "Debuggee": { + "type": "object", + "properties": { + "sourceContexts": { + "description": "References to the locations and revisions of the source code used in the\ndeployed application.", + "type": "array", + "items": { + "$ref": "SourceContext" + } + }, + "extSourceContexts": { + "type": "array", + "items": { + "$ref": "ExtendedSourceContext" + }, + "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" + }, + "isInactive": { + "type": "boolean", + "description": "If set to `true`, indicates that Controller service does not detect any\nactivity from the debuggee agents and the application is possibly stopped." + }, + "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." + }, + "project": { + "type": "string", + "description": "Project the debuggee is associated with.\nUse project number or id when registering a Google Cloud Platform project." + }, + "id": { + "description": "Unique identifier for the debuggee generated by the controller service.", + "type": "string" + }, + "agentVersion": { + "description": "Version ID of the agent.\nSchema: `domain/language-platform/vmajor.minor` (for example\n`google.com/java-gcp/v1.1`).", + "type": "string" + }, + "isDisabled": { + "description": "If set to `true`, indicates that the agent should disable itself and\ndetach from the debuggee.", + "type": "boolean" + }, + "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." + } + }, + "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": { + "type": "array", + "items": { + "$ref": "Breakpoint" + }, + "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": { + "description": "A 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." + }, + "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": { + "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" + }, + "CloudWorkspaceSourceContext": { + "description": "A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot.", + "type": "object", + "properties": { + "workspaceId": { + "$ref": "CloudWorkspaceId", + "description": "The ID of the workspace." + }, + "snapshotId": { + "description": "The ID of the snapshot.\nAn empty snapshot_id refers to the most recent snapshot.", + "type": "string" + } + }, + "id": "CloudWorkspaceSourceContext" + }, + "UpdateActiveBreakpointResponse": { + "type": "object", + "properties": {}, + "id": "UpdateActiveBreakpointResponse", + "description": "Response for updating an active breakpoint.\nThe message is defined to allow future extensions." + }, + "GerritSourceContext": { + "description": "A SourceContext referring to a Gerrit project.", + "type": "object", + "properties": { + "hostUri": { + "type": "string", + "description": "The URI of a running Gerrit instance." + }, + "revisionId": { + "description": "A revision (commit) ID.", + "type": "string" + }, + "aliasName": { + "description": "The name of an alias (branch, tag, etc.).", + "type": "string" + }, + "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." + } + }, + "id": "GerritSourceContext" + }, + "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": { + "$ref": "RepoId", + "description": "The ID of the repo containing the workspace." + }, + "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": { + "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.", + "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", + "description": "Response for listing breakpoints." + }, + "Breakpoint": { + "type": "object", + "properties": { + "location": { + "$ref": "SourceLocation", + "description": "Breakpoint source location." + }, + "finalTime": { + "type": "string", + "description": "Time this breakpoint was finalized as seen by the server in seconds\nresolution.", + "format": "google-datetime" + }, + "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" + } + }, + "createTime": { + "type": "string", + "description": "Time this breakpoint was created by the server in seconds resolution.", + "format": "google-datetime" + }, + "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": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A set of custom breakpoint properties, populated by the agent, to be\ndisplayed to the user." + }, + "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": { + "type": "boolean", + "description": "When true, indicates that this is a final result and the\nbreakpoint state will not change from here on." + }, + "stackFrames": { + "type": "array", + "items": { + "$ref": "StackFrame" + }, + "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." + }, + "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": { + "type": "string", + "description": "E-mail address of the user that created this breakpoint" + }, + "action": { + "enum": [ + "CAPTURE", + "LOG" + ], + "description": "Action that the agent should perform when the code at the\nbreakpoint location is hit.", + "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." + ] + }, + "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." + } + }, + "id": "Breakpoint", + "description": "Represents the breakpoint specification, status and results." + }, + "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." + }, + "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." + }, + "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", + "properties": { + "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." + }, + "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." + } + }, + "id": "SourceContext" + }, + "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": { + "$ref": "AliasContext", + "description": "An alias, which may be a branch or tag." + }, + "revisionId": { + "type": "string", + "description": "A revision ID." + }, + "aliasName": { + "description": "The name of an alias (branch, tag, etc.).", + "type": "string" + } + }, + "id": "CloudRepoSourceContext" + }, + "RegisterDebuggeeResponse": { + "type": "object", + "properties": { + "debuggee": { + "$ref": "Debuggee", + "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", + "description": "Response for registering a debuggee." + }, + "RegisterDebuggeeRequest": { + "description": "Request to register a debuggee.", + "type": "object", + "properties": { + "debuggee": { + "$ref": "Debuggee", + "description": "Debuggee information to register.\nThe fields `project`, `uniquifier`, `description` and `agent_version`\nof the debuggee must be set." + } + }, + "id": "RegisterDebuggeeRequest" + }, + "GetBreakpointResponse": { + "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." + }, + "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": { + "type": "boolean", + "description": "Distinguishes errors from informational messages." + }, + "description": { + "$ref": "FormatMessage", + "description": "Status message text." + }, + "refersTo": { + "type": "string", + "enumDescriptions": [ + "Status doesn't refer to any particular input.", + "Status applies to the breakpoint and is related to its location.", + "Status applies to the breakpoint and is related to its condition.", + "Status applies to the breakpoint and is related to its expressions.", + "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)." + ], + "enum": [ + "UNSPECIFIED", + "BREAKPOINT_SOURCE_LOCATION", + "BREAKPOINT_CONDITION", + "BREAKPOINT_EXPRESSION", + "BREAKPOINT_AGE", + "VARIABLE_NAME", + "VARIABLE_VALUE" + ], + "description": "Reference to which the message applies." + } + }, + "id": "StatusMessage" + }, + "GitSourceContext": { + "description": "A GitSourceContext denotes a particular revision in a third party Git\nrepository (e.g. GitHub).", + "type": "object", + "properties": { + "revisionId": { + "type": "string", + "description": "Git commit hash.\nrequired." + }, + "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": { + "members": { + "type": "array", + "items": { + "$ref": "Variable" + }, + "description": "Members contained or pointed to by the 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`" + }, + "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" + } + }, + "id": "Variable" + }, + "StackFrame": { + "type": "object", + "properties": { + "location": { + "$ref": "SourceLocation", + "description": "Source location of the call site." + }, + "function": { + "type": "string", + "description": "Demangled function name at the call site." + }, + "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" + } + } + }, + "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." } } } diff --git a/etc/api/clouderrorreporting/v1beta1/clouderrorreporting-api.json b/etc/api/clouderrorreporting/v1beta1/clouderrorreporting-api.json index 6d2f95fc81..74b3bb54ed 100644 --- a/etc/api/clouderrorreporting/v1beta1/clouderrorreporting-api.json +++ b/etc/api/clouderrorreporting/v1beta1/clouderrorreporting-api.json @@ -1,349 +1,4 @@ { - "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": { @@ -364,6 +19,8 @@ "projects": { "methods": { "deleteEvents": { + "path": "v1beta1/{+projectName}/events", + "id": "clouderrorreporting.projects.deleteEvents", "description": "Deletes all error events of a given project.", "response": { "$ref": "DeleteEventsResponse" @@ -375,8 +32,8 @@ "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`.", - "type": "string", "required": true, + "type": "string", "pattern": "^projects/[^/]+$", "location": "path" } @@ -384,15 +41,15 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1beta1/projects/{projectsId}/events", - "id": "clouderrorreporting.projects.deleteEvents", - "path": "v1beta1/{+projectName}/events" + "flatPath": "v1beta1/projects/{projectsId}/events" } }, "resources": { "events": { "methods": { "list": { + "id": "clouderrorreporting.projects.events.list", + "path": "v1beta1/{+projectName}/events", "description": "Lists the specified events.", "httpMethod": "GET", "parameterOrder": [ @@ -401,43 +58,18 @@ "response": { "$ref": "ListEventsResponse" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], "parameters": { - "groupId": { - "type": "string", + "serviceFilter.version": { "location": "query", - "description": "[Required] The group for which events shall be returned." - }, - "serviceFilter.service": { - "type": "string", - "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.", + "description": "[Optional] The exact value to match against\n[`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version).", "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).", + "serviceFilter.resourceType": { + "description": "[Optional] The exact value to match against\n[`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type).", "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", @@ -447,91 +79,24 @@ "PERIOD_1_WEEK", "PERIOD_30_DAYS" ], - "description": "Restricts the query to the specified time range." + "description": "Restricts the query to the specified time range.", + "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`.", - "type": "string", "required": true, + "type": "string", "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", - "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" - ] }, "groupId": { - "repeated": true, + "description": "[Required] The group for which events shall be returned.", + "type": "string", + "location": "query" + }, + "pageToken": { "location": "query", - "description": "[Optional] List all \u003ccode\u003eErrorGroupStats\u003c/code\u003e with these IDs.", + "description": "[Optional] A `next_page_token` provided by a previous response.", "type": "string" }, "serviceFilter.service": { @@ -541,92 +106,53 @@ }, "pageSize": { "location": "query", + "description": "[Optional] The maximum number of results to return per response.", "format": "int32", - "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": { - "type": "string", - "location": "query", - "enum": [ - "GROUP_ORDER_UNSPECIFIED", - "COUNT_DESC", - "LAST_SEEN_DESC", - "CREATED_DESC", - "AFFECTED_USERS_DESC" - ], - "description": "[Optional] The sort order in which the results are returned.\nDefault is `COUNT_DESC`." - }, - "alignmentTime": { - "format": "google-datetime", - "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 \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" - }, - "timedCountDuration": { - "type": "string", - "location": "query", - "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." + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/events" + }, + "report": { + "request": { + "$ref": "ReportedErrorEvent" + }, + "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", + "response": { + "$ref": "ReportErrorEventResponse" + }, + "parameterOrder": [ + "projectName" + ], + "httpMethod": "POST", + "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, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/events:report", + "path": "v1beta1/{+projectName}/events:report", + "id": "clouderrorreporting.projects.events.report" } } }, "groups": { "methods": { - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "groupName" - ], - "response": { + "update": { + "description": "Replace the data for the specified group.\nFails if the group does not exist.", + "request": { "$ref": "ErrorGroup" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "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", - "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" }, @@ -640,19 +166,148 @@ "parameters": { "name": { "description": "The group resource name.\nExample: \u003ccode\u003eprojects/my-project-123/groups/my-groupid\u003c/code\u003e", - "type": "string", "required": true, + "type": "string", "pattern": "^projects/[^/]+/groups/[^/]+$", "location": "path" } }, "flatPath": "v1beta1/projects/{projectsId}/groups/{groupsId}", - "id": "clouderrorreporting.projects.groups.update", "path": "v1beta1/{+name}", - "request": { + "id": "clouderrorreporting.projects.groups.update" + }, + "get": { + "description": "Get the specified group.", + "response": { "$ref": "ErrorGroup" }, - "description": "Replace the data for the specified group.\nFails if the group does not exist." + "parameterOrder": [ + "groupName" + ], + "httpMethod": "GET", + "parameters": { + "groupName": { + "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/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/groups/{groupsId}", + "path": "v1beta1/{+groupName}", + "id": "clouderrorreporting.projects.groups.get" + } + } + }, + "groupStats": { + "methods": { + "list": { + "response": { + "$ref": "ListGroupStatsResponse" + }, + "parameterOrder": [ + "projectName" + ], + "httpMethod": "GET", + "parameters": { + "alignment": { + "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`.", + "type": "string", + "location": "query" + }, + "groupId": { + "repeated": true, + "location": "query", + "description": "[Optional] List all \u003ccode\u003eErrorGroupStats\u003c/code\u003e with these IDs.", + "type": "string" + }, + "serviceFilter.service": { + "description": "[Optional] The exact value to match against\n[`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service).", + "type": "string", + "location": "query" + }, + "pageSize": { + "description": "[Optional] The maximum number of results to return per response.\nDefault is 20.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "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": { + "location": "query", + "enum": [ + "GROUP_ORDER_UNSPECIFIED", + "COUNT_DESC", + "LAST_SEEN_DESC", + "CREATED_DESC", + "AFFECTED_USERS_DESC" + ], + "description": "[Optional] The sort order in which the results are returned.\nDefault is `COUNT_DESC`.", + "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" + }, + "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" + }, + "projectName": { + "pattern": "^projects/[^/]+$", + "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, + "type": "string" + }, + "timedCountDuration": { + "description": "[Optional] The preferred duration for a single returned `TimedCount`.\nIf not set, no timed counts are returned.", + "format": "google-duration", + "type": "string", + "location": "query" + }, + "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.", + "type": "string" + }, + "timeRange.period": { + "location": "query", + "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.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/groupStats", + "path": "v1beta1/{+projectName}/groupStats", + "id": "clouderrorreporting.projects.groupStats.list", + "description": "Lists the specified groups." } } } @@ -660,15 +315,25 @@ } }, "parameters": { - "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "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", + "default": "true", "location": "query" }, "fields": { @@ -677,29 +342,31 @@ "type": "string" }, "uploadType": { + "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" + "type": "string" }, "$.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": { + "description": "Data format for response.", + "default": "json", "enum": [ "json", "media", @@ -711,14 +378,12 @@ "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", @@ -726,25 +391,360 @@ "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" - }, - "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." + "location": "query" } - } + }, + "version": "v1beta1", + "baseUrl": "https://clouderrorreporting.googleapis.com/", + "kind": "discovery#restDescription", + "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", + "servicePath": "", + "basePath": "", + "id": "clouderrorreporting:v1beta1", + "revision": "20171201", + "documentationLink": "https://cloud.google.com/error-reporting/", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "ListEventsResponse": { + "description": "Contains a set of requested error events.", + "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.", + "format": "google-datetime", + "type": "string" + }, + "errorEvents": { + "description": "The error events which match the given request.", + "type": "array", + "items": { + "$ref": "ErrorEvent" + } + } + }, + "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": { + "properties": { + "name": { + "description": "The group resource name.\nExample: \u003ccode\u003eprojects/my-project-123/groups/my-groupid\u003c/code\u003e", + "type": "string" + }, + "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" + } + } + }, + "id": "ErrorGroup", + "description": "Description of a group of similar error events.", + "type": "object" + }, + "ServiceContext": { + "description": "Describes a running service that sends errors.\nIts version changes over time and multiple versions can run in parallel.", + "type": "object", + "properties": { + "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" + }, + "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" + } + }, + "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": { + "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": { + "description": "1-based. 0 indicates that the line number is unknown.", + "format": "int32", + "type": "integer" + } + }, + "id": "SourceLocation" + }, + "ReportErrorEventResponse": { + "properties": {}, + "id": "ReportErrorEventResponse", + "description": "Response for reporting an individual error event.\nData may be added to this message in the future.", + "type": "object" + }, + "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": { + "url": { + "description": "The URL of the request.", + "type": "string" + }, + "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" + } + }, + "id": "HttpRequestContext" + }, + "ListGroupStatsResponse": { + "description": "Contains a set of requested error group stats.", + "type": "object", + "properties": { + "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" + } + }, + "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" + } + }, + "id": "ListGroupStatsResponse" + }, + "SourceReference": { + "properties": { + "repository": { + "description": "Optional. A URI string identifying the repository.\nExample: \"https://github.com/GoogleCloudPlatform/kubernetes.git\"", + "type": "string" + }, + "revisionId": { + "description": "The canonical and persistent identifier of the deployed revision.\nExample (git): \"0035781c50ec7aa23385dc841529ce8a4b70db1b\"", + "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": { + "properties": { + "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" + }, + "serviceContext": { + "description": "The `ServiceContext` for which this error was reported.", + "$ref": "ServiceContext" + }, + "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" + } + }, + "id": "ErrorEvent", + "description": "An error event which is returned by the Error Reporting system.", + "type": "object" + }, + "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" + }, + "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": { + "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" + }, + "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." + }, + "sourceReferences": { + "description": "Source code that was used to build the executable which has\ncaused the given error message.", + "type": "array", + "items": { + "$ref": "SourceReference" + } + }, + "httpRequest": { + "$ref": "HttpRequestContext", + "description": "The HTTP request which was processed when the error was\ntriggered." + } + }, + "id": "ErrorContext" + }, + "TrackingIssue": { + "description": "Information related to tracking the progress on resolving the error.", + "type": "object", + "properties": { + "url": { + "description": "A URL pointing to a related entry in an issue tracking system.\nExample: https://github.com/user/project/issues/4", + "type": "string" + } + }, + "id": "TrackingIssue" + }, + "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": { + "$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" + }, + "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" + }, + "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" + }, + "numAffectedServices": { + "description": "The total number of services with a non-zero error count for the given\nfilter criteria.", + "format": "int32", + "type": "integer" + }, + "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" + } + }, + "representative": { + "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.", + "$ref": "ErrorEvent" + }, + "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" + } + } + }, + "id": "ErrorGroupStats" + } + }, + "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" } diff --git a/etc/api/cloudfunctions/v1/cloudfunctions-api.json b/etc/api/cloudfunctions/v1/cloudfunctions-api.json index 79d21ea93c..b6cde7608d 100644 --- a/etc/api/cloudfunctions/v1/cloudfunctions-api.json +++ b/etc/api/cloudfunctions/v1/cloudfunctions-api.json @@ -1,52 +1,589 @@ { - "schemas": { - "Location": { - "type": "object", - "properties": { - "metadata": { - "type": "object", - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud Functions API", + "ownerName": "Google", + "resources": { + "operations": { + "methods": { + "list": { + "response": { + "$ref": "ListOperationsResponse" }, - "description": "Service-specific metadata. For example the available capacity at the given\nlocation." - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "name": { + "description": "The name of the operation's parent resource.", + "type": "string", + "location": "query" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "type": "integer", + "location": "query" + } }, - "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/operations", + "path": "v1/operations", + "id": "cloudfunctions.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." }, - "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": { + "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": "^operations/[^/]+$" + } + }, + "flatPath": "v1/operations/{operationsId}", + "path": "v1/{+name}", + "id": "cloudfunctions.operations.get" + } + } + }, + "projects": { + "resources": { + "locations": { + "methods": { + "list": { + "path": "v1/{+name}/locations", + "id": "cloudfunctions.projects.locations.list", + "description": "Lists information about the supported locations for this service.", + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "name": { + "description": "The resource that owns the locations collection, if applicable.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "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": "v1/projects/{projectsId}/locations" + } + }, + "resources": { + "functions": { + "methods": { + "delete": { + "id": "cloudfunctions.projects.locations.functions.delete", + "path": "v1/{+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.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "description": "The name of the function which should be deleted.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}" + }, + "list": { + "description": "Returns a list of functions that belong to the requested project.", + "response": { + "$ref": "ListFunctionsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageToken": { + "location": "query", + "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" + }, + "pageSize": { + "description": "Maximum number of functions to return per call.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "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.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions", + "path": "v1/{+parent}/functions", + "id": "cloudfunctions.projects.locations.functions.list" + }, + "call": { + "response": { + "$ref": "CallFunctionResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "location": "path", + "description": "The name of the function to be called.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:call", + "path": "v1/{+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." + }, + "create": { + "path": "v1/{+location}/functions", + "id": "cloudfunctions.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", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "location": { + "description": "The project and location in which the function should be created, specified\nin the format `projects/*/locations/*`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions" + }, + "generateUploadUrl": { + "response": { + "$ref": "GenerateUploadUrlResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "The project and location in which the Google Cloud Storage signed URL\nshould be generated, specified in the format `projects/*/locations/*", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl", + "path": "v1/{+parent}/functions:generateUploadUrl", + "id": "cloudfunctions.projects.locations.functions.generateUploadUrl", + "description": "Returns a signed URL for uploading a function source code.\nFor more information about the signed URL usage see:\nhttps://cloud.google.com/storage/docs/access-control/signed-urls\nOnce the function source code upload is complete, the used signed\nURL should be provided in CreateFunction or UpdateFunction request\nas a reference to the function source code.", + "request": { + "$ref": "GenerateUploadUrlRequest" + } + }, + "generateDownloadUrl": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "GenerateDownloadUrlResponse" + }, + "parameters": { + "name": { + "description": "The name of function for which source code Google Cloud Storage signed\nURL should be generated.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:generateDownloadUrl", + "id": "cloudfunctions.projects.locations.functions.generateDownloadUrl", + "path": "v1/{+name}:generateDownloadUrl", + "request": { + "$ref": "GenerateDownloadUrlRequest" + }, + "description": "Returns a signed URL for downloading deployed function source code.\nThe URL is only valid for a limited period and should be used within\nminutes after generation.\nFor more information about the signed URL usage see:\nhttps://cloud.google.com/storage/docs/access-control/signed-urls" + }, + "patch": { + "request": { + "$ref": "CloudFunction" + }, + "description": "Updates existing function.", + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "updateMask": { + "description": "Required list of fields to be updated in this request.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, + "name": { + "location": "path", + "description": "A user-defined name of the function. Function names must be unique\nglobally and match pattern `projects/*/locations/*/functions/*`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + "id": "cloudfunctions.projects.locations.functions.patch", + "path": "v1/{+name}" + }, + "get": { + "response": { + "$ref": "CloudFunction" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "location": "path", + "description": "The name of the function which details should be obtained.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + "path": "v1/{+name}", + "id": "cloudfunctions.projects.locations.functions.get", + "description": "Returns a function with the given name from the requested project." + } + } + } + } + } + } + } + }, + "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": { + "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": { + "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": { + "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": { + "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": { + "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://cloudfunctions.googleapis.com/", + "kind": "discovery#restDescription", + "description": "API for managing lightweight user-provided functions executed in response to events.", + "servicePath": "", + "basePath": "", + "revision": "20171206", + "documentationLink": "https://cloud.google.com/functions", + "id": "cloudfunctions:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "ListLocationsResponse": { + "properties": { + "locations": { + "description": "A list of locations that matches the specified filter in the request.", "type": "array", - "description": "A list of operations that matches the specified filter in the request." + "items": { + "$ref": "Location" + } }, "nextPageToken": { - "type": "string", - "description": "The standard List next-page token." + "description": "The standard List next-page token.", + "type": "string" } }, - "id": "ListOperationsResponse" + "id": "ListLocationsResponse", + "description": "The response message for Locations.ListLocations.", + "type": "object" + }, + "CallFunctionResponse": { + "properties": { + "executionId": { + "description": "Execution id of function invocation.", + "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" + }, + "error": { + "description": "Either system or user-function generated error. Set if execution\nwas not successful.", + "type": "string" + } + }, + "id": "CallFunctionResponse", + "description": "Response of `CallFunction` method.", + "type": "object" + }, + "EventTrigger": { + "properties": { + "eventType": { + "description": "Required. The type of event to observe. For example:\n`providers/cloud.storage/eventTypes/object.change` and\n`providers/cloud.pubsub/eventTypes/topic.publish`.\n\nEvent types match pattern `providers/*/eventTypes/*.*`.\nThe pattern contains:\n 1. namespace: For example, `cloud.storage` and\n `google.firebase.analytics`.\n 2. resource type: The type of resource on which event occurs. For\n example, the Google Cloud Storage API includes the type `object`.\n 3. action: The action that generates the event. For example, action for\n a Google Cloud Storage Object is 'change'.\nThese parts are lower case.", + "type": "string" + }, + "resource": { + "description": "Required. The resource(s) from which to observe events, for example,\n`projects/_/buckets/myBucket`.\n\nNot all syntactically correct values are accepted by all services. For\nexample:\n\n1. The authorization model must support it. Google Cloud Functions\n only allows EventTriggers to be deployed that observe resources in the\n same project as the `CloudFunction`.\n2. The resource type must match the pattern expected for an\n `event_type`. For example, an `EventTrigger` that has an\n `event_type` of \"google.pubsub.topic.publish\" should have a resource\n that matches Google Cloud Pub/Sub topics.\n\nAdditionally, some services may support short names when creating an\n`EventTrigger`. These will always be returned in the normalized \"long\"\nformat.\n\nSee each *service's* documentation for supported formats.", + "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": { + "description": "Specifies policy for failed executions.", + "$ref": "FailurePolicy" + } + }, + "id": "EventTrigger", + "description": "Describes EventTrigger, used to request events be sent from another\nservice.", + "type": "object" + }, + "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": { + "description": "If specified, then the function will be retried in case of a failure.", + "$ref": "Retry" + } + }, + "id": "FailurePolicy" + }, + "OperationMetadataV1": { + "description": "Metadata describing an Operation", + "type": "object", + "properties": { + "updateTime": { + "description": "The last update timestamp of the operation.", + "format": "google-datetime", + "type": "string" + }, + "target": { + "description": "Target of the operation - for example\nprojects/project-1/locations/region-1/functions/function-1", + "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.", + "type": "object" + }, + "versionId": { + "description": "Version id of the function created or updated by an API call.\nThis field is only pupulated for Create and Update operations.", + "format": "int64", + "type": "string" + }, + "type": { + "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" + ], + "description": "Type of operation.", + "type": "string" + } + }, + "id": "OperationMetadataV1" + }, + "GenerateDownloadUrlRequest": { + "description": "Request of `GenerateDownloadUrl` method.", + "type": "object", + "properties": { + "versionId": { + "description": "The optional version of function. If not set, default, current version\nis used.", + "format": "uint64", + "type": "string" + } + }, + "id": "GenerateDownloadUrlRequest" }, "Operation": { "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", @@ -61,17 +598,17 @@ "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`." + "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": { "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": "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" @@ -84,24 +621,28 @@ "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" + "updateTime": { + "description": "The last update timestamp of the operation.", + "format": "google-datetime", + "type": "string" }, - "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." + "target": { + "description": "Target of the operation - for example\nprojects/project-1/locations/region-1/functions/function-1", + "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" - }, - "description": "The original request that started the operation.", - "type": "object" + } + }, + "versionId": { + "description": "Version id of the function created or updated by an API call.\nThis field is only pupulated for Create and Update operations.", + "format": "int64", + "type": "string" }, "type": { "enum": [ @@ -121,59 +662,269 @@ } }, "id": "OperationMetadataV1Beta2", - "description": "Metadata describing an Operation" + "description": "Metadata describing an Operation", + "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 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": { - "format": "int32", "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 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." + "id": "Status" }, - "ListLocationsResponse": { + "CallFunctionRequest": { + "description": "Request for the `CallFunction` method.", "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" + "data": { + "description": "Input to be passed to the function.", + "type": "string" } }, - "id": "ListLocationsResponse", - "description": "The response message for Locations.ListLocations." + "id": "CallFunctionRequest" + }, + "SourceRepository": { + "properties": { + "url": { + "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/*/moveable-aliases/*/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/*/fixed-aliases/*/paths/*`\n\nYou may omit `paths/*` if you want to use the main directory.", + "type": "string" + }, + "deployedUrl": { + "description": "Output only. The URL pointing to the hosted repository where the function\nwere defined at the time of deployment. It always points to a specific\ncommit in the format described above.", + "type": "string" + } + }, + "id": "SourceRepository", + "description": "Describes SourceRepository, used to represent parameters related to\nsource repository where a function is hosted.", + "type": "object" + }, + "CloudFunction": { + "properties": { + "updateTime": { + "description": "Output only. The last update timestamp of a Cloud Function.", + "format": "google-datetime", + "type": "string" + }, + "httpsTrigger": { + "description": "An HTTPS endpoint type of source that can be triggered via URL.", + "$ref": "HttpsTrigger" + }, + "serviceAccountEmail": { + "description": "Output only. The email of the function's service account.", + "type": "string" + }, + "description": { + "description": "User-provided description of a function.", + "type": "string" + }, + "timeout": { + "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.", + "format": "google-duration", + "type": "string" + }, + "sourceUploadUrl": { + "description": "The Google Cloud Storage signed URL used for source uploading, generated\nby google.cloud.functions.v1.GenerateUploadUrl", + "type": "string" + }, + "eventTrigger": { + "description": "A source that fires events in response to a condition in another service.", + "$ref": "EventTrigger" + }, + "status": { + "enumDescriptions": [ + "Not specified. Invalid state.", + "Function has been succesfully deployed and is serving.", + "Function deployment failed and the function isn’t serving.", + "Function is being created or updated.", + "Function is being deleted.", + "Function deployment failed and the function serving state is undefined.\nThe function should be updated or deleted to move it out of this state." + ], + "enum": [ + "CLOUD_FUNCTION_STATUS_UNSPECIFIED", + "ACTIVE", + "OFFLINE", + "DEPLOY_IN_PROGRESS", + "DELETE_IN_PROGRESS", + "UNKNOWN" + ], + "description": "Output only. Status of the function deployment.", + "type": "string" + }, + "availableMemoryMb": { + "description": "The amount of memory in MB available for a function.\nDefaults to 256MB.", + "format": "int32", + "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": { + "description": "Output only.\nThe version identifier of the Cloud Function. Each deployment attempt\nresults in a new version of a function being created.", + "format": "int64", + "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": "**Beta Feature**\n\nThe source repository where a function is hosted.", + "$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" + } + } + }, + "id": "CloudFunction", + "description": "Describes a Cloud Function that contains user computation executed in\nresponse to an event. It encapsulate function and triggers configurations.", + "type": "object" + }, + "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" + }, + "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": { + "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" + }, + "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" + }, + "GenerateDownloadUrlResponse": { + "description": "Response of `GenerateDownloadUrl` method.", + "type": "object", + "properties": { + "downloadUrl": { + "description": "The generated Google Cloud Storage signed URL that should be used for\nfunction source code download.", + "type": "string" + } + }, + "id": "GenerateDownloadUrlResponse" + }, + "Retry": { + "properties": {}, + "id": "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" + }, + "GenerateUploadUrlRequest": { + "description": "Request of `GenerateSourceUploadUrl` method.", + "type": "object", + "properties": {}, + "id": "GenerateUploadUrlRequest" + }, + "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": "Operation" + } + } + }, + "id": "ListOperationsResponse", + "description": "The response message for Operations.ListOperations.", + "type": "object" + }, + "GenerateUploadUrlResponse": { + "description": "Response of `GenerateSourceUploadUrl` method.", + "type": "object", + "properties": { + "uploadUrl": { + "description": "The generated Google Cloud Storage signed URL that should be used for a\nfunction source code upload. The uploaded file should be a zip archive\nwhich contains a function.", + "type": "string" + } + }, + "id": "GenerateUploadUrlResponse" + }, + "ListFunctionsResponse": { + "description": "Response for the `ListFunctions` method.", + "type": "object", + "properties": { + "functions": { + "description": "The functions that match the request.", + "type": "array", + "items": { + "$ref": "CloudFunction" + } + }, + "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.v1.ListFunctionsRequest\nto get more functions.", + "type": "string" + } + }, + "id": "ListFunctionsResponse" } }, - "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" + }, "canonicalName": "Cloud Functions", "auth": { "oauth2": { @@ -187,224 +938,5 @@ "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 + "batchPath": "batch" } diff --git a/etc/api/cloudfunctions/v1beta2/cloudfunctions-api.json b/etc/api/cloudfunctions/v1beta2/cloudfunctions-api.json index d69a0005f4..e39514f26c 100644 --- a/etc/api/cloudfunctions/v1beta2/cloudfunctions-api.json +++ b/etc/api/cloudfunctions/v1beta2/cloudfunctions-api.json @@ -1,539 +1,89 @@ { - "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.", + "Location": { + "description": "A resource that represents Google Cloud Platform location.", "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.", + "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}", "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.", + "name": { + "description": "Resource name for the location, which may vary between implementations.\nFor example: `\"projects/example-project/locations/us-east1\"`", "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\"}", + "description": "Service-specific metadata. For example the available capacity at the given\nlocation.", "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" }, + "GenerateDownloadUrlResponse": { + "properties": { + "downloadUrl": { + "description": "The generated Google Cloud Storage signed URL that should be used for\nfunction source code download.", + "type": "string" + } + }, + "id": "GenerateDownloadUrlResponse", + "description": "Response of `GenerateDownloadUrl` method.", + "type": "object" + }, "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" }, + "GenerateUploadUrlRequest": { + "description": "Request of `GenerateUploadUrl` method.", + "type": "object", + "properties": {}, + "id": "GenerateUploadUrlRequest" + }, "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" + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "type": "array", + "items": { + "$ref": "Operation" + } } }, "id": "ListOperationsResponse" }, + "GenerateUploadUrlResponse": { + "description": "Response of `GenerateUploadUrl` method.", + "type": "object", + "properties": { + "uploadUrl": { + "description": "The generated Google Cloud Storage signed URL that should be used for a\nfunction source code upload. The uploaded file should be a zip archive\nwhich contains a function.", + "type": "string" + } + }, + "id": "GenerateUploadUrlResponse" + }, "ListFunctionsResponse": { "description": "Response for the `ListFunctions` method.", "type": "object", @@ -544,33 +94,14 @@ }, "functions": { "description": "The functions that match the request.", + "type": "array", "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", @@ -581,33 +112,52 @@ }, "locations": { "description": "A list of locations that matches the specified filter in the request.", + "type": "array", "items": { "$ref": "Location" - }, - "type": "array" + } } }, "id": "ListLocationsResponse" }, + "CallFunctionResponse": { + "properties": { + "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" + }, + "error": { + "description": "Either system or user-function generated error. Set if execution\nwas not successful.", + "type": "string" + }, + "executionId": { + "description": "Execution id of function invocation.", + "type": "string" + } + }, + "id": "CallFunctionResponse", + "description": "Response of `CallFunction` method.", + "type": "object" + }, "EventTrigger": { "description": "Describes EventTrigger, used to request events be sent from another\nservice.", "type": "object", "properties": { + "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/google.firebase.database/eventTypes/ref.write`", + "type": "string" + }, "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.", + "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" + "description": "Specifies policy for failed executions.", + "$ref": "FailurePolicy" } }, "id": "EventTrigger" @@ -628,67 +178,49 @@ "type": "object", "properties": { "retry": { - "$ref": "Retry", - "description": "If specified, then the function will be retried in case of a failure." + "description": "If specified, then the function will be retried in case of a failure.", + "$ref": "Retry" } }, "id": "FailurePolicy" }, - "Operation": { - "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", - "type": "object", + "GenerateDownloadUrlRequest": { "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`.", + "versionId": { + "description": "The optional version of function.", + "format": "uint64", "type": "string" } }, - "id": "Operation" + "id": "GenerateDownloadUrlRequest", + "description": "Request of `GenerateDownloadUrl` method.", + "type": "object" }, - "OperationMetadataV1Beta2": { + "OperationMetadataV1": { "description": "Metadata describing an Operation", "type": "object", "properties": { + "updateTime": { + "description": "The last update timestamp of the operation.", + "format": "google-datetime", + "type": "string" + }, "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" - } + }, + "description": "The original request that started the operation.", + "type": "object" + }, + "versionId": { + "description": "Version id of the function created or updated by an API call.\nThis field is only pupulated for Create and Update operations.", + "format": "int64", + "type": "string" }, "type": { "description": "Type of operation.", @@ -707,39 +239,146 @@ ] } }, + "id": "OperationMetadataV1" + }, + "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": { + "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": { + "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" + }, + "OperationMetadataV1Beta2": { + "description": "Metadata describing an Operation", + "type": "object", + "properties": { + "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" + }, + "versionId": { + "description": "Version id of the function created or updated by an API call.\nThis field is only pupulated for Create and Update operations.", + "format": "int64", + "type": "string" + }, + "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" + ] + }, + "updateTime": { + "description": "The last update timestamp of the operation.", + "format": "google-datetime", + "type": "string" + }, + "target": { + "description": "Target of the operation - for example\nprojects/project-1/locations/region-1/functions/function-1", + "type": "string" + } + }, "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": { + "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": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + } + }, "code": { - "format": "int32", "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 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" }, + "CallFunctionRequest": { + "properties": { + "data": { + "description": "Input to be passed to the function.", + "type": "string" + } + }, + "id": "CallFunctionRequest", + "description": "Request for the `CallFunction` method.", + "type": "object" + }, "SourceRepository": { "description": "Describes the location of the function source in a remote repository.", "type": "object", "properties": { + "branch": { + "description": "The name of the branch from which the function should be fetched.", + "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" + }, + "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" + }, + "revision": { + "description": "The id of the revision that captures the state of the repository from\nwhich the function should be fetched.", + "type": "string" + }, "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" @@ -747,42 +386,107 @@ "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", + "CloudFunction": { "properties": { - "data": { - "description": "Input to be passed to the function.", + "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": { + "$ref": "SourceRepository", + "description": "The hosted repository where the function is defined." + }, + "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": { + "additionalProperties": { + "type": "string" + }, + "description": "Labels associated with this Cloud Function.", + "type": "object" + }, + "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/*/moveable-aliases/*/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/*/fixed-aliases/*/paths/*`\n\nYou may omit `paths/*` if you want to use the main directory.", + "type": "string" + }, + "updateTime": { + "description": "Output only. The last update timestamp of a Cloud Function.", + "format": "google-datetime", + "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": { + "description": "An HTTPS endpoint type of source that can be triggered via URL.", + "$ref": "HTTPSTrigger" + }, + "sourceUploadUrl": { + "description": "The Google Cloud Storage signed URL used for source uploading, generated\nby google.cloud.functions.v1beta2.GenerateUploadUrl", + "type": "string" + }, + "eventTrigger": { + "$ref": "EventTrigger", + "description": "A source that fires events in response to a condition in another service." + }, + "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" + }, + "timeout": { + "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.", + "format": "google-duration", + "type": "string" + }, + "availableMemoryMb": { + "description": "The amount of memory in MB available for a function.\nDefaults to 256MB.", + "format": "int32", + "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": { + "description": "Output only.\nThe version identifier of the Cloud Function. Each deployment attempt\nresults in a new version of a function being created.", + "format": "int64", "type": "string" } }, - "id": "CallFunctionRequest" + "id": "CloudFunction", + "description": "Describes a Cloud Function that contains user computation executed in\nresponse to an event. It encapsulate function and triggers configurations.", + "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" }, "canonicalName": "Cloud Functions", "auth": { @@ -800,5 +504,451 @@ "batchPath": "batch", "fullyEncodeReservedExpansion": true, "title": "Google Cloud Functions API", - "ownerName": "Google" + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "locations": { + "methods": { + "list": { + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "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": { + "description": "The standard list page size.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/locations", + "path": "v1beta2/{+name}/locations", + "id": "cloudfunctions.projects.locations.list", + "description": "Lists information about the supported locations for this service." + } + }, + "resources": { + "functions": { + "methods": { + "generateUploadUrl": { + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl", + "path": "v1beta2/{+parent}/functions:generateUploadUrl", + "id": "cloudfunctions.projects.locations.functions.generateUploadUrl", + "description": "Returns a signed URL for uploading a function source code.\nFor more information about the signed URL usage see:\nhttps://cloud.google.com/storage/docs/access-control/signed-urls\nOnce the function source code upload is complete, the used signed\nURL should be provided in CreateFunction or UpdateFunction request\nas a reference to the function source code.", + "request": { + "$ref": "GenerateUploadUrlRequest" + }, + "response": { + "$ref": "GenerateUploadUrlResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "The project and location in which the Google Cloud Storage signed URL\nshould be generated, specified in the format `projects/*/locations/*", + "required": true, + "type": "string" + } + } + }, + "generateDownloadUrl": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "GenerateDownloadUrlResponse" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "location": "path", + "description": "The name of function for which source code Google Cloud Storage signed\nURL should be generated.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:generateDownloadUrl", + "id": "cloudfunctions.projects.locations.functions.generateDownloadUrl", + "path": "v1beta2/{+name}:generateDownloadUrl", + "request": { + "$ref": "GenerateDownloadUrlRequest" + }, + "description": "Returns a signed URL for downloading deployed function source code.\nThe URL is only valid for a limited period and should be used within\nminutes after generation.\nFor more information about the signed URL usage see:\nhttps://cloud.google.com/storage/docs/access-control/signed-urls" + }, + "get": { + "id": "cloudfunctions.projects.locations.functions.get", + "path": "v1beta2/{+name}", + "description": "Returns a function with the given name from the requested project.", + "httpMethod": "GET", + "response": { + "$ref": "CloudFunction" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the function which details should be obtained.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}" + }, + "update": { + "description": "Updates existing function.", + "request": { + "$ref": "CloudFunction" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "location": "path", + "description": "The name of the function to be updated.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + "path": "v1beta2/{+name}", + "id": "cloudfunctions.projects.locations.functions.update" + }, + "delete": { + "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.", + "httpMethod": "DELETE", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the function which should be deleted.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$" + } + }, + "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}" + }, + "list": { + "description": "Returns a list of functions that belong to the requested project.", + "response": { + "$ref": "ListFunctionsResponse" + }, + "parameterOrder": [ + "location" + ], + "httpMethod": "GET", + "parameters": { + "location": { + "location": "path", + "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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$" + }, + "pageToken": { + "location": "query", + "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" + }, + "pageSize": { + "description": "Maximum number of functions to return per call.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions", + "path": "v1beta2/{+location}/functions", + "id": "cloudfunctions.projects.locations.functions.list" + }, + "create": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "location" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "location": { + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "The project and location in which the function should be created, specified\nin the format `projects/*/locations/*`", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/functions", + "path": "v1beta2/{+location}/functions", + "id": "cloudfunctions.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" + } + }, + "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.", + "response": { + "$ref": "CallFunctionResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "description": "The name of the function to be called.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + }, + "operations": { + "methods": { + "list": { + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "name": { + "location": "query", + "description": "The name of the operation's parent resource.", + "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" + } + }, + "flatPath": "v1beta2/operations", + "path": "v1beta2/operations", + "id": "cloudfunctions.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." + }, + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "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" + ], + "flatPath": "v1beta2/operations/{operationsId}", + "id": "cloudfunctions.operations.get", + "path": "v1beta2/{+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." + } + } + } + }, + "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.", + "type": "boolean", + "default": "true", + "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": { + "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": { + "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.", + "type": "boolean", + "default": "true" + }, + "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" + } + }, + "version": "v1beta2", + "baseUrl": "https://cloudfunctions.googleapis.com/", + "kind": "discovery#restDescription", + "description": "API for managing lightweight user-provided functions executed in response to events.", + "servicePath": "", + "basePath": "", + "revision": "20171206", + "documentationLink": "https://cloud.google.com/functions", + "id": "cloudfunctions:v1beta2" } diff --git a/etc/api/cloudiot/v1/cloudiot-api.json b/etc/api/cloudiot/v1/cloudiot-api.json new file mode 100644 index 0000000000..7881f5e116 --- /dev/null +++ b/etc/api/cloudiot/v1/cloudiot-api.json @@ -0,0 +1,1311 @@ +{ + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "locations": { + "resources": { + "registries": { + "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.", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "resource": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field." + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}:getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "id": "cloudiot.projects.locations.registries.getIamPolicy" + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "DeviceRegistry" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the device registry. For example,\n`projects/example-project/locations/us-central1/registries/my-registry`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}", + "id": "cloudiot.projects.locations.registries.get", + "path": "v1/{+name}", + "description": "Gets a device registry configuration." + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "DeviceRegistry" + }, + "parameters": { + "name": { + "location": "path", + "description": "The resource path name. For example,\n`projects/example-project/locations/us-central1/registries/my-registry`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$" + }, + "updateMask": { + "location": "query", + "description": "Only updates the `device_registry` fields indicated by this mask.\nThe field mask must not be empty, and it must not contain fields that\nare immutable or only set by the server.\nMutable top-level fields: `event_notification_config`, `http_config`,\n`mqtt_config`, and `state_notification_config`.", + "format": "google-fieldmask", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}", + "id": "cloudiot.projects.locations.registries.patch", + "path": "v1/{+name}", + "request": { + "$ref": "DeviceRegistry" + }, + "description": "Updates a device registry configuration." + }, + "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" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "resource": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$", + "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}/locations/{locationsId}/registries/{registriesId}:testIamPermissions", + "id": "cloudiot.projects.locations.registries.testIamPermissions", + "path": "v1/{+resource}:testIamPermissions" + }, + "delete": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}", + "path": "v1/{+name}", + "id": "cloudiot.projects.locations.registries.delete", + "description": "Deletes a device registry configuration.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$", + "location": "path", + "description": "The name of the device registry. For example,\n`projects/example-project/locations/us-central1/registries/my-registry`." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ] + }, + "list": { + "description": "Lists device registries.", + "response": { + "$ref": "ListDeviceRegistriesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "parent": { + "location": "path", + "description": "The project and cloud region path. For example,\n`projects/example-project/locations/us-central1`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$" + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "The value returned by the last `ListDeviceRegistriesResponse`; indicates\nthat this is a continuation of a prior `ListDeviceRegistries` call, and\nthat the system should return the next page of data." + }, + "pageSize": { + "location": "query", + "description": "The maximum number of registries to return in the response. If this value\nis zero, the service will select a default size. A call may return fewer\nobjects than requested, but if there is a non-empty `page_token`, it\nindicates that more entries are available.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries", + "path": "v1/{+parent}/registries", + "id": "cloudiot.projects.locations.registries.list" + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "DeviceRegistry" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "parent": { + "location": "path", + "description": "The project and cloud region where this device registry must be created.\nFor example, `projects/example-project/locations/us-central1`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries", + "id": "cloudiot.projects.locations.registries.create", + "path": "v1/{+parent}/registries", + "description": "Creates a device registry that contains devices.", + "request": { + "$ref": "DeviceRegistry" + } + }, + "setIamPolicy": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "cloudiot.projects.locations.registries.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", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "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/[^/]+/locations/[^/]+/registries/[^/]+$" + } + } + } + }, + "resources": { + "devices": { + "methods": { + "get": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices/{devicesId}", + "id": "cloudiot.projects.locations.registries.devices.get", + "path": "v1/{+name}", + "description": "Gets details about a device.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Device" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+/devices/[^/]+$", + "location": "path", + "description": "The name of the device. For example,\n`projects/p0/locations/us-central1/registries/registry0/devices/device0` or\n`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`." + }, + "fieldMask": { + "type": "string", + "location": "query", + "description": "The fields of the `Device` resource to be returned in the response. If the\nfield mask is unset or empty, all fields are returned.", + "format": "google-fieldmask" + } + } + }, + "patch": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices/{devicesId}", + "path": "v1/{+name}", + "id": "cloudiot.projects.locations.registries.devices.patch", + "description": "Updates a device.", + "request": { + "$ref": "Device" + }, + "response": { + "$ref": "Device" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "name": { + "location": "path", + "description": "The resource path name. For example,\n`projects/p1/locations/us-central1/registries/registry0/devices/dev0` or\n`projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.\nWhen `name` is populated as a response from the service, it always ends\nin the device numeric ID.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+/devices/[^/]+$" + }, + "updateMask": { + "type": "string", + "location": "query", + "description": "Only updates the `device` fields indicated by this mask.\nThe field mask must not be empty, and it must not contain fields that\nare immutable or only set by the server.\nMutable top-level fields: `credentials`, `enabled_state`, and `metadata`", + "format": "google-fieldmask" + } + } + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+/devices/[^/]+$", + "location": "path", + "description": "The name of the device. For example,\n`projects/p0/locations/us-central1/registries/registry0/devices/device0` or\n`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices/{devicesId}", + "path": "v1/{+name}", + "id": "cloudiot.projects.locations.registries.devices.delete", + "description": "Deletes a device." + }, + "list": { + "description": "List devices in a device registry.", + "response": { + "$ref": "ListDevicesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "The value returned by the last `ListDevicesResponse`; indicates\nthat this is a continuation of a prior `ListDevices` call, and\nthat the system should return the next page of data.", + "type": "string" + }, + "fieldMask": { + "type": "string", + "location": "query", + "description": "The fields of the `Device` resource to be returned in the response. The\nfields `id`, and `num_id` are always returned by default, along with any\nother fields specified.", + "format": "google-fieldmask" + }, + "pageSize": { + "type": "integer", + "location": "query", + "description": "The maximum number of devices to return in the response. If this value\nis zero, the service will select a default size. A call may return fewer\nobjects than requested, but if there is a non-empty `page_token`, it\nindicates that more entries are available.", + "format": "int32" + }, + "parent": { + "location": "path", + "description": "The device registry path. Required. For example,\n`projects/my-project/locations/us-central1/registries/my-registry`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$" + }, + "deviceIds": { + "type": "string", + "repeated": true, + "location": "query", + "description": "A list of device string identifiers. If empty, it will ignore this field.\nFor example, `['device0', 'device12']`. This field cannot hold more than\n10,000 entries." + }, + "deviceNumIds": { + "location": "query", + "description": "A list of device numerical ids. If empty, it will ignore this field. This\nfield cannot hold more than 10,000 entries.", + "format": "uint64", + "type": "string", + "repeated": true + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices", + "path": "v1/{+parent}/devices", + "id": "cloudiot.projects.locations.registries.devices.list" + }, + "create": { + "response": { + "$ref": "Device" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "location": "path", + "description": "The name of the device registry where this device should be created.\nFor example,\n`projects/example-project/locations/us-central1/registries/my-registry`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices", + "path": "v1/{+parent}/devices", + "id": "cloudiot.projects.locations.registries.devices.create", + "request": { + "$ref": "Device" + }, + "description": "Creates a device in a device registry." + }, + "modifyCloudToDeviceConfig": { + "response": { + "$ref": "DeviceConfig" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "location": "path", + "description": "The name of the device. For example,\n`projects/p0/locations/us-central1/registries/registry0/devices/device0` or\n`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+/devices/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices/{devicesId}:modifyCloudToDeviceConfig", + "path": "v1/{+name}:modifyCloudToDeviceConfig", + "id": "cloudiot.projects.locations.registries.devices.modifyCloudToDeviceConfig", + "request": { + "$ref": "ModifyCloudToDeviceConfigRequest" + }, + "description": "Modifies the configuration for the device, which is eventually sent from\nthe Cloud IoT Core servers. Returns the modified configuration version and\nits metadata." + } + }, + "resources": { + "configVersions": { + "methods": { + "list": { + "response": { + "$ref": "ListDeviceConfigVersionsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the device. For example,\n`projects/p0/locations/us-central1/registries/registry0/devices/device0` or\n`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+/devices/[^/]+$" + }, + "numVersions": { + "type": "integer", + "location": "query", + "description": "The number of versions to list. Versions are listed in decreasing order of\nthe version number. The maximum number of versions retained is 10. If this\nvalue is zero, it will return all the versions available.", + "format": "int32" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices/{devicesId}/configVersions", + "path": "v1/{+name}/configVersions", + "id": "cloudiot.projects.locations.registries.devices.configVersions.list", + "description": "Lists the last few versions of the device configuration in descending\norder (i.e.: newest first)." + } + } + }, + "states": { + "methods": { + "list": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices/{devicesId}/states", + "path": "v1/{+name}/states", + "id": "cloudiot.projects.locations.registries.devices.states.list", + "description": "Lists the last few versions of the device state in descending order (i.e.:\nnewest first).", + "response": { + "$ref": "ListDeviceStatesResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+/devices/[^/]+$", + "location": "path", + "description": "The name of the device. For example,\n`projects/p0/locations/us-central1/registries/registry0/devices/device0` or\n`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`." + }, + "numStates": { + "type": "integer", + "location": "query", + "description": "The number of states to list. States are listed in descending order of\nupdate time. The maximum number of states retained is 10. If this\nvalue is zero, it will return all the states available.", + "format": "int32" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ] + } + } + } + } + } + } + } + } + } + } + } + }, + "parameters": { + "upload_protocol": { + "type": "string", + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." + }, + "prettyPrint": { + "type": "boolean", + "default": "true", + "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\")." + }, + "$.xgafv": { + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format.", + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ] + }, + "callback": { + "type": "string", + "location": "query", + "description": "JSONP" + }, + "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": { + "type": "boolean", + "default": "true", + "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." + } + }, + "version": "v1", + "baseUrl": "https://cloudiot.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Registers and manages IoT (Internet of Things) devices that connect to the Google Cloud Platform.\n", + "servicePath": "", + "basePath": "", + "revision": "20171204", + "id": "cloudiot:v1", + "documentationLink": "https://cloud.google.com/iot", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "PublicKeyCredential": { + "description": "A public key format and data.", + "type": "object", + "properties": { + "key": { + "description": "The key data.", + "type": "string" + }, + "format": { + "type": "string", + "enumDescriptions": [ + "The format has not been specified. This is an invalid default value and\nmust not be used.", + "An RSA public key encoded in base64, and wrapped by\n`-----BEGIN PUBLIC KEY-----` and `-----END PUBLIC KEY-----`. This can be\nused to verify `RS256` signatures in JWT tokens ([RFC7518](\nhttps://www.ietf.org/rfc/rfc7518.txt)).", + "As RSA_PEM, but wrapped in an X.509v3 certificate ([RFC5280](\nhttps://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by\n`-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.", + "Public key for the ECDSA algorithm using P-256 and SHA-256, encoded in\nbase64, and wrapped by `-----BEGIN PUBLIC KEY-----` and `-----END\nPUBLIC KEY-----`. This can be used to verify JWT tokens with the `ES256`\nalgorithm ([RFC7518](https://www.ietf.org/rfc/rfc7518.txt)). This curve is\ndefined in [OpenSSL](https://www.openssl.org/) as the `prime256v1` curve.", + "As ES256_PEM, but wrapped in an X.509v3 certificate ([RFC5280](\nhttps://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by\n`-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`." + ], + "enum": [ + "UNSPECIFIED_PUBLIC_KEY_FORMAT", + "RSA_PEM", + "RSA_X509_PEM", + "ES256_PEM", + "ES256_X509_PEM" + ], + "description": "The format of the key." + } + }, + "id": "PublicKeyCredential" + }, + "PublicKeyCertificate": { + "description": "A public key certificate format and data.", + "type": "object", + "properties": { + "x509Details": { + "$ref": "X509CertificateDetails", + "description": "[Output only] The certificate details. Used only for X.509 certificates." + }, + "format": { + "type": "string", + "enumDescriptions": [ + "The format has not been specified. This is an invalid default value and\nmust not be used.", + "An X.509v3 certificate ([RFC5280](https://www.ietf.org/rfc/rfc5280.txt)),\nencoded in base64, and wrapped by `-----BEGIN CERTIFICATE-----` and\n`-----END CERTIFICATE-----`." + ], + "enum": [ + "UNSPECIFIED_PUBLIC_KEY_CERTIFICATE_FORMAT", + "X509_CERTIFICATE_PEM" + ], + "description": "The certificate format." + }, + "certificate": { + "type": "string", + "description": "The certificate data." + } + }, + "id": "PublicKeyCertificate" + }, + "DeviceState": { + "description": "The device state, as reported by the device.", + "type": "object", + "properties": { + "binaryData": { + "description": "The device state data.", + "format": "byte", + "type": "string" + }, + "updateTime": { + "type": "string", + "description": "[Output only] The time at which this state version was updated in Cloud\nIoT Core.", + "format": "google-datetime" + } + }, + "id": "DeviceState" + }, + "AuditLogConfig": { + "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": { + "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" + } + } + }, + "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." + }, + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "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" + }, + "StateNotificationConfig": { + "description": "The configuration for notification of new states received from the device.", + "type": "object", + "properties": { + "pubsubTopicName": { + "type": "string", + "description": "A Cloud Pub/Sub topic name. For example,\n`projects/myProject/topics/deviceEvents`." + } + }, + "id": "StateNotificationConfig" + }, + "RegistryCredential": { + "description": "A server-stored registry credential used to validate device credentials.", + "type": "object", + "properties": { + "publicKeyCertificate": { + "$ref": "PublicKeyCertificate", + "description": "A public key certificate used to verify the device credentials." + } + }, + "id": "RegistryCredential" + }, + "Policy": { + "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": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + }, + "auditConfigs": { + "description": "Specifies cloud audit logging configuration for this policy.", + "type": "array", + "items": { + "$ref": "AuditConfig" + } + }, + "bindings": { + "type": "array", + "items": { + "$ref": "Binding" + }, + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error." + }, + "iamOwned": { + "type": "boolean" + } + }, + "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)." + }, + "ListDeviceRegistriesResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there may be more registries that match the\nrequest; this value should be passed in a new\n`ListDeviceRegistriesRequest`." + }, + "deviceRegistries": { + "description": "The registries that matched the query.", + "type": "array", + "items": { + "$ref": "DeviceRegistry" + } + } + }, + "id": "ListDeviceRegistriesResponse", + "description": "Response for `ListDeviceRegistries`." + }, + "DeviceRegistry": { + "type": "object", + "properties": { + "stateNotificationConfig": { + "$ref": "StateNotificationConfig", + "description": "The configuration for notification of new states received from the device.\nState updates are guaranteed to be stored in the state history, but\nnotifications to Cloud Pub/Sub are not guaranteed. For example, if\npermissions are misconfigured or the specified topic doesn't exist, no\nnotification will be published but the state will still be stored in Cloud\nIoT Core." + }, + "credentials": { + "type": "array", + "items": { + "$ref": "RegistryCredential" + }, + "description": "The credentials used to verify the device credentials. No more than 10\ncredentials can be bound to a single registry at a time. The verification\nprocess occurs at the time of device creation or update. If this field is\nempty, no verification is performed. Otherwise, the credentials of a newly\ncreated device or added credentials of an updated device should be signed\nwith one of these registry credentials.\n\nNote, however, that existing devices will never be affected by\nmodifications to this list of credentials: after a device has been\nsuccessfully created in a registry, it should be able to connect even if\nits registry credentials are revoked, deleted, or modified." + }, + "name": { + "description": "The resource path name. For example,\n`projects/example-project/locations/us-central1/registries/my-registry`.", + "type": "string" + }, + "eventNotificationConfigs": { + "description": "The configuration for notification of telemetry events received from the\ndevice. All telemetry events that were successfully published by the\ndevice and acknowledged by Cloud IoT Core are guaranteed to be\ndelivered to Cloud Pub/Sub. Only the first configuration is used. If you\ntry to publish a device telemetry event using MQTT without specifying a\nCloud Pub/Sub topic for the device's registry, the connection closes\nautomatically. If you try to do so using an HTTP connection, an error\nis returned.", + "type": "array", + "items": { + "$ref": "EventNotificationConfig" + } + }, + "httpConfig": { + "$ref": "HttpConfig", + "description": "The DeviceService (HTTP) configuration for this device registry." + }, + "id": { + "description": "The identifier of this device registry. For example, `myRegistry`.", + "type": "string" + }, + "mqttConfig": { + "$ref": "MqttConfig", + "description": "The MQTT configuration for this device registry." + } + }, + "id": "DeviceRegistry", + "description": "A container for a group of devices." + }, + "ListDevicesResponse": { + "description": "Response for `ListDevices`.", + "type": "object", + "properties": { + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there may be more devices that match the\nrequest; this value should be passed in a new `ListDevicesRequest`." + }, + "devices": { + "description": "The devices that match the request.", + "type": "array", + "items": { + "$ref": "Device" + } + } + }, + "id": "ListDevicesResponse" + }, + "DeviceCredential": { + "type": "object", + "properties": { + "publicKey": { + "$ref": "PublicKeyCredential", + "description": "A public key used to verify the signature of JSON Web Tokens (JWTs).\nWhen adding a new device credential, either via device creation or via\nmodifications, this public key credential may be required to be signed by\none of the registry level certificates. More specifically, if the\nregistry contains at least one certificate, any new device credential\nmust be signed by one of the registry certificates. As a result,\nwhen the registry contains certificates, only X.509 certificates are\naccepted as device credentials. However, if the registry does\nnot contain a certificate, self-signed certificates and public keys will\nbe accepted. New device credentials must be different from every\nregistry-level certificate." + }, + "expirationTime": { + "description": "[Optional] The time at which this credential becomes invalid. This\ncredential will be ignored for new client authentication requests after\nthis timestamp; however, it will not be automatically deleted.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "DeviceCredential", + "description": "A server-stored device credential used for authentication." + }, + "HttpConfig": { + "description": "The configuration of the HTTP bridge for a device registry.", + "type": "object", + "properties": { + "httpEnabledState": { + "type": "string", + "enumDescriptions": [ + "No HTTP state specified. If not specified, DeviceService will be\nenabled by default.", + "Enables DeviceService (HTTP) service for the registry.", + "Disables DeviceService (HTTP) service for the registry." + ], + "enum": [ + "HTTP_STATE_UNSPECIFIED", + "HTTP_ENABLED", + "HTTP_DISABLED" + ], + "description": "If enabled, allows devices to use DeviceService via the HTTP protocol.\nOtherwise, any requests to DeviceService will fail for this registry." + } + }, + "id": "HttpConfig" + }, + "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": { + "type": "array", + "items": { + "type": "string" + } + }, + "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": { + "type": "array", + "items": { + "$ref": "AuditLogConfig" + }, + "description": "The configuration for logging of each type of permission.\nNext ID: 4" + } + }, + "id": "AuditConfig" + }, + "DeviceConfig": { + "description": "The device configuration. Eventually delivered to devices.", + "type": "object", + "properties": { + "version": { + "description": "[Output only] The version of this update. The version number is assigned by\nthe server, and is always greater than 0 after device creation. The\nversion must be 0 on the `CreateDevice` request if a `config` is\nspecified; the response of `CreateDevice` will always have a value of 1.", + "format": "int64", + "type": "string" + }, + "cloudUpdateTime": { + "type": "string", + "description": "[Output only] The time at which this configuration version was updated in\nCloud IoT Core. This timestamp is set by the server.", + "format": "google-datetime" + }, + "deviceAckTime": { + "description": "[Output only] The time at which Cloud IoT Core received the\nacknowledgment from the device, indicating that the device has received\nthis configuration version. If this field is not present, the device has\nnot yet acknowledged that it received this version. Note that when\nthe config was sent to the device, many config versions may have been\navailable in Cloud IoT Core while the device was disconnected, and on\nconnection, only the latest version is sent to the device. Some\nversions may never be sent to the device, and therefore are never\nacknowledged. This timestamp is set by Cloud IoT Core.", + "format": "google-datetime", + "type": "string" + }, + "binaryData": { + "description": "The device configuration data.", + "format": "byte", + "type": "string" + } + }, + "id": "DeviceConfig" + }, + "MqttConfig": { + "type": "object", + "properties": { + "mqttEnabledState": { + "type": "string", + "enumDescriptions": [ + "No MQTT state specified. If not specified, MQTT will be enabled by default.", + "Enables a MQTT connection.", + "Disables a MQTT connection." + ], + "enum": [ + "MQTT_STATE_UNSPECIFIED", + "MQTT_ENABLED", + "MQTT_DISABLED" + ], + "description": "If enabled, allows connections using the MQTT protocol. Otherwise, MQTT\nconnections to this registry will fail." + } + }, + "id": "MqttConfig", + "description": "The configuration of MQTT for a device registry." + }, + "Status": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32" + }, + "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." + }, + "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": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + } + } + } + }, + "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." + }, + "Binding": { + "type": "object", + "properties": { + "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." + }, + "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" + } + } + }, + "id": "Binding", + "description": "Associates `members` with a `role`." + }, + "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": { + "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" + }, + "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." + }, + "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." + }, + "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" + }, + "ModifyCloudToDeviceConfigRequest": { + "type": "object", + "properties": { + "versionToUpdate": { + "description": "The version number to update. If this value is zero, it will not check the\nversion number of the server and will always update the current version;\notherwise, this update will fail if the version number found on the server\ndoes not match this version number. This is used to support multiple\nsimultaneous updates without losing data.", + "format": "int64", + "type": "string" + }, + "binaryData": { + "type": "string", + "description": "The configuration data for the device.", + "format": "byte" + } + }, + "id": "ModifyCloudToDeviceConfigRequest", + "description": "Request for `ModifyCloudToDeviceConfig`." + }, + "ListDeviceStatesResponse": { + "description": "Response for `ListDeviceStates`.", + "type": "object", + "properties": { + "deviceStates": { + "description": "The last few device states. States are listed in descending order of server\nupdate time, starting from the most recent one.", + "type": "array", + "items": { + "$ref": "DeviceState" + } + } + }, + "id": "ListDeviceStatesResponse" + }, + "GetIamPolicyRequest": { + "description": "Request message for `GetIamPolicy` method.", + "type": "object", + "properties": {}, + "id": "GetIamPolicyRequest" + }, + "TestIamPermissionsResponse": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed." + } + }, + "id": "TestIamPermissionsResponse", + "description": "Response message for `TestIamPermissions` method." + }, + "Device": { + "description": "The device resource.", + "type": "object", + "properties": { + "state": { + "$ref": "DeviceState", + "description": "[Output only] The state most recently received from the device. If no state\nhas been reported, this field is not present." + }, + "config": { + "$ref": "DeviceConfig", + "description": "The most recent device configuration, which is eventually sent from\nCloud IoT Core to the device. If not present on creation, the\nconfiguration will be initialized with an empty payload and version value\nof `1`. To update this field after creation, use the\n`DeviceManager.ModifyCloudToDeviceConfig` method." + }, + "name": { + "type": "string", + "description": "The resource path name. For example,\n`projects/p1/locations/us-central1/registries/registry0/devices/dev0` or\n`projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.\nWhen `name` is populated as a response from the service, it always ends\nin the device numeric ID." + }, + "credentials": { + "type": "array", + "items": { + "$ref": "DeviceCredential" + }, + "description": "The credentials used to authenticate this device. To allow credential\nrotation without interruption, multiple device credentials can be bound to\nthis device. No more than 3 credentials can be bound to a single device at\na time. When new credentials are added to a device, they are verified\nagainst the registry credentials. For details, see the description of the\n`DeviceRegistry.credentials` field." + }, + "lastErrorTime": { + "description": "[Output only] The time the most recent error occurred, such as a failure to\npublish to Cloud Pub/Sub. This field is the timestamp of\n'last_error_status'.", + "format": "google-datetime", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "The metadata key-value pairs assigned to the device. This metadata is not\ninterpreted or indexed by Cloud IoT Core. It can be used to add contextual\ninformation for the device.\n\nKeys must conform to the regular expression [a-zA-Z0-9-_]+ and be less than\n128 bytes in length.\n\nValues are free-form strings. Each value must be less than or equal to 32\nKB in size.\n\nThe total size of all keys and values must be less than 256 KB, and the\nmaximum number of key-value pairs is 500.", + "type": "object" + }, + "id": { + "description": "The user-defined device identifier. The device ID must be unique\nwithin a device registry.", + "type": "string" + }, + "lastConfigAckTime": { + "type": "string", + "description": "[Output only] The last time a cloud-to-device config version acknowledgment\nwas received from the device. This field is only for configurations\nsent through MQTT.", + "format": "google-datetime" + }, + "numId": { + "description": "[Output only] A server-defined unique numeric ID for the device. This is a\nmore compact way to identify devices, and it is globally unique.", + "format": "uint64", + "type": "string" + }, + "blocked": { + "description": "If a device is blocked, connections or requests from this device will fail.\nCan be used to temporarily prevent the device from connecting if, for\nexample, the sensor is generating bad data and needs maintenance.", + "type": "boolean" + }, + "lastHeartbeatTime": { + "type": "string", + "description": "[Output only] The last time a heartbeat was received. Timestamps are\nperiodically collected and written to storage; they may be stale by a few\nminutes. This field is only for devices connecting through MQTT.", + "format": "google-datetime" + }, + "lastEventTime": { + "description": "[Output only] The last time a telemetry event was received. Timestamps are\nperiodically collected and written to storage; they may be stale by a few\nminutes.", + "format": "google-datetime", + "type": "string" + }, + "lastConfigSendTime": { + "description": "[Output only] The last time a cloud-to-device config version was sent to\nthe device.", + "format": "google-datetime", + "type": "string" + }, + "lastErrorStatus": { + "$ref": "Status", + "description": "[Output only] The error message of the most recent error, such as a failure\nto publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this\nfield. If no errors have occurred, this field has an empty message\nand the status code 0 == OK. Otherwise, this field is expected to have a\nstatus code other than OK." + }, + "lastStateTime": { + "description": "[Output only] The last time a state event was received. Timestamps are\nperiodically collected and written to storage; they may be stale by a few\nminutes.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "Device" + }, + "ListDeviceConfigVersionsResponse": { + "description": "Response for `ListDeviceConfigVersions`.", + "type": "object", + "properties": { + "deviceConfigs": { + "type": "array", + "items": { + "$ref": "DeviceConfig" + }, + "description": "The device configuration for the last few versions. Versions are listed\nin decreasing order, starting from the most recent one." + } + }, + "id": "ListDeviceConfigVersionsResponse" + }, + "X509CertificateDetails": { + "type": "object", + "properties": { + "signatureAlgorithm": { + "description": "The algorithm used to sign the certificate.", + "type": "string" + }, + "startTime": { + "type": "string", + "description": "The time the certificate becomes valid.", + "format": "google-datetime" + }, + "expiryTime": { + "description": "The time the certificate becomes invalid.", + "format": "google-datetime", + "type": "string" + }, + "subject": { + "type": "string", + "description": "The entity the certificate and public key belong to." + }, + "issuer": { + "type": "string", + "description": "The entity that signed the certificate." + }, + "publicKeyType": { + "description": "The type of public key in the certificate.", + "type": "string" + } + }, + "id": "X509CertificateDetails", + "description": "Details of an X.509 certificate. For informational purposes only." + }, + "EventNotificationConfig": { + "description": "The configuration to forward telemetry events.", + "type": "object", + "properties": { + "pubsubTopicName": { + "type": "string", + "description": "A Cloud Pub/Sub topic name. For example,\n`projects/myProject/topics/deviceEvents`." + } + }, + "id": "EventNotificationConfig" + }, + "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": { + "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" + }, + "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" + } + }, + "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 Iot", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloudiot": { + "description": "Register and manage devices in the Google Cloud IoT service" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://cloudiot.googleapis.com/", + "ownerDomain": "google.com", + "name": "cloudiot", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud IoT API" +} diff --git a/etc/api/cloudiot/v1beta1/cloudiot-api.json b/etc/api/cloudiot/v1beta1/cloudiot-api.json new file mode 100644 index 0000000000..1d702ae1ba --- /dev/null +++ b/etc/api/cloudiot/v1beta1/cloudiot-api.json @@ -0,0 +1,1112 @@ +{ + "basePath": "", + "id": "cloudiot:v1beta1", + "documentationLink": "https://cloud.google.com/iot", + "revision": "20171204", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "NotificationConfig": { + "id": "NotificationConfig", + "description": "Configuration to forward messages such as telemetry events.", + "type": "object", + "properties": { + "pubsubTopicName": { + "description": "A Cloud Pub/Sub topic name. For example,\n`projects/myProject/topics/deviceEvents`.", + "type": "string" + } + } + }, + "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": { + "version": { + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32", + "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`.\n`bindings` with no members will result in an error.", + "type": "array", + "items": { + "$ref": "Binding" + } + }, + "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", + "type": "string" + } + }, + "id": "Policy" + }, + "ListDeviceRegistriesResponse": { + "id": "ListDeviceRegistriesResponse", + "description": "Response for `ListDeviceRegistries`.", + "type": "object", + "properties": { + "deviceRegistries": { + "description": "The registries that matched the query.", + "type": "array", + "items": { + "$ref": "DeviceRegistry" + } + }, + "nextPageToken": { + "description": "If not empty, indicates that there may be more registries that match the\nrequest; this value should be passed in a new\n`ListDeviceRegistriesRequest`.", + "type": "string" + } + } + }, + "Device": { + "id": "Device", + "description": "The device resource.", + "type": "object", + "properties": { + "name": { + "description": "The resource path name. For example,\n`projects/p1/locations/us-central1/registries/registry0/devices/dev0` or\n`projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.\nWhen `name` is populated as a response from the service, it always ends\nin the device numeric ID.", + "type": "string" + }, + "credentials": { + "description": "The credentials used to authenticate this device. To allow credential\nrotation without interruption, multiple device credentials can be bound to\nthis device. No more than 3 credentials can be bound to a single device at\na time.", + "type": "array", + "items": { + "$ref": "DeviceCredential" + } + }, + "lastErrorTime": { + "description": "[Output only] The last time an error happened, e.g., failed to publish to\nCloud Pub/Sub. This field is the timestamp of 'last_error_status'.", + "format": "google-datetime", + "type": "string" + }, + "id": { + "description": "The user-defined device identifier. The device ID must be unique\nwithin a device registry.", + "type": "string" + }, + "enabledState": { + "enumDescriptions": [ + "No enabled state specified. If not specified, defaults to enabled\n(communication to Cloud IoT Core allowed).", + "Enables a device. By default, devices are enabled, allowing communication\nfrom the device to Cloud IoT Core. When a device is disabled, it is blocked\nfrom communicating with Cloud IoT Core.", + "Disables a device, blocking all communication from it to Cloud IoT Core." + ], + "enum": [ + "UNSPECIFIED_ENABLED_STATE", + "DEVICE_ENABLED", + "DEVICE_DISABLED" + ], + "description": "If a device is disabled, communication from it will be blocked. Can be used\nto temporarily prevent the device from connecting if, for example, the\nsensor is generating bad data and needs maintenance.", + "type": "string" + }, + "lastHeartbeatTime": { + "description": "[Output only] The last time a heartbeat was received. Timestamps are\nperiodically collected and written to storage; they may be stale by a few\nminutes.", + "format": "google-datetime", + "type": "string" + }, + "lastEventTime": { + "description": "[Output only] The last time an event was received. Timestamps are\nperiodically collected and written to storage; they may be stale by a few\nminutes.", + "format": "google-datetime", + "type": "string" + }, + "lastConfigAckTime": { + "description": "[Output only] The last time a cloud-to-device config version acknowledgment\nwas received from the device.", + "format": "google-datetime", + "type": "string" + }, + "lastErrorStatus": { + "$ref": "Status", + "description": "[Output only] The error message of the last error, e.g., failed to publish\nto Cloud Pub/Sub. 'last_error_time' is the timestamp of this field. If no\nerrors are present, this will have an empty message (whose status code is\n0 == OK), otherwise this field is expected to have a not-OK status code." + }, + "numId": { + "description": "[Output only] A server-defined unique numeric ID for the device. This is a\nmore compact way to identify devices, and it is globally unique.", + "format": "uint64", + "type": "string" + }, + "config": { + "description": "The most recent device configuration, which is eventually sent from the\nCloud IoT Core service to the device. If not present on creation, the\nconfiguration will be initialized with an empty payload and version value\nof `1`. To update this field after creation, use the\n`DeviceManager.ModifyCloudToDeviceConfig` method.", + "$ref": "DeviceConfig" + } + } + }, + "DeviceRegistry": { + "id": "DeviceRegistry", + "description": "A container for a group of devices.", + "type": "object", + "properties": { + "id": { + "description": "The identifier of this device registry. For example, `myRegistry`.", + "type": "string" + }, + "mqttConfig": { + "$ref": "MqttConfig", + "description": "The configuration of the MQTT broker associated with this device registry,\nincluding enablement, payload data format type, etc." + }, + "name": { + "description": "The resource path name. For example,\n`projects/example-project/locations/us-central1/registries/my-registry`.", + "type": "string" + }, + "eventNotificationConfig": { + "$ref": "NotificationConfig", + "description": "Configuration to notify events received from the device." + } + } + }, + "ListDeviceConfigVersionsResponse": { + "id": "ListDeviceConfigVersionsResponse", + "description": "Response for `ListDeviceConfigVersions`.", + "type": "object", + "properties": { + "deviceConfigs": { + "description": "The device configuration for the last few versions. Versions are listed\nin decreasing order, starting from the most recent one.", + "type": "array", + "items": { + "$ref": "DeviceConfig" + } + } + } + }, + "ListDevicesResponse": { + "description": "Response for `ListDevices`.", + "type": "object", + "properties": { + "devices": { + "description": "The devices that match the request.", + "type": "array", + "items": { + "$ref": "Device" + } + }, + "nextPageToken": { + "description": "If not empty, indicates that there may be more devices that match the\nrequest; this value should be passed in a new `ListDevicesRequest`.", + "type": "string" + } + }, + "id": "ListDevicesResponse" + }, + "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": { + "type": "array", + "items": { + "type": "string" + } + }, + "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" + }, + "DeviceCredential": { + "id": "DeviceCredential", + "description": "A server-stored device credential used for authentication.", + "type": "object", + "properties": { + "expirationTime": { + "description": "[Optional] The time at which this credential becomes invalid. This\ncredential will be ignored for new client authentication requests after\nthis timestamp; however, it will not be automatically deleted.", + "format": "google-datetime", + "type": "string" + }, + "publicKey": { + "$ref": "PublicKeyCredential", + "description": "A public key used to verify the signature of JSON Web Tokens (JWTs)." + } + } + }, + "DeviceConfig": { + "id": "DeviceConfig", + "description": "The device configuration and its metadata. Eventually delivered to devices.", + "type": "object", + "properties": { + "version": { + "description": "[Output only] The version of this update. The version number is assigned by\nthe server, and is always greater than zero after device creation. The\nversion must be zero on the `CreateDevice` request if a `config` is\nspecified; the response of `CreateDevice` will always have a value of one.", + "format": "int64", + "type": "string" + }, + "cloudUpdateTime": { + "description": "[Output only] The time when this version state was updated in the Cloud IoT\nCore service. This timestamp is set by the server.", + "format": "google-datetime", + "type": "string" + }, + "deviceAckTime": { + "description": "[Output only] The time when the Cloud IoT Core server received the\nacknowledgment from the device, indicating that the device has received\nthis configuration version. If this field is not present, the device has\nnot yet acknowledged that it received this version. Note that when sending\nthe config to the device, there may have been many config versions on the\nCloud IoT Core service while the device was disconnected; and on\nconnection, only the latest version is sent to the device. Some of the\nversions may never be sent to the device, and therefore are never\nacknowledged. This timestamp is set by the Cloud IoT Core service.", + "format": "google-datetime", + "type": "string" + }, + "data": { + "$ref": "DeviceConfigData", + "description": "The device configuration data." + } + } + }, + "MqttConfig": { + "description": "The configuration of MQTT for a device registry.", + "type": "object", + "properties": { + "mqttConfigState": { + "enumDescriptions": [ + "No MQTT state specified. If not specified, MQTT will be enabled by default.", + "Enables a MQTT connection.", + "Disables a MQTT connection." + ], + "enum": [ + "UNSPECIFIED_MQTT_STATE", + "MQTT_ENABLED", + "MQTT_DISABLED" + ], + "description": "If enabled, allows connections using the MQTT protocol. Otherwise any MQTT\nconnection to this registry will fail.", + "type": "string" + } + }, + "id": "MqttConfig" + }, + "SetIamPolicyRequest": { + "description": "Request message for `SetIamPolicy` method.", + "type": "object", + "properties": { + "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" + }, + "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" + }, + "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" + }, + "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" + }, + "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" + }, + "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": { + "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\"", + "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" + }, + "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" + }, + "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" + } + } + }, + "DeviceConfigData": { + "id": "DeviceConfigData", + "description": "The data for a device configuration. Only binary data is currently supported.", + "type": "object", + "properties": { + "binaryData": { + "description": "The configuration sent to the device, as bytes.", + "format": "byte", + "type": "string" + } + } + }, + "PublicKeyCredential": { + "id": "PublicKeyCredential", + "description": "A public key format and data.", + "type": "object", + "properties": { + "key": { + "description": "The key data.", + "type": "string" + }, + "format": { + "description": "The format of the key.", + "type": "string", + "enumDescriptions": [ + "The format has not been specified. This is an invalid default value and\nmust not be used.", + "An RSA public key wrapped in a X.509v3 certificate\n[RFC5280](https://www.ietf.org/rfc/rfc5280.txt), encoded in base64, and\nwrapped by `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.\nThis can be used to verify `RS256` signatures in JWT tokens\n[RFC7518](https://www.ietf.org/rfc/rfc7518.txt).", + "Public key for the ECDSA algorithm using P-256 and SHA-256, encoded in\nbase64, and wrapped by `-----BEGIN PUBLIC KEY-----` and `-----END\nPUBLIC KEY-----`. This can be used to verify JWT tokens with the `ES256`\nalgorithm [RFC7518](https://www.ietf.org/rfc/rfc7518.txt). This curve is\ndefined in [openssl](https://www.openssl.org/) as the `prime256v1` curve." + ], + "enum": [ + "UNSPECIFIED_PUBLIC_KEY_FORMAT", + "RSA_X509_PEM", + "ES256_PEM" + ] + } + } + }, + "ModifyCloudToDeviceConfigRequest": { + "id": "ModifyCloudToDeviceConfigRequest", + "description": "Request for `ModifyCloudToDeviceConfig`.", + "type": "object", + "properties": { + "data": { + "description": "The configuration data for the device.", + "$ref": "DeviceConfigData" + }, + "versionToUpdate": { + "description": "The version number to update. If this value is zero, it will not check the\nversion number of the server and will always update the current version;\notherwise, this update will fail if the version number found on the server\ndoes not match this version number. This is used to support multiple\nsimultaneous updates without losing data.", + "format": "int64", + "type": "string" + } + } + }, + "GetIamPolicyRequest": { + "description": "Request message for `GetIamPolicy` method.", + "type": "object", + "properties": {}, + "id": "GetIamPolicyRequest" + }, + "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" + } + } + } + }, + "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" + } + }, + "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" + } + }, + "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 Iot", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloudiot": { + "description": "Register and manage devices in the Google Cloud IoT service" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://cloudiot.googleapis.com/", + "ownerDomain": "google.com", + "name": "cloudiot", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud IoT API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "locations": { + "resources": { + "registries": { + "methods": { + "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" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "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/[^/]+/locations/[^/]+/registries/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}:testIamPermissions", + "path": "v1beta1/{+resource}:testIamPermissions", + "id": "cloudiot.projects.locations.registries.testIamPermissions" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$", + "location": "path", + "description": "The name of the device registry. For example,\n`projects/example-project/locations/us-central1/registries/my-registry`.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}", + "path": "v1beta1/{+name}", + "id": "cloudiot.projects.locations.registries.delete", + "description": "Deletes a device registry configuration." + }, + "list": { + "parameters": { + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "The project and cloud region path. For example,\n`projects/example-project/locations/us-central1`.", + "required": true, + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The value returned by the last `ListDeviceRegistriesResponse`; indicates\nthat this is a continuation of a prior `ListDeviceRegistries` call, and\nthat the system should return the next page of data.", + "type": "string" + }, + "pageSize": { + "location": "query", + "description": "The maximum number of registries to return in the response. If this value\nis zero, the service will select a default size. A call may return fewer\nobjects than requested, but if there is a non-empty `page_token`, it\nindicates that more entries are available.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries", + "id": "cloudiot.projects.locations.registries.list", + "path": "v1beta1/{+parent}/registries", + "description": "Lists device registries.", + "httpMethod": "GET", + "response": { + "$ref": "ListDeviceRegistriesResponse" + }, + "parameterOrder": [ + "parent" + ] + }, + "create": { + "path": "v1beta1/{+parent}/registries", + "id": "cloudiot.projects.locations.registries.create", + "description": "Creates a device registry that contains devices.", + "request": { + "$ref": "DeviceRegistry" + }, + "response": { + "$ref": "DeviceRegistry" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "The project and cloud region where this device registry must be created.\nFor example, `projects/example-project/locations/us-central1`.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries" + }, + "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" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "resource": { + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$", + "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" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}:setIamPolicy", + "id": "cloudiot.projects.locations.registries.setIamPolicy", + "path": "v1beta1/{+resource}:setIamPolicy" + }, + "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" + }, + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "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/[^/]+/locations/[^/]+/registries/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}:getIamPolicy", + "path": "v1beta1/{+resource}:getIamPolicy", + "id": "cloudiot.projects.locations.registries.getIamPolicy" + }, + "get": { + "path": "v1beta1/{+name}", + "id": "cloudiot.projects.locations.registries.get", + "description": "Gets a device registry configuration.", + "response": { + "$ref": "DeviceRegistry" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "name": { + "description": "The name of the device registry. For example,\n`projects/example-project/locations/us-central1/registries/my-registry`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}" + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "DeviceRegistry" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "updateMask": { + "location": "query", + "description": "Only updates the `device_registry` fields indicated by this mask.\nThe field mask must not be empty, and it must not contain fields that\nare immutable or only set by the server.\nMutable top-level fields: `event_notification_config` and `mqtt_config`", + "format": "google-fieldmask", + "type": "string" + }, + "name": { + "description": "The resource path name. For example,\n`projects/example-project/locations/us-central1/registries/my-registry`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}", + "id": "cloudiot.projects.locations.registries.patch", + "path": "v1beta1/{+name}", + "description": "Updates a device registry configuration.", + "request": { + "$ref": "DeviceRegistry" + } + } + }, + "resources": { + "devices": { + "methods": { + "patch": { + "description": "Updates a device.", + "request": { + "$ref": "Device" + }, + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Device" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "updateMask": { + "description": "Only updates the `device` fields indicated by this mask.\nThe field mask must not be empty, and it must not contain fields that\nare immutable or only set by the server.\nMutable top-level fields: `credentials` and `enabled_state`", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, + "name": { + "description": "The resource path name. For example,\n`projects/p1/locations/us-central1/registries/registry0/devices/dev0` or\n`projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`.\nWhen `name` is populated as a response from the service, it always ends\nin the device numeric ID.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+/devices/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices/{devicesId}", + "id": "cloudiot.projects.locations.registries.devices.patch", + "path": "v1beta1/{+name}" + }, + "get": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "name": { + "description": "The name of the device. For example,\n`projects/p0/locations/us-central1/registries/registry0/devices/device0` or\n`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+/devices/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices/{devicesId}", + "id": "cloudiot.projects.locations.registries.devices.get", + "path": "v1beta1/{+name}", + "description": "Gets details about a device.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Device" + } + }, + "delete": { + "parameters": { + "name": { + "description": "The name of the device. For example,\n`projects/p0/locations/us-central1/registries/registry0/devices/device0` or\n`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+/devices/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices/{devicesId}", + "path": "v1beta1/{+name}", + "id": "cloudiot.projects.locations.registries.devices.delete", + "description": "Deletes a device.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE" + }, + "list": { + "parameters": { + "pageToken": { + "location": "query", + "description": "The value returned by the last `ListDevicesResponse`; indicates\nthat this is a continuation of a prior `ListDevices` call, and\nthat the system should return the next page of data.", + "type": "string" + }, + "fieldMask": { + "location": "query", + "description": "The fields of the `Device` resource to be returned in the response. The\nfields `id`, and `num_id` are always returned by default, along with any\nother fields specified.", + "format": "google-fieldmask", + "type": "string" + }, + "pageSize": { + "description": "The maximum number of devices to return in the response. If this value\nis zero, the service will select a default size. A call may return fewer\nobjects than requested, but if there is a non-empty `page_token`, it\nindicates that more entries are available.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$", + "location": "path", + "description": "The device registry path. Required. For example,\n`projects/my-project/locations/us-central1/registries/my-registry`.", + "required": true, + "type": "string" + }, + "deviceIds": { + "repeated": true, + "location": "query", + "description": "A list of device string identifiers. If empty, it will ignore this field.\nFor example, `['device0', 'device12']`. This field cannot hold more than\n10,000 entries.", + "type": "string" + }, + "deviceNumIds": { + "repeated": true, + "location": "query", + "description": "A list of device numerical ids. If empty, it will ignore this field. This\nfield cannot hold more than 10,000 entries.", + "format": "uint64", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices", + "id": "cloudiot.projects.locations.registries.devices.list", + "path": "v1beta1/{+parent}/devices", + "description": "List devices in a device registry.", + "httpMethod": "GET", + "response": { + "$ref": "ListDevicesResponse" + }, + "parameterOrder": [ + "parent" + ] + }, + "create": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+$", + "location": "path", + "description": "The name of the device registry where this device should be created.\nFor example,\n`projects/example-project/locations/us-central1/registries/my-registry`.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices", + "id": "cloudiot.projects.locations.registries.devices.create", + "path": "v1beta1/{+parent}/devices", + "description": "Creates a device in a device registry.", + "request": { + "$ref": "Device" + }, + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Device" + } + }, + "modifyCloudToDeviceConfig": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "DeviceConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+/devices/[^/]+$", + "location": "path", + "description": "The name of the device. For example,\n`projects/p0/locations/us-central1/registries/registry0/devices/device0` or\n`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices/{devicesId}:modifyCloudToDeviceConfig", + "id": "cloudiot.projects.locations.registries.devices.modifyCloudToDeviceConfig", + "path": "v1beta1/{+name}:modifyCloudToDeviceConfig", + "description": "Modifies the configuration for the device, which is eventually sent from\nthe Cloud IoT servers. Returns the modified configuration version and its\nmeta-data.", + "request": { + "$ref": "ModifyCloudToDeviceConfigRequest" + } + } + }, + "resources": { + "configVersions": { + "methods": { + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListDeviceConfigVersionsResponse" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the device. For example,\n`projects/p0/locations/us-central1/registries/registry0/devices/device0` or\n`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/registries/[^/]+/devices/[^/]+$", + "location": "path" + }, + "numVersions": { + "location": "query", + "description": "The number of versions to list. Versions are listed in decreasing order of\nthe version number. The maximum number of versions retained is 10. If this\nvalue is zero, it will return all the versions available.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudiot" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/registries/{registriesId}/devices/{devicesId}/configVersions", + "id": "cloudiot.projects.locations.registries.devices.configVersions.list", + "path": "v1beta1/{+name}/configVersions", + "description": "Lists the last few versions of the device configuration in descending\norder (i.e.: newest first)." + } + } + } + } + } + } + } + } + } + } + } + }, + "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" + }, + "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": { + "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" + }, + "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" + }, + "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": "v1beta1", + "baseUrl": "https://cloudiot.googleapis.com/", + "servicePath": "", + "description": "Registers and manages IoT (Internet of Things) devices that connect to the Google Cloud Platform.\n", + "kind": "discovery#restDescription" +} diff --git a/etc/api/cloudkms/v1/cloudkms-api.json b/etc/api/cloudkms/v1/cloudkms-api.json index 5fe4bf1167..acf37e1006 100644 --- a/etc/api/cloudkms/v1/cloudkms-api.json +++ b/etc/api/cloudkms/v1/cloudkms-api.json @@ -1,524 +1,4 @@ { - "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": { @@ -526,76 +6,112 @@ "resources": { "locations": { "methods": { - "get": { + "list": { + "httpMethod": "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": { + "name": { + "location": "path", + "description": "The resource that owns the locations collection, if applicable.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$" + }, "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.", + "format": "int32", "type": "integer" }, "filter": { - "description": "The standard list filter.", "type": "string", - "location": "query" + "location": "query", + "description": "The standard list filter." } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "flatPath": "v1/projects/{projectsId}/locations", - "path": "v1/{+name}/locations", "id": "cloudkms.projects.locations.list", + "path": "v1/{+name}/locations", "description": "Lists information about the supported locations for this service." + }, + "get": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}", + "path": "v1/{+name}", + "id": "cloudkms.projects.locations.get", + "description": "Get information about a location.", + "response": { + "$ref": "Location" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "Resource name for the location." + } + } } }, "resources": { "keyRings": { "methods": { + "list": { + "response": { + "$ref": "ListKeyRingsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "parent": { + "location": "path", + "description": "Required. The resource name of the location associated with the\nKeyRings, in the format `projects/*/locations/*`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$" + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "Optional pagination token, returned earlier via\nListKeyRingsResponse.next_page_token." + }, + "pageSize": { + "location": "query", + "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.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings", + "path": "v1/{+parent}/keyRings", + "id": "cloudkms.projects.locations.keyRings.list", + "description": "Lists KeyRings." + }, "create": { "response": { "$ref": "KeyRing" @@ -606,34 +122,30 @@ "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, + "type": "string", "pattern": "^projects/[^/]+/locations/[^/]+$", - "location": "path" + "location": "path", + "description": "Required. The resource name of the location associated with the\nKeyRings, in the format `projects/*/locations/*`." }, "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" + "location": "query", + "description": "Required. It must be unique within a location and match the regular\nexpression `[a-zA-Z0-9_-]{1,63}`" } }, "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.", + "id": "cloudkms.projects.locations.keyRings.create", "request": { "$ref": "KeyRing" - } + }, + "description": "Create a new KeyRing in a given Project and Location." }, "setIamPolicy": { - "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", - "request": { - "$ref": "SetIamPolicyRequest" - }, "response": { "$ref": "Policy" }, @@ -643,75 +155,75 @@ "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, + "type": "string", "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$", - "location": "path" + "location": "path", + "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field." } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", "id": "cloudkms.projects.locations.keyRings.setIamPolicy", - "path": "v1/{+resource}:setIamPolicy" + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy." }, "getIamPolicy": { - "httpMethod": "GET", + "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/[^/]+/locations/[^/]+/keyRings/[^/]+$" + } + }, "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." + "id": "cloudkms.projects.locations.keyRings.getIamPolicy" }, "get": { - "path": "v1/{+name}", - "id": "cloudkms.projects.locations.keyRings.get", "description": "Returns metadata for a given KeyRing.", - "httpMethod": "GET", "response": { "$ref": "KeyRing" }, "parameterOrder": [ "name" ], + "httpMethod": "GET", "parameters": { "name": { + "location": "path", "description": "The name of the KeyRing to get.", - "type": "string", "required": true, - "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$", - "location": "path" + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}" + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}", + "path": "v1/{+name}", + "id": "cloudkms.projects.locations.keyRings.get" }, "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" @@ -721,139 +233,32 @@ }, "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.", + "required": true, "type": "string", - "required": true + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}:testIamPermissions", + "id": "cloudkms.projects.locations.keyRings.testIamPermissions", "path": "v1/{+resource}:testIamPermissions", - "id": "cloudkms.projects.locations.keyRings.testIamPermissions" - }, - "list": { - "description": "Lists KeyRings.", - "response": { - "$ref": "ListKeyRingsResponse" + "request": { + "$ref": "TestIamPermissionsRequest" }, - "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" + "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": { "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": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}", + "path": "v1/{+name}", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.patch", "request": { "$ref": "CryptoKey" }, @@ -865,83 +270,105 @@ "name" ], "httpMethod": "PATCH", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], "parameters": { "updateMask": { - "format": "google-fieldmask", + "location": "query", "description": "Required list of fields to be updated in this request.", - "type": "string", - "location": "query" + "format": "google-fieldmask", + "type": "string" }, "name": { + "required": true, + "type": "string", "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 + "description": "Output only. The resource name for this CryptoKey in the format\n`projects/*/locations/*/keyRings/*/cryptoKeys/*`." } }, - "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}", - "id": "cloudkms.projects.locations.keyRings.cryptoKeys.patch", - "path": "v1/{+name}" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] }, - "testIamPermissions": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], + "get": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}", + "path": "v1/{+name}", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.get", + "description": "Returns metadata for a given CryptoKey, as well as its\nprimary CryptoKeyVersion.", "response": { - "$ref": "TestIamPermissionsResponse" + "$ref": "CryptoKey" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { - "resource": { - "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "name": { "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.", + "description": "The name of the CryptoKey to get.", + "required": true, "type": "string", - "required": true + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$" } - }, + } + }, + "testIamPermissions": { "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." + "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", + "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/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] }, "decrypt": { + "response": { + "$ref": "DecryptResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path", + "description": "Required. The resource name of the CryptoKey to use for decryption.\nThe server will choose the appropriate version." + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}: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.", @@ -953,33 +380,36 @@ ], "httpMethod": "GET", "parameters": { - "pageToken": { - "description": "Optional pagination token, returned earlier via\nListCryptoKeysResponse.next_page_token.", + "parent": { + "required": true, "type": "string", - "location": "query" + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$", + "location": "path", + "description": "Required. The resource name of the KeyRing to list, in the format\n`projects/*/locations/*/keyRings/*`." + }, + "pageToken": { + "location": "query", + "description": "Optional pagination token, returned earlier via\nListCryptoKeysResponse.next_page_token.", + "type": "string" }, "pageSize": { + "type": "integer", "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" + "format": "int32" } }, "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" + "path": "v1/{+parent}/cryptoKeys", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.list" }, "encrypt": { + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:encrypt", + "path": "v1/{+name}:encrypt", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.encrypt", "request": { "$ref": "EncryptRequest" }, @@ -991,56 +421,24 @@ "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" + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/.+$" } }, "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": { + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", "response": { "$ref": "Policy" }, @@ -1050,28 +448,202 @@ "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.", + "required": true, "type": "string", - "required": true + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$" } }, "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.", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy" + }, + "create": { + "response": { + "$ref": "CryptoKey" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$", + "location": "path", + "description": "Required. The name of the KeyRing associated with the\nCryptoKeys." + }, + "cryptoKeyId": { + "type": "string", + "location": "query", + "description": "Required. It must be unique within a KeyRing and match the regular\nexpression `[a-zA-Z0-9_-]{1,63}`" + } + }, + "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", "request": { - "$ref": "SetIamPolicyRequest" - } + "$ref": "CryptoKey" + }, + "description": "Create a new CryptoKey within a KeyRing.\n\nCryptoKey.purpose is required." + }, + "updatePrimaryVersion": { + "response": { + "$ref": "CryptoKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "location": "path", + "description": "The resource name of the CryptoKey to update.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:updatePrimaryVersion", + "path": "v1/{+name}:updatePrimaryVersion", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion", + "request": { + "$ref": "UpdateCryptoKeyPrimaryVersionRequest" + }, + "description": "Update the version of a CryptoKey that will be used in Encrypt" + }, + "getIamPolicy": { + "httpMethod": "GET", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "parameters": { + "resource": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "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" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}:getIamPolicy", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.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." } }, "resources": { "cryptoKeyVersions": { "methods": { + "list": { + "response": { + "$ref": "ListCryptoKeyVersionsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "parent": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path", + "description": "Required. The resource name of the CryptoKey to list, in the format\n`projects/*/locations/*/keyRings/*/cryptoKeys/*`." + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "Optional pagination token, returned earlier via\nListCryptoKeyVersionsResponse.next_page_token." + }, + "pageSize": { + "location": "query", + "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.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions", + "path": "v1/{+parent}/cryptoKeyVersions", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list", + "description": "Lists CryptoKeyVersions." + }, + "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.", + "response": { + "$ref": "CryptoKeyVersion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+$", + "location": "path", + "description": "The resource name of the CryptoKeyVersion to destroy." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/{cryptoKeyVersionsId}:destroy", + "path": "v1/{+name}:destroy", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy" + }, + "create": { + "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.", + "response": { + "$ref": "CryptoKeyVersion" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$", + "location": "path", + "description": "Required. The name of the CryptoKey associated with\nthe CryptoKeyVersions." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "restore": { "httpMethod": "POST", "parameterOrder": [ @@ -1082,27 +654,50 @@ }, "parameters": { "name": { - "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+$", "location": "path", "description": "The resource name of the CryptoKeyVersion to restore.", + "required": true, "type": "string", - "required": true + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+$" } }, "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.", + "path": "v1/{+name}:restore", "request": { "$ref": "RestoreCryptoKeyVersionRequest" - } + }, + "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." + }, + "get": { + "response": { + "$ref": "CryptoKeyVersion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the CryptoKeyVersion to get.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/{cryptoKeyVersionsId}", + "path": "v1/{+name}", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get", + "description": "Returns metadata for a given CryptoKeyVersion." }, "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" @@ -1114,142 +709,27 @@ "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/[^/]+/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 + "pattern": "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyVersions/[^/]+$" + }, + "updateMask": { + "location": "query", + "description": "Required list of fields to be updated in this request.", + "format": "google-fieldmask", + "type": "string" } }, - "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." + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyRings/{keyRingsId}/cryptoKeys/{cryptoKeysId}/cryptoKeyVersions/{cryptoKeyVersionsId}", + "path": "v1/{+name}", + "id": "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch" } } } @@ -1271,25 +751,21 @@ "prettyPrint": { "location": "query", "description": "Returns response with indentations and line breaks.", - "default": "true", - "type": "boolean" + "type": "boolean", + "default": "true" + }, + "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" }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" - }, "$.xgafv": { + "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -1299,8 +775,12 @@ "1", "2" ], - "description": "V1 error format.", - "type": "string" + "description": "V1 error format." + }, + "callback": { + "type": "string", + "location": "query", + "description": "JSONP" }, "alt": { "enum": [ @@ -1318,16 +798,16 @@ "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.", @@ -1336,18 +816,538 @@ "pp": { "location": "query", "description": "Pretty-print response.", - "default": "true", - "type": "boolean" + "type": "boolean", + "default": "true" }, "oauth_token": { + "type": "string", "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" + "description": "OAuth 2.0 token for the current user." }, "bearer_token": { + "location": "query", "description": "OAuth bearer token.", - "type": "string", - "location": "query" + "type": "string" } - } + }, + "version": "v1", + "baseUrl": "https://cloudkms.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Manages encryption for your cloud services the same way you do on-premises. You can generate, use, rotate, and destroy AES256 encryption keys.", + "servicePath": "", + "basePath": "", + "revision": "20171201", + "documentationLink": "https://cloud.google.com/kms/", + "id": "cloudkms:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "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", + "properties": { + "state": { + "enum": [ + "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED", + "ENABLED", + "DISABLED", + "DESTROYED", + "DESTROY_SCHEDULED" + ], + "description": "The current state of the CryptoKeyVersion.", + "type": "string", + "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." + ] + }, + "name": { + "description": "Output only. The resource name for this CryptoKeyVersion in the format\n`projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.", + "type": "string" + }, + "destroyEventTime": { + "type": "string", + "description": "Output only. The time this CryptoKeyVersion's key material was\ndestroyed. Only present if state is\nDESTROYED.", + "format": "google-datetime" + }, + "destroyTime": { + "type": "string", + "description": "Output only. The time this CryptoKeyVersion's key material is scheduled\nfor destruction. Only present if state is\nDESTROY_SCHEDULED.", + "format": "google-datetime" + }, + "createTime": { + "type": "string", + "description": "Output only. The time at which this CryptoKeyVersion was created.", + "format": "google-datetime" + } + }, + "id": "CryptoKeyVersion" + }, + "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" + }, + "DecryptRequest": { + "type": "object", + "properties": { + "ciphertext": { + "type": "string", + "description": "Required. The encrypted data originally returned in\nEncryptResponse.ciphertext.", + "format": "byte" + }, + "additionalAuthenticatedData": { + "type": "string", + "description": "Optional data that must match the data originally supplied in\nEncryptRequest.additional_authenticated_data.", + "format": "byte" + } + }, + "id": "DecryptRequest", + "description": "Request message for KeyManagementService.Decrypt." + }, + "Binding": { + "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": { + "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": { + "type": "string", + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired" + } + }, + "id": "Binding", + "description": "Associates `members` with a `role`." + }, + "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": { + "title": { + "type": "string", + "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." + }, + "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." + }, + "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." + }, + "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" + }, + "EncryptRequest": { + "description": "Request message for KeyManagementService.Encrypt.", + "type": "object", + "properties": { + "additionalAuthenticatedData": { + "description": "Optional data that, if specified, must also be provided during decryption\nthrough DecryptRequest.additional_authenticated_data. Must be no\nlarger than 64KiB.", + "format": "byte", + "type": "string" + }, + "plaintext": { + "description": "Required. The data to encrypt. Must be no larger than 64KiB.", + "format": "byte", + "type": "string" + } + }, + "id": "EncryptRequest" + }, + "ListCryptoKeyVersionsResponse": { + "description": "Response message for KeyManagementService.ListCryptoKeyVersions.", + "type": "object", + "properties": { + "cryptoKeyVersions": { + "type": "array", + "items": { + "$ref": "CryptoKeyVersion" + }, + "description": "The list of CryptoKeyVersions." + }, + "nextPageToken": { + "type": "string", + "description": "A token to retrieve next page of results. Pass this value in\nListCryptoKeyVersionsRequest.page_token to retrieve the next page of\nresults." + }, + "totalSize": { + "description": "The total number of CryptoKeyVersions that matched the\nquery.", + "format": "int32", + "type": "integer" + } + }, + "id": "ListCryptoKeyVersionsResponse" + }, + "Location": { + "type": "object", + "properties": { + "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\"`." + }, + "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": { + "additionalProperties": { + "type": "string" + }, + "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}", + "type": "object" + } + }, + "id": "Location", + "description": "A resource that represents Google Cloud Platform location." + }, + "ListCryptoKeysResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token to retrieve next page of results. Pass this value in\nListCryptoKeysRequest.page_token to retrieve the next page of results." + }, + "cryptoKeys": { + "description": "The list of CryptoKeys.", + "type": "array", + "items": { + "$ref": "CryptoKey" + } + }, + "totalSize": { + "type": "integer", + "description": "The total number of CryptoKeys that matched the query.", + "format": "int32" + } + }, + "id": "ListCryptoKeysResponse", + "description": "Response message for KeyManagementService.ListCryptoKeys." + }, + "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" + }, + "DestroyCryptoKeyVersionRequest": { + "type": "object", + "properties": {}, + "id": "DestroyCryptoKeyVersionRequest", + "description": "Request message for KeyManagementService.DestroyCryptoKeyVersion." + }, + "AuditLogConfig": { + "type": "object", + "properties": { + "logType": { + "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" + ], + "description": "The log type that this config enables." + }, + "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" + } + } + }, + "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." + }, + "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", + "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": { + "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.", + "format": "google-datetime", + "type": "string" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Labels with user-defined metadata. For more information, see\n[Labeling Keys](/kms/docs/labeling-keys).", + "type": "object" + }, + "createTime": { + "type": "string", + "description": "Output only. The time at which this CryptoKey was created.", + "format": "google-datetime" + }, + "rotationPeriod": { + "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.", + "format": "google-duration", + "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" + }, + "DecryptResponse": { + "description": "Response message for KeyManagementService.Decrypt.", + "type": "object", + "properties": { + "plaintext": { + "description": "The decrypted data originally supplied in EncryptRequest.plaintext.", + "format": "byte", + "type": "string" + } + }, + "id": "DecryptResponse" + }, + "TestIamPermissionsRequest": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "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", + "description": "Request message for `TestIamPermissions` method." + }, + "EncryptResponse": { + "type": "object", + "properties": { + "ciphertext": { + "type": "string", + "description": "The encrypted data.", + "format": "byte" + }, + "name": { + "type": "string", + "description": "The resource name of the CryptoKeyVersion used in encryption." + } + }, + "id": "EncryptResponse", + "description": "Response message for KeyManagementService.Encrypt." + }, + "KeyRing": { + "description": "A KeyRing is a toplevel logical grouping of CryptoKeys.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Output only. The resource name for the KeyRing in the format\n`projects/*/locations/*/keyRings/*`." + }, + "createTime": { + "type": "string", + "description": "Output only. The time at which this KeyRing was created.", + "format": "google-datetime" + } + }, + "id": "KeyRing" + }, + "ListLocationsResponse": { + "description": "The response message for Locations.ListLocations.", + "type": "object", + "properties": { + "nextPageToken": { + "type": "string", + "description": "The standard List next-page token." + }, + "locations": { + "type": "array", + "items": { + "$ref": "Location" + }, + "description": "A list of locations that matches the specified filter in the request." + } + }, + "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": { + "bindings": { + "type": "array", + "items": { + "$ref": "Binding" + }, + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error." + }, + "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", + "type": "string" + }, + "version": { + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32", + "type": "integer" + }, + "auditConfigs": { + "description": "Specifies cloud audit logging configuration for this policy.", + "type": "array", + "items": { + "$ref": "AuditConfig" + } + } + }, + "id": "Policy" + }, + "RestoreCryptoKeyVersionRequest": { + "type": "object", + "properties": {}, + "id": "RestoreCryptoKeyVersionRequest", + "description": "Request message for KeyManagementService.RestoreCryptoKeyVersion." + }, + "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": { + "type": "string", + "description": "A token to retrieve next page of results. Pass this value in\nListKeyRingsRequest.page_token to retrieve the next page of results." + }, + "totalSize": { + "description": "The total number of KeyRings that matched the query.", + "format": "int32", + "type": "integer" + }, + "keyRings": { + "description": "The list of KeyRings.", + "type": "array", + "items": { + "$ref": "KeyRing" + } + } + }, + "id": "ListKeyRingsResponse" + }, + "AuditConfig": { + "type": "object", + "properties": { + "exemptedMembers": { + "type": "array", + "items": { + "type": "string" + } + }, + "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." + } + }, + "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" } diff --git a/etc/api/cloudresourcemanager/v1/cloudresourcemanager-api.json b/etc/api/cloudresourcemanager/v1/cloudresourcemanager-api.json index 58e88fdf8d..5002f41a72 100644 --- a/etc/api/cloudresourcemanager/v1/cloudresourcemanager-api.json +++ b/etc/api/cloudresourcemanager/v1/cloudresourcemanager-api.json @@ -1,4 +1,7 @@ { + "rootUrl": "https://cloudresourcemanager.googleapis.com/", + "ownerDomain": "google.com", + "name": "cloudresourcemanager", "batchPath": "batch", "fullyEncodeReservedExpansion": true, "title": "Google Cloud Resource Manager API", @@ -6,155 +9,40 @@ "resources": { "projects": { "methods": { - "getOrgPolicy": { - "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" - }, - "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": "^projects/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ] - }, - "undelete": { - "flatPath": "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" - }, - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "POST", - "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, - "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" - ], - "response": { - "$ref": "Project" - }, - "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" - ] - }, "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": { "$ref": "ListProjectsResponse" }, - "parameters": { - "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+ `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": { - "description": "A pagination token returned from a previous call to ListProjects\nthat indicates from where listing should continue.\n\nOptional.", - "type": "string", - "location": "query" - }, - "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" - } - }, + "parameterOrder": [], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only" ], + "parameters": { + "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", + "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": "v1/projects", "path": "v1/projects", "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" @@ -166,24 +54,23 @@ "resource" ], "httpMethod": "POST", - "parameters": { - "resource": { - "location": "path", - "description": "Resource name of the resource to attach the `Policy`.", - "type": "string", - "required": true, - "pattern": "^projects/[^/]+$" - } - }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" - ] + ], + "parameters": { + "resource": { + "description": "Resource name of the resource to attach the `Policy`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}:setOrgPolicy", + "path": "v1/{+resource}:setOrgPolicy", + "id": "cloudresourcemanager.projects.setOrgPolicy" }, "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.\n\nAuthorization requires the Google IAM permission\n`resourcemanager.projects.create` on the specified parent for the new\nproject.", "response": { "$ref": "Operation" }, @@ -194,39 +81,47 @@ ], "parameters": {}, "flatPath": "v1/projects", + "path": "v1/projects", "id": "cloudresourcemanager.projects.create", - "path": "v1/projects" + "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.", + "request": { + "$ref": "Project" + } }, "listOrgPolicies": { - "request": { - "$ref": "ListOrgPoliciesRequest" - }, - "description": "Lists all the `Policies` set for a particular resource.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], "response": { "$ref": "ListOrgPoliciesResponse" }, + "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 Policies for.", - "type": "string", "required": true, - "pattern": "^projects/[^/]+$", - "location": "path" + "type": "string", + "pattern": "^projects/[^/]+$" } }, "flatPath": "v1/projects/{projectsId}:listOrgPolicies", "path": "v1/{+resource}:listOrgPolicies", - "id": "cloudresourcemanager.projects.listOrgPolicies" + "id": "cloudresourcemanager.projects.listOrgPolicies", + "description": "Lists all the `Policies` set for a particular resource.", + "request": { + "$ref": "ListOrgPoliciesRequest" + } }, "get": { + "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.", "response": { "$ref": "Project" }, @@ -240,39 +135,35 @@ ], "parameters": { "projectId": { + "location": "path", "description": "The Project ID (for example, `my-project-123`).\n\nRequired.", - "type": "string", "required": true, - "location": "path" + "type": "string" } - }, - "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": { + "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" }, - "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" }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", "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", - "required": true + "location": "path" } }, "flatPath": "v1/projects/{projectId}:getAncestry", @@ -284,33 +175,33 @@ "$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" - }, + "httpMethod": "POST", "parameterOrder": [ "resource" ], - "httpMethod": "POST", + "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.", + "required": true, + "type": "string" + } + }, "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 detail is being requested.\nSee the operation documentation for the appropriate value for this field.", - "type": "string", - "required": true, - "location": "path" - } - }, "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}", + "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.", "response": { "$ref": "Empty" @@ -324,73 +215,76 @@ ], "parameters": { "projectId": { + "location": "path", "description": "The Project ID (for example, `foo-bar-123`).\n\nRequired.", - "type": "string", "required": true, - "location": "path" + "type": "string" } } }, "clearOrgPolicy": { - "flatPath": "v1/projects/{projectsId}:clearOrgPolicy", - "path": "v1/{+resource}:clearOrgPolicy", - "id": "cloudresourcemanager.projects.clearOrgPolicy", + "description": "Clears a `Policy` from a resource.", "request": { "$ref": "ClearOrgPolicyRequest" }, - "description": "Clears a `Policy` from a resource.", - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], "response": { "$ref": "Empty" }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { "resource": { + "location": "path", "description": "Name of the resource for the `Policy` to clear.", - "type": "string", "required": true, - "pattern": "^projects/[^/]+$", - "location": "path" + "type": "string", + "pattern": "^projects/[^/]+$" } - } + }, + "flatPath": "v1/projects/{projectsId}:clearOrgPolicy", + "path": "v1/{+resource}:clearOrgPolicy", + "id": "cloudresourcemanager.projects.clearOrgPolicy" }, "setIamPolicy": { + "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+ 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" - }, + "httpMethod": "POST", "parameterOrder": [ "resource" ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], + "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, - "location": "path" + "type": "string" } }, - "flatPath": "v1/projects/{resource}:setIamPolicy", - "id": "cloudresourcemanager.projects.setIamPolicy", - "path": "v1/projects/{resource}:setIamPolicy" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] }, "listAvailableOrgPolicyConstraints": { - "description": "Lists `Constraints` that could be applied on the specified resource.", + "flatPath": "v1/projects/{projectsId}:listAvailableOrgPolicyConstraints", + "path": "v1/{+resource}:listAvailableOrgPolicyConstraints", + "id": "cloudresourcemanager.projects.listAvailableOrgPolicyConstraints", "request": { "$ref": "ListAvailableOrgPolicyConstraintsRequest" }, + "description": "Lists `Constraints` that could be applied on the specified resource.", "response": { "$ref": "ListAvailableOrgPolicyConstraintsResponse" }, @@ -400,9 +294,63 @@ "httpMethod": "POST", "parameters": { "resource": { + "location": "path", "description": "Name of the resource to list `Constraints` for.", - "type": "string", "required": true, + "type": "string", + "pattern": "^projects/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "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" + ], + "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", + "location": "path" + } + }, + "flatPath": "v1/projects/{resource}:getIamPolicy", + "path": "v1/projects/{resource}:getIamPolicy", + "id": "cloudresourcemanager.projects.getIamPolicy", + "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", + "request": { + "$ref": "GetIamPolicyRequest" + } + }, + "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.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "OrgPolicy" + }, + "parameters": { + "resource": { + "description": "Name of the resource the `Policy` is set on.", + "required": true, + "type": "string", "pattern": "^projects/[^/]+$", "location": "path" } @@ -411,20 +359,13 @@ "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" + "flatPath": "v1/projects/{projectsId}:getOrgPolicy", + "id": "cloudresourcemanager.projects.getOrgPolicy", + "path": "v1/{+resource}:getOrgPolicy" }, - "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", + "getEffectiveOrgPolicy": { "response": { - "$ref": "Policy" + "$ref": "OrgPolicy" }, "parameterOrder": [ "resource" @@ -437,195 +378,83 @@ "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.", + "description": "The name of the resource to start computing the effective `Policy`.", + "required": true, "type": "string", - "required": true + "pattern": "^projects/[^/]+$" } + }, + "flatPath": "v1/projects/{projectsId}:getEffectiveOrgPolicy", + "path": "v1/{+resource}:getEffectiveOrgPolicy", + "id": "cloudresourcemanager.projects.getEffectiveOrgPolicy", + "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.", + "request": { + "$ref": "GetEffectiveOrgPolicyRequest" } + }, + "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" + }, + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "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.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/projects/{projectId}:undelete", + "path": "v1/projects/{projectId}:undelete", + "id": "cloudresourcemanager.projects.undelete" + }, + "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" + }, + "response": { + "$ref": "Project" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The project ID (for example, `my-project-123`).\n\nRequired.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/projects/{projectId}", + "path": "v1/projects/{projectId}", + "id": "cloudresourcemanager.projects.update" } } }, "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}: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", + "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" }, - "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" }, @@ -639,19 +468,22 @@ ], "parameters": { "resource": { + "location": "path", "description": "Name of the resource the `Policy` is set on.", - "type": "string", "required": true, - "pattern": "^organizations/[^/]+$", - "location": "path" + "type": "string", + "pattern": "^organizations/[^/]+$" } - } + }, + "flatPath": "v1/organizations/{organizationsId}:getOrgPolicy", + "path": "v1/{+resource}:getOrgPolicy", + "id": "cloudresourcemanager.organizations.getOrgPolicy" }, "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.\n\nSearch will only return organizations on which the user has the permission\n`resourcemanager.organizations.get`", "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" }, @@ -663,42 +495,42 @@ ], "parameters": {}, "flatPath": "v1/organizations:search", - "id": "cloudresourcemanager.organizations.search", - "path": "v1/organizations:search" + "path": "v1/organizations:search", + "id": "cloudresourcemanager.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" - }, + "httpMethod": "POST", "parameterOrder": [ "resource" ], - "httpMethod": "POST", + "response": { + "$ref": "OrgPolicy" + }, + "parameters": { + "resource": { + "location": "path", + "description": "The name of the resource to start computing the effective `Policy`.", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+$" + } + }, "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" - } - } + "flatPath": "v1/organizations/{organizationsId}:getEffectiveOrgPolicy", + "id": "cloudresourcemanager.organizations.getEffectiveOrgPolicy", + "path": "v1/{+resource}:getEffectiveOrgPolicy" }, "get": { "flatPath": "v1/organizations/{organizationsId}", - "id": "cloudresourcemanager.organizations.get", "path": "v1/{+name}", + "id": "cloudresourcemanager.organizations.get", "description": "Fetches an Organization resource identified by the specified resource name.", "response": { "$ref": "Organization" @@ -714,25 +546,196 @@ "parameters": { "name": { "description": "The resource name of the Organization to fetch, e.g. \"organizations/1234\".", - "type": "string", "required": true, + "type": "string", "pattern": "^organizations/[^/]+$", "location": "path" } } }, "testIamPermissions": { + "flatPath": "v1/organizations/{organizationsId}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "id": "cloudresourcemanager.organizations.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\".\n\nThere are no permissions required for making this API call.", "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" }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "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 detail is being requested.\nSee the operation documentation for the appropriate value for this field.", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+$", + "location": "path" + } + } + }, + "clearOrgPolicy": { + "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.", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+$", + "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" + } + }, + "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" + }, + "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`.", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/organizations/{organizationsId}:setOrgPolicy", + "path": "v1/{+resource}:setOrgPolicy", + "id": "cloudresourcemanager.organizations.setOrgPolicy" + }, + "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", + "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": "^organizations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/organizations/{organizationsId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "cloudresourcemanager.organizations.setIamPolicy" + }, + "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": { + "description": "Name of the resource to list `Constraints` for.", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/organizations/{organizationsId}:listAvailableOrgPolicyConstraints", + "path": "v1/{+resource}:listAvailableOrgPolicyConstraints", + "id": "cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints" + }, + "listOrgPolicies": { + "response": { + "$ref": "ListOrgPoliciesResponse" + }, + "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 to list Policies for.", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/organizations/{organizationsId}:listOrgPolicies", + "path": "v1/{+resource}:listOrgPolicies", + "id": "cloudresourcemanager.organizations.listOrgPolicies", + "description": "Lists all the `Policies` set for a particular resource.", + "request": { + "$ref": "ListOrgPoliciesRequest" + } + }, + "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", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only" @@ -740,15 +743,97 @@ "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", + "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": "^organizations/[^/]+$" } }, - "flatPath": "v1/organizations/{organizationsId}:testIamPermissions", - "path": "v1/{+resource}:testIamPermissions", - "id": "cloudresourcemanager.organizations.testIamPermissions" + "flatPath": "v1/organizations/{organizationsId}:getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "id": "cloudresourcemanager.organizations.getIamPolicy" + } + } + }, + "liens": { + "methods": { + "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", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "The `next_page_token` value returned from a previous List request, if any.", + "type": "string" + }, + "pageSize": { + "description": "The maximum number of items to return. This is a suggestion for the server.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "parent": { + "description": "The name of the resource to list all attached Liens.\nFor example, `projects/1234`.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/liens", + "path": "v1/liens", + "id": "cloudresourcemanager.liens.list" + }, + "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": {}, + "flatPath": "v1/liens", + "path": "v1/liens", + "id": "cloudresourcemanager.liens.create" + }, + "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`.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name/identifier of the Lien to delete.", + "required": true, + "type": "string", + "pattern": "^liens/.+$" + } + }, + "flatPath": "v1/liens/{liensId}", + "path": "v1/{+name}", + "id": "cloudresourcemanager.liens.delete" } } }, @@ -768,109 +853,23 @@ ], "parameters": { "name": { + "location": "path", "description": "The name of the operation resource.", - "type": "string", "required": true, - "pattern": "^operations/.+$", - "location": "path" + "type": "string", + "pattern": "^operations/.+$" } }, "flatPath": "v1/operations/{operationsId}", + "path": "v1/{+name}", "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" }, @@ -884,15 +883,19 @@ "parameters": { "resource": { "description": "Name of the resource for the `Policy` to clear.", - "type": "string", "required": true, + "type": "string", "pattern": "^folders/[^/]+$", "location": "path" } }, "flatPath": "v1/folders/{foldersId}:clearOrgPolicy", + "path": "v1/{+resource}:clearOrgPolicy", "id": "cloudresourcemanager.folders.clearOrgPolicy", - "path": "v1/{+resource}:clearOrgPolicy" + "description": "Clears a `Policy` from a resource.", + "request": { + "$ref": "ClearOrgPolicyRequest" + } }, "setOrgPolicy": { "response": { @@ -908,69 +911,40 @@ "parameters": { "resource": { "description": "Resource name of the resource to attach the `Policy`.", - "type": "string", "required": true, + "type": "string", "pattern": "^folders/[^/]+$", "location": "path" } }, "flatPath": "v1/folders/{foldersId}:setOrgPolicy", - "id": "cloudresourcemanager.folders.setOrgPolicy", "path": "v1/{+resource}:setOrgPolicy", + "id": "cloudresourcemanager.folders.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`." - }, - "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" - }, + "description": "Lists `Constraints` that could be applied on the specified resource.", + "httpMethod": "POST", "parameterOrder": [ "resource" ], - "httpMethod": "POST", + "response": { + "$ref": "ListAvailableOrgPolicyConstraintsResponse" + }, "parameters": { "resource": { "description": "Name of the resource to list `Constraints` for.", - "type": "string", "required": true, + "type": "string", "pattern": "^folders/[^/]+$", "location": "path" } @@ -980,25 +954,54 @@ "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" - }, + "listOrgPolicies": { "response": { - "$ref": "OrgPolicy" + "$ref": "ListOrgPoliciesResponse" }, "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.", - "type": "string", + "description": "Name of the resource to list Policies for.", "required": true, - "pattern": "^folders/[^/]+$" + "type": "string", + "pattern": "^folders/[^/]+$", + "location": "path" + } + }, + "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" + } + }, + "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.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "OrgPolicy" + }, + "parameters": { + "resource": { + "description": "Name of the resource the `Policy` is set on.", + "required": true, + "type": "string", + "pattern": "^folders/[^/]+$", + "location": "path" } }, "scopes": [ @@ -1010,58 +1013,79 @@ "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" - }, + "httpMethod": "POST", "parameterOrder": [ "resource" ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], + "response": { + "$ref": "OrgPolicy" + }, "parameters": { "resource": { "description": "The name of the resource to start computing the effective `Policy`.", - "type": "string", "required": true, + "type": "string", "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}:getEffectiveOrgPolicy", "id": "cloudresourcemanager.folders.getEffectiveOrgPolicy", - "path": "v1/{+resource}: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." } } } }, "parameters": { - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", + "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": { "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", - "location": "query" + "default": "true" }, "fields": { "description": "Selector specifying which fields to include in a partial response.", @@ -1069,16 +1093,18 @@ "location": "query" }, "uploadType": { + "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string", - "location": "query" + "type": "string" }, "callback": { + "location": "query", "description": "JSONP", - "type": "string", - "location": "query" + "type": "string" }, "$.xgafv": { + "description": "V1 error format.", + "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -1087,17 +1113,9 @@ "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", @@ -1105,28 +1123,13 @@ ], "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.", + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], "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" } }, "version": "v1", @@ -1135,348 +1138,11 @@ "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", + "revision": "20171206", + "id": "cloudresourcemanager:v1", "discoveryVersion": "v1", "schemas": { - "FolderOperationError": { - "description": "A classification of the Folder Operation error.", - "type": "object", - "properties": { - "errorMessageId": { - "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.", - "type": "string" - } - }, - "id": "FolderOperationError" - }, - "OrgPolicy": { - "description": "Defines a Cloud Organization `Policy` which is used to specify `Constraints`\nfor configurations of Cloud Platform resources.", - "type": "object", - "properties": { - "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" - }, - "updateTime": { - "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" - } - }, - "id": "OrgPolicy" - }, - "BooleanPolicy": { - "description": "Used in `policy_type` to specify how `boolean_policy` will behave at this\nresource.", - "type": "object", - "properties": { - "enforced": { - "description": "If `true`, then the `Policy` is enforced. If `false`, then any\nconfiguration is acceptable.\n\nSuppose you have a `Constraint` `constraints/compute.disableSerialPortAccess`\nwith `constraint_default` set to `ALLOW`. A `Policy` for that\n`Constraint` exhibits the following behavior:\n - If the `Policy` at this resource has enforced set to `false`, serial\n port connection attempts will be allowed.\n - If the `Policy` at this resource has enforced set to `true`, serial\n port connection attempts will be refused.\n - If the `Policy` at this resource is `RestoreDefault`, serial port\n connection attempts will be allowed.\n - If no `Policy` is set at this resource or anywhere higher in the\n resource hierarchy, serial port connection attempts will be allowed.\n - If no `Policy` is set at this resource, but one exists higher in the\n resource hierarchy, the behavior is as if the`Policy` were set at\n this resource.\n\nThe following examples demonstrate the different possible layerings:\n\nExample 1 (nearest `Constraint` wins):\n `organizations/foo` has a `Policy` with:\n {enforced: false}\n `projects/bar` has no `Policy` set.\nThe constraint at `projects/bar` and `organizations/foo` will not be\nenforced.\n\nExample 2 (enforcement gets replaced):\n `organizations/foo` has a `Policy` with:\n {enforced: false}\n `projects/bar` has a `Policy` with:\n {enforced: true}\nThe constraint at `organizations/foo` is not enforced.\nThe constraint at `projects/bar` is enforced.\n\nExample 3 (RestoreDefault):\n `organizations/foo` has a `Policy` with:\n {enforced: true}\n `projects/bar` has a `Policy` with:\n {RestoreDefault: {}}\nThe constraint at `organizations/foo` is enforced.\nThe constraint at `projects/bar` is not enforced, because\n`constraint_default` for the `Constraint` is `ALLOW`.", - "type": "boolean" - } - }, - "id": "BooleanPolicy" - }, - "Lien": { - "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": { - "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'", - "type": "string" - }, - "origin": { - "description": "A stable, user-visible/meaningful string identifying the origin of the\nLien, intended to be inspected programmatically. Maximum length of 200\ncharacters.\n\nExample: 'compute.googleapis.com'", - "type": "string" - }, - "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']", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "id": "Lien" - }, - "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" - }, - "ListConstraint": { - "description": "A `Constraint` that allows or disallows a list of string values, which are\nconfigured by an Organization's policy administrator with a `Policy`.", - "type": "object", - "properties": { - "suggestedValue": { - "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" - }, - "SetOrgPolicyRequest": { - "description": "The request sent to the SetOrgPolicyRequest method.", - "type": "object", - "properties": { - "policy": { - "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." - } - }, - "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" - }, - "Organization": { - "description": "The root node in the resource hierarchy to which a particular entity's\n(e.g., company) resources belong.", - "type": "object", - "properties": { - "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": { - "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" - }, - "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" - } - }, - "id": "Organization" - }, - "ListAvailableOrgPolicyConstraintsResponse": { - "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" - } - }, - "id": "ListAvailableOrgPolicyConstraintsResponse" - }, - "ListPolicy": { - "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.", - "A policy with this set denies all values." - ], - "enum": [ - "ALL_VALUES_UNSPECIFIED", - "ALLOW", - "DENY" - ] - } - }, - "id": "ListPolicy" - }, - "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" - }, - "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": { - "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" - ] - }, - "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": { - "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": { - "format": "int32", - "description": "The maximum number of Organizations to return in the response.\nThis field is optional.", - "type": "integer" - } - }, - "id": "SearchOrganizationsRequest" - }, "GetAncestryRequest": { "description": "The request sent to the\nGetAncestry\nmethod.", "type": "object", @@ -1489,68 +1155,31 @@ "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" }, - "ListAvailableOrgPolicyConstraintsRequest": { - "description": "The request sent to the [ListAvailableOrgPolicyConstraints]\ngoogle.cloud.OrgPolicy.v1.ListAvailableOrgPolicyConstraints] method.", - "type": "object", - "properties": { - "pageSize": { - "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" - }, - "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": { - "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" - } - }, - "id": "Policy" - }, "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": { - "description": "The type of this operation.", - "type": "string", "enumDescriptions": [ "Operation type not specified.", "A create folder operation.", @@ -1560,23 +1189,60 @@ "OPERATION_TYPE_UNSPECIFIED", "CREATE", "MOVE" - ] - }, - "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.", + ], + "description": "The type of this operation.", "type": "string" } }, "id": "FolderOperation" }, + "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.", + "type": "array", + "items": { + "$ref": "AuditConfig" + } + }, + "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" + }, + "version": { + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32", + "type": "integer" + } + }, + "id": "Policy" + }, + "ListAvailableOrgPolicyConstraintsRequest": { + "description": "The request sent to the [ListAvailableOrgPolicyConstraints]\ngoogle.cloud.OrgPolicy.v1.ListAvailableOrgPolicyConstraints] method.", + "type": "object", + "properties": { + "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" + }, + "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", + "type": "integer" + } + }, + "id": "ListAvailableOrgPolicyConstraintsRequest" + }, "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", @@ -1608,8 +1274,8 @@ "type": "object", "properties": { "pageSize": { - "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.", + "format": "int32", "type": "integer" }, "pageToken": { @@ -1619,51 +1285,16 @@ }, "id": "ListOrgPoliciesRequest" }, - "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": { - "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" - } - }, - "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", + "type": "array", "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.", @@ -1672,11 +1303,83 @@ }, "id": "AuditConfig" }, + "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" + }, + "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 is a common set of\nmessage 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" + }, "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": { + "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" + }, "constraintDefault": { + "description": "The evaluation behavior of this constraint in the absense of 'Policy'.", + "type": "string", "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.", @@ -1686,9 +1389,7 @@ "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`", @@ -1699,21 +1400,9 @@ "$ref": "ListConstraint" }, "version": { - "format": "int32", "description": "Version of the `Constraint`. Default version is 0;", + "format": "int32", "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" @@ -1724,10 +1413,10 @@ "properties": { "liens": { "description": "A list of Liens.", + "type": "array", "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.", @@ -1736,43 +1425,16 @@ }, "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", + "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", @@ -1781,12 +1443,6 @@ }, "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", @@ -1798,43 +1454,49 @@ }, "id": "GetOrgPolicyRequest" }, + "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" + }, + "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" + }, "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.", + "ready": { + "description": "True if the project creation process is complete.", "type": "boolean" }, "createTime": { - "format": "google-datetime", "description": "Creation time of the project creation workflow.", + "format": "google-datetime", "type": "string" }, - "ready": { - "description": "True if the project creation process is complete.", + "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" } }, @@ -1858,10 +1520,10 @@ "properties": { "permissions": { "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } } }, "id": "TestIamPermissionsResponse" @@ -1883,10 +1545,10 @@ "properties": { "projects": { "description": "The list of Projects that matched the list filter. This list can\nbe paginated.", + "type": "array", "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.", @@ -1899,6 +1561,31 @@ "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." + }, + "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": { + "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" @@ -1918,45 +1605,38 @@ "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" }, + "SearchOrganizationsResponse": { + "description": "The response returned from the `SearchOrganizations` 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": { + "description": "The list of Organizations that matched the search query, possibly\npaginated.", + "type": "array", + "items": { + "$ref": "Organization" + } + } + }, + "id": "SearchOrganizationsResponse" + }, "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.", + "type": "array", "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.", @@ -1965,30 +1645,345 @@ }, "id": "ListOrgPoliciesResponse" }, - "SearchOrganizationsResponse": { - "description": "The response returned from the `SearchOrganizations` method.", + "FolderOperationError": { + "description": "A classification of the Folder Operation error.", "type": "object", "properties": { - "organizations": { - "description": "The list of Organizations that matched the search query, possibly\npaginated.", - "items": { - "$ref": "Organization" - }, - "type": "array" + "errorMessageId": { + "description": "The type of operation error experienced.", + "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" + ] + } + }, + "id": "FolderOperationError" + }, + "BooleanPolicy": { + "description": "Used in `policy_type` to specify how `boolean_policy` will behave at this\nresource.", + "type": "object", + "properties": { + "enforced": { + "description": "If `true`, then the `Policy` is enforced. If `false`, then any\nconfiguration is acceptable.\n\nSuppose you have a `Constraint` `constraints/compute.disableSerialPortAccess`\nwith `constraint_default` set to `ALLOW`. A `Policy` for that\n`Constraint` exhibits the following behavior:\n - If the `Policy` at this resource has enforced set to `false`, serial\n port connection attempts will be allowed.\n - If the `Policy` at this resource has enforced set to `true`, serial\n port connection attempts will be refused.\n - If the `Policy` at this resource is `RestoreDefault`, serial port\n connection attempts will be allowed.\n - If no `Policy` is set at this resource or anywhere higher in the\n resource hierarchy, serial port connection attempts will be allowed.\n - If no `Policy` is set at this resource, but one exists higher in the\n resource hierarchy, the behavior is as if the`Policy` were set at\n this resource.\n\nThe following examples demonstrate the different possible layerings:\n\nExample 1 (nearest `Constraint` wins):\n `organizations/foo` has a `Policy` with:\n {enforced: false}\n `projects/bar` has no `Policy` set.\nThe constraint at `projects/bar` and `organizations/foo` will not be\nenforced.\n\nExample 2 (enforcement gets replaced):\n `organizations/foo` has a `Policy` with:\n {enforced: false}\n `projects/bar` has a `Policy` with:\n {enforced: true}\nThe constraint at `organizations/foo` is not enforced.\nThe constraint at `projects/bar` is enforced.\n\nExample 3 (RestoreDefault):\n `organizations/foo` has a `Policy` with:\n {enforced: true}\n `projects/bar` has a `Policy` with:\n {RestoreDefault: {}}\nThe constraint at `organizations/foo` is enforced.\nThe constraint at `projects/bar` is not enforced, because\n`constraint_default` for the `Constraint` is `ALLOW`.", + "type": "boolean" + } + }, + "id": "BooleanPolicy" + }, + "OrgPolicy": { + "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" }, - "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.", + "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" + }, + "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", "type": "string" } }, - "id": "SearchOrganizationsResponse" + "id": "OrgPolicy" + }, + "Lien": { + "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": { + "description": "The creation time of this Lien.", + "format": "google-datetime", + "type": "string" + }, + "name": { + "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'", + "type": "string" + }, + "origin": { + "description": "A stable, user-visible/meaningful string identifying the origin of the\nLien, intended to be inspected programmatically. Maximum length of 200\ncharacters.\n\nExample: 'compute.googleapis.com'", + "type": "string" + }, + "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" + } + } + }, + "id": "Lien" + }, + "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" + }, + "ListConstraint": { + "description": "A `Constraint` that allows or disallows a list of string values, which are\nconfigured by an Organization's policy administrator with a `Policy`.", + "type": "object", + "properties": { + "suggestedValue": { + "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" + }, + "SetOrgPolicyRequest": { + "description": "The request sent to the SetOrgPolicyRequest method.", + "type": "object", + "properties": { + "policy": { + "description": "`Policy` to set on the resource.", + "$ref": "OrgPolicy" + } + }, + "id": "SetOrgPolicyRequest" + }, + "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" + }, + "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" + }, + "Organization": { + "description": "The root node in the resource hierarchy to which a particular entity's\n(e.g., company) resources belong.", + "type": "object", + "properties": { + "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": { + "description": "Timestamp when the Organization was created. Assigned by the server.\n@OutputOnly", + "format": "google-datetime", + "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" + }, + "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" + }, + "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" + } + }, + "id": "Organization" + }, + "ListAvailableOrgPolicyConstraintsResponse": { + "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.", + "type": "array", + "items": { + "$ref": "Constraint" + } + }, + "nextPageToken": { + "description": "Page token used to retrieve the next page. This is currently not used.", + "type": "string" + } + }, + "id": "ListAvailableOrgPolicyConstraintsResponse" + }, + "ListPolicy": { + "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`.", + "type": "array", + "items": { + "type": "string" + } + }, + "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" + }, + "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" + } + }, + "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.", + "A policy with this set denies all values." + ], + "enum": [ + "ALL_VALUES_UNSPECIFIED", + "ALLOW", + "DENY" + ] + } + }, + "id": "ListPolicy" + }, + "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" + }, + "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" + } + }, + "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" + }, + "SearchOrganizationsRequest": { + "description": "The request sent to the `SearchOrganizations` method.", + "type": "object", + "properties": { + "pageSize": { + "description": "The maximum number of Organizations to return in the response.\nThis field is optional.", + "format": "int32", + "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\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" + } + }, + "id": "SearchOrganizationsRequest" } }, - "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", "canonicalName": "Cloud Resource Manager", "auth": { "oauth2": { @@ -2001,8 +1996,5 @@ } } } - }, - "rootUrl": "https://cloudresourcemanager.googleapis.com/", - "ownerDomain": "google.com", - "name": "cloudresourcemanager" + } } diff --git a/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json b/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json index 8bd387cef9..95d292ae57 100644 --- a/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json +++ b/etc/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json @@ -1,250 +1,592 @@ { + "canonicalName": "Cloud Resource Manager", + "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" + } + } + } + }, + "rootUrl": "https://cloudresourcemanager.googleapis.com/", + "ownerDomain": "google.com", + "name": "cloudresourcemanager", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud Resource Manager API", + "ownerName": "Google", + "resources": { + "projects": { + "methods": { + "delete": { + "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.", + "httpMethod": "DELETE", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "Empty" + }, + "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}" + }, + "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": { + "$ref": "ListProjectsResponse" + }, + "parameters": { + "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", + "type": "integer", + "location": "query" + }, + "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+ `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": { + "description": "A pagination token returned from a previous call to ListProjects\nthat indicates from where listing should continue.\n\nOptional.", + "type": "string", + "location": "query" + } + }, + "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" + }, + "setIamPolicy": { + "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.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{resource}:setIamPolicy", + "path": "v1beta1/projects/{resource}:setIamPolicy", + "id": "cloudresourcemanager.projects.setIamPolicy", + "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.", + "request": { + "$ref": "SetIamPolicyRequest" + } + }, + "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": { + "description": "A safety hatch to opt out of the new reliable project creation process.", + "type": "boolean", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects", + "path": "v1beta1/projects", + "id": "cloudresourcemanager.projects.create" + }, + "getIamPolicy": { + "id": "cloudresourcemanager.projects.getIamPolicy", + "path": "v1beta1/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.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "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.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta1/projects/{resource}:getIamPolicy" + }, + "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" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "GET", + "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": "v1beta1/projects/{projectId}", + "path": "v1beta1/projects/{projectId}", + "id": "cloudresourcemanager.projects.get" + }, + "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.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "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": "v1beta1/projects/{projectId}:undelete", + "path": "v1beta1/projects/{projectId}:undelete", + "id": "cloudresourcemanager.projects.undelete" + }, + "update": { + "flatPath": "v1beta1/projects/{projectId}", + "path": "v1beta1/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" + }, + "response": { + "$ref": "Project" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "description": "The project ID (for example, `my-project-123`).\n\nRequired.", + "required": true, + "type": "string", + "location": "path" + } + } + }, + "getAncestry": { + "response": { + "$ref": "GetAncestryResponse" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "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", + "path": "v1beta1/projects/{projectId}:getAncestry", + "id": "cloudresourcemanager.projects.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" + } + }, + "testIamPermissions": { + "description": "Returns permissions that a caller has on the specified Project.", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "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" + } + }, + "flatPath": "v1beta1/projects/{resource}:testIamPermissions", + "path": "v1beta1/projects/{resource}:testIamPermissions", + "id": "cloudresourcemanager.projects.testIamPermissions" + } + } + }, + "organizations": { + "methods": { + "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\".", + "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.", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta1/organizations/{organizationsId}:testIamPermissions", + "path": "v1beta1/{+resource}:testIamPermissions", + "id": "cloudresourcemanager.organizations.testIamPermissions" + }, + "list": { + "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.", + "response": { + "$ref": "ListOrganizationsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "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": { + "description": "The maximum number of Organizations to return in the response.\nThis field is optional.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "flatPath": "v1beta1/organizations" + }, + "setIamPolicy": { + "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.", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/organizations/{organizationsId}:setIamPolicy", + "path": "v1beta1/{+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" + } + }, + "getIamPolicy": { + "path": "v1beta1/{+resource}:getIamPolicy", + "id": "cloudresourcemanager.organizations.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\".", + "request": { + "$ref": "GetIamPolicyRequest" + }, + "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": { + "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": "^organizations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/organizations/{organizationsId}:getIamPolicy" + }, + "get": { + "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": { + "location": "path", + "description": "The resource name of the Organization to fetch, e.g. \"organizations/1234\".", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+$" + }, + "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}", + "path": "v1beta1/{+name}", + "id": "cloudresourcemanager.organizations.get" + }, + "update": { + "flatPath": "v1beta1/organizations/{organizationsId}", + "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" + ] + } + } + } + }, + "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": { + "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": { + "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" + }, + "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": { + "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" + } + }, "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", + "documentationLink": "https://cloud.google.com/resource-manager", + "revision": "20171206", "discoveryVersion": "v1", "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" - }, - "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": { - "$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." - }, - "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" - }, - "organizationId": { - "description": "An immutable id for the Organization that is assigned on creation. This\nshould be omitted when creating a new Organization.\nThis field is read-only.\nThis field is deprecated and will be removed in v1. Use name instead.", - "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" - }, - "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": { - "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" - }, - "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" - }, - "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" - }, - "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.", - "items": { - "type": "string" - }, - "type": "array" - }, - "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" - }, - "GetAncestryRequest": { - "description": "The request sent to the\nGetAncestry\nmethod.", - "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": { - "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 DeleteProject)\nor by the system (Google Cloud Platform).\nThis can generally be reversed by invoking UndeleteProject.", - "This lifecycle state is no longer used and is not returned by the API." - ], - "enum": [ - "LIFECYCLE_STATE_UNSPECIFIED", - "ACTIVE", - "DELETE_REQUESTED", - "DELETE_IN_PROGRESS" - ], - "description": "The Project lifecycle state.\n\nRead-only.", - "type": "string" - }, - "projectNumber": { - "format": "int64", - "description": "The number uniquely identifying the project.\n\nExample: \u003ccode\u003e415104041262\u003c/code\u003e\nRead-only.", - "type": "string" - }, - "parent": { - "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.", - "type": "object", - "additionalProperties": { - "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" - }, "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" @@ -253,40 +595,69 @@ "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": { - "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.", + "format": "byte", "type": "string" }, "version": { - "format": "int32", "description": "Version of the `Policy`. The default version is 0.", + "format": "int32", "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`.\n`bindings` with no members will result in an error.", + "type": "array", + "items": { + "$ref": "Binding" + } } }, "id": "Policy" }, + "FolderOperation": { + "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", + "description": "Metadata describing a long running folder operation", + "type": "object" + }, "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.", "The attempted action would violate the max folder depth constraint.", @@ -310,43 +681,14 @@ "FOLDER_BEING_MOVED_VIOLATION", "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION", "DELETED_FOLDER_HEIGHT_VIOLATION" - ] - } - }, - "id": "FolderOperationError" - }, - "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.", + "description": "The type of operation error experienced.", "type": "string" } }, - "id": "FolderOperation" + "id": "FolderOperationError", + "description": "A classification of the Folder Operation error.", + "type": "object" }, "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.", @@ -367,16 +709,16 @@ "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" @@ -386,30 +728,12 @@ "type": "object", "properties": { "resourceId": { - "description": "Resource id of the ancestor.", - "$ref": "ResourceId" + "$ref": "ResourceId", + "description": "Resource id of the ancestor." } }, "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", @@ -419,23 +743,41 @@ "$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.", + "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": { + "description": "The list of Organizations that matched the list query, possibly paginated.", + "type": "array", + "items": { + "$ref": "Organization" + } + } + }, + "id": "ListOrganizationsResponse" + }, "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": { "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", @@ -443,578 +785,236 @@ } }, "id": "Binding" - } - }, - "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 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": { - "organizations": { - "methods": { - "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\".", - "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": "v1beta1/organizations/{organizationsId}:testIamPermissions", - "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", - "parameterOrder": [], - "response": { - "$ref": "ListOrganizationsResponse" - }, - "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 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" - } - }, - "flatPath": "v1beta1/organizations", - "path": "v1beta1/organizations", - "id": "cloudresourcemanager.organizations.list" - }, - "setIamPolicy": { - "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" - } - }, - "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": { - "$ref": "GetIamPolicyRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], - "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" - ], - "flatPath": "v1beta1/projects/{resource}:getIamPolicy", - "path": "v1beta1/projects/{resource}:getIamPolicy", - "id": "cloudresourcemanager.projects.getIamPolicy" + "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" + }, + "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": { + "$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." }, - "undelete": { - "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" - ], - "response": { - "$ref": "Empty" - }, - "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" - } - } + "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" }, - "get": { - "response": { - "$ref": "Project" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "GET", - "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.", - "type": "string", - "required": true, - "location": "path" - } - }, - "flatPath": "v1beta1/projects/{projectId}", - "id": "cloudresourcemanager.projects.get", - "path": "v1beta1/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." + "organizationId": { + "description": "An immutable id for the Organization that is assigned on creation. This\nshould be omitted when creating a new Organization.\nThis field is read-only.\nThis field is deprecated and will be removed in v1. Use name instead.", + "type": "string" }, - "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" - }, - "response": { - "$ref": "GetAncestryResponse" - }, - "parameterOrder": [ - "projectId" + "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.", + "The organization has been marked for deletion by the user." ], - "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" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "PUT", - "parameters": { - "projectId": { - "location": "path", - "description": "The project ID (for example, `my-project-123`).\n\nRequired.", - "type": "string", - "required": true - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" + "enum": [ + "LIFECYCLE_STATE_UNSPECIFIED", + "ACTIVE", + "DELETE_REQUESTED" ] }, - "testIamPermissions": { - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "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.", - "type": "string", - "required": true - } - }, - "flatPath": "v1beta1/projects/{resource}:testIamPermissions", - "id": "cloudresourcemanager.projects.testIamPermissions", - "path": "v1beta1/projects/{resource}:testIamPermissions" + "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" }, - "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." + "creationTime": { + "description": "Timestamp when the Organization was created. Assigned by the server.\n@OutputOnly", + "format": "google-datetime", + "type": "string" + } + }, + "id": "Organization" + }, + "UndeleteProjectRequest": { + "properties": {}, + "id": "UndeleteProjectRequest", + "description": "The request sent to the UndeleteProject\nmethod.", + "type": "object" + }, + "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" }, - "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" + "createTime": { + "description": "Creation time of the project creation workflow.", + "format": "google-datetime", + "type": "string" }, - "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}: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" - } + "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" + } + }, + "id": "ProjectCreationStatus" + }, + "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" + }, + "GetIamPolicyRequest": { + "properties": {}, + "id": "GetIamPolicyRequest", + "description": "Request message for `GetIamPolicy` method.", + "type": "object" + }, + "GetAncestryResponse": { + "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", + "description": "Response from the GetAncestry method.", + "type": "object" + }, + "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.", + "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" + }, + "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": { + "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" + } + } + }, + "id": "AuditLogConfig" + }, + "GetAncestryRequest": { + "description": "The request sent to the\nGetAncestry\nmethod.", + "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": { + "lifecycleState": { + "enum": [ + "LIFECYCLE_STATE_UNSPECIFIED", + "ACTIVE", + "DELETE_REQUESTED", + "DELETE_IN_PROGRESS" + ], + "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 DeleteProject)\nor by the system (Google Cloud Platform).\nThis can generally be reversed by invoking UndeleteProject.", + "This lifecycle state is no longer used and is not returned by the API." + ] + }, + "projectNumber": { + "description": "The number uniquely identifying the project.\n\nExample: \u003ccode\u003e415104041262\u003c/code\u003e\nRead-only.", + "format": "int64", + "type": "string" + }, + "parent": { + "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": { + "description": "Creation time.\n\nRead-only.", + "format": "google-datetime", + "type": "string" + }, + "labels": { + "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.", + "type": "object" + }, + "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" } }, - "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", - "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": { - "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" - } - } + "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/cloudresourcemanager/v2beta1/cloudresourcemanager-api.json b/etc/api/cloudresourcemanager/v2beta1/cloudresourcemanager-api.json index d761846a83..f701ff392a 100644 --- a/etc/api/cloudresourcemanager/v2beta1/cloudresourcemanager-api.json +++ b/etc/api/cloudresourcemanager/v2beta1/cloudresourcemanager-api.json @@ -1,25 +1,83 @@ { + "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": "20171206", + "documentationLink": "https://cloud.google.com/resource-manager", + "id": "cloudresourcemanager:v2beta1", + "discoveryVersion": "v1", "schemas": { - "TestIamPermissionsRequest": { - "description": "Request message for `TestIamPermissions` 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": { - "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).", + "auditConfigs": { + "description": "Specifies cloud audit logging configuration for this policy.", + "type": "array", "items": { - "type": "string" - }, - "type": "array" + "$ref": "AuditConfig" + } + }, + "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" + }, + "version": { + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32", + "type": "integer" } }, - "id": "TestIamPermissionsRequest" + "id": "Policy" + }, + "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": { + "description": "The type of this operation.", + "type": "string", + "enumDescriptions": [ + "Operation type not specified.", + "A create folder operation.", + "A move folder operation." + ], + "enum": [ + "OPERATION_TYPE_UNSPECIFIED", + "CREATE", + "MOVE" + ] + } + }, + "id": "FolderOperation" }, "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.", @@ -44,106 +102,43 @@ "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION", "DELETED_FOLDER_HEIGHT_VIOLATION" ], - "description": "The type of operation error experienced." + "description": "The type of operation error experienced.", + "type": "string" } }, "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": { + "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" - }, - "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" @@ -154,77 +149,77 @@ "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" }, "ListFoldersResponse": { + "description": "The ListFolders response message.", + "type": "object", "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": { + "description": "A possibly paginated list of Folders that are direct descendants of\nthe specified parent resource.", + "type": "array", "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" + "id": "ListFoldersResponse" }, "MoveFolderRequest": { + "description": "The MoveFolder request message.", "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.", + "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}`.", "type": "string" } }, - "id": "SearchFoldersResponse", + "id": "MoveFolderRequest" + }, + "SearchFoldersResponse": { "description": "The response message for searching folders.", - "type": "object" + "type": "object", + "properties": { + "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" + }, + "folders": { + "description": "A possibly paginated folder search results.\nthe specified parent resource.", + "type": "array", + "items": { + "$ref": "Folder" + } + } + }, + "id": "SearchFoldersResponse" }, "SetIamPolicyRequest": { "description": "Request message for `SetIamPolicy` method.", "type": "object", "properties": { + "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" + }, "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" @@ -235,18 +230,18 @@ "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": { - "type": "object", "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - } - }, - "type": "array" + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + } }, "code": { - "format": "int32", "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", "type": "integer" }, "message": { @@ -257,82 +252,74 @@ "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", + "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" } - } + }, + "id": "Binding" }, "SearchFoldersRequest": { + "description": "The request message for searching folders.", "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.", + "format": "int32", "type": "integer" + }, + "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" } }, - "id": "SearchFoldersRequest", - "description": "The request message for searching folders." + "id": "SearchFoldersRequest" }, "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" + "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" }, - "createTime": { - "type": "string", - "format": "google-datetime", - "description": "Creation time of the project creation workflow." + "ready": { + "description": "True if the project creation process is complete.", + "type": "boolean" } }, "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.", + "format": "google-datetime", "type": "string" }, "lifecycleState": { + "description": "Output only. The lifecycle state of the folder.\nUpdates to the lifecycle_state must be performed via\n[DeleteFolder] and [UndeleteFolder].", "type": "string", "enumDescriptions": [ "Unspecified state.", @@ -343,20 +330,22 @@ "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" + }, + "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" } - } - }, - "GetIamPolicyRequest": { - "description": "Request message for `GetIamPolicy` method.", - "type": "object", - "properties": {}, - "id": "GetIamPolicyRequest" + }, + "id": "Folder" }, "TestIamPermissionsResponse": { "description": "Response message for `TestIamPermissions` method.", @@ -364,14 +353,20 @@ "properties": { "permissions": { "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } } }, "id": "TestIamPermissionsResponse" }, + "GetIamPolicyRequest": { + "description": "Request message for `GetIamPolicy` method.", + "type": "object", + "properties": {}, + "id": "GetIamPolicyRequest" + }, "UndeleteFolderRequest": { "description": "The UndeleteFolder request message.", "type": "object", @@ -379,17 +374,17 @@ "id": "UndeleteFolderRequest" }, "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", - "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", @@ -401,12 +396,26 @@ "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" + "id": "AuditLogConfig" + }, + "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", @@ -437,207 +446,14 @@ "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": { + "flatPath": "v2beta1/folders:search", + "path": "v2beta1/folders:search", + "id": "cloudresourcemanager.folders.search", + "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`.", + "request": { + "$ref": "SearchFoldersRequest" + }, "response": { "$ref": "SearchFoldersResponse" }, @@ -647,16 +463,16 @@ "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`." + "parameters": {} }, "undelete": { + "flatPath": "v2beta1/folders/{foldersId}:undelete", + "path": "v2beta1/{+name}:undelete", + "id": "cloudresourcemanager.folders.undelete", + "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.", + "request": { + "$ref": "UndeleteFolderRequest" + }, "response": { "$ref": "Folder" }, @@ -669,20 +485,13 @@ ], "parameters": { "name": { - "type": "string", + "description": "The resource name of the Folder to undelete.\nMust be of the form `folders/{folder_id}`.", "required": true, + "type": "string", "pattern": "^folders/[^/]+$", - "location": "path", - "description": "The resource name of the Folder to undelete.\nMust be of the form `folders/{folder_id}`." + "location": "path" } - }, - "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.", @@ -693,83 +502,311 @@ "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" ], + "parameters": { + "name": { + "location": "path", + "description": "The resource name of the Folder to retrieve.\nMust be of the form `folders/{folder_id}`.", + "required": true, + "type": "string", + "pattern": "^folders/[^/]+$" + } + }, "flatPath": "v2beta1/folders/{foldersId}", - "id": "cloudresourcemanager.folders.get", - "path": "v2beta1/{+name}" + "path": "v2beta1/{+name}", + "id": "cloudresourcemanager.folders.get" }, "patch": { + "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.", "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" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "updateMask": { + "location": "query", + "description": "Fields to be updated.\nOnly the `display_name` can be updated.", + "format": "google-fieldmask", + "type": "string" + }, + "name": { + "location": "path", + "description": "Output only. The resource name of the Folder.\nIts format is `folders/{folder_id}`, for example: \"folders/1234\".", + "required": true, + "type": "string", + "pattern": "^folders/[^/]+$" + } + }, + "flatPath": "v2beta1/folders/{foldersId}", + "path": "v2beta1/{+name}", + "id": "cloudresourcemanager.folders.patch" + }, + "move": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", "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", + "description": "The resource name of the Folder to move.\nMust be of the form folders/{folder_id}", "required": true, + "type": "string", + "pattern": "^folders/[^/]+$" + } + }, + "flatPath": "v2beta1/folders/{foldersId}:move", + "path": "v2beta1/{+name}:move", + "id": "cloudresourcemanager.folders.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" + } + }, + "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": "^folders/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/folders/{foldersId}:testIamPermissions", + "id": "cloudresourcemanager.folders.testIamPermissions", + "path": "v2beta1/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "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." + }, + "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.", + "response": { + "$ref": "Folder" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "the resource name of the Folder to be deleted.\nMust be of the form `folders/{folder_id}`.", + "required": true, + "type": "string", "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" + "id": "cloudresourcemanager.folders.delete" + }, + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListFoldersResponse" + }, + "parameterOrder": [], + "parameters": { + "showDeleted": { + "location": "query", + "description": "Controls whether Folders in the [DELETE_REQUESTED} state should\nbe returned.", + "type": "boolean" + }, + "pageToken": { + "location": "query", + "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" + }, + "pageSize": { + "location": "query", + "description": "The maximum number of Folders to return in the response.\nThis field is optional.", + "format": "int32", + "type": "integer" + }, + "parent": { + "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", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "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." + }, + "create": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "The resource name of the new Folder's parent.\nMust be of the form `folders/{folder_id}` or `organizations/{org_id}`.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v2beta1/folders", + "path": "v2beta1/folders", + "id": "cloudresourcemanager.folders.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" + } + }, + "setIamPolicy": { + "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.", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "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.", + "required": true, + "type": "string", + "pattern": "^folders/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta1/folders/{foldersId}:setIamPolicy", + "path": "v2beta1/{+resource}:setIamPolicy", + "id": "cloudresourcemanager.folders.setIamPolicy" + }, + "getIamPolicy": { + "request": { + "$ref": "GetIamPolicyRequest" + }, + "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.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "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.", + "required": true, + "type": "string", + "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" } } } }, "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": { + "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": { - "default": "true", + "description": "Returns response with indentations and line breaks.", "type": "boolean", - "location": "query", - "description": "Returns response with indentations and line breaks." + "default": "true", + "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" + "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" @@ -778,16 +815,15 @@ "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": [ @@ -795,17 +831,6 @@ "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": { @@ -813,36 +838,11 @@ "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.", + "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": "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" + "version": "v2beta1" } diff --git a/etc/api/cloudtasks/v2beta2/cloudtasks-api.json b/etc/api/cloudtasks/v2beta2/cloudtasks-api.json index 930fc82670..11ec65695c 100644 --- a/etc/api/cloudtasks/v2beta2/cloudtasks-api.json +++ b/etc/api/cloudtasks/v2beta2/cloudtasks-api.json @@ -1,113 +1,10 @@ { - "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/", + "revision": "20171208", "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", @@ -124,7 +21,7 @@ "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.", + "description": "Output only. The host that the task is sent to.\n\nFor 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": { @@ -179,12 +76,12 @@ "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" - } + }, + "description": "Service-specific metadata. For example the available capacity at the given\nlocation.", + "type": "object" } }, "id": "Location" @@ -194,8 +91,8 @@ "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.", + "format": "google-datetime", "type": "string" } }, @@ -207,13 +104,12 @@ "properties": { "queues": { "description": "The list of queues.", + "type": "array", "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" } @@ -226,110 +122,63 @@ "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" }, - "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": { + "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": { - "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.", + "format": "byte", "type": "string" }, "version": { - "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`.\n`bindings` with no members will result in an error.", - "items": { - "$ref": "Binding" - }, - "type": "array" } }, "id": "Policy" }, - "AppEngineTaskTarget": { - "description": "Deprecated. Use AppEngineHttpRequest.", + "ListLocationsResponse": { + "description": "The response message for Locations.ListLocations.", "type": "object", "properties": { - "relativeUrl": { - "description": "Deprecated. Use AppEngineHttpRequest.relative_url.", - "type": "string" - }, - "headers": { - "description": "Deprecated. Use AppEngineHttpRequest.headers.", - "type": "object", - "additionalProperties": { - "type": "string" + "locations": { + "description": "A list of locations that matches the specified filter in the request.", + "type": "array", + "items": { + "$ref": "Location" } }, - "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.", + "nextPageToken": { + "description": "The standard List next-page token.", "type": "string" } }, - "id": "AppEngineTaskTarget" + "id": "ListLocationsResponse" }, "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.", + "format": "google-datetime", "type": "string" }, "responseView": { @@ -337,8 +186,8 @@ "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." + "The basic view omits fields which can be large or can contain\nsensitive data.\n\nThis view does not include (AppEngineHttpRequest.payload\nand PullMessage.payload). These payloads are desirable to\nreturn only when needed, because they can be large and because\nof the sensitivity of the data that you choose to store in it.", + "All information is returned.\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", @@ -353,28 +202,50 @@ "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": { + "description": "Output only. The time that this attempt response was received.\n\n`response_time` will be truncated to the nearest microsecond.", "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" }, + "responseStatus": { + "description": "Output only. The 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" + }, "scheduleTime": { + "description": "Output only. The time that this attempt was scheduled.\n\n`schedule_time` will be truncated to the nearest microsecond.", "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": { + "description": "Output only. The time that this attempt was dispatched.\n\n`dispatch_time` will be truncated to the nearest microsecond.", "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" }, + "RateLimits": { + "description": "Rate limits.\n\nThis message determines the maximum rate that tasks can be dispatched by a\nqueue, regardless of whether the dispatch is a first task attempt or a retry.", + "type": "object", + "properties": { + "maxTasksDispatchedPerSecond": { + "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 In addition to the `max_tasks_dispatched_per_second` limit, a maximum of\n 10 QPS of CloudTasks.PullTasks requests are allowed per queue.\n\nThis field has the same meaning as\n[rate in queue.yaml](/appengine/docs/standard/python/config/queueref#rate).", + "format": "double", + "type": "number" + }, + "maxBurstSize": { + "description": "Output only. The max burst size.\n\nMax burst size limits how fast the queue is processed when many\ntasks are in the queue and the rate is high. This field allows\nthe queue to have a high rate so processing starts shortly after\na task is enqueued, but still limits resource usage when many\ntasks are enqueued in a short period of time.\n\n* For App Engine queues, if\n RateLimits.max_tasks_dispatched_per_second is 1, this\n field is 10; otherwise this field is\n RateLimits.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).", + "format": "int32", + "type": "integer" + }, + "maxConcurrentTasks": { + "description": "The maximum number of concurrent 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\nconcurrent 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).", + "format": "int32", + "type": "integer" + } + }, + "id": "RateLimits" + }, "PurgeQueueRequest": { "description": "Request message for CloudTasks.PurgeQueue.", "type": "object", @@ -394,8 +265,8 @@ "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." + "The basic view omits fields which can be large or can contain\nsensitive data.\n\nThis view does not include (AppEngineHttpRequest.payload\nand PullMessage.payload). These payloads are desirable to\nreturn only when needed, because they can be large and because\nof the sensitivity of the data that you choose to store in it.", + "All information is returned.\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", @@ -414,10 +285,10 @@ "properties": { "tasks": { "description": "The leased tasks.", + "type": "array", "items": { "$ref": "Task" - }, - "type": "array" + } } }, "id": "PullTasksResponse" @@ -426,52 +297,44 @@ "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": { + "description": "Output only. The view specifies which subset of the Task has\nbeen returned.", + "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." + "The basic view omits fields which can be large or can contain\nsensitive data.\n\nThis view does not include (AppEngineHttpRequest.payload\nand PullMessage.payload). These payloads are desirable to\nreturn only when needed, because they can be large and because\nof the sensitivity of the data that you choose to store in it.", + "All information is returned.\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." + "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.", + "$ref": "PullMessage" }, "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.", + "format": "google-datetime", "type": "string" }, "createTime": { + "description": "Output only. The time that the task was created.\n\n`create_time` will be truncated to the nearest second.", "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.", + "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 letters ([A-Za-z]), numbers ([0-9]),\n hyphens (-), colons (:), or periods (.).\n For more information, see\n [Identifying projects](/resource-manager/docs/creating-managing-projects#identifying_projects)\n* `LOCATION_ID` is the canonical ID for the task's location.\n The list of available locations can be obtained by calling\n google.cloud.location.Locations.ListLocations.\n For more information, see https://cloud.google.com/about/locations/.\n* `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or\n hyphens (-). The maximum length is 100 characters.\n* `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),\n hyphens (-), or underscores (_). The maximum length is 500 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.", + "description": "Output only. The task status.", "$ref": "TaskStatus" } }, @@ -481,14 +344,14 @@ "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": { + "tag": { + "description": "The task's tag.\n\nTags allow similar tasks to be processed in a batch. If you label\ntasks with a tag, your task worker can pull tasks\nwith the same tag using PullTasksRequest.filter. For example,\nif you want to aggregate the events associated with a specific\nuser once a day, you could tag tasks with the user ID.\n\nThe task's tag can only be set when the\ntask is created.\n\nThe tag must be less than 500 bytes.", "format": "byte", - "description": "A data payload consumed by the task worker to execute the task.", "type": "string" }, - "tag": { + "payload": { + "description": "A data payload consumed by the task worker to execute the task.", "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" } }, @@ -498,25 +361,25 @@ "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": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + } + }, "code": { - "format": "int32", "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 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" @@ -527,10 +390,10 @@ "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", @@ -544,13 +407,13 @@ "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.", + "format": "google-datetime", "type": "string" }, - "newLeaseDuration": { + "leaseDuration": { + "description": "Required.\n\nThe desired new lease duration, starting from now.\n\n\nThe maximum lease duration is 1 week.\n`lease_duration` will be truncated to the nearest second.", "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": { @@ -558,8 +421,8 @@ "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." + "The basic view omits fields which can be large or can contain\nsensitive data.\n\nThis view does not include (AppEngineHttpRequest.payload\nand PullMessage.payload). These payloads are desirable to\nreturn only when needed, because they can be large and because\nof the sensitivity of the data that you choose to store in it.", + "All information is returned.\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", @@ -574,22 +437,22 @@ "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).", + "lastAttemptStatus": { + "description": "Output only. The status of the task's last attempt.\n\nThis field is not calculated for\n[pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget).", "$ref": "AttemptStatus" }, - "attemptResponseCount": { + "attemptDispatchCount": { + "description": "Output only. The number of attempts dispatched.\n\nThis count includes tasks which have been dispatched but haven't\nreceived a response.", "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": { + "firstAttemptStatus": { "$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)." + "description": "Output only. The 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)." }, - "attemptDispatchCount": { + "attemptResponseCount": { + "description": "Output only. The number of attempts which have received a response.\n\nThis field is not calculated for\n[pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget).", "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" } }, @@ -600,7 +463,7 @@ "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.", + "description": "The relative URL.\n\nThe relative URL must begin with \"/\" and must be a valid HTTP relative URL.\nIt can contain a path and query string arguments.\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": { @@ -611,11 +474,11 @@ "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" + "$ref": "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." }, "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).", + "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). 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", @@ -635,93 +498,65 @@ ] }, "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.", + "format": "byte", "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.", + "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" + }, + "RetryConfig": { + "description": "Retry config.\n\nThese settings determine how a failed task attempt is retried.", "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": { + "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.\n\nThis field has the same meaning as\n[min_backoff_seconds in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters).", "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": { + "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.\n\nThis field has the same meaning as\n[max_backoff_seconds in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters).", "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" + }, + "maxRetryDuration": { + "description": "If positive, `max_retry_duration` specifies the time limit for retrying a\nfailed task, measured from when the task was first attempted. Once\n`max_retry_duration` time has passed *and* the task has been attempted\nRetryConfig.max_attempts times, no further attempts will be made and\nthe task will be deleted.\n\nIf zero, then the task age is unlimited.\n\n* For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget),\n this field is 0 seconds by default.\n* For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this\n field is output only and always 0.\n\n`max_retry_duration` will be truncated to the nearest second.\n\nThis field has the same meaning as\n[task_age_limit in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters).", + "format": "google-duration", + "type": "string" + }, + "maxDoublings": { + "description": "The time between retries will double `max_doublings` times.\n\nA task's retry interval starts at RetryConfig.min_backoff,\nthen doubles `max_doublings` times, then increases linearly, and\nfinally retries retries at intervals of\nRetryConfig.max_backoff up to max_attempts times.\n\nFor example, if RetryConfig.min_backoff is 10s,\nRetryConfig.max_backoff is 300s, and `max_doublings` is 3,\nthen the a task will first be retried in 10s. The retry interval\nwill double three times, and then increase linearly by 2^3 * 10s.\nFinally, the task will retry at intervals of\nRetryConfig.max_backoff until the task has been attempted\n`max_attempts` times. Thus, the requests will retry at 10s, 20s,\n40s, 80s, 160s, 240s, 300s, 300s, ....\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.\n\nThis field has the same meaning as\n[max_doublings in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters).", + "format": "int32", + "type": "integer" + }, + "maxAttempts": { + "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.", + "format": "int32", + "type": "integer" } }, "id": "RetryConfig" @@ -732,68 +567,128 @@ "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" + "$ref": "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\nIf Task.schedule_time is not set or is in the past then Cloud\nTasks will set it to the current time.\n\nTask De-duplication:\n\nExplicitly specifying a task ID enables task de-duplication. If\na task's ID is identical to that of an existing task or a task\nthat was deleted or completed recently then the call will fail\nwith google.rpc.Code.ALREADY_EXISTS. If the task's queue was\ncreated using Cloud Tasks, then another task with the same name\ncan't be created for ~1hour after the original task was deleted\nor completed. If the task's queue was created using queue.yaml or\nqueue.xml, then another task with the same name can't be created\nfor ~9days after the original task was deleted or completed.\n\nBecause there is an extra lookup cost to identify duplicate task\nnames, these CloudTasks.CreateTask calls have significantly\nincreased latency. Using hashed strings for the task id or for\nthe prefix of the task id is recommended. Choosing task ids that\nare sequential 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." + }, + "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 (AppEngineHttpRequest.payload\nand PullMessage.payload). These payloads are desirable to\nreturn only when needed, because they can be large and because\nof the sensitivity of the data that you choose to store in it.", + "All information is returned.\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": "CreateTaskRequest" + }, + "ListTasksResponse": { + "description": "Response message for listing tasks using CloudTasks.ListTasks.", + "type": "object", + "properties": { + "tasks": { + "description": "The list of tasks.", + "type": "array", + "items": { + "$ref": "Task" + } + }, + "nextPageToken": { + "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" + } + }, + "id": "ListTasksResponse" + }, + "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": { + "pullTarget": { + "$ref": "PullTarget", + "description": "Pull target.\n\nA pull queue is a queue that has a PullTarget." + }, + "appEngineHttpTarget": { + "description": "App Engine HTTP target.\n\nAn App Engine queue is a queue that has an AppEngineHttpTarget.", + "$ref": "AppEngineHttpTarget" + }, + "purgeTime": { + "description": "Output only. The last time this queue was purged.\n\nAll tasks that were created before this time\nwere 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.", + "format": "google-datetime", + "type": "string" + }, + "state": { + "description": "Output only. The state of the queue.\n\n`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 `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": [ + "STATE_UNSPECIFIED", + "RUNNING", + "PAUSED", + "DISABLED" + ] + }, + "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).", + "$ref": "RetryConfig" + }, + "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 letters ([A-Za-z]), numbers ([0-9]),\n hyphens (-), colons (:), or periods (.).\n For more information, see\n [Identifying projects](/resource-manager/docs/creating-managing-projects#identifying_projects)\n* `LOCATION_ID` is the canonical ID for the queue's location.\n The list of available locations can be obtained by calling\n google.cloud.location.Locations.ListLocations.\n For more information, see https://cloud.google.com/about/locations/.\n* `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or\n hyphens (-). The maximum length is 100 characters.\n\nCaller-specified and required in CreateQueueRequest, after which\nit becomes output only.", + "type": "string" + }, + "rateLimits": { + "$ref": "RateLimits", + "description": "Rate limits for task dispatches.\n\nQueue.rate_limits and Queue.retry_config are related because they\nboth control task attempts however they control how tasks are attempted in\ndifferent ways:\n\n* Queue.rate_limits controls the total rate of dispatches from a queue\n (i.e. all traffic dispatched from the queue, regardless of whether the\n dispatch is from a first attempt or a retry).\n* Queue.retry_config controls what happens to particular a task after\n its first attempt fails. That is, Queue.retry_config controls task\n retries (the second attempt, third attempt, etc)." + } + }, + "id": "Queue" + }, + "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` must be less than\n500 bytes.\n\nWhen `filter` is set to `tag_function=oldest_tag()`, only tasks which have\nthe same tag as the task with the oldest schedule_time will be returned.\n\nGrammar Syntax:\n\n* `filter = \"tag=\" tag | \"tag_function=\" function`\n\n* `tag = string | bytes`\n\n* `function = \"oldest_tag()\"`\n\nThe `oldest_tag()` function returns tasks which have the same tag as the\noldest task (ordered by schedule time).", + "type": "string" + }, + "maxTasks": { + "description": "The maximum number of tasks to lease. The maximum that can be\nrequested is 1000.", + "format": "int32", + "type": "integer" + }, + "leaseDuration": { + "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.", + "format": "google-duration", + "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." + "The basic view omits fields which can be large or can contain\nsensitive data.\n\nThis view does not include (AppEngineHttpRequest.payload\nand PullMessage.payload). These payloads are desirable to\nreturn only when needed, because they can be large and because\nof the sensitivity of the data that you choose to store in it.", + "All information is returned.\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", @@ -802,13 +697,13 @@ ] } }, - "id": "CreateTaskRequest" + "id": "PullTasksRequest" } }, "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" }, "canonicalName": "Cloud Tasks", "auth": { @@ -832,66 +727,66 @@ "resources": { "locations": { "methods": { + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListLocationsResponse" + }, + "parameters": { + "pageSize": { + "location": "query", + "description": "The standard list page size.", + "format": "int32", + "type": "integer" + }, + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "name": { + "description": "The resource that owns the locations collection, if applicable.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta2/projects/{projectsId}/locations", + "id": "cloudtasks.projects.locations.list", + "path": "v2beta2/{+name}/locations", + "description": "Lists information about the supported locations for this service." + }, "get": { + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}", + "id": "cloudtasks.projects.locations.get", + "path": "v2beta2/{+name}", "description": "Get information about a location.", + "httpMethod": "GET", "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/[^/]+$" + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" } }, "scopes": [ @@ -902,6 +797,40 @@ "resources": { "queues": { "methods": { + "patch": { + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}", + "id": "cloudtasks.projects.locations.queues.patch", + "path": "v2beta2/{+name}", + "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: Using this method may have unintended side effects if you are\nusing an App Engine `queue.yaml` or `queue.xml` file to manage your queues.\nRead\n[Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)\ncarefully before using this method.", + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Queue" + }, + "parameters": { + "updateMask": { + "location": "query", + "description": "A mask used to specify which fields of the queue are being updated.\n\nIf empty, then all fields will be updated.", + "format": "google-fieldmask", + "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 letters ([A-Za-z]), numbers ([0-9]),\n hyphens (-), colons (:), or periods (.).\n For more information, see\n [Identifying projects](/resource-manager/docs/creating-managing-projects#identifying_projects)\n* `LOCATION_ID` is the canonical ID for the queue's location.\n The list of available locations can be obtained by calling\n google.cloud.location.Locations.ListLocations.\n For more information, see https://cloud.google.com/about/locations/.\n* `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or\n hyphens (-). The maximum length is 100 characters.\n\nCaller-specified and required in CreateQueueRequest, after which\nit becomes output only.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "get": { "description": "Gets a queue.", "response": { @@ -911,92 +840,58 @@ "name" ], "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "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}" + "path": "v2beta2/{+name}", + "id": "cloudtasks.projects.locations.queues.get" }, "purge": { + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:purge", + "id": "cloudtasks.projects.locations.queues.purge", + "path": "v2beta2/{+name}:purge", + "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.", "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" - }, + "httpMethod": "POST", "parameterOrder": [ "name" ], - "httpMethod": "POST", + "response": { + "$ref": "Queue" + }, "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/[^/]+$", - "location": "path" + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" } - }, - "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", + "id": "cloudtasks.projects.locations.queues.testIamPermissions", + "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.", "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" }, @@ -1011,17 +906,17 @@ "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, + "type": "string", "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" } } }, "pause": { + "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.state; if paused it will be set to\nQueue.State.PAUSED.", "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" }, @@ -1036,30 +931,30 @@ "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, + "type": "string", "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" } }, "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:pause", - "id": "cloudtasks.projects.locations.queues.pause", - "path": "v2beta2/{+name}:pause" + "path": "v2beta2/{+name}:pause", + "id": "cloudtasks.projects.locations.queues.pause" }, "delete": { - "httpMethod": "DELETE", - "parameterOrder": [ - "name" - ], "response": { "$ref": "Empty" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", "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/[^/]+$" + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", + "location": "path" } }, "scopes": [ @@ -1068,63 +963,122 @@ "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)." + "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: Using this method may have unintended side effects if you are\nusing an App Engine `queue.yaml` or `queue.xml` file to manage your queues.\nRead\n[Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)\ncarefully before using this method." }, "list": { - "httpMethod": "GET", - "parameterOrder": [ - "parent" - ], + "description": "Lists queues.\n\nQueues are returned in lexicographical order.", "response": { "$ref": "ListQueuesResponse" }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { "filter": { + "location": "query", "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" + "type": "string" }, "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" + "format": "int32", + "type": "integer", + "location": "query" }, "parent": { "description": "Required.\n\nThe location name.\nFor example: `projects/PROJECT_ID/locations/LOCATION_ID`", - "type": "string", "required": true, + "type": "string", "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." + "id": "cloudtasks.projects.locations.queues.list" + }, + "create": { + "response": { + "$ref": "Queue" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues", + "path": "v2beta2/{+parent}/queues", + "id": "cloudtasks.projects.locations.queues.create", + "request": { + "$ref": "Queue" + }, + "description": "Creates a queue.\n\nWARNING: Using this method may have unintended side effects if you are\nusing an App Engine `queue.yaml` or `queue.xml` file to manage your queues.\nRead\n[Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml)\ncarefully before using this method." }, "setIamPolicy": { - "httpMethod": "POST", - "parameterOrder": [ - "resource" - ], + "description": "Sets the access control policy for a Queue. Replaces any existing\npolicy.\n\nNote: The Cloud Console does not check queue-level IAM permissions yet.\nProject-level permissions are required to use the Cloud Console.\n\nAuthorization requires the following [Google IAM](/iam) permission on the\nspecified resource parent:\n\n* `cloudtasks.queues.setIamPolicy`", + "request": { + "$ref": "SetIamPolicyRequest" + }, "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, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:setIamPolicy", + "path": "v2beta2/{+resource}:setIamPolicy", + "id": "cloudtasks.projects.locations.queues.setIamPolicy" + }, + "resume": { + "request": { + "$ref": "ResumeQueueRequest" + }, + "description": "Resume a queue.\n\nThis method resumes a queue after it has been\nQueue.State.PAUSED or Queue.State.DISABLED. The state of\na queue is stored in Queue.state; after calling this method it\nwill be set to Queue.State.RUNNING.\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).", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Queue" + }, + "parameters": { + "name": { + "description": "Required.\n\nThe queue name. For example:\n`projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`", + "required": true, + "type": "string", "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", "location": "path" } @@ -1132,75 +1086,15 @@ "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)." + "path": "v2beta2/{+name}:resume" }, "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", + "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`", "response": { "$ref": "Policy" }, @@ -1208,42 +1102,149 @@ "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": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", + "location": "path" + } + }, "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" + "path": "v2beta2/{+resource}:getIamPolicy", + "id": "cloudtasks.projects.locations.queues.getIamPolicy" } }, "resources": { "tasks": { "methods": { - "run": { + "list": { + "response": { + "$ref": "ListTasksResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "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", + "location": "query", + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ] + }, + "orderBy": { + "description": "Sort order used for the query. The only fields supported for sorting\nare `schedule_time` and `pull_message.tag`. All results will be\nreturned in approximately ascending order. The default ordering is by\n`schedule_time`.", + "type": "string", + "location": "query" + }, + "pageToken": { + "location": "query", + "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" + }, + "pageSize": { + "location": "query", + "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.", + "format": "int32", + "type": "integer" + }, + "parent": { + "location": "path", + "description": "Required.\n\nThe queue name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks", + "path": "v2beta2/{+parent}/tasks", + "id": "cloudtasks.projects.locations.queues.tasks.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." + }, + "create": { + "request": { + "$ref": "CreateTaskRequest" + }, + "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.\n\n* For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget),\n the maximum task size is 100KB.\n* For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this\n the maximum task size is 1MB.", "response": { "$ref": "Task" }, "parameterOrder": [ - "name" + "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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks", + "path": "v2beta2/{+parent}/tasks", + "id": "cloudtasks.projects.locations.queues.tasks.create" + }, + "cancelLease": { + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}:cancelLease", + "id": "cloudtasks.projects.locations.queues.tasks.cancelLease", + "path": "v2beta2/{+name}: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" + }, + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Task" + }, + "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, + "type": "string", "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", "location": "path" } + } + }, + "run": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Task" + }, + "parameters": { + "name": { + "location": "path", + "description": "Required.\n\nThe task name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$" + } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" @@ -1251,44 +1252,12 @@ "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" + "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.State.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.\n\nCloudTasks.RunTask cannot be called on pull tasks." }, "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" }, @@ -1302,17 +1271,28 @@ "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, + "type": "string", "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", "location": "path" } }, "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}:acknowledge", + "path": "v2beta2/{+name}:acknowledge", "id": "cloudtasks.projects.locations.queues.tasks.acknowledge", - "path": "v2beta2/{+name}:acknowledge" + "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.\n\nTo acknowledge 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.", + "request": { + "$ref": "AcknowledgeTaskRequest" + } }, "renewLease": { + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}:renewLease", + "path": "v2beta2/{+name}:renewLease", + "id": "cloudtasks.projects.locations.queues.tasks.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.", "response": { "$ref": "Task" }, @@ -1320,30 +1300,20 @@ "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, + "type": "string", "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." + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] }, "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" @@ -1352,28 +1322,31 @@ "name" ], "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "parameters": { + "name": { + "location": "path", + "description": "Required.\n\nThe task name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$" + }, "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", "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" - ] + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}", + "path": "v2beta2/{+name}", + "id": "cloudtasks.projects.locations.queues.tasks.get" }, "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.", @@ -1386,127 +1359,47 @@ "httpMethod": "DELETE", "parameters": { "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/[^/]+$", - "location": "path" + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$" } }, "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}" + "path": "v2beta2/{+name}", + "id": "cloudtasks.projects.locations.queues.tasks.delete" }, "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.", + "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.\n\nA maximum of 10 qps of CloudTasks.PullTasks requests are allowed per\nqueue. google.rpc.Code.RESOURCE_EXHAUSTED is returned when this limit\nis exceeded. google.rpc.Code.RESOURCE_EXHAUSTED is also returned when\nRateLimits.max_tasks_dispatched_per_second is exceeded.", "response": { - "$ref": "ListTasksResponse" + "$ref": "PullTasksResponse" }, "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" + "name" ], "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", + "name": { + "description": "Required.\n\nThe queue name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`", "required": true, - "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$" + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", + "location": "path" } }, "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" + ] } } } @@ -1518,6 +1411,16 @@ } }, "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": { "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "type": "string", @@ -1525,13 +1428,8 @@ }, "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", + "default": "true", "location": "query" }, "uploadType": { @@ -1539,10 +1437,10 @@ "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": { "enumDescriptions": [ @@ -1557,7 +1455,18 @@ "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": [ @@ -1565,44 +1474,34 @@ "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" + "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": { "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", - "location": "query" + "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": { "location": "query", - "description": "OAuth bearer token.", - "type": "string" + "description": "Pretty-print response.", + "type": "boolean", + "default": "true" } - } + }, + "version": "v2beta2", + "baseUrl": "https://cloudtasks.googleapis.com/", + "servicePath": "", + "description": "Manages the execution of large numbers of distributed requests. Cloud Tasks is in Alpha.", + "kind": "discovery#restDescription", + "basePath": "" } diff --git a/etc/api/cloudtrace/v1/cloudtrace-api.json b/etc/api/cloudtrace/v1/cloudtrace-api.json index b53ff049e5..c5011d2b2e 100644 --- a/etc/api/cloudtrace/v1/cloudtrace-api.json +++ b/etc/api/cloudtrace/v1/cloudtrace-api.json @@ -1,4 +1,9 @@ { + "ownerDomain": "google.com", + "name": "cloudtrace", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Stackdriver Trace API", "ownerName": "Google", "resources": { "projects": { @@ -11,21 +16,21 @@ "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 + "required": true, + "type": "string" } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/trace.append" + ], "flatPath": "v1/projects/{projectId}/traces", - "id": "cloudtrace.projects.patchTraces", "path": "v1/projects/{projectId}/traces", + "id": "cloudtrace.projects.patchTraces", "request": { "$ref": "Traces" }, @@ -35,106 +40,106 @@ "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": { + "flatPath": "v1/projects/{projectId}/traces", + "id": "cloudtrace.projects.traces.list", + "path": "v1/projects/{projectId}/traces", "description": "Returns of a list of traces that match the specified filter conditions.", "httpMethod": "GET", - "parameterOrder": [ - "projectId" - ], "response": { "$ref": "ListTracesResponse" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/trace.readonly" + "parameterOrder": [ + "projectId" ], "parameters": { - "projectId": { - "location": "path", - "description": "ID of the Cloud project where the trace data is stored.", - "type": "string", - "required": true - }, "filter": { "location": "query", "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.", + "format": "google-datetime", "type": "string", "location": "query" }, "startTime": { - "location": "query", - "format": "google-datetime", "description": "Start of the time interval (inclusive) during which the trace data was\ncollected from the application.", + "format": "google-datetime", + "type": "string", + "location": "query" + }, + "pageToken": { + "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.", "type": "string" }, "pageSize": { - "format": "int32", + "location": "query", "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.", - "type": "integer", - "location": "query" + "format": "int32", + "type": "integer" }, "view": { + "description": "Type of data returned for traces in the list. Optional. Default is\n`MINIMAL`.", + "type": "string", "location": "query", "enum": [ "VIEW_TYPE_UNSPECIFIED", "MINIMAL", "ROOTSPAN", "COMPLETE" - ], - "description": "Type of data returned for traces in the list. Optional. Default is\n`MINIMAL`.", - "type": "string" + ] }, "orderBy": { "location": "query", "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" + }, + "projectId": { + "location": "path", + "description": "ID of the Cloud project where the trace data is stored.", + "required": true, + "type": "string" } }, - "flatPath": "v1/projects/{projectId}/traces", - "path": "v1/projects/{projectId}/traces", - "id": "cloudtrace.projects.traces.list" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/trace.readonly" + ] + }, + "get": { + "flatPath": "v1/projects/{projectId}/traces/{traceId}", + "path": "v1/projects/{projectId}/traces/{traceId}", + "id": "cloudtrace.projects.traces.get", + "description": "Gets a single trace by its ID.", + "response": { + "$ref": "Trace" + }, + "parameterOrder": [ + "projectId", + "traceId" + ], + "httpMethod": "GET", + "parameters": { + "projectId": { + "location": "path", + "description": "ID of the Cloud project where the trace data is stored.", + "required": true, + "type": "string" + }, + "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" + ] } } } @@ -142,21 +147,21 @@ } }, "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" }, - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "callback": { + "description": "JSONP", "type": "string", "location": "query" }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" - }, "$.xgafv": { "enumDescriptions": [ "v1 error format", @@ -171,6 +176,12 @@ "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": [ @@ -178,13 +189,7 @@ "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" + "type": "string" }, "key": { "location": "query", @@ -203,104 +208,44 @@ }, "pp": { "description": "Pretty-print response.", - "default": "true", "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" }, - "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", - "location": "query" + "default": "true" } }, "version": "v1", "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", + "description": "Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API.\n", "servicePath": "", "basePath": "", - "revision": "20170919", - "documentationLink": "https://cloud.google.com/trace", "id": "cloudtrace:v1", + "documentationLink": "https://cloud.google.com/trace", + "revision": "20171202", "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", @@ -317,23 +262,23 @@ "type": "string" }, "spanId": { - "format": "uint64", "description": "Identifier for the span. Must be a 64-bit integer other than 0 and\nunique within a trace.", + "format": "uint64", "type": "string" }, "parentSpanId": { - "format": "uint64", "description": "ID of the parent span, if any. Optional.", + "format": "uint64", "type": "string" }, "endTime": { - "format": "google-datetime", "description": "End time of the span in nanoseconds from the UNIX epoch.", + "format": "google-datetime", "type": "string" }, "startTime": { - "format": "google-datetime", "description": "Start time of the span in nanoseconds from the UNIX epoch.", + "format": "google-datetime", "type": "string" }, "kind": { @@ -352,32 +297,88 @@ } }, "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": { + "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" + }, + "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" + } + }, + "id": "Trace" + }, + "Traces": { + "description": "List of new or updated traces.", + "type": "object", + "properties": { + "traces": { + "description": "List of traces.", + "type": "array", + "items": { + "$ref": "Trace" + } + } + }, + "id": "Traces" } }, "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 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" + }, + "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" + "rootUrl": "https://cloudtrace.googleapis.com/" } diff --git a/etc/api/cloudtrace/v2/cloudtrace-api.json b/etc/api/cloudtrace/v2/cloudtrace-api.json index 4cbaf4dd3c..ed64affd7e 100644 --- a/etc/api/cloudtrace/v2/cloudtrace-api.json +++ b/etc/api/cloudtrace/v2/cloudtrace-api.json @@ -1,133 +1,25 @@ { - "basePath": "", "id": "cloudtrace:v2", - "revision": "20170919", "documentationLink": "https://cloud.google.com/trace", + "revision": "20171202", "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": { + "droppedLinksCount": { + "description": "The number of dropped links after the maximum size was enforced. If\nthis value is 0, then no links were dropped.", + "format": "int32", + "type": "integer" + }, "link": { "description": "A collection of links.", + "type": "array", "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" @@ -137,8 +29,8 @@ "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`.", + "format": "int64", "type": "string" }, "stackFrames": { @@ -152,86 +44,85 @@ "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.", + "description": "The shortened string. For example, if the original string is 500\nbytes long and the limit of the string is 128 bytes, then\n`value` contains the first 128 bytes of the 500-byte string.\n\nTruncation always happens on a UTF8 character boundary. If there\nare multi-byte characters in the string, then the length of the\nshortened string might be less than the size limit.", "type": "string" + }, + "truncatedByteCount": { + "description": "The number of bytes removed from the original string. If this\nvalue is 0, then the string was not shortened.", + "format": "int32", + "type": "integer" } }, "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." + "description": "Text annotation with a set of attributes.", + "$ref": "Annotation" + }, + "messageEvent": { + "$ref": "MessageEvent", + "description": "An event describing a message sent/received between Spans." + }, + "time": { + "description": "The timestamp indicating the time the event occurred.", + "format": "google-datetime", + "type": "string" } }, - "id": "TimeEvent" + "id": "TimeEvent", + "description": "A time-stamped annotation or message event in the Span.", + "type": "object" }, - "NetworkEvent": { - "description": "An event describing an RPC message sent or received on the network.", + "MessageEvent": { + "description": "An event describing a message sent/received between Spans.", "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", + "uncompressedSizeBytes": { "description": "The number of uncompressed bytes sent or received.", + "format": "int64", "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" + "RECEIVED" + ], + "description": "Type of MessageEvent. Indicates whether the message was sent or\nreceived.", + "type": "string", + "enumDescriptions": [ + "Unknown event type.", + "Indicates a sent message.", + "Indicates a received message." ] }, - "messageId": { - "format": "uint64", - "description": "An identifier for the message, which must be unique in this span.", + "id": { + "description": "An identifier for the MessageEvent's message that can be used to match\nSENT and RECEIVED MessageEvents. It is recommended to be unique within\na Span.", + "format": "int64", "type": "string" }, - "compressedMessageSize": { - "format": "uint64", - "description": "The number of compressed bytes sent or received.", + "compressedSizeBytes": { + "description": "The number of compressed bytes sent or received. If missing assumed to\nbe the same size as uncompressed.", + "format": "int64", "type": "string" } }, - "id": "NetworkEvent" + "id": "MessageEvent" }, "StackFrame": { "description": "Represents a single stack frame in a stack trace.", "type": "object", "properties": { + "functionName": { + "description": "The fully-qualified name that uniquely identifies the function or\nmethod that is active in this frame (up to 1024 bytes).", + "$ref": "TruncatableString" + }, "lineNumber": { - "format": "int64", "description": "The line number in `file_name` where the function call appears.", + "format": "int64", "type": "string" }, "loadModule": { @@ -239,8 +130,8 @@ "$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.", + "format": "int64", "type": "string" }, "fileName": { @@ -252,48 +143,44 @@ "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)." + "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).", + "$ref": "TruncatableString" } }, "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": { + "enum": [ + "TYPE_UNSPECIFIED", + "CHILD_LINKED_SPAN", + "PARENT_LINKED_SPAN" + ], "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.", + "description": "The [TRACE_ID] for a trace within a project.", "type": "string" }, + "attributes": { + "$ref": "Attributes", + "description": "A set of attributes on the link. You have have up to 32 attributes per\nlink." + }, "spanId": { - "description": "`SPAN_ID` identifies a span within a trace.", + "description": "The [SPAN_ID] for a span within a trace.", "type": "string" } }, - "id": "Link" + "id": "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" }, "Annotation": { "description": "Text annotation with a set of attributes.", @@ -304,51 +191,51 @@ "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" + "$ref": "Attributes", + "description": "A set of attributes on the annotation. You can have up to 4 attributes\nper Annotation." } }, "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.", + "format": "int32", "type": "integer" }, "frame": { "description": "Stack frames in this call stack.", + "type": "array", "items": { "$ref": "StackFrame" - }, - "type": "array" + } } }, - "id": "StackFrames" + "id": "StackFrames", + "description": "A collection of stack frames, which can be truncated.", + "type": "object" }, "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.", + "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 a message sent/received between Spans.", "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.", + "format": "int32", + "type": "integer" + }, + "droppedMessageEventsCount": { + "description": "The number of dropped message events in all the included time events.\nIf the value is 0, then no message events were dropped.", + "format": "int32", "type": "integer" }, "timeEvent": { "description": "A collection of `TimeEvent`s.", + "type": "array", "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" @@ -358,8 +245,8 @@ "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" + "$ref": "TruncatableString", + "description": "For example: main binary, kernel modules, and dynamic libraries\nsuch as libc.so, sharedlib.so (up to 256 bytes)." }, "buildId": { "$ref": "TruncatableString", @@ -369,61 +256,168 @@ "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.", + "type": "array", "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", + "type": "integer" } }, - "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.", + "type": "object" }, "BatchWriteSpansRequest": { - "description": "The request message for the `BatchWriteSpans` method.", - "type": "object", "properties": { "spans": { - "description": "A collection of spans.", + "description": "A list of new spans. The span names must not match existing\nspans, or the results are undefined.", + "type": "array", "items": { "$ref": "Span" - }, - "type": "array" + } } }, - "id": "BatchWriteSpansRequest" + "id": "BatchWriteSpansRequest", + "description": "The request message for the `BatchWriteSpans` method.", + "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" + }, + "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": { + "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": { + "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.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "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.", + "format": "google-datetime", + "type": "string" + }, + "displayName": { + "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.", + "$ref": "TruncatableString" + }, + "timeEvents": { + "description": "A set of time events. You can have up to 32 annotations and 128 message\nevents per span.", + "$ref": "TimeEvents" + }, + "links": { + "$ref": "Links", + "description": "Links associated with the span. You can have up to 128 links per Span." + }, + "attributes": { + "$ref": "Attributes", + "description": "A set of attributes on the span. You can have up to 32 attributes per\nspan." + }, + "spanId": { + "description": "The [SPAN_ID] portion of the span's resource name.", + "type": "string" + }, + "childSpanCount": { + "description": "An optional number of child spans that were generated while this span\nwas active. If set, allows implementation to detect missing child spans.", + "format": "int32", + "type": "integer" + }, + "sameProcessAsParentSpan": { + "description": "(Optional) Set this parameter to indicate whether this span is in\nthe same process as its parent. If you do not set this parameter,\nStackdriver Trace is unable to take advantage of this helpful\ninformation.", + "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;\nit is a 32-character hexadecimal encoding of a 16-byte array.\n\n[SPAN_ID] is a unique identifier for a span within a trace; it\nis a 16-character hexadecimal encoding of an 8-byte array.", + "type": "string" + }, + "stackTrace": { + "$ref": "StackTrace", + "description": "Stack trace captured at the start of the span." + } + }, + "id": "Span" + }, + "AttributeValue": { + "properties": { + "intValue": { + "description": "A 64-bit signed integer.", + "format": "int64", + "type": "string" + }, + "stringValue": { + "description": "A string up to 256 bytes long.", + "$ref": "TruncatableString" + }, + "boolValue": { + "description": "A Boolean value represented by `true` or `false`.", + "type": "boolean" + } + }, + "id": "AttributeValue", + "description": "The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.", + "type": "object" + }, + "Attributes": { + "properties": { + "droppedAttributesCount": { + "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.", + "format": "int32", + "type": "integer" + }, + "attributeMap": { + "additionalProperties": { + "$ref": "AttributeValue" + }, + "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" + } + }, + "id": "Attributes", + "description": "A set of attributes, each in the format `[KEY]:[VALUE]`.", + "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" }, + "protocol": "rest", "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.append": { + "description": "Write Trace data for a project or application" } } } @@ -432,43 +426,13 @@ "ownerDomain": "google.com", "name": "cloudtrace", "batchPath": "batch", + "fullyEncodeReservedExpansion": true, "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": { @@ -479,45 +443,76 @@ "parameterOrder": [ "name" ], - "httpMethod": "PUT", + "httpMethod": "POST", "parameters": { "name": { + "pattern": "^projects/[^/]+/traces/[^/]+$", "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", + "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;\nit is a 32-character hexadecimal encoding of a 16-byte array.\n\n[SPAN_ID] is a unique identifier for a span within a trace; it\nis a 16-character hexadecimal encoding of an 8-byte array.", "required": true, - "pattern": "^projects/[^/]+/traces/[^/]+/spans/[^/]+$" + "type": "string" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/trace.append" ], - "flatPath": "v2/projects/{projectsId}/traces/{tracesId}/spans/{spansId}", + "flatPath": "v2/projects/{projectsId}/traces/{tracesId}/spans", + "path": "v2/{+name}/spans", "id": "cloudtrace.projects.traces.spans.create", - "path": "v2/{+name}", - "description": "Creates a new Span.", "request": { "$ref": "Span" - } + }, + "description": "Creates a new span." } } } + }, + "methods": { + "batchWrite": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Required. The name of the project where the spans belong. The format is\n`projects/[PROJECT_ID]`.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/trace.append" + ], + "flatPath": "v2/projects/{projectsId}/traces:batchWrite", + "id": "cloudtrace.projects.traces.batchWrite", + "path": "v2/{+name}/traces:batchWrite", + "request": { + "$ref": "BatchWriteSpansRequest" + }, + "description": "Sends new spans to new or existing traces. You cannot update\nexisting spans." + } } } } } }, "parameters": { - "pp": { + "quotaUser": { "location": "query", - "description": "Pretty-print response.", - "default": "true", - "type": "boolean" + "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" }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", + "pp": { + "description": "Pretty-print response.", + "type": "boolean", + "default": "true", "location": "query" }, "bearer_token": { @@ -525,31 +520,36 @@ "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", - "location": "query" + "type": "string" }, "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" + "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" + "type": "string", + "location": "query" }, "$.xgafv": { "enumDescriptions": [ @@ -565,6 +565,12 @@ "type": "string" }, "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -572,33 +578,23 @@ ], "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" + "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" }, - "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" + "access_token": { + "location": "query", + "description": "OAuth access token.", + "type": "string" } }, "version": "v2", "baseUrl": "https://cloudtrace.googleapis.com/", + "servicePath": "", + "description": "Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API.\n", "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": "" + "basePath": "" } diff --git a/etc/api/compute/alpha/compute-api.json b/etc/api/compute/alpha/compute-api.json index 936a253085..ac6121b831 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/3cMXWrWKedeDcxyJugoWfBBTcik\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/h08zVfEZXBLh6kuPAmaFBvfKpSQ\"", "discoveryVersion": "v1", "id": "compute:alpha", "name": "compute", "version": "alpha", - "revision": "20170908", + "revision": "20171122", "title": "Compute Engine API", "description": "Creates and runs virtual machines on Google Cloud Platform.", "ownerDomain": "google.com", @@ -110,7 +110,7 @@ "AcceleratorType": { "id": "AcceleratorType", "type": "object", - "description": "An Accelerator Type resource.", + "description": "An Accelerator Type resource. (== resource_for beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -193,9 +193,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -206,7 +210,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -226,6 +232,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -293,9 +305,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -306,7 +322,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -326,6 +344,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -375,9 +399,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -388,7 +416,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -408,6 +438,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -500,7 +536,7 @@ "Address": { "id": "Address", "type": "object", - "description": "A reserved address resource.", + "description": "A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)", "properties": { "address": { "type": "string", @@ -508,7 +544,7 @@ }, "addressType": { "type": "string", - "description": "The type of address to reserve. If unspecified, defaults to EXTERNAL.", + "description": "The type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL.", "enum": [ "DNS_FORWARDING", "EXTERNAL", @@ -600,7 +636,7 @@ }, "status": { "type": "string", - "description": "[Output Only] The status of the address, which can be either IN_USE or RESERVED. An address that is RESERVED is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available.", + "description": "[Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available.", "enum": [ "IN_USE", "RESERVED" @@ -612,7 +648,7 @@ }, "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." + "description": "The 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. This field can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER purposes." }, "users": { "type": "array", @@ -662,9 +698,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -675,7 +715,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -695,6 +737,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -762,9 +810,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -775,7 +827,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -795,6 +849,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -844,9 +904,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -857,7 +921,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -877,6 +943,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -946,6 +1018,13 @@ "description": "The size of the disk in base-2 GB. This supersedes disk_size_gb in InitializeParams.", "format": "int64" }, + "guestOsFeatures": { + "type": "array", + "description": "A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.", + "items": { + "$ref": "GuestOsFeature" + } + }, "index": { "type": "integer", "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.", @@ -993,7 +1072,7 @@ }, "source": { "type": "string", - "description": "Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.\n\nIf desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.\n\nNote that for InstanceTemplate, specify the disk name, not the URL for the disk." + "description": "Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD.\n\nIf desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.\n\nNote that for InstanceTemplate, specify the disk name, not the URL for the disk." }, "type": { "type": "string", @@ -1041,7 +1120,7 @@ }, "sourceImage": { "type": "string", - "description": "The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a private image that you created, specify the image name in the following format:\n\nglobal/images/my-private-image \n\nYou can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-private-family \n\nIf the source image is deleted later, this field will not be set." + "description": "The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a custom image that you created, specify the image name in the following format:\n\nglobal/images/my-custom-image \n\nYou can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-image-family \n\nIf the source image is deleted later, this field will not be set." }, "sourceImageEncryptionKey": { "$ref": "CustomerEncryptionKey", @@ -1132,7 +1211,7 @@ "Autoscaler": { "id": "Autoscaler", "type": "object", - "description": "Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.", + "description": "Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)", "properties": { "autoscalingPolicy": { "$ref": "AutoscalingPolicy", @@ -1246,9 +1325,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -1259,7 +1342,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -1279,6 +1364,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1346,9 +1437,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -1359,7 +1454,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -1379,6 +1476,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1476,9 +1579,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -1489,7 +1596,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -1509,6 +1618,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1613,20 +1728,20 @@ "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." + "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 per-group 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 per-group 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." + "description": "The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.\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.", + "description": "If scaling is based on a per-group 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.", + "description": "The target value of the metric that autoscaler should maintain. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric.\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.", "format": "double" }, "utilizationTargetType": { @@ -1870,9 +1985,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -1883,7 +2002,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -1903,6 +2024,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1934,7 +2061,7 @@ "BackendService": { "id": "BackendService", "type": "object", - "description": "A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity.", + "description": "A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==)", "properties": { "affinityCookieTtlSec": { "type": "integer", @@ -2135,9 +2262,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2148,7 +2279,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2168,6 +2301,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2348,9 +2487,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2361,7 +2504,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2381,6 +2526,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2439,9 +2590,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2452,7 +2607,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2472,6 +2629,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2571,7 +2734,7 @@ "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.", + "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. (== resource_for beta.commitments ==) (== resource_for v1.commitments ==)", "properties": { "creationTimestamp": { "type": "string", @@ -2694,9 +2857,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2707,7 +2874,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2727,6 +2896,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2794,9 +2969,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2807,7 +2986,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2827,6 +3008,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2876,9 +3063,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2889,7 +3080,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2909,6 +3102,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3066,6 +3265,26 @@ } } }, + "DailyMaintenanceWindow": { + "id": "DailyMaintenanceWindow", + "type": "object", + "description": "Time window specified for daily maintenance operations.", + "properties": { + "daysInCycle": { + "type": "integer", + "description": "Allows to define schedule that runs every nth day of the month.", + "format": "int32" + }, + "duration": { + "type": "string", + "description": "[Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario." + }, + "startTime": { + "type": "string", + "description": "Time within the maintenance window to start the maintenance operations. It must be in format \"HH:MM?, where HH : [00-23] and MM : [00-59] GMT." + } + } + }, "DeprecationStatus": { "id": "DeprecationStatus", "type": "object", @@ -3106,7 +3325,7 @@ "Disk": { "id": "Disk", "type": "object", - "description": "A Disk resource.", + "description": "A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks ==)", "properties": { "creationTimestamp": { "type": "string", @@ -3120,6 +3339,13 @@ "$ref": "CustomerEncryptionKey", "description": "Encrypts the disk using a customer-supplied encryption key.\n\nAfter you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine).\n\nCustomer-supplied encryption keys do not protect access to metadata of the disk.\n\nIf you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later." }, + "guestOsFeatures": { + "type": "array", + "description": "A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.", + "items": { + "$ref": "GuestOsFeature" + } + }, "id": { "type": "string", "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", @@ -3206,7 +3432,7 @@ }, "sourceImage": { "type": "string", - "description": "The source image used to create this disk. If the source image is deleted, this field will not be set.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a private image that you created, specify the image name in the following format:\n\nglobal/images/my-private-image \n\nYou can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-private-family" + "description": "The source image used to create this disk. If the source image is deleted, this field will not be set.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a custom image that you created, specify the image name in the following format:\n\nglobal/images/my-custom-image \n\nYou can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-image-family" }, "sourceImageEncryptionKey": { "$ref": "CustomerEncryptionKey", @@ -3312,9 +3538,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3325,7 +3555,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3345,6 +3577,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3373,6 +3611,47 @@ } } }, + "DiskInstantiationConfig": { + "id": "DiskInstantiationConfig", + "type": "object", + "description": "A specification of the desired way to instantiate a disk in the instance template when its created from a source instance.", + "properties": { + "autoDelete": { + "type": "boolean", + "description": "Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance)." + }, + "deviceName": { + "type": "string", + "description": "Specifies the device name of the disk to which the configurations apply to." + }, + "instantiateFrom": { + "type": "string", + "description": "Specifies whether to include the disk and what image to use.", + "enum": [ + "ATTACH_READ_ONLY", + "BLANK", + "DEFAULT", + "DO_NOT_INCLUDE", + "IMAGE_URL", + "SOURCE_IMAGE", + "SOURCE_IMAGE_FAMILY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "sourceImage": { + "type": "string", + "description": "The custom source image to be used to restore this disk when instantiating this instance template." + } + } + }, "DiskList": { "id": "DiskList", "type": "object", @@ -3412,9 +3691,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3425,7 +3708,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3445,6 +3730,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3490,7 +3781,7 @@ "DiskType": { "id": "DiskType", "type": "object", - "description": "A DiskType resource.", + "description": "A DiskType resource. (== resource_for beta.diskTypes ==) (== resource_for v1.diskTypes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -3577,9 +3868,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3590,7 +3885,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3610,6 +3907,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3677,9 +3980,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3690,7 +3997,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3710,6 +4019,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3759,9 +4074,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3772,7 +4091,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3792,6 +4113,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3852,9 +4179,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3865,7 +4196,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3885,6 +4218,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4036,6 +4375,10 @@ "" ] }, + "disabled": { + "type": "boolean", + "description": "Denotes whether the firewall rule is disabled, i.e not applied to the network it is associated with. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled." + }, "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." @@ -4104,7 +4447,7 @@ }, "targetTags": { "type": "array", - "description": "A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", + "description": "A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", "items": { "type": "string" } @@ -4150,9 +4493,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4163,7 +4510,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4183,6 +4532,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4218,17 +4573,17 @@ "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)", + "description": "[Output Only] Absolute value of VM instances calculated based on the specific mode.\n\n \n- If the value is fixed, then the caculated value is equal to the fixed value. \n- If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.", "format": "int32" }, "fixed": { "type": "integer", - "description": "fixed must be non-negative.", + "description": "Specifies a fixed number of VM instances. This must be a positive integer.", "format": "int32" }, "percent": { "type": "integer", - "description": "percent must belong to [0, 100].", + "description": "Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.", "format": "int32" } } @@ -4236,11 +4591,11 @@ "ForwardingRule": { "id": "ForwardingRule", "type": "object", - "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple.", + "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==)", "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 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." + "description": "The IP address that this forwarding rule is serving on behalf of.\n\nAddresses are restricted based on the forwarding rule's load balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional).\n\nWhen the load balancing scheme is EXTERNAL, for global forwarding rules, the address must be a global IP, and for regional forwarding rules, the address must live in the same region as the forwarding rule. If this field is empty, 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/subnet configured for the forwarding rule. By default, if this field is empty, an ephemeral internal IP address will be automatically allocated from the IP range of the subnet or network configured for this forwarding rule.\n\nAn address can be specified either by a literal IP address or a URL reference to an existing Address resource. The following examples are all valid: \n- 100.1.2.3 \n- https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address \n- projects/project/regions/region/addresses/address \n- regions/region/addresses/address \n- global/addresses/address \n- address" }, "IPProtocol": { "type": "string", @@ -4429,9 +4784,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4442,7 +4801,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4462,6 +4823,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4529,9 +4896,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4542,7 +4913,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4562,6 +4935,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4620,9 +4999,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4633,7 +5016,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4653,6 +5038,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4730,14 +5121,18 @@ "properties": { "type": { "type": "string", - "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.", + "description": "The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.", "enum": [ "FEATURE_TYPE_UNSPECIFIED", "MULTI_IP_SUBNET", + "SECURE_BOOT", + "UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS" ], "enumDescriptions": [ + "", + "", "", "", "", @@ -5038,9 +5433,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5051,7 +5450,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5071,6 +5472,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5294,9 +5701,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5307,7 +5718,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5327,6 +5740,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5394,9 +5813,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5407,7 +5830,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5427,6 +5852,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5577,9 +6008,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5590,7 +6025,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5610,6 +6047,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5677,9 +6120,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5690,7 +6137,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5710,6 +6159,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5759,9 +6214,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5772,7 +6231,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5792,6 +6253,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5841,9 +6308,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5854,7 +6325,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5874,6 +6347,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5902,6 +6381,26 @@ } } }, + "HourlyMaintenanceWindow": { + "id": "HourlyMaintenanceWindow", + "type": "object", + "description": "Time window specified for hourly maintenance operations.", + "properties": { + "duration": { + "type": "string", + "description": "[Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario." + }, + "hoursInCycle": { + "type": "integer", + "description": "Allows to define schedule that runs every nth hour.", + "format": "int32" + }, + "startTime": { + "type": "string", + "description": "Time within the maintenance window to start the maintenance operations. It must be in format \"HH:MM?, where HH : [00-23] and MM : [00-59] GMT." + } + } + }, "HttpHealthCheck": { "id": "HttpHealthCheck", "type": "object", @@ -6008,9 +6507,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6021,7 +6524,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6041,6 +6546,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6175,9 +6686,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6188,7 +6703,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6208,6 +6725,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6239,7 +6762,7 @@ "Image": { "id": "Image", "type": "object", - "description": "An Image resource.", + "description": "An Image resource. (== resource_for beta.images ==) (== resource_for v1.images ==)", "properties": { "archiveSizeBytes": { "type": "string", @@ -6269,7 +6792,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 newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image.", + "description": "A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.", "items": { "$ref": "GuestOsFeature" } @@ -6383,6 +6906,18 @@ "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." }, + "sourceSnapshot": { + "type": "string", + "description": "URL of the source snapshot 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 sourceImage property, or \n- the rawDisk.source property, or \n- the sourceDisk property in order to create an image." + }, + "sourceSnapshotEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key." + }, + "sourceSnapshotId": { + "type": "string", + "description": "[Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name." + }, "sourceType": { "type": "string", "description": "The type of the image used to create this disk. The default and only value is RAW", @@ -6449,9 +6984,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6462,7 +7001,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6482,6 +7023,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6513,7 +7060,7 @@ "Instance": { "id": "Instance", "type": "object", - "description": "An Instance resource.", + "description": "An Instance resource. (== resource_for beta.instances ==) (== resource_for v1.instances ==)", "properties": { "canIpForward": { "type": "boolean", @@ -6588,6 +7135,13 @@ ] } }, + "maintenancePolicies": { + "type": "array", + "description": "Maintenance policies applied to this instance.", + "items": { + "type": "string" + } + }, "metadata": { "$ref": "Metadata", "description": "The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys." @@ -6628,6 +7182,9 @@ "$ref": "ServiceAccount" } }, + "shieldedVmConfig": { + "$ref": "ShieldedVmConfig" + }, "startRestricted": { "type": "boolean", "description": "[Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity." @@ -6709,9 +7266,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6722,7 +7283,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6742,6 +7305,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6773,6 +7342,7 @@ "InstanceGroup": { "id": "InstanceGroup", "type": "object", + "description": "InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== resource_for v1.regionInstanceGroups ==)", "properties": { "creationTimestamp": { "type": "string", @@ -6880,9 +7450,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6893,7 +7467,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6913,6 +7489,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6980,9 +7562,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6993,7 +7579,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7013,6 +7601,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7044,7 +7638,7 @@ "InstanceGroupManager": { "id": "InstanceGroupManager", "type": "object", - "description": "An Instance Group Manager resource.", + "description": "An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==)", "properties": { "activities": { "$ref": "InstanceGroupManagerActivities" @@ -7152,7 +7746,7 @@ "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", + "$ref": "StatefulPolicy", "description": "Stateful configuration for this Instanced Group Manager" }, "targetPools": { @@ -7179,7 +7773,7 @@ }, "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.", + "description": "Specifies the instance templates used by this managed instance group to create instances.\n\nEach version is defined by an instanceTemplate. Every template can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.", "items": { "$ref": "InstanceGroupManagerVersion" } @@ -7363,9 +7957,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -7376,7 +7974,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7396,6 +7996,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7440,6 +8046,18 @@ "maxUnavailable": { "$ref": "FixedOrPercent", "description": "Maximum number of instances that can be unavailable when autohealing. 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 percent value of 100% is used." + }, + "mode": { + "type": "string", + "description": "Defines operating mode for this policy.", + "enum": [ + "OFF", + "ON" + ], + "enumDescriptions": [ + "", + "" + ] } } }, @@ -7482,9 +8100,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -7495,7 +8117,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7515,6 +8139,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7569,40 +8199,17 @@ } } }, - "InstanceGroupManagerStatefulPolicy": { - "id": "InstanceGroupManagerStatefulPolicy", - "type": "object", - "properties": { - "preservedDisks": { - "type": "array", - "description": "Disks created on the instances that will be preserved on instance delete, resize down, etc.", - "items": { - "$ref": "InstanceGroupManagerStatefulPolicyDiskPolicy" - } - } - } - }, - "InstanceGroupManagerStatefulPolicyDiskPolicy": { - "id": "InstanceGroupManagerStatefulPolicyDiskPolicy", - "type": "object", - "properties": { - "deviceName": { - "type": "string", - "description": "Device name of the disk to be preserved" - } - } - }, "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." + "description": "The maximum number of instances that can be created above the specified targetSize during the update process. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.\n\nAt least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge." }, "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." + "description": "The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied:\n\n \n- The instance's status is RUNNING. \n- If there is a health check on the instance group, the instance's liveness health check result must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.\n\nAt least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable." }, "minReadySec": { "type": "integer", @@ -7611,7 +8218,7 @@ }, "minimalAction": { "type": "string", - "description": "Minimal action to be taken on an instance. The order of action types is: RESTART \u003c REPLACE.", + "description": "Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a code\u003eRESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.", "enum": [ "NONE", "REFRESH", @@ -7655,7 +8262,7 @@ }, "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." + "description": "Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to: \n- If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used. \n- if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded up. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information." } } }, @@ -7787,9 +8394,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -7800,7 +8411,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7820,6 +8433,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7897,9 +8516,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -7910,7 +8533,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7930,6 +8555,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8063,9 +8694,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8076,7 +8711,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8096,6 +8733,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8176,9 +8819,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8189,7 +8836,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8209,6 +8858,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8294,9 +8949,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8307,7 +8966,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8327,6 +8988,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8394,9 +9061,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8407,7 +9078,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8427,6 +9100,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8557,7 +9236,7 @@ "InstanceTemplate": { "id": "InstanceTemplate", "type": "object", - "description": "An Instance Template resource.", + "description": "An Instance Template resource. (== resource_for beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)", "properties": { "creationTimestamp": { "type": "string", @@ -8598,6 +9277,10 @@ "sourceInstance": { "type": "string", "description": "The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance \n- projects/project/zones/zone/instances/instance" + }, + "sourceInstanceParams": { + "$ref": "SourceInstanceParams", + "description": "The source instance params to use to create this instance template." } } }, @@ -8640,9 +9323,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8653,7 +9340,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8673,6 +9362,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8742,6 +9437,32 @@ } } }, + "InstancesAddMaintenancePoliciesRequest": { + "id": "InstancesAddMaintenancePoliciesRequest", + "type": "object", + "properties": { + "maintenancePolicies": { + "type": "array", + "description": "Maintenance policies to be added to this instance.", + "items": { + "type": "string" + } + } + } + }, + "InstancesRemoveMaintenancePoliciesRequest": { + "id": "InstancesRemoveMaintenancePoliciesRequest", + "type": "object", + "properties": { + "maintenancePolicies": { + "type": "array", + "description": "Maintenance policies to be removed from this instance.", + "items": { + "type": "string" + } + } + } + }, "InstancesScopedList": { "id": "InstancesScopedList", "type": "object", @@ -8763,9 +9484,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8776,7 +9501,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8796,6 +9523,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8911,11 +9644,11 @@ "Interconnect": { "id": "Interconnect", "type": "object", - "description": "Protocol definitions for Mixer API to support Interconnect. Next available tag: 23", + "description": "Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==)", "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?." + "description": "Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status is set to true." }, "circuitInfos": { "type": "array", @@ -8924,10 +9657,6 @@ "$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." @@ -8969,11 +9698,14 @@ }, "interconnectType": { "type": "string", + "description": "Type of interconnect. Note that \"IT_PRIVATE\" has been deprecated in favor of \"DEDICATED\"", "enum": [ - "IT_PARTNER", - "IT_PRIVATE" + "DEDICATED", + "IT_PRIVATE", + "PARTNER" ], "enumDescriptions": [ + "", "", "" ] @@ -8983,8 +9715,21 @@ "description": "[Output Only] Type of the resource. Always compute#interconnect for interconnects.", "default": "compute#interconnect" }, + "labelFingerprint": { + "type": "string", + "description": "A fingerprint for the labels being applied to this Interconnect, 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 Interconnect.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "Labels to apply to this Interconnect 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" + } + }, "linkType": { "type": "string", + "description": "Type of link requested. This field indicates speed of each of the links in the bundle, not the entire bundle. Only 10G per link is allowed for a dedicated interconnect. Options: Ethernet_10G_LR", "enum": [ "LINK_TYPE_ETHERNET_10G_LR" ], @@ -9039,14 +9784,77 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for the resource." + }, + "state": { + "type": "string", + "description": "[Output Only] The current state of whether or not this Interconnect is functional.", + "enum": [ + "ACTIVE", + "UNPROVISIONED" + ], + "enumDescriptions": [ + "", + "" + ] } } }, "InterconnectAttachment": { "id": "InterconnectAttachment", "type": "object", - "description": "Protocol definitions for Mixer API to support InterconnectAttachment. Next available tag: 18", + "description": "Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==)", "properties": { + "adminEnabled": { + "type": "boolean", + "description": "Determines whether this Attachment will carry packets. Not present for PARTNER_PROVIDER." + }, + "availabilityZone": { + "type": "string", + "enum": [ + "ZONE_1", + "ZONE_2", + "ZONE_ANY" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "bandwidth": { + "type": "string", + "enum": [ + "BPS_100M", + "BPS_10G", + "BPS_1G", + "BPS_200M", + "BPS_2G", + "BPS_300M", + "BPS_400M", + "BPS_500M", + "BPS_50M", + "BPS_5G" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "candidateSubnets": { + "type": "array", + "description": "Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google?s edge. If not supplied, Google will randomly select an unused /29 from all of link-local space.", + "items": { + "type": "string" + } + }, "cloudRouterIpAddress": { "type": "string", "description": "[Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment." @@ -9061,7 +9869,7 @@ }, "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." }, "googleReferenceId": { "type": "string", @@ -9081,6 +9889,18 @@ "description": "[Output Only] Type of the resource. Always compute#interconnectAttachment for interconnect attachments.", "default": "compute#interconnectAttachment" }, + "labelFingerprint": { + "type": "string", + "description": "A fingerprint for the labels being applied to this InterconnectAttachment, 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 InterconnectAttachment.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "Labels to apply to this InterconnectAttachment 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.", @@ -9098,9 +9918,21 @@ "" ] }, + "pairingKey": { + "type": "string", + "description": "[Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present for DEDICATED]. Opaque string identifying an PARTNER attachment. Of the form ?cloud-region/XXXXXX?." + }, + "partnerAsn": { + "type": "string", + "description": "[Output only for PARTNER. Input for PARTNER_PROVIDER. Not present for DEDICATED] BGP ASN of the Partner. A layer 3 Partner should supply this if they configured BGP on behalf of the customer.", + "format": "int64" + }, + "partnerMetadata": { + "$ref": "InterconnectAttachmentPartnerMetadata" + }, "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." + "description": "[Output Only] Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED." }, "region": { "type": "string", @@ -9113,6 +9945,46 @@ "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for the resource." + }, + "state": { + "type": "string", + "description": "[Output Only] The current state of whether or not this interconnect attachment is functional.", + "enum": [ + "ACTIVE", + "DEFUNCT", + "PARTNER_REQUEST_RECEIVED", + "PENDING_CUSTOMER", + "PENDING_PARTNER", + "STATE_UNSPECIFIED", + "UNPROVISIONED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "type": { + "type": "string", + "enum": [ + "DEDICATED", + "PARTNER", + "PARTNER_PROVIDER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "vlanTag8021q": { + "type": "integer", + "description": "Available only for DEDICATED and PARTNER_PROVIDER. Desired VLAN tag for this attachment, in the range 2-4094. This field refers to 802.1q VLAN tag, also known as IEEE 802.1Q Only specified at creation time.", + "format": "int32" } } }, @@ -9155,9 +10027,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9168,7 +10044,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9188,6 +10066,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -9255,9 +10139,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9268,7 +10156,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9288,6 +10178,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -9316,10 +10212,29 @@ } } }, + "InterconnectAttachmentPartnerMetadata": { + "id": "InterconnectAttachmentPartnerMetadata", + "type": "object", + "description": "Informational metadata about Partner attachments from Partners to display to customers. These fields are propagated from PARTNER_PROVIDER attachments to their corresponding PARTNER attachments. Only mutable for PARTNER_PROVIDER type, output-only for PARTNER, not available for DEDICATED.", + "properties": { + "interconnectName": { + "type": "string", + "description": "Plain text name of the Interconnect this attachment is connected to, as displayed in the Partner?s portal. For instance ?Chicago 1?. This value may be validated to match approved Partner values." + }, + "partnerName": { + "type": "string", + "description": "Plain text name of the Partner providing this attachment. This value may be validated to match approved Partner values." + }, + "portalUrl": { + "type": "string", + "description": "URL of the Partner?s portal for this Attachment. Partners may customise this to be a deep-link to the specific resource on the Partner portal. This value may be validated to match approved Partner values." + } + } + }, "InterconnectAttachmentPrivateInfo": { "id": "InterconnectAttachmentPrivateInfo", "type": "object", - "description": "Private information for an interconnect attachment when this belongs to an interconnect of type IT_PRIVATE.", + "description": "Information for an interconnect attachment when this belongs to an interconnect of type DEDICATED.", "properties": { "tag8021q": { "type": "integer", @@ -9349,9 +10264,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9362,7 +10281,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9382,6 +10303,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -9417,7 +10344,7 @@ "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." + "description": "Customer-side demarc ID for this circuit." }, "googleCircuitId": { "type": "string", @@ -9468,9 +10395,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9481,7 +10412,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9501,6 +10434,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -9532,7 +10471,7 @@ "InterconnectLocation": { "id": "InterconnectLocation", "type": "object", - "description": "Protocol definitions for Mixer API to support InterconnectLocation.", + "description": "Represents an InterconnectLocations resource. The InterconnectLocations resource describes the locations where you can connect to Google's networks. For more information, see Colocation Facilities.", "properties": { "address": { "type": "string", @@ -9540,23 +10479,33 @@ }, "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\"." + "description": "[Output Only] Availability zone for this location. Within a metropolitan area (metro), 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\"." + "description": "[Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: \"Chicago, IL\", \"Amsterdam, Netherlands\"." }, "continent": { "type": "string", - "description": "Continent for this location. Used by the location picker in the Interconnect UI.", + "description": "[Output Only] Continent for this location.", "enum": [ + "AFRICA", + "ASIA_PAC", "C_AFRICA", "C_ASIA_PAC", "C_EUROPE", "C_NORTH_AMERICA", - "C_SOUTH_AMERICA" + "C_SOUTH_AMERICA", + "EUROPE", + "NORTH_AMERICA", + "SOUTH_AMERICA" ], "enumDescriptions": [ + "", + "", + "", + "", + "", "", "", "", @@ -9650,9 +10599,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9663,7 +10616,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9683,6 +10638,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -9725,10 +10686,14 @@ "type": "string", "description": "Identifies the network presence of this location.", "enum": [ + "GLOBAL", + "LOCAL_REGION", "LP_GLOBAL", "LP_LOCAL_REGION" ], "enumDescriptions": [ + "", + "", "", "" ] @@ -9736,10 +10701,6 @@ "region": { "type": "string", "description": "URL for the region of this location." - }, - "regionKey": { - "type": "string", - "description": "Scope key for the region of this location." } } }, @@ -9757,19 +10718,25 @@ }, "description": { "type": "string", - "description": "Short user-visible description of the purpose of the outage." + "description": "A description about the purpose of the outage." }, "endTime": { "type": "string", + "description": "Scheduled end time for the outage (milliseconds since Unix epoch).", "format": "int64" }, "issueType": { "type": "string", + "description": "Form this outage is expected to take. Note that the \"IT_\" versions of this enum have been deprecated in favor of the unprefixed values.", "enum": [ "IT_OUTAGE", - "IT_PARTIAL_OUTAGE" + "IT_PARTIAL_OUTAGE", + "OUTAGE", + "PARTIAL_OUTAGE" ], "enumDescriptions": [ + "", + "", "", "" ] @@ -9780,25 +10747,33 @@ }, "source": { "type": "string", + "description": "The party that generated this notification. Note that \"NSRC_GOOGLE\" has been deprecated in favor of \"GOOGLE\"", "enum": [ + "GOOGLE", "NSRC_GOOGLE" ], "enumDescriptions": [ + "", "" ] }, "startTime": { "type": "string", - "description": "Scheduled start and end times for the outage (milliseconds since Unix epoch).", + "description": "Scheduled start time for the outage (milliseconds since Unix epoch).", "format": "int64" }, "state": { "type": "string", + "description": "State of this notification. Note that the \"NS_\" versions of this enum have been deprecated in favor of the unprefixed values.", "enum": [ + "ACTIVE", + "CANCELLED", "NS_ACTIVE", "NS_CANCELED" ], "enumDescriptions": [ + "", + "", "", "" ] @@ -9865,9 +10840,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9878,7 +10857,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9898,6 +10879,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -10111,9 +11098,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -10124,7 +11115,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -10144,6 +11137,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -10253,7 +11252,7 @@ "MachineType": { "id": "MachineType", "type": "object", - "description": "A Machine Type resource.", + "description": "A Machine Type resource. (== resource_for v1.machineTypes ==) (== resource_for beta.machineTypes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -10355,9 +11354,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -10368,7 +11371,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -10388,6 +11393,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -10455,9 +11466,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -10468,7 +11483,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -10488,6 +11505,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -10537,9 +11560,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -10550,7 +11577,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -10570,6 +11599,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -10598,6 +11633,382 @@ } } }, + "MaintenancePoliciesList": { + "id": "MaintenancePoliciesList", + "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 MaintenancePolicy resources.", + "items": { + "$ref": "MaintenancePolicy" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource.Always compute#maintenancePoliciesList for listsof maintenancePolicies", + "default": "compute#maintenancePoliciesList" + }, + "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } + } + } + }, + "MaintenancePoliciesScopedList": { + "id": "MaintenancePoliciesScopedList", + "type": "object", + "properties": { + "maintenancePolicies": { + "type": "array", + "description": "List of maintenancePolicies contained in this scope.", + "items": { + "$ref": "MaintenancePolicy" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of maintenancePolicies 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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } + } + } + }, + "MaintenancePolicy": { + "id": "MaintenancePolicy", + "type": "object", + "description": "A maintenance policy for an instance. This specifies what kind of maintenance operations our infrastructure may perform on this instance and when.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string" + }, + "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#maintenance_policies for maintenance policies.", + "default": "compute#maintenancePolicy" + }, + "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.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "region": { + "type": "string" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined fully-qualified URL for this resource." + }, + "vmMaintenancePolicy": { + "$ref": "VmMaintenancePolicy", + "description": "Maintenance policy applicable to VMs for infrastructure maintenance." + } + } + }, + "MaintenancePolicyAggregatedList": { + "id": "MaintenancePolicyAggregatedList", + "type": "object", + "description": "Contains a list of maintenancePolicies.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "A list of MaintenancePolicy resources.", + "additionalProperties": { + "$ref": "MaintenancePoliciesScopedList", + "description": "Name of the scope containing this set of maintenancePolicies." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#maintenancePolicyAggregatedList" + }, + "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } + } + } + }, + "MaintenanceWindow": { + "id": "MaintenanceWindow", + "type": "object", + "description": "A maintenance window for VMs and disks. When set, we restrict our maintenance operations to this window.", + "properties": { + "dailyMaintenanceWindow": { + "$ref": "DailyMaintenanceWindow" + }, + "hourlyMaintenanceWindow": { + "$ref": "HourlyMaintenanceWindow" + } + } + }, "ManagedInstance": { "id": "ManagedInstance", "type": "object", @@ -10743,7 +12154,7 @@ "description": "[Output Only] Indicates where does the override come from.", "enum": [ "AUTO_GENERATED", - "USER_GENERATED" + "USER_PROVIDED" ], "enumDescriptions": [ "", @@ -10858,7 +12269,7 @@ "Network": { "id": "Network", "type": "object", - "description": "Represents a Network resource. Read Networks and Firewalls for more information.", + "description": "Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==)", "properties": { "IPv4Range": { "type": "string", @@ -11071,9 +12482,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11084,7 +12499,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11104,6 +12521,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11194,9 +12617,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11207,7 +12634,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11227,6 +12656,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11333,9 +12768,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11346,7 +12785,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11366,6 +12807,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11415,9 +12862,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11428,7 +12879,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11448,6 +12901,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11579,9 +13038,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11592,7 +13055,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11612,6 +13077,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11704,7 +13175,12 @@ }, "name": { "type": "string", - "description": "Name of the peering, which should conform to RFC1035." + "description": "Name of the peering, which should conform to RFC1035.", + "annotations": { + "required": [ + "compute.networks.addPeering" + ] + } }, "peerNetwork": { "type": "string", @@ -11725,7 +13201,7 @@ "Operation": { "id": "Operation", "type": "object", - "description": "An Operation resource, used to manage asynchronous API requests.", + "description": "An Operation resource, used to manage asynchronous API requests. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)", "properties": { "clientOperationId": { "type": "string", @@ -11861,9 +13337,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11874,7 +13354,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11894,6 +13376,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11966,9 +13454,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11979,7 +13471,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11999,6 +13493,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -12066,9 +13566,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -12079,7 +13583,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -12099,6 +13605,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -12148,9 +13660,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -12161,7 +13677,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -12181,6 +13699,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -12311,7 +13835,7 @@ "Project": { "id": "Project", "type": "object", - "description": "A Project resource. Projects can only be created in the Google Cloud Platform Console. Unless marked otherwise, values can only be modified in the console.", + "description": "A Project resource. Projects can only be created in the Google Cloud Platform Console. Unless marked otherwise, values can only be modified in the console. (== resource_for v1.projects ==) (== resource_for beta.projects ==)", "properties": { "commonInstanceMetadata": { "$ref": "Metadata", @@ -12506,13 +14030,17 @@ "INSTANCE_GROUP_MANAGERS", "INSTANCE_TEMPLATES", "INTERCONNECTS", + "INTERNAL_ADDRESSES", "IN_USE_ADDRESSES", "LOCAL_SSD_TOTAL_GB", + "MAINTENANCE_POLICIES", "NETWORKS", "NVIDIA_K80_GPUS", "NVIDIA_P100_GPUS", "PREEMPTIBLE_CPUS", "PREEMPTIBLE_LOCAL_SSD_GB", + "PREEMPTIBLE_NVIDIA_K80_GPUS", + "PREEMPTIBLE_NVIDIA_P100_GPUS", "REGIONAL_AUTOSCALERS", "REGIONAL_INSTANCE_GROUP_MANAGERS", "ROUTERS", @@ -12578,6 +14106,10 @@ "", "", "", + "", + "", + "", + "", "" ] }, @@ -12615,7 +14147,7 @@ "Region": { "id": "Region", "type": "object", - "description": "Region resource.", + "description": "Region resource. (== resource_for beta.regions ==) (== resource_for v1.regions ==)", "properties": { "creationTimestamp": { "type": "string", @@ -12714,9 +14246,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -12727,7 +14263,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -12747,6 +14285,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -12813,9 +14357,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -12826,7 +14374,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -12846,6 +14396,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -12924,9 +14480,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -12937,7 +14497,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -12957,6 +14519,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13038,9 +14606,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13051,7 +14623,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13071,6 +14645,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13210,9 +14790,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13223,7 +14807,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13243,6 +14829,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13379,9 +14971,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13392,7 +14988,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13412,6 +15010,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13520,9 +15124,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13533,7 +15141,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13553,6 +15163,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13640,7 +15256,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 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.", + "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. (== resource_for beta.routes ==) (== resource_for v1.routes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -13750,9 +15366,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13763,7 +15383,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13783,6 +15405,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13851,9 +15479,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13864,7 +15496,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13884,6 +15518,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13989,6 +15629,21 @@ } } }, + "RouterAdvertisedIpRange": { + "id": "RouterAdvertisedIpRange", + "type": "object", + "description": "Description-tagged IP ranges for the router to advertise.", + "properties": { + "description": { + "type": "string", + "description": "User-specified description for the IP range." + }, + "range": { + "type": "string", + "description": "The IP range to advertise. The value must be a CIDR-formatted string." + } + } + }, "RouterAdvertisedPrefix": { "id": "RouterAdvertisedPrefix", "type": "object", @@ -14044,9 +15699,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -14057,7 +15716,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -14077,6 +15738,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -14134,6 +15801,13 @@ ] } }, + "advertisedIpRanges": { + "type": "array", + "description": "User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.", + "items": { + "$ref": "RouterAdvertisedIpRange" + } + }, "advertisedPrefixs": { "type": "array", "description": "User-specified list of individual prefixes to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These prefixes will be advertised in addition to any specified groups. Leave this field blank to advertise no custom prefixes.", @@ -14177,6 +15851,13 @@ ] } }, + "advertisedIpRanges": { + "type": "array", + "description": "User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in Bgp message). These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.", + "items": { + "$ref": "RouterAdvertisedIpRange" + } + }, "advertisedPrefixs": { "type": "array", "description": "User-specified list of individual prefixes to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in Bgp message). These prefixes will be advertised in addition to any specified groups. Leave this field blank to advertise no custom prefixes.", @@ -14275,9 +15956,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -14288,7 +15973,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -14308,6 +15995,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -14613,9 +16306,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -14626,7 +16323,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -14646,6 +16345,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -14701,7 +16406,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" } @@ -14896,9 +16601,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -14909,7 +16618,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -14929,6 +16640,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -15008,6 +16725,10 @@ "$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." }, + "expr": { + "$ref": "Expr", + "description": "User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header." + }, "srcIpRanges": { "type": "array", "description": "CIDR IP address range. Only IPv4 is supported.", @@ -15015,13 +16736,6 @@ "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.", @@ -15097,6 +16811,21 @@ } } }, + "ShieldedVmConfig": { + "id": "ShieldedVmConfig", + "type": "object", + "description": "A set of Shielded VM options.", + "properties": { + "enableSecureBoot": { + "type": "boolean", + "description": "Defines whether the instance should have secure boot enabled." + }, + "enableVtpm": { + "type": "boolean", + "description": "Defines whether the instance should have the TPM enabled." + } + } + }, "SignedUrlKey": { "id": "SignedUrlKey", "type": "object", @@ -15116,7 +16845,7 @@ "Snapshot": { "id": "Snapshot", "type": "object", - "description": "A persistent disk snapshot resource.", + "description": "A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== resource_for v1.snapshots ==)", "properties": { "creationTimestamp": { "type": "string", @@ -15227,6 +16956,13 @@ "", "" ] + }, + "storageLocations": { + "type": "array", + "description": "GCS bucket storage location of the snapshot (regional or multi-regional).", + "items": { + "type": "string" + } } } }, @@ -15269,9 +17005,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -15282,7 +17022,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -15302,6 +17044,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -15330,10 +17078,24 @@ } } }, + "SourceInstanceParams": { + "id": "SourceInstanceParams", + "type": "object", + "description": "A specification of the parameters to use when creating the instance template from a source instance.", + "properties": { + "diskConfigs": { + "type": "array", + "description": "Attached disks configuration. If not provided, defaults are applied: For boot disk and any other R/W disks, new custom images will be created from each disk. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes.", + "items": { + "$ref": "DiskInstantiationConfig" + } + } + } + }, "SslCertificate": { "id": "SslCertificate", "type": "object", - "description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user.", + "description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)", "properties": { "certificate": { "type": "string", @@ -15411,9 +17173,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -15424,7 +17190,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -15444,6 +17212,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -15510,9 +17284,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -15523,7 +17301,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -15543,6 +17323,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -15678,9 +17464,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -15691,7 +17481,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -15711,6 +17503,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -15750,10 +17548,43 @@ } } }, + "StatefulPolicy": { + "id": "StatefulPolicy", + "type": "object", + "properties": { + "preservedResources": { + "$ref": "StatefulPolicyPreservedResources" + } + } + }, + "StatefulPolicyPreservedDisk": { + "id": "StatefulPolicyPreservedDisk", + "type": "object", + "properties": { + "deviceName": { + "type": "string", + "description": "Device name of the disk to be preserved" + } + } + }, + "StatefulPolicyPreservedResources": { + "id": "StatefulPolicyPreservedResources", + "type": "object", + "description": "Configuration of all preserved resources.", + "properties": { + "disks": { + "type": "array", + "description": "Disks created on the instances that will be preserved on instance delete, resize down, etc.", + "items": { + "$ref": "StatefulPolicyPreservedDisk" + } + } + } + }, "Subnetwork": { "id": "Subnetwork", "type": "object", - "description": "A Subnetwork resource.", + "description": "A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==)", "properties": { "allowSubnetCidrRoutesOverlap": { "type": "boolean", @@ -15859,9 +17690,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -15872,7 +17707,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -15892,6 +17729,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -15959,9 +17802,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -15972,7 +17819,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -15992,6 +17841,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -16066,9 +17921,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -16079,7 +17938,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -16099,6 +17960,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -16207,7 +18074,7 @@ "TargetHttpProxy": { "id": "TargetHttpProxy", "type": "object", - "description": "A TargetHttpProxy resource. This resource defines an HTTP proxy.", + "description": "A TargetHttpProxy resource. This resource defines an HTTP proxy. (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==)", "properties": { "creationTimestamp": { "type": "string", @@ -16281,9 +18148,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -16294,7 +18165,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -16314,6 +18187,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -16378,7 +18257,7 @@ "TargetHttpsProxy": { "id": "TargetHttpsProxy", "type": "object", - "description": "A TargetHttpsProxy resource. This resource defines an HTTPS proxy.", + "description": "A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies ==)", "properties": { "clientSslPolicy": { "type": "string", @@ -16481,9 +18360,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -16494,7 +18377,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -16514,6 +18399,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -16545,7 +18436,7 @@ "TargetInstance": { "id": "TargetInstance", "type": "object", - "description": "A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols.", + "description": "A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. (== resource_for beta.targetInstances ==) (== resource_for v1.targetInstances ==)", "properties": { "creationTimestamp": { "type": "string", @@ -16633,9 +18524,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -16646,7 +18541,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -16666,6 +18563,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -16733,9 +18636,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -16746,7 +18653,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -16766,6 +18675,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -16815,9 +18730,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -16828,7 +18747,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -16848,6 +18769,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -16879,7 +18806,7 @@ "TargetPool": { "id": "TargetPool", "type": "object", - "description": "A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool.", + "description": "A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool. (== resource_for beta.targetPools ==) (== resource_for v1.targetPools ==)", "properties": { "backupPool": { "type": "string", @@ -16994,9 +18921,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -17007,7 +18938,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -17027,6 +18960,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -17111,9 +19050,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -17124,7 +19067,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -17144,6 +19089,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -17245,9 +19196,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -17258,7 +19213,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -17278,6 +19235,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -17359,7 +19322,7 @@ "TargetSslProxy": { "id": "TargetSslProxy", "type": "object", - "description": "A TargetSslProxy resource. This resource defines an SSL proxy.", + "description": "A TargetSslProxy resource. This resource defines an SSL proxy. (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==)", "properties": { "clientSslPolicy": { "type": "string", @@ -17460,9 +19423,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -17473,7 +19440,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -17493,6 +19462,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -17552,7 +19527,7 @@ "TargetTcpProxy": { "id": "TargetTcpProxy", "type": "object", - "description": "A TargetTcpProxy resource. This resource defines a TCP proxy.", + "description": "A TargetTcpProxy resource. This resource defines a TCP proxy. (== resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==)", "properties": { "creationTimestamp": { "type": "string", @@ -17638,9 +19613,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -17651,7 +19630,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -17671,6 +19652,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -17702,7 +19689,7 @@ "TargetVpnGateway": { "id": "TargetVpnGateway", "type": "object", - "description": "Represents a Target VPN gateway resource.", + "description": "Represents a Target VPN gateway resource. (== resource_for beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==)", "properties": { "creationTimestamp": { "type": "string", @@ -17832,9 +19819,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -17845,7 +19836,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -17865,6 +19858,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -17932,9 +19931,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -17945,7 +19948,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -17965,6 +19970,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -18014,9 +20025,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -18027,7 +20042,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -18047,6 +20064,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -18245,9 +20268,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -18258,7 +20285,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -18278,6 +20307,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -18389,6 +20424,14 @@ "type": "object", "description": "Subnetwork which the current user has compute.subnetworks.use permission on.", "properties": { + "ipCidrRange": { + "type": "string", + "description": "The range of internal addresses that are owned by this subnetwork." + }, + "network": { + "type": "string", + "description": "Network URL." + }, "subnetwork": { "type": "string", "description": "Subnetwork URL." @@ -18433,9 +20476,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -18446,7 +20493,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -18466,6 +20515,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -18509,9 +20564,21 @@ } } }, + "VmMaintenancePolicy": { + "id": "VmMaintenancePolicy", + "type": "object", + "description": "A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when.", + "properties": { + "maintenanceWindow": { + "$ref": "MaintenanceWindow", + "description": "Maintenance windows that are applied to VMs covered by this policy." + } + } + }, "VpnTunnel": { "id": "VpnTunnel", "type": "object", + "description": "VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for v1.vpnTunnels ==)", "properties": { "creationTimestamp": { "type": "string", @@ -18682,9 +20749,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -18695,7 +20766,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -18715,6 +20788,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -18782,9 +20861,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -18795,7 +20878,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -18815,6 +20900,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -18864,9 +20955,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -18877,7 +20972,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -18897,6 +20994,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -18963,9 +21066,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -18976,7 +21083,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -18996,6 +21105,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -19050,7 +21165,7 @@ "Zone": { "id": "Zone", "type": "object", - "description": "A Zone resource.", + "description": "A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones ==)", "properties": { "availableCpuPlatforms": { "type": "array", @@ -19146,9 +21261,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -19159,7 +21278,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -19179,6 +21300,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -21540,7 +23667,7 @@ "id": "compute.disks.resize", "path": "{project}/zones/{zone}/disks/{disk}/resize", "httpMethod": "POST", - "description": "Resizes the specified persistent disk.", + "description": "Resizes the specified persistent disk. You can only increase the size of the disk.", "parameters": { "disk": { "type": "string", @@ -24724,7 +26851,7 @@ "id": "compute.images.list", "path": "{project}/global/images", "httpMethod": "GET", - "description": "Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.", + "description": "Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.", "parameters": { "filter": { "type": "string", @@ -26624,6 +28751,55 @@ "https://www.googleapis.com/auth/compute" ] }, + "addMaintenancePolicies": { + "id": "compute.instances.addMaintenancePolicies", + "path": "{project}/zones/{zone}/instances/{instance}/addMaintenancePolicies", + "httpMethod": "POST", + "description": "Adds existing maintenance policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.", + "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" + }, + "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": "InstancesAddMaintenancePoliciesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "aggregatedList": { "id": "compute.instances.aggregatedList", "path": "{project}/aggregated/instances", @@ -27242,6 +29418,55 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "removeMaintenancePolicies": { + "id": "compute.instances.removeMaintenancePolicies", + "path": "{project}/zones/{zone}/instances/{instance}/removeMaintenancePolicies", + "httpMethod": "POST", + "description": "Removes maintenance policies from an instance.", + "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" + }, + "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": "InstancesRemoveMaintenancePoliciesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "reset": { "id": "compute.instances.reset", "path": "{project}/zones/{zone}/instances/{instance}/reset", @@ -27977,7 +30202,7 @@ "id": "compute.instances.stop", "path": "{project}/zones/{zone}/instances/{instance}/stop", "httpMethod": "POST", - "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.", + "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.", "parameters": { "discardLocalSsd": { "type": "boolean", @@ -28231,6 +30456,55 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute" ] + }, + "updateShieldedVmConfig": { + "id": "compute.instances.updateShieldedVmConfig", + "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig", + "httpMethod": "PATCH", + "description": "Updates the Shielded VM config for an instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", + "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": "ShieldedVmConfig" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] } } }, @@ -28513,6 +30787,55 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "patch": { + "id": "compute.interconnectAttachments.patch", + "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}", + "httpMethod": "PATCH", + "description": "Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.", + "parameters": { + "interconnectAttachment": { + "type": "string", + "description": "Name of the interconnect attachment to patch.", + "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 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" + } + }, + "parameterOrder": [ + "project", + "region", + "interconnectAttachment" + ], + "request": { + "$ref": "InterconnectAttachment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setIamPolicy": { "id": "compute.interconnectAttachments.setIamPolicy", "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy", @@ -28557,6 +30880,55 @@ "https://www.googleapis.com/auth/compute" ] }, + "setLabels": { + "id": "compute.interconnectAttachments.setLabels", + "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels", + "httpMethod": "POST", + "description": "Sets the labels on an InterconnectAttachment. 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.interconnectAttachments.testIamPermissions", "path": "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions", @@ -28995,6 +31367,42 @@ "https://www.googleapis.com/auth/compute" ] }, + "setLabels": { + "id": "compute.interconnects.setLabels", + "path": "{project}/global/interconnects/{resource}/setLabels", + "httpMethod": "POST", + "description": "Sets the labels on an Interconnect. 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.interconnects.testIamPermissions", "path": "{project}/global/interconnects/{resource}/testIamPermissions", @@ -29599,6 +32007,376 @@ } } }, + "maintenancePolicies": { + "methods": { + "aggregatedList": { + "id": "compute.maintenancePolicies.aggregatedList", + "path": "{project}/aggregated/maintenancePolicies", + "httpMethod": "GET", + "description": "Retrieves an aggregated list of maintenance policies.", + "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": "MaintenancePolicyAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.maintenancePolicies.delete", + "path": "{project}/regions/{region}/maintenancePolicies/{maintenancePolicy}", + "httpMethod": "DELETE", + "description": "Deletes the specified maintenance policy.", + "parameters": { + "maintenancePolicy": { + "type": "string", + "description": "Name of the maintenance policy 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", + "maintenancePolicy" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.maintenancePolicies.get", + "path": "{project}/regions/{region}/maintenancePolicies/{maintenancePolicy}", + "httpMethod": "GET", + "description": "Retrieves all information of the specified maintenance policy.", + "parameters": { + "maintenancePolicy": { + "type": "string", + "description": "Name of the maintenance policy to retrieve.", + "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", + "maintenancePolicy" + ], + "response": { + "$ref": "MaintenancePolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "getIamPolicy": { + "id": "compute.maintenancePolicies.getIamPolicy", + "path": "{project}/regions/{region}/maintenancePolicies/{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" + }, + "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" + ], + "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.maintenancePolicies.insert", + "path": "{project}/regions/{region}/maintenancePolicies", + "httpMethod": "POST", + "description": "Creates a new maintenance 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": "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": "MaintenancePolicy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.maintenancePolicies.list", + "path": "{project}/regions/{region}/maintenancePolicies", + "httpMethod": "GET", + "description": "List all the maintenance policies that have been configured for the specified project in 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": "MaintenancePoliciesList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setIamPolicy": { + "id": "compute.maintenancePolicies.setIamPolicy", + "path": "{project}/regions/{region}/maintenancePolicies/{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.maintenancePolicies.testIamPermissions", + "path": "{project}/regions/{region}/maintenancePolicies/{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" + ] + } + } + }, "networkEndpointGroups": { "methods": { "aggregatedList": { @@ -30322,7 +33100,7 @@ "id": "compute.networks.patch", "path": "{project}/global/networks/{network}", "httpMethod": "PATCH", - "description": "Patches the specified network with the data included in the request.", + "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.", "parameters": { "network": { "type": "string", @@ -34445,6 +37223,42 @@ }, "securityPolicies": { "methods": { + "addRule": { + "id": "compute.securityPolicies.addRule", + "path": "{project}/global/securityPolicies/{securityPolicy}/addRule", + "httpMethod": "POST", + "description": "Inserts a rule into a security 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 update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "securityPolicy" + ], + "request": { + "$ref": "SecurityPolicyRule" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "delete": { "id": "compute.securityPolicies.delete", "path": "{project}/global/securityPolicies/{securityPolicy}", @@ -34517,6 +37331,46 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "getRule": { + "id": "compute.securityPolicies.getRule", + "path": "{project}/global/securityPolicies/{securityPolicy}/getRule", + "httpMethod": "GET", + "description": "Gets a rule at the specified priority.", + "parameters": { + "priority": { + "type": "integer", + "description": "The priority of the rule to get from the security policy.", + "format": "int32", + "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" + }, + "securityPolicy": { + "type": "string", + "description": "Name of the security policy to which the queried rule belongs.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "securityPolicy" + ], + "response": { + "$ref": "SecurityPolicyRule" + }, + "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", @@ -34640,6 +37494,87 @@ "https://www.googleapis.com/auth/compute" ] }, + "patchRule": { + "id": "compute.securityPolicies.patchRule", + "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule", + "httpMethod": "POST", + "description": "Patches a rule at the specified priority.", + "parameters": { + "priority": { + "type": "integer", + "description": "The priority of the rule to patch.", + "format": "int32", + "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" + }, + "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": "SecurityPolicyRule" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "removeRule": { + "id": "compute.securityPolicies.removeRule", + "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule", + "httpMethod": "POST", + "description": "Deletes a rule at the specified priority.", + "parameters": { + "priority": { + "type": "integer", + "description": "The priority of the rule to remove from the security policy.", + "format": "int32", + "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" + }, + "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" + ], + "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", @@ -38319,6 +41254,55 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "setLabels": { + "id": "compute.targetVpnGateways.setLabels", + "path": "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels", + "httpMethod": "POST", + "description": "Sets the labels on a TargetVpnGateway. 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.targetVpnGateways.testIamPermissions", "path": "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions", diff --git a/etc/api/compute/beta/compute-api.json b/etc/api/compute/beta/compute-api.json index 10446d78f9..c53c5f1356 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/2Jt9iILNSBvotCe8YWfswUcsXKc\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/j5zvxTgngRBLrvV_ukeemeNJYB4\"", "discoveryVersion": "v1", "id": "compute:beta", "name": "compute", "version": "beta", - "revision": "20170908", + "revision": "20171122", "title": "Compute Engine API", "description": "Creates and runs virtual machines on Google Cloud Platform.", "ownerDomain": "google.com", @@ -110,7 +110,7 @@ "AcceleratorType": { "id": "AcceleratorType", "type": "object", - "description": "An Accelerator Type resource.", + "description": "An Accelerator Type resource. (== resource_for beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -193,9 +193,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -206,7 +210,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -226,6 +232,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -293,9 +305,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -306,7 +322,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -326,6 +344,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -375,9 +399,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -388,7 +416,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -408,6 +438,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -478,7 +514,7 @@ "Address": { "id": "Address", "type": "object", - "description": "A reserved address resource.", + "description": "A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)", "properties": { "address": { "type": "string", @@ -486,7 +522,7 @@ }, "addressType": { "type": "string", - "description": "The type of address to reserve. If unspecified, defaults to EXTERNAL.", + "description": "The type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL.", "enum": [ "EXTERNAL", "INTERNAL", @@ -562,7 +598,7 @@ }, "status": { "type": "string", - "description": "[Output Only] The status of the address, which can be either IN_USE or RESERVED. An address that is RESERVED is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available.", + "description": "[Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available.", "enum": [ "IN_USE", "RESERVED" @@ -574,7 +610,7 @@ }, "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." + "description": "The 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. This field can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER purposes." }, "users": { "type": "array", @@ -624,9 +660,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -637,7 +677,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -657,6 +699,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -724,9 +772,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -737,7 +789,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -757,6 +811,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -806,9 +866,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -819,7 +883,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -839,6 +905,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -950,7 +1022,7 @@ }, "source": { "type": "string", - "description": "Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.\n\nIf desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.\n\nNote that for InstanceTemplate, specify the disk name, not the URL for the disk." + "description": "Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD.\n\nIf desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.\n\nNote that for InstanceTemplate, specify the disk name, not the URL for the disk." }, "type": { "type": "string", @@ -998,7 +1070,7 @@ }, "sourceImage": { "type": "string", - "description": "The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a private image that you created, specify the image name in the following format:\n\nglobal/images/my-private-image \n\nYou can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-private-family \n\nIf the source image is deleted later, this field will not be set." + "description": "The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a custom image that you created, specify the image name in the following format:\n\nglobal/images/my-custom-image \n\nYou can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-image-family \n\nIf the source image is deleted later, this field will not be set." }, "sourceImageEncryptionKey": { "$ref": "CustomerEncryptionKey", @@ -1089,7 +1161,7 @@ "Autoscaler": { "id": "Autoscaler", "type": "object", - "description": "Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.", + "description": "Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)", "properties": { "autoscalingPolicy": { "$ref": "AutoscalingPolicy", @@ -1203,9 +1275,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -1216,7 +1292,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -1236,6 +1314,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1303,9 +1387,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -1316,7 +1404,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -1336,6 +1426,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1433,9 +1529,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -1446,7 +1546,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -1466,6 +1568,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1550,20 +1658,20 @@ "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." + "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 per-group 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 per-group 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." + "description": "The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.\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.", + "description": "If scaling is based on a per-group 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.", + "description": "The target value of the metric that autoscaler should maintain. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric.\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.", "format": "double" }, "utilizationTargetType": { @@ -1734,9 +1842,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -1747,7 +1859,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -1767,6 +1881,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1798,7 +1918,7 @@ "BackendService": { "id": "BackendService", "type": "object", - "description": "A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity.", + "description": "A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==)", "properties": { "affinityCookieTtlSec": { "type": "integer", @@ -1979,9 +2099,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -1992,7 +2116,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2012,6 +2138,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2127,9 +2259,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2140,7 +2276,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2160,6 +2298,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2209,9 +2353,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2222,7 +2370,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2242,6 +2392,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2341,7 +2497,7 @@ "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.", + "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. (== resource_for beta.commitments ==) (== resource_for v1.commitments ==)", "properties": { "creationTimestamp": { "type": "string", @@ -2464,9 +2620,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2477,7 +2637,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2497,6 +2659,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2564,9 +2732,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2577,7 +2749,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2597,6 +2771,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2646,9 +2826,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2659,7 +2843,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2679,6 +2865,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2872,7 +3064,7 @@ "Disk": { "id": "Disk", "type": "object", - "description": "A Disk resource.", + "description": "A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks ==)", "properties": { "creationTimestamp": { "type": "string", @@ -2916,6 +3108,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.", @@ -2948,7 +3148,7 @@ }, "sourceImage": { "type": "string", - "description": "The source image used to create this disk. If the source image is deleted, this field will not be set.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a private image that you created, specify the image name in the following format:\n\nglobal/images/my-private-image \n\nYou can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-private-family" + "description": "The source image used to create this disk. If the source image is deleted, this field will not be set.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a custom image that you created, specify the image name in the following format:\n\nglobal/images/my-custom-image \n\nYou can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-image-family" }, "sourceImageEncryptionKey": { "$ref": "CustomerEncryptionKey", @@ -3054,9 +3254,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3067,7 +3271,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3087,6 +3293,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3115,6 +3327,47 @@ } } }, + "DiskInstantiationConfig": { + "id": "DiskInstantiationConfig", + "type": "object", + "description": "A specification of the desired way to instantiate a disk in the instance template when its created from a source instance.", + "properties": { + "autoDelete": { + "type": "boolean", + "description": "Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance)." + }, + "deviceName": { + "type": "string", + "description": "Specifies the device name of the disk to which the configurations apply to." + }, + "instantiateFrom": { + "type": "string", + "description": "Specifies whether to include the disk and what image to use.", + "enum": [ + "ATTACH_READ_ONLY", + "BLANK", + "DEFAULT", + "DO_NOT_INCLUDE", + "IMAGE_URL", + "SOURCE_IMAGE", + "SOURCE_IMAGE_FAMILY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "sourceImage": { + "type": "string", + "description": "The custom source image to be used to restore this disk when instantiating this instance template." + } + } + }, "DiskList": { "id": "DiskList", "type": "object", @@ -3154,9 +3407,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3167,7 +3424,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3187,6 +3446,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3232,7 +3497,7 @@ "DiskType": { "id": "DiskType", "type": "object", - "description": "A DiskType resource.", + "description": "A DiskType resource. (== resource_for beta.diskTypes ==) (== resource_for v1.diskTypes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -3319,9 +3584,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3332,7 +3601,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3352,6 +3623,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3419,9 +3696,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3432,7 +3713,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3452,6 +3735,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3501,9 +3790,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3514,7 +3807,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3534,6 +3829,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3594,9 +3895,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3607,7 +3912,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3627,6 +3934,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3842,7 +4155,7 @@ }, "targetTags": { "type": "array", - "description": "A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", + "description": "A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", "items": { "type": "string" } @@ -3888,9 +4201,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -3901,7 +4218,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -3921,6 +4240,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -3956,17 +4281,17 @@ "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)", + "description": "[Output Only] Absolute value of VM instances calculated based on the specific mode.\n\n \n- If the value is fixed, then the caculated value is equal to the fixed value. \n- If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.", "format": "int32" }, "fixed": { "type": "integer", - "description": "fixed must be non-negative.", + "description": "Specifies a fixed number of VM instances. This must be a positive integer.", "format": "int32" }, "percent": { "type": "integer", - "description": "percent must belong to [0, 100].", + "description": "Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.", "format": "int32" } } @@ -3974,11 +4299,11 @@ "ForwardingRule": { "id": "ForwardingRule", "type": "object", - "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple.", + "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==)", "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 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." + "description": "The IP address that this forwarding rule is serving on behalf of.\n\nAddresses are restricted based on the forwarding rule's load balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional).\n\nWhen the load balancing scheme is EXTERNAL, for global forwarding rules, the address must be a global IP, and for regional forwarding rules, the address must live in the same region as the forwarding rule. If this field is empty, 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/subnet configured for the forwarding rule. By default, if this field is empty, an ephemeral internal IP address will be automatically allocated from the IP range of the subnet or network configured for this forwarding rule.\n\nAn address can be specified either by a literal IP address or a URL reference to an existing Address resource. The following examples are all valid: \n- 100.1.2.3 \n- https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address \n- projects/project/regions/region/addresses/address \n- regions/region/addresses/address \n- global/addresses/address \n- address" }, "IPProtocol": { "type": "string", @@ -4148,9 +4473,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4161,7 +4490,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4181,6 +4512,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4248,9 +4585,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4261,7 +4602,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4281,6 +4624,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4330,9 +4679,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4343,7 +4696,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4363,6 +4718,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4416,14 +4777,18 @@ "properties": { "type": { "type": "string", - "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.", + "description": "The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.", "enum": [ "FEATURE_TYPE_UNSPECIFIED", "MULTI_IP_SUBNET", + "SECURE_BOOT", + "UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS" ], "enumDescriptions": [ + "", + "", "", "", "", @@ -4464,6 +4829,10 @@ "requestPath": { "type": "string", "description": "The request path of the HTTP health check request. The default value is /." + }, + "response": { + "type": "string", + "description": "The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII." } } }, @@ -4499,6 +4868,10 @@ "requestPath": { "type": "string", "description": "The request path of the HTTPS health check request. The default value is /." + }, + "response": { + "type": "string", + "description": "The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII." } } }, @@ -4630,9 +5003,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4643,7 +5020,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4663,6 +5042,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4860,9 +5245,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4873,7 +5262,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4893,6 +5284,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5027,9 +5424,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5040,7 +5441,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5060,6 +5463,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5091,7 +5500,7 @@ "Image": { "id": "Image", "type": "object", - "description": "An Image resource.", + "description": "An Image resource. (== resource_for beta.images ==) (== resource_for v1.images ==)", "properties": { "archiveSizeBytes": { "type": "string", @@ -5121,7 +5530,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 newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image.", + "description": "A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.", "items": { "$ref": "GuestOsFeature" } @@ -5152,6 +5561,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.", @@ -5293,9 +5710,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5306,7 +5727,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5326,6 +5749,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5357,7 +5786,7 @@ "Instance": { "id": "Instance", "type": "object", - "description": "An Instance resource.", + "description": "An Instance resource. (== resource_for beta.instances ==) (== resource_for v1.instances ==)", "properties": { "canIpForward": { "type": "boolean", @@ -5371,6 +5800,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." @@ -5541,9 +5974,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5554,7 +5991,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5574,6 +6013,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5605,6 +6050,7 @@ "InstanceGroup": { "id": "InstanceGroup", "type": "object", + "description": "InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== resource_for v1.regionInstanceGroups ==)", "properties": { "creationTimestamp": { "type": "string", @@ -5712,9 +6158,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5725,7 +6175,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5745,6 +6197,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5812,9 +6270,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5825,7 +6287,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5845,6 +6309,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5876,7 +6346,7 @@ "InstanceGroupManager": { "id": "InstanceGroupManager", "type": "object", - "description": "An Instance Group Manager resource.", + "description": "An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==)", "properties": { "autoHealingPolicies": { "type": "array", @@ -6004,7 +6474,7 @@ }, "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.", + "description": "Specifies the instance templates used by this managed instance group to create instances.\n\nEach version is defined by an instanceTemplate. Every template can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.", "items": { "$ref": "InstanceGroupManagerVersion" } @@ -6105,9 +6575,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6118,7 +6592,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6138,6 +6614,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6220,9 +6702,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6233,7 +6719,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6253,6 +6741,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6313,11 +6807,11 @@ "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." + "description": "The maximum number of instances that can be created above the specified targetSize during the update process. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.\n\nAt least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge." }, "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." + "description": "The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied:\n\n \n- The instance's status is RUNNING. \n- If there is a health check on the instance group, the instance's liveness health check result must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary.\n\nAt least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable." }, "minReadySec": { "type": "integer", @@ -6326,7 +6820,7 @@ }, "minimalAction": { "type": "string", - "description": "Minimal action to be taken on an instance. The order of action types is: RESTART \u003c REPLACE.", + "description": "Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a code\u003eRESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.", "enum": [ "REPLACE", "RESTART" @@ -6362,7 +6856,7 @@ }, "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." + "description": "Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to: \n- If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used. \n- if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded up. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information." } } }, @@ -6458,9 +6952,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6471,7 +6969,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6491,6 +6991,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6610,9 +7116,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6623,7 +7133,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6643,6 +7155,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6723,9 +7241,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6736,7 +7258,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6756,6 +7280,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6841,9 +7371,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6854,7 +7388,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6874,6 +7410,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6941,9 +7483,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6954,7 +7500,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6974,6 +7522,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7104,7 +7658,7 @@ "InstanceTemplate": { "id": "InstanceTemplate", "type": "object", - "description": "An Instance Template resource.", + "description": "An Instance Template resource. (== resource_for beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)", "properties": { "creationTimestamp": { "type": "string", @@ -7141,6 +7695,14 @@ "selfLink": { "type": "string", "description": "[Output Only] The URL for this instance template. The server defines this URL." + }, + "sourceInstance": { + "type": "string", + "description": "The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance \n- projects/project/zones/zone/instances/instance" + }, + "sourceInstanceParams": { + "$ref": "SourceInstanceParams", + "description": "The source instance params to use to create this instance template." } } }, @@ -7183,9 +7745,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -7196,7 +7762,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7216,6 +7784,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7306,9 +7880,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -7319,7 +7897,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7339,6 +7919,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7450,11 +8036,11 @@ "Interconnect": { "id": "Interconnect", "type": "object", - "description": "Protocol definitions for Mixer API to support Interconnect. Next available tag: 23", + "description": "Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==)", "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?." + "description": "Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status is set to true." }, "circuitInfos": { "type": "array", @@ -7463,10 +8049,6 @@ "$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." @@ -7508,10 +8090,13 @@ }, "interconnectType": { "type": "string", + "description": "Type of interconnect. Note that \"IT_PRIVATE\" has been deprecated in favor of \"DEDICATED\"", "enum": [ + "DEDICATED", "IT_PRIVATE" ], "enumDescriptions": [ + "", "" ] }, @@ -7522,6 +8107,7 @@ }, "linkType": { "type": "string", + "description": "Type of link requested. This field indicates speed of each of the links in the bundle, not the entire bundle. Only 10G per link is allowed for a dedicated interconnect. Options: Ethernet_10G_LR", "enum": [ "LINK_TYPE_ETHERNET_10G_LR" ], @@ -7582,7 +8168,7 @@ "InterconnectAttachment": { "id": "InterconnectAttachment", "type": "object", - "description": "Protocol definitions for Mixer API to support InterconnectAttachment. Next available tag: 18", + "description": "Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==)", "properties": { "cloudRouterIpAddress": { "type": "string", @@ -7598,7 +8184,7 @@ }, "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." }, "googleReferenceId": { "type": "string", @@ -7637,7 +8223,7 @@ }, "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." + "description": "[Output Only] Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED." }, "region": { "type": "string", @@ -7692,9 +8278,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -7705,7 +8295,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7725,6 +8317,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7792,9 +8390,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -7805,7 +8407,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7825,6 +8429,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7856,7 +8466,7 @@ "InterconnectAttachmentPrivateInfo": { "id": "InterconnectAttachmentPrivateInfo", "type": "object", - "description": "Private information for an interconnect attachment when this belongs to an interconnect of type IT_PRIVATE.", + "description": "Information for an interconnect attachment when this belongs to an interconnect of type DEDICATED.", "properties": { "tag8021q": { "type": "integer", @@ -7886,9 +8496,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -7899,7 +8513,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7919,6 +8535,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7954,7 +8576,7 @@ "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." + "description": "Customer-side demarc ID for this circuit." }, "googleCircuitId": { "type": "string", @@ -8005,9 +8627,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8018,7 +8644,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8038,6 +8666,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8069,7 +8703,7 @@ "InterconnectLocation": { "id": "InterconnectLocation", "type": "object", - "description": "Protocol definitions for Mixer API to support InterconnectLocation.", + "description": "Represents an InterconnectLocations resource. The InterconnectLocations resource describes the locations where you can connect to Google's networks. For more information, see Colocation Facilities.", "properties": { "address": { "type": "string", @@ -8077,23 +8711,33 @@ }, "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\"." + "description": "[Output Only] Availability zone for this location. Within a metropolitan area (metro), 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\"." + "description": "[Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: \"Chicago, IL\", \"Amsterdam, Netherlands\"." }, "continent": { "type": "string", - "description": "Continent for this location. Used by the location picker in the Interconnect UI.", + "description": "[Output Only] Continent for this location.", "enum": [ + "AFRICA", + "ASIA_PAC", "C_AFRICA", "C_ASIA_PAC", "C_EUROPE", "C_NORTH_AMERICA", - "C_SOUTH_AMERICA" + "C_SOUTH_AMERICA", + "EUROPE", + "NORTH_AMERICA", + "SOUTH_AMERICA" ], "enumDescriptions": [ + "", + "", + "", + "", + "", "", "", "", @@ -8187,9 +8831,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8200,7 +8848,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8220,6 +8870,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8262,10 +8918,14 @@ "type": "string", "description": "Identifies the network presence of this location.", "enum": [ + "GLOBAL", + "LOCAL_REGION", "LP_GLOBAL", "LP_LOCAL_REGION" ], "enumDescriptions": [ + "", + "", "", "" ] @@ -8273,10 +8933,6 @@ "region": { "type": "string", "description": "URL for the region of this location." - }, - "regionKey": { - "type": "string", - "description": "Scope key for the region of this location." } } }, @@ -8294,19 +8950,25 @@ }, "description": { "type": "string", - "description": "Short user-visible description of the purpose of the outage." + "description": "A description about the purpose of the outage." }, "endTime": { "type": "string", + "description": "Scheduled end time for the outage (milliseconds since Unix epoch).", "format": "int64" }, "issueType": { "type": "string", + "description": "Form this outage is expected to take. Note that the \"IT_\" versions of this enum have been deprecated in favor of the unprefixed values.", "enum": [ "IT_OUTAGE", - "IT_PARTIAL_OUTAGE" + "IT_PARTIAL_OUTAGE", + "OUTAGE", + "PARTIAL_OUTAGE" ], "enumDescriptions": [ + "", + "", "", "" ] @@ -8317,25 +8979,33 @@ }, "source": { "type": "string", + "description": "The party that generated this notification. Note that \"NSRC_GOOGLE\" has been deprecated in favor of \"GOOGLE\"", "enum": [ + "GOOGLE", "NSRC_GOOGLE" ], "enumDescriptions": [ + "", "" ] }, "startTime": { "type": "string", - "description": "Scheduled start and end times for the outage (milliseconds since Unix epoch).", + "description": "Scheduled start time for the outage (milliseconds since Unix epoch).", "format": "int64" }, "state": { "type": "string", + "description": "State of this notification. Note that the \"NS_\" versions of this enum have been deprecated in favor of the unprefixed values.", "enum": [ + "ACTIVE", + "CANCELLED", "NS_ACTIVE", "NS_CANCELED" ], "enumDescriptions": [ + "", + "", "", "" ] @@ -8351,11 +9021,29 @@ "type": "boolean", "description": "[Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee." }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] 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#license for licenses.", "default": "compute#license" }, + "licenseCode": { + "type": "string", + "description": "[Output Only] The unique code used to attach this license to images, snapshots, and disks.", + "format": "uint64" + }, "name": { "type": "string", "description": "[Output Only] Name of the resource. The name is 1-63 characters long and complies with RFC1035.", @@ -8366,9 +9054,219 @@ ] } }, + "resourceRequirements": { + "$ref": "LicenseResourceRequirements" + }, "selfLink": { "type": "string", "description": "[Output Only] Server-defined URL for the resource." + }, + "transferable": { + "type": "boolean", + "description": "If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk." + } + } + }, + "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", + "properties": { + "minGuestCpuCount": { + "type": "integer", + "description": "Minimum number of guest cpus required to use the Instance. Enforced at Instance creation and Instance start.", + "format": "int32" + }, + "minMemoryMb": { + "type": "integer", + "description": "Minimum memory required to use the Instance. Enforced at Instance creation and Instance start.", + "format": "int32" + } + } + }, + "LicensesListResponse": { + "id": "LicensesListResponse", + "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 License resources.", + "items": { + "$ref": "License" + } + }, + "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -8453,7 +9351,7 @@ "MachineType": { "id": "MachineType", "type": "object", - "description": "A Machine Type resource.", + "description": "A Machine Type resource. (== resource_for v1.machineTypes ==) (== resource_for beta.machineTypes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -8555,9 +9453,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8568,7 +9470,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8588,6 +9492,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8655,9 +9565,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8668,7 +9582,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8688,6 +9604,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8737,9 +9659,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8750,7 +9676,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8770,6 +9698,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8984,7 +9918,7 @@ "Network": { "id": "Network", "type": "object", - "description": "Represents a Network resource. Read Networks and Firewalls for more information.", + "description": "Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==)", "properties": { "IPv4Range": { "type": "string", @@ -9138,9 +10072,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9151,7 +10089,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9171,6 +10111,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -9263,7 +10209,12 @@ }, "name": { "type": "string", - "description": "Name of the peering, which should conform to RFC1035." + "description": "Name of the peering, which should conform to RFC1035.", + "annotations": { + "required": [ + "compute.networks.addPeering" + ] + } }, "peerNetwork": { "type": "string", @@ -9284,7 +10235,7 @@ "Operation": { "id": "Operation", "type": "object", - "description": "An Operation resource, used to manage asynchronous API requests.", + "description": "An Operation resource, used to manage asynchronous API requests. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)", "properties": { "clientOperationId": { "type": "string", @@ -9420,9 +10371,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9433,7 +10388,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9453,6 +10410,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -9525,9 +10488,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9538,7 +10505,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9558,6 +10527,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -9625,9 +10600,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9638,7 +10617,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9658,6 +10639,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -9707,9 +10694,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9720,7 +10711,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9740,6 +10733,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -9857,7 +10856,7 @@ "Project": { "id": "Project", "type": "object", - "description": "A Project resource. Projects can only be created in the Google Cloud Platform Console. Unless marked otherwise, values can only be modified in the console.", + "description": "A Project resource. Projects can only be created in the Google Cloud Platform Console. Unless marked otherwise, values can only be modified in the console. (== resource_for v1.projects ==) (== resource_for beta.projects ==)", "properties": { "commonInstanceMetadata": { "$ref": "Metadata", @@ -10007,6 +11006,7 @@ "INSTANCE_GROUP_MANAGERS", "INSTANCE_TEMPLATES", "INTERCONNECTS", + "INTERNAL_ADDRESSES", "IN_USE_ADDRESSES", "LOCAL_SSD_TOTAL_GB", "NETWORKS", @@ -10014,6 +11014,8 @@ "NVIDIA_P100_GPUS", "PREEMPTIBLE_CPUS", "PREEMPTIBLE_LOCAL_SSD_GB", + "PREEMPTIBLE_NVIDIA_K80_GPUS", + "PREEMPTIBLE_NVIDIA_P100_GPUS", "REGIONAL_AUTOSCALERS", "REGIONAL_INSTANCE_GROUP_MANAGERS", "ROUTERS", @@ -10078,6 +11080,9 @@ "", "", "", + "", + "", + "", "" ] }, @@ -10115,7 +11120,7 @@ "Region": { "id": "Region", "type": "object", - "description": "Region resource.", + "description": "Region resource. (== resource_for beta.regions ==) (== resource_for v1.regions ==)", "properties": { "creationTimestamp": { "type": "string", @@ -10214,9 +11219,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -10227,7 +11236,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -10247,6 +11258,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -10314,9 +11331,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -10327,7 +11348,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -10347,6 +11370,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -10414,9 +11443,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -10427,7 +11460,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -10447,6 +11482,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -10609,9 +11650,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -10622,7 +11667,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -10642,6 +11689,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -10750,9 +11803,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -10763,7 +11820,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -10783,6 +11842,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -10868,7 +11933,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 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.", + "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. (== resource_for beta.routes ==) (== resource_for v1.routes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -10978,9 +12043,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -10991,7 +12060,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11011,6 +12082,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11079,9 +12156,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11092,7 +12173,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11112,6 +12195,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11210,6 +12299,21 @@ } } }, + "RouterAdvertisedIpRange": { + "id": "RouterAdvertisedIpRange", + "type": "object", + "description": "Description-tagged IP ranges for the router to advertise.", + "properties": { + "description": { + "type": "string", + "description": "User-specified description for the IP range." + }, + "range": { + "type": "string", + "description": "The IP range to advertise. The value must be a CIDR-formatted string." + } + } + }, "RouterAggregatedList": { "id": "RouterAggregatedList", "type": "object", @@ -11250,9 +12354,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11263,7 +12371,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11283,6 +12393,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11315,6 +12431,38 @@ "id": "RouterBgp", "type": "object", "properties": { + "advertiseMode": { + "type": "string", + "description": "User-specified flag to indicate which mode to use for advertisement.", + "enum": [ + "CUSTOM", + "DEFAULT" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "advertisedGroups": { + "type": "array", + "description": "User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.", + "items": { + "type": "string", + "enum": [ + "ALL_SUBNETS" + ], + "enumDescriptions": [ + "" + ] + } + }, + "advertisedIpRanges": { + "type": "array", + "description": "User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.", + "items": { + "$ref": "RouterAdvertisedIpRange" + } + }, "asn": { "type": "integer", "description": "Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.", @@ -11326,6 +12474,38 @@ "id": "RouterBgpPeer", "type": "object", "properties": { + "advertiseMode": { + "type": "string", + "description": "User-specified flag to indicate which mode to use for advertisement.", + "enum": [ + "CUSTOM", + "DEFAULT" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "advertisedGroups": { + "type": "array", + "description": "User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in Bgp message). These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.", + "items": { + "type": "string", + "enum": [ + "ALL_SUBNETS" + ], + "enumDescriptions": [ + "" + ] + } + }, + "advertisedIpRanges": { + "type": "array", + "description": "User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in Bgp message). These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.", + "items": { + "$ref": "RouterAdvertisedIpRange" + } + }, "advertisedRoutePriority": { "type": "integer", "description": "The priority of routes advertised to this BGP peer. In the case where there is more than one matching route of maximum length, the routes with lowest priority value win.", @@ -11417,9 +12597,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11430,7 +12614,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11450,6 +12636,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11613,9 +12805,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11626,7 +12822,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11646,6 +12844,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11701,7 +12905,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" } @@ -11882,9 +13086,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -11895,7 +13103,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -11915,6 +13125,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -11989,6 +13205,35 @@ "id": "SecurityPolicyRuleMatcher", "type": "object", "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" + } + }, + "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", @@ -12050,7 +13295,7 @@ "Snapshot": { "id": "Snapshot", "type": "object", - "description": "A persistent disk snapshot resource.", + "description": "A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== resource_for v1.snapshots ==)", "properties": { "creationTimestamp": { "type": "string", @@ -12087,6 +13332,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).", @@ -12195,9 +13448,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -12208,7 +13465,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -12228,6 +13487,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -12256,10 +13521,24 @@ } } }, + "SourceInstanceParams": { + "id": "SourceInstanceParams", + "type": "object", + "description": "A specification of the parameters to use when creating the instance template from a source instance.", + "properties": { + "diskConfigs": { + "type": "array", + "description": "Attached disks configuration. If not provided, defaults are applied: For boot disk and any other R/W disks, new custom images will be created from each disk. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes.", + "items": { + "$ref": "DiskInstantiationConfig" + } + } + } + }, "SslCertificate": { "id": "SslCertificate", "type": "object", - "description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user.", + "description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)", "properties": { "certificate": { "type": "string", @@ -12337,9 +13616,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -12350,7 +13633,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -12370,6 +13655,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -12398,10 +13689,312 @@ } } }, + "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } + }, "Subnetwork": { "id": "Subnetwork", "type": "object", - "description": "A Subnetwork resource.", + "description": "A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==)", "properties": { "allowSubnetCidrRoutesOverlap": { "type": "boolean", @@ -12507,9 +14100,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -12520,7 +14117,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -12540,6 +14139,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -12607,9 +14212,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -12620,7 +14229,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -12640,6 +14251,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -12714,9 +14331,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -12727,7 +14348,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -12747,6 +14370,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -12841,7 +14470,7 @@ "TargetHttpProxy": { "id": "TargetHttpProxy", "type": "object", - "description": "A TargetHttpProxy resource. This resource defines an HTTP proxy.", + "description": "A TargetHttpProxy resource. This resource defines an HTTP proxy. (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==)", "properties": { "creationTimestamp": { "type": "string", @@ -12915,9 +14544,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -12928,7 +14561,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -12948,6 +14583,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -12976,6 +14617,26 @@ } } }, + "TargetHttpsProxiesSetQuicOverrideRequest": { + "id": "TargetHttpsProxiesSetQuicOverrideRequest", + "type": "object", + "properties": { + "quicOverride": { + "type": "string", + "description": "QUIC policy for the TargetHttpsProxy resource.", + "enum": [ + "DISABLE", + "ENABLE", + "NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, "TargetHttpsProxiesSetSslCertificatesRequest": { "id": "TargetHttpsProxiesSetSslCertificatesRequest", "type": "object", @@ -12992,7 +14653,7 @@ "TargetHttpsProxy": { "id": "TargetHttpsProxy", "type": "object", - "description": "A TargetHttpsProxy resource. This resource defines an HTTPS proxy.", + "description": "A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies ==)", "properties": { "creationTimestamp": { "type": "string", @@ -13017,6 +14678,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." @@ -13028,6 +14703,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" @@ -13073,9 +14752,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13086,7 +14769,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13106,6 +14791,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13137,7 +14828,7 @@ "TargetInstance": { "id": "TargetInstance", "type": "object", - "description": "A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols.", + "description": "A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. (== resource_for beta.targetInstances ==) (== resource_for v1.targetInstances ==)", "properties": { "creationTimestamp": { "type": "string", @@ -13225,9 +14916,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13238,7 +14933,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13258,6 +14955,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13325,9 +15028,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13338,7 +15045,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13358,6 +15067,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13407,9 +15122,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13420,7 +15139,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13440,6 +15161,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13471,7 +15198,7 @@ "TargetPool": { "id": "TargetPool", "type": "object", - "description": "A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool.", + "description": "A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool. (== resource_for beta.targetPools ==) (== resource_for v1.targetPools ==)", "properties": { "backupPool": { "type": "string", @@ -13586,9 +15313,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13599,7 +15330,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13619,6 +15352,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13703,9 +15442,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13716,7 +15459,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13736,6 +15481,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13837,9 +15588,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -13850,7 +15605,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -13870,6 +15627,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -13951,7 +15714,7 @@ "TargetSslProxy": { "id": "TargetSslProxy", "type": "object", - "description": "A TargetSslProxy resource. This resource defines an SSL proxy.", + "description": "A TargetSslProxy resource. This resource defines an SSL proxy. (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==)", "properties": { "creationTimestamp": { "type": "string", @@ -14002,6 +15765,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." } } }, @@ -14044,9 +15811,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -14057,7 +15828,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -14077,6 +15850,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -14136,7 +15915,7 @@ "TargetTcpProxy": { "id": "TargetTcpProxy", "type": "object", - "description": "A TargetTcpProxy resource. This resource defines a TCP proxy.", + "description": "A TargetTcpProxy resource. This resource defines a TCP proxy. (== resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==)", "properties": { "creationTimestamp": { "type": "string", @@ -14222,9 +16001,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -14235,7 +16018,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -14255,6 +16040,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -14286,7 +16077,7 @@ "TargetVpnGateway": { "id": "TargetVpnGateway", "type": "object", - "description": "Represents a Target VPN gateway resource.", + "description": "Represents a Target VPN gateway resource. (== resource_for beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==)", "properties": { "creationTimestamp": { "type": "string", @@ -14313,6 +16104,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.", @@ -14404,9 +16207,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -14417,7 +16224,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -14437,6 +16246,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -14504,9 +16319,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -14517,7 +16336,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -14537,6 +16358,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -14586,9 +16413,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -14599,7 +16430,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -14619,6 +16452,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -14817,9 +16656,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -14830,7 +16673,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -14850,6 +16695,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -14974,6 +16825,7 @@ "VpnTunnel": { "id": "VpnTunnel", "type": "object", + "description": "VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for v1.vpnTunnels ==)", "properties": { "creationTimestamp": { "type": "string", @@ -15002,6 +16854,18 @@ "description": "[Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels.", "default": "compute#vpnTunnel" }, + "labelFingerprint": { + "type": "string", + "description": "A fingerprint for the labels being applied to this VpnTunnel, 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 VpnTunnel.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "Labels to apply to this VpnTunnel. 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" + } + }, "localTrafficSelector": { "type": "array", "description": "Local traffic selector to use when establishing the VPN tunnel with peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported.", @@ -15132,9 +16996,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -15145,7 +17013,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -15165,6 +17035,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -15232,9 +17108,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -15245,7 +17125,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -15265,6 +17147,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -15314,9 +17202,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -15327,7 +17219,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -15347,6 +17241,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -15413,9 +17313,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -15426,7 +17330,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -15446,6 +17352,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -15500,7 +17412,7 @@ "Zone": { "id": "Zone", "type": "object", - "description": "A Zone resource.", + "description": "A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones ==)", "properties": { "availableCpuPlatforms": { "type": "array", @@ -15596,9 +17508,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -15609,7 +17525,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -15629,6 +17547,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -17632,7 +19556,7 @@ "id": "compute.disks.resize", "path": "{project}/zones/{zone}/disks/{disk}/resize", "httpMethod": "POST", - "description": "Resizes the specified persistent disk.", + "description": "Resizes the specified persistent disk. You can only increase the size of the disk.", "parameters": { "disk": { "type": "string", @@ -20126,7 +22050,7 @@ "id": "compute.images.list", "path": "{project}/global/images", "httpMethod": "GET", - "description": "Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.", + "description": "Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.", "parameters": { "filter": { "type": "string", @@ -22170,6 +24094,11 @@ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\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": { "type": "string", "description": "The name of the zone for this request.", @@ -22361,6 +24290,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", @@ -22913,7 +24894,7 @@ "id": "compute.instances.stop", "path": "{project}/zones/{zone}/instances/{instance}/stop", "httpMethod": "POST", - "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.", + "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.", "parameters": { "instance": { "type": "string", @@ -23721,8 +25702,84 @@ } } }, + "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" + ] + } + } + }, "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}", @@ -23756,6 +25813,91 @@ "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/compute.readonly" ] + }, + "insert": { + "id": "compute.licenses.insert", + "path": "{project}/global/licenses", + "httpMethod": "POST", + "description": "Create a License resource in the specified 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": "License" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "id": "compute.licenses.list", + "path": "{project}/global/licenses", + "httpMethod": "GET", + "description": "Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 8. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.", + "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": "LicensesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] } } }, @@ -24112,7 +26254,7 @@ "id": "compute.networks.patch", "path": "{project}/global/networks/{network}", "httpMethod": "PATCH", - "description": "Patches the specified network with the data included in the request.", + "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.", "parameters": { "network": { "type": "string", @@ -27442,6 +29584,42 @@ }, "securityPolicies": { "methods": { + "addRule": { + "id": "compute.securityPolicies.addRule", + "path": "{project}/global/securityPolicies/{securityPolicy}/addRule", + "httpMethod": "POST", + "description": "Inserts a rule into a security 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 update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "securityPolicy" + ], + "request": { + "$ref": "SecurityPolicyRule" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "delete": { "id": "compute.securityPolicies.delete", "path": "{project}/global/securityPolicies/{securityPolicy}", @@ -27514,6 +29692,46 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "getRule": { + "id": "compute.securityPolicies.getRule", + "path": "{project}/global/securityPolicies/{securityPolicy}/getRule", + "httpMethod": "GET", + "description": "Gets a rule at the specified priority.", + "parameters": { + "priority": { + "type": "integer", + "description": "The priority of the rule to get from the security policy.", + "format": "int32", + "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" + }, + "securityPolicy": { + "type": "string", + "description": "Name of the security policy to which the queried rule belongs.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "securityPolicy" + ], + "response": { + "$ref": "SecurityPolicyRule" + }, + "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", @@ -27637,6 +29855,87 @@ "https://www.googleapis.com/auth/compute" ] }, + "patchRule": { + "id": "compute.securityPolicies.patchRule", + "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule", + "httpMethod": "POST", + "description": "Patches a rule at the specified priority.", + "parameters": { + "priority": { + "type": "integer", + "description": "The priority of the rule to patch.", + "format": "int32", + "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" + }, + "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": "SecurityPolicyRule" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "removeRule": { + "id": "compute.securityPolicies.removeRule", + "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule", + "httpMethod": "POST", + "description": "Deletes a rule at the specified priority.", + "parameters": { + "priority": { + "type": "integer", + "description": "The priority of the rule to remove from the security policy.", + "format": "int32", + "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" + }, + "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" + ], + "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", @@ -28069,6 +30368,288 @@ } } }, + "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" + } + }, + "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" + ] + } + } + }, "subnetworks": { "methods": { "aggregatedList": { @@ -28978,6 +31559,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", @@ -29019,6 +31640,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", @@ -30242,6 +32903,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", @@ -30758,6 +33459,55 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "setLabels": { + "id": "compute.targetVpnGateways.setLabels", + "path": "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels", + "httpMethod": "POST", + "description": "Sets the labels on a TargetVpnGateway. 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.targetVpnGateways.testIamPermissions", "path": "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions", @@ -31396,6 +34146,55 @@ "https://www.googleapis.com/auth/compute.readonly" ] }, + "setLabels": { + "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 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.vpnTunnels.testIamPermissions", "path": "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions", diff --git a/etc/api/compute/v1/compute-api.json b/etc/api/compute/v1/compute-api.json index faef7b2f5d..96edf85352 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/cngOjaowRI92cKIanqfdVBHzE7E\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/BzHLXiml7t9ltKStcz-Ic74UmRU\"", "discoveryVersion": "v1", "id": "compute:v1", "name": "compute", "version": "v1", - "revision": "20170908", + "revision": "20171122", "title": "Compute Engine API", "description": "Creates and runs virtual machines on Google Cloud Platform.", "ownerDomain": "google.com", @@ -110,7 +110,7 @@ "AcceleratorType": { "id": "AcceleratorType", "type": "object", - "description": "An Accelerator Type resource.", + "description": "An Accelerator Type resource. (== resource_for beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -182,6 +182,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -213,6 +294,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -237,9 +399,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -250,7 +416,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -270,6 +438,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -332,12 +506,26 @@ "Address": { "id": "Address", "type": "object", - "description": "A reserved address resource.", + "description": "A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)", "properties": { "address": { "type": "string", "description": "The static IP address represented by this resource." }, + "addressType": { + "type": "string", + "description": "The type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL.", + "enum": [ + "EXTERNAL", + "INTERNAL", + "UNSPECIFIED_TYPE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, "creationTimestamp": { "type": "string", "description": "[Output Only] Creation timestamp in RFC3339 text format." @@ -390,7 +578,7 @@ }, "status": { "type": "string", - "description": "[Output Only] The status of the address, which can be either IN_USE or RESERVED. An address that is RESERVED is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available.", + "description": "[Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available.", "enum": [ "IN_USE", "RESERVED" @@ -400,6 +588,10 @@ "" ] }, + "subnetwork": { + "type": "string", + "description": "The 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. This field can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER purposes." + }, "users": { "type": "array", "description": "[Output Only] The URLs of the resources that are using this address.", @@ -437,6 +629,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -468,6 +741,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -492,9 +846,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -505,7 +863,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -525,6 +885,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -636,7 +1002,7 @@ }, "source": { "type": "string", - "description": "Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.\n\nIf desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.\n\nNote that for InstanceTemplate, specify the disk name, not the URL for the disk." + "description": "Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD.\n\nIf desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.\n\nNote that for InstanceTemplate, specify the disk name, not the URL for the disk." }, "type": { "type": "string", @@ -672,7 +1038,7 @@ }, "sourceImage": { "type": "string", - "description": "The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a private image that you created, specify the image name in the following format:\n\nglobal/images/my-private-image \n\nYou can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-private-family \n\nIf the source image is deleted later, this field will not be set." + "description": "The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a custom image that you created, specify the image name in the following format:\n\nglobal/images/my-custom-image \n\nYou can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-image-family \n\nIf the source image is deleted later, this field will not be set." }, "sourceImageEncryptionKey": { "$ref": "CustomerEncryptionKey", @@ -683,7 +1049,7 @@ "Autoscaler": { "id": "Autoscaler", "type": "object", - "description": "Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.", + "description": "Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)", "properties": { "autoscalingPolicy": { "$ref": "AutoscalingPolicy", @@ -786,6 +1152,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -817,6 +1264,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -889,9 +1417,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -902,7 +1434,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -922,6 +1456,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1006,11 +1546,11 @@ "properties": { "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." + "description": "The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.\n\nThe metric must have a value type of INT64 or 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.", + "description": "The target value of the metric that autoscaler should maintain. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric.\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.", "format": "double" }, "utilizationTargetType": { @@ -1170,13 +1710,94 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, "BackendService": { "id": "BackendService", "type": "object", - "description": "A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity.", + "description": "A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==)", "properties": { "affinityCookieTtlSec": { "type": "integer", @@ -1342,6 +1963,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -1421,6 +2123,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -1445,9 +2228,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -1458,7 +2245,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -1478,6 +2267,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1555,7 +2350,7 @@ "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.", + "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. (== resource_for beta.commitments ==) (== resource_for v1.commitments ==)", "properties": { "creationTimestamp": { "type": "string", @@ -1667,6 +2462,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -1698,6 +2574,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -1722,9 +2679,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -1735,7 +2696,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -1755,6 +2718,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1864,7 +2833,7 @@ "Disk": { "id": "Disk", "type": "object", - "description": "A Disk resource.", + "description": "A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks ==)", "properties": { "creationTimestamp": { "type": "string", @@ -1940,7 +2909,7 @@ }, "sourceImage": { "type": "string", - "description": "The source image used to create this disk. If the source image is deleted, this field will not be set.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a private image that you created, specify the image name in the following format:\n\nglobal/images/my-private-image \n\nYou can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-private-family" + "description": "The source image used to create this disk. If the source image is deleted, this field will not be set.\n\nTo create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:\n\nprojects/debian-cloud/global/images/family/debian-8 \n\nAlternatively, use a specific version of a public operating system image:\n\nprojects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD \n\nTo create a disk with a custom image that you created, specify the image name in the following format:\n\nglobal/images/my-custom-image \n\nYou can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:\n\nglobal/images/family/my-image-family" }, "sourceImageEncryptionKey": { "$ref": "CustomerEncryptionKey", @@ -2023,6 +2992,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -2054,6 +3104,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -2074,7 +3205,7 @@ "DiskType": { "id": "DiskType", "type": "object", - "description": "A DiskType resource.", + "description": "A DiskType resource. (== resource_for beta.diskTypes ==) (== resource_for v1.diskTypes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -2150,6 +3281,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -2181,6 +3393,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -2205,9 +3498,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2218,7 +3515,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2238,6 +3537,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2298,9 +3603,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2311,7 +3620,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2331,6 +3642,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2472,6 +3789,13 @@ "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 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.", @@ -2479,9 +3803,16 @@ "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" + } + }, "targetTags": { "type": "array", - "description": "A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", + "description": "A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", "items": { "type": "string" } @@ -2516,17 +3847,98 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, "ForwardingRule": { "id": "ForwardingRule", "type": "object", - "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple.", + "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==)", "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 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." + "description": "The IP address that this forwarding rule is serving on behalf of.\n\nAddresses are restricted based on the forwarding rule's load balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional).\n\nWhen the load balancing scheme is EXTERNAL, for global forwarding rules, the address must be a global IP, and for regional forwarding rules, the address must live in the same region as the forwarding rule. If this field is empty, 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/subnet configured for the forwarding rule. By default, if this field is empty, an ephemeral internal IP address will be automatically allocated from the IP range of the subnet or network configured for this forwarding rule.\n\nAn address can be specified either by a literal IP address or a URL reference to an existing Address resource. The following examples are all valid: \n- 100.1.2.3 \n- https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address \n- projects/project/regions/region/addresses/address \n- regions/region/addresses/address \n- global/addresses/address \n- address" }, "IPProtocol": { "type": "string", @@ -2664,6 +4076,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -2695,6 +4188,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -2719,9 +4293,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -2732,7 +4310,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -2752,6 +4332,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -2805,7 +4391,7 @@ "properties": { "type": { "type": "string", - "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.", + "description": "The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.", "enum": [ "FEATURE_TYPE_UNSPECIFIED", "VIRTIO_SCSI_MULTIQUEUE", @@ -3001,6 +4587,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -3162,6 +4829,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -3260,13 +5008,94 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, "Image": { "id": "Image", "type": "object", - "description": "An Image resource.", + "description": "An Image resource. (== resource_for beta.images ==) (== resource_for v1.images ==)", "properties": { "archiveSizeBytes": { "type": "string", @@ -3296,7 +5125,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 newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image.", + "description": "A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.", "items": { "$ref": "GuestOsFeature" } @@ -3457,13 +5286,94 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, "Instance": { "id": "Instance", "type": "object", - "description": "An Instance resource.", + "description": "An Instance resource. (== resource_for beta.instances ==) (== resource_for v1.instances ==)", "properties": { "canIpForward": { "type": "boolean", @@ -3477,6 +5387,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." @@ -3530,6 +5444,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.", @@ -3632,12 +5550,94 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, "InstanceGroup": { "id": "InstanceGroup", "type": "object", + "description": "InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== resource_for v1.regionInstanceGroups ==)", "properties": { "creationTimestamp": { "type": "string", @@ -3734,6 +5734,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -3765,13 +5846,94 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, "InstanceGroupManager": { "id": "InstanceGroupManager", "type": "object", - "description": "An Instance Group Manager resource.", + "description": "An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==)", "properties": { "baseInstanceName": { "type": "string", @@ -3942,6 +6104,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -3973,6 +6216,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -4049,9 +6373,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4062,7 +6390,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4082,6 +6412,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4178,6 +6514,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -4233,9 +6650,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4246,7 +6667,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4266,6 +6689,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4340,6 +6769,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -4404,6 +6914,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.", @@ -4441,7 +6955,7 @@ "InstanceTemplate": { "id": "InstanceTemplate", "type": "object", - "description": "An Instance Template resource.", + "description": "An Instance Template resource. (== resource_for beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)", "properties": { "creationTimestamp": { "type": "string", @@ -4509,6 +7023,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -4574,9 +7169,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4587,7 +7186,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4607,6 +7208,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -4675,6 +7282,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", @@ -4705,6 +7322,985 @@ } } }, + "Interconnect": { + "id": "Interconnect", + "type": "object", + "description": "Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==)", + "properties": { + "adminEnabled": { + "type": "boolean", + "description": "Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status 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" + } + }, + "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", + "description": "Type of interconnect. Note that \"IT_PRIVATE\" has been deprecated in favor of \"DEDICATED\"", + "enum": [ + "DEDICATED", + "IT_PRIVATE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#interconnect for interconnects.", + "default": "compute#interconnect" + }, + "linkType": { + "type": "string", + "description": "Type of link requested. This field indicates speed of each of the links in the bundle, not the entire bundle. Only 10G per link is allowed for a dedicated interconnect. Options: Ethernet_10G_LR", + "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": "Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==)", + "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." + }, + "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 an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED." + }, + "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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": "Information for an interconnect attachment when this belongs to an interconnect of type DEDICATED.", + "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + }, + "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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": "Represents an InterconnectLocations resource. The InterconnectLocations resource describes the locations where you can connect to Google's networks. For more information, see Colocation Facilities.", + "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": "[Output Only] Availability zone for this location. Within a metropolitan area (metro), maintenance will not be simultaneously scheduled in more than one availability zone. Example: \"zone1\" or \"zone2\"." + }, + "city": { + "type": "string", + "description": "[Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: \"Chicago, IL\", \"Amsterdam, Netherlands\"." + }, + "continent": { + "type": "string", + "description": "[Output Only] Continent for this location.", + "enum": [ + "AFRICA", + "ASIA_PAC", + "C_AFRICA", + "C_ASIA_PAC", + "C_EUROPE", + "C_NORTH_AMERICA", + "C_SOUTH_AMERICA", + "EUROPE", + "NORTH_AMERICA", + "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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": [ + "GLOBAL", + "LOCAL_REGION", + "LP_GLOBAL", + "LP_LOCAL_REGION" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "region": { + "type": "string", + "description": "URL 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": "A description about the purpose of the outage." + }, + "endTime": { + "type": "string", + "description": "Scheduled end time for the outage (milliseconds since Unix epoch).", + "format": "int64" + }, + "issueType": { + "type": "string", + "description": "Form this outage is expected to take. Note that the \"IT_\" versions of this enum have been deprecated in favor of the unprefixed values.", + "enum": [ + "IT_OUTAGE", + "IT_PARTIAL_OUTAGE", + "OUTAGE", + "PARTIAL_OUTAGE" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Unique identifier for this outage notification." + }, + "source": { + "type": "string", + "description": "The party that generated this notification. Note that \"NSRC_GOOGLE\" has been deprecated in favor of \"GOOGLE\"", + "enum": [ + "GOOGLE", + "NSRC_GOOGLE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "startTime": { + "type": "string", + "description": "Scheduled start time for the outage (milliseconds since Unix epoch).", + "format": "int64" + }, + "state": { + "type": "string", + "description": "State of this notification. Note that the \"NS_\" versions of this enum have been deprecated in favor of the unprefixed values.", + "enum": [ + "ACTIVE", + "CANCELLED", + "NS_ACTIVE", + "NS_CANCELED" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, "License": { "id": "License", "type": "object", @@ -4738,7 +8334,7 @@ "MachineType": { "id": "MachineType", "type": "object", - "description": "A Machine Type resource.", + "description": "A Machine Type resource. (== resource_for v1.machineTypes ==) (== resource_for beta.machineTypes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -4848,6 +8444,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -4879,6 +8556,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -4903,9 +8661,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -4916,7 +8678,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -4936,6 +8700,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5130,7 +8900,7 @@ "Network": { "id": "Network", "type": "object", - "description": "Represents a Network resource. Read Networks and Firewalls for more information.", + "description": "Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==)", "properties": { "IPv4Range": { "type": "string", @@ -5181,6 +8951,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." @@ -5264,6 +9038,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -5302,6 +9157,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", @@ -5312,7 +9186,12 @@ }, "name": { "type": "string", - "description": "Name of the peering, which should conform to RFC1035." + "description": "Name of the peering, which should conform to RFC1035.", + "annotations": { + "required": [ + "compute.networks.addPeering" + ] + } }, "peerNetwork": { "type": "string", @@ -5333,7 +9212,7 @@ "Operation": { "id": "Operation", "type": "object", - "description": "An Operation resource, used to manage asynchronous API requests.", + "description": "An Operation resource, used to manage asynchronous API requests. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)", "properties": { "clientOperationId": { "type": "string", @@ -5469,9 +9348,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5482,7 +9365,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5502,6 +9387,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5563,6 +9454,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -5594,6 +9566,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -5618,9 +9671,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -5631,7 +9688,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -5651,6 +9710,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -5726,7 +9791,7 @@ "Project": { "id": "Project", "type": "object", - "description": "A Project resource. Projects can only be created in the Google Cloud Platform Console. Unless marked otherwise, values can only be modified in the console.", + "description": "A Project resource. Projects can only be created in the Google Cloud Platform Console. Unless marked otherwise, values can only be modified in the console. (== resource_for v1.projects ==) (== resource_for beta.projects ==)", "properties": { "commonInstanceMetadata": { "$ref": "Metadata", @@ -5875,6 +9940,8 @@ "INSTANCE_GROUPS", "INSTANCE_GROUP_MANAGERS", "INSTANCE_TEMPLATES", + "INTERCONNECTS", + "INTERNAL_ADDRESSES", "IN_USE_ADDRESSES", "LOCAL_SSD_TOTAL_GB", "NETWORKS", @@ -5882,6 +9949,8 @@ "NVIDIA_P100_GPUS", "PREEMPTIBLE_CPUS", "PREEMPTIBLE_LOCAL_SSD_GB", + "PREEMPTIBLE_NVIDIA_K80_GPUS", + "PREEMPTIBLE_NVIDIA_P100_GPUS", "REGIONAL_AUTOSCALERS", "REGIONAL_INSTANCE_GROUP_MANAGERS", "ROUTERS", @@ -5945,6 +10014,10 @@ "", "", "", + "", + "", + "", + "", "" ] }, @@ -5958,7 +10031,7 @@ "Region": { "id": "Region", "type": "object", - "description": "Region resource.", + "description": "Region resource. (== resource_for beta.regions ==) (== resource_for v1.regions ==)", "properties": { "creationTimestamp": { "type": "string", @@ -6046,6 +10119,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -6077,6 +10231,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -6108,6 +10343,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -6218,6 +10534,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -6290,6 +10687,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -6332,7 +10810,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 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.", + "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. (== resource_for beta.routes ==) (== resource_for v1.routes ==)", "properties": { "creationTimestamp": { "type": "string", @@ -6442,9 +10920,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6455,7 +10937,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6475,6 +10959,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -6532,6 +11022,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -6634,6 +11205,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -6689,6 +11341,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." @@ -6728,6 +11384,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -6866,9 +11603,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -6879,7 +11620,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -6899,6 +11642,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7040,7 +11789,7 @@ "Snapshot": { "id": "Snapshot", "type": "object", - "description": "A persistent disk snapshot resource.", + "description": "A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== resource_for v1.snapshots ==)", "properties": { "creationTimestamp": { "type": "string", @@ -7174,13 +11923,94 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, "SslCertificate": { "id": "SslCertificate", "type": "object", - "description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user.", + "description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)", "properties": { "certificate": { "type": "string", @@ -7247,13 +12077,94 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, "Subnetwork": { "id": "Subnetwork", "type": "object", - "description": "A Subnetwork resource.", + "description": "A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==)", "properties": { "creationTimestamp": { "type": "string", @@ -7339,6 +12250,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -7370,6 +12362,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -7419,9 +12492,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -7432,7 +12509,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7452,6 +12531,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7546,7 +12631,7 @@ "TargetHttpProxy": { "id": "TargetHttpProxy", "type": "object", - "description": "A TargetHttpProxy resource. This resource defines an HTTP proxy.", + "description": "A TargetHttpProxy resource. This resource defines an HTTP proxy. (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==)", "properties": { "creationTimestamp": { "type": "string", @@ -7609,6 +12694,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -7628,7 +12794,7 @@ "TargetHttpsProxy": { "id": "TargetHttpsProxy", "type": "object", - "description": "A TargetHttpsProxy resource. This resource defines an HTTPS proxy.", + "description": "A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies ==)", "properties": { "creationTimestamp": { "type": "string", @@ -7698,13 +12864,94 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, "TargetInstance": { "id": "TargetInstance", "type": "object", - "description": "A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols.", + "description": "A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. (== resource_for beta.targetInstances ==) (== resource_for v1.targetInstances ==)", "properties": { "creationTimestamp": { "type": "string", @@ -7781,6 +13028,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -7812,6 +13140,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -7836,9 +13245,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -7849,7 +13262,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -7869,6 +13284,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -7900,7 +13321,7 @@ "TargetPool": { "id": "TargetPool", "type": "object", - "description": "A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool.", + "description": "A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool. (== resource_for beta.targetPools ==) (== resource_for v1.targetPools ==)", "properties": { "backupPool": { "type": "string", @@ -8004,6 +13425,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -8052,6 +13554,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -8128,9 +13711,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8141,7 +13728,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8161,6 +13750,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8242,7 +13837,7 @@ "TargetSslProxy": { "id": "TargetSslProxy", "type": "object", - "description": "A TargetSslProxy resource. This resource defines an SSL proxy.", + "description": "A TargetSslProxy resource. This resource defines an SSL proxy. (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==)", "properties": { "creationTimestamp": { "type": "string", @@ -8324,6 +13919,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -8358,7 +14034,7 @@ "TargetTcpProxy": { "id": "TargetTcpProxy", "type": "object", - "description": "A TargetTcpProxy resource. This resource defines a TCP proxy.", + "description": "A TargetTcpProxy resource. This resource defines a TCP proxy. (== resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==)", "properties": { "creationTimestamp": { "type": "string", @@ -8433,13 +14109,94 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, "TargetVpnGateway": { "id": "TargetVpnGateway", "type": "object", - "description": "Represents a Target VPN gateway resource.", + "description": "Represents a Target VPN gateway resource. (== resource_for beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==)", "properties": { "creationTimestamp": { "type": "string", @@ -8546,6 +14303,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -8577,6 +14415,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -8601,9 +14520,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -8614,7 +14537,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -8634,6 +14559,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -8772,6 +14703,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -8871,6 +14883,7 @@ "VpnTunnel": { "id": "VpnTunnel", "type": "object", + "description": "VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for v1.vpnTunnels ==)", "properties": { "creationTimestamp": { "type": "string", @@ -9018,6 +15031,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -9049,6 +15143,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -9073,9 +15248,13 @@ "enum": [ "CLEANUP_FAILED", "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", "FIELD_VALUE_OVERRIDEN", "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", "NEXT_HOP_ADDRESS_NOT_ASSIGNED", "NEXT_HOP_CANNOT_IP_FORWARD", "NEXT_HOP_INSTANCE_NOT_FOUND", @@ -9086,7 +15265,9 @@ "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", "UNREACHABLE" ], "enumDescriptions": [ @@ -9106,6 +15287,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -9161,6 +15348,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -9190,8 +15458,15 @@ "Zone": { "id": "Zone", "type": "object", - "description": "A Zone resource.", + "description": "A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones ==)", "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." @@ -9268,6 +15543,87 @@ "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", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "MISSING_TYPE_DEPENDENCY", + "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", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "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." + } + } } } }, @@ -11030,7 +17386,7 @@ "id": "compute.disks.resize", "path": "{project}/zones/{zone}/disks/{disk}/resize", "httpMethod": "POST", - "description": "Resizes the specified persistent disk.", + "description": "Resizes the specified persistent disk. You can only increase the size of the disk.", "parameters": { "disk": { "type": "string", @@ -13091,7 +19447,7 @@ "id": "compute.images.list", "path": "{project}/global/images", "httpMethod": "GET", - "description": "Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.", + "description": "Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.", "parameters": { "filter": { "type": "string", @@ -14909,6 +21265,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", @@ -15166,6 +21574,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", @@ -15412,7 +21869,7 @@ "id": "compute.instances.stop", "path": "{project}/zones/{zone}/instances/{instance}/stop", "httpMethod": "POST", - "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.", + "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.", "parameters": { "instance": { "type": "string", @@ -15456,6 +21913,531 @@ } } }, + "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" + ] + } + } + }, + "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" + ] + } + } + }, "licenses": { "methods": { "get": { @@ -15843,6 +22825,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. Only the following fields can be modified: routingConfig.routingMode.", + "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", diff --git a/etc/api/container/v1/container-api.json b/etc/api/container/v1/container-api.json index 9aa4ae922b..69268588b5 100644 --- a/etc/api/container/v1/container-api.json +++ b/etc/api/container/v1/container-api.json @@ -1,1369 +1,510 @@ { - "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" + "schemas": { + "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" } - } - } - }, - "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": "20170915", - "title": "Google Container Engine API", - "ownerName": "Google", - "discoveryVersion": "v1", - "resources": { - "projects": { - "resources": { - "zones": { - "methods": { - "getServerconfig": { - "id": "container.projects.zones.getServerconfig", - "path": "v1/projects/{projectId}/zones/{zone}/serverconfig", - "description": "Returns configuration info about the Container Engine service.", - "response": { - "$ref": "ServerConfig" - }, - "parameterOrder": [ - "projectId", - "zone" - ], - "httpMethod": "GET", - "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 [zone](/compute/docs/zones#available)\nto return operations for.", - "type": "string", - "required": true, - "location": "path" - } - }, - "flatPath": "v1/projects/{projectId}/zones/{zone}/serverconfig" - } - }, - "resources": { - "clusters": { - "resources": { - "nodePools": { - "methods": { - "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.", - "type": "string", - "required": true - }, - "clusterId": { - "location": "path", - "description": "The name of the cluster.", - "type": "string", - "required": true - }, - "nodePoolId": { - "location": "path", - "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.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" - }, - "parameterOrder": [ - "projectId", - "zone", - "clusterId", - "nodePoolId" - ], - "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, - "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.", - "type": "string", - "required": true - }, - "clusterId": { - "location": "path", - "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", - "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" - }, - "parameterOrder": [ - "projectId", - "zone", - "clusterId" - ], - "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", - "zone", - "clusterId", - "nodePoolId" - ], - "response": { - "$ref": "Operation" - }, - "parameters": { - "clusterId": { - "description": "The name of the cluster to rollback.", - "type": "string", - "required": true, - "location": "path" - }, - "nodePoolId": { - "description": "The name of the node pool to rollback.", - "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 - }, - "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" - ] - }, - "create": { - "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" - }, - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "projectId", - "zone", - "clusterId" - ], - "httpMethod": "POST", - "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": { - "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}/nodePools" - }, - "autoscaling": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "projectId", - "zone", - "clusterId", - "nodePoolId" - ], - "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": { - "description": "The name of the cluster to upgrade.", - "type": "string", - "required": true, - "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" - }, - "description": "Cancels the specified operation.", - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "projectId", - "zone", - "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.", - "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)." - } - } - }, - "get": { - "httpMethod": "GET", - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "projectId", - "zone", - "operationId" - ], - "parameters": { - "operationId": { - "description": "The server-assigned `name` of the operation.", - "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 - }, - "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}/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." - } - } - } + }, + "id": "SetLegacyAbacRequest" + }, + "AddonsConfig": { + "description": "Configuration for the addons that can be automatically spun up in the\ncluster, enabling additional functionality.", + "type": "object", + "properties": { + "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." + }, + "kubernetesDashboard": { + "description": "Configuration for the Kubernetes Dashboard.", + "$ref": "KubernetesDashboard" + } + }, + "id": "AddonsConfig" + }, + "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.", + "type": "array", + "items": { + "type": "string" } } + }, + "id": "SetLocationsRequest" + }, + "SetNodePoolSizeRequest": { + "description": "SetNodePoolSizeRequest sets the size a node\npool.", + "type": "object", + "properties": { + "nodeCount": { + "description": "The desired node count for the pool.", + "format": "int32", + "type": "integer" + } + }, + "id": "SetNodePoolSizeRequest" + }, + "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", + "properties": { + "disabled": { + "description": "Whether NetworkPolicy is enabled for this cluster.", + "type": "boolean" + } + }, + "id": "NetworkPolicyConfig" + }, + "UpdateClusterRequest": { + "description": "UpdateClusterRequest updates the settings of a cluster.", + "type": "object", + "properties": { + "update": { + "description": "A description of the update.", + "$ref": "ClusterUpdate" + } + }, + "id": "UpdateClusterRequest" + }, + "Cluster": { + "description": "A Google Container Engine cluster.", + "type": "object", + "properties": { + "subnetwork": { + "description": "The name of the Google Compute Engine\n[subnetwork](/compute/docs/subnetworks) to which the\ncluster is connected.", + "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" + }, + "maintenancePolicy": { + "description": "Configure the maintenance policy for this cluster.", + "$ref": "MaintenancePolicy" + }, + "resourceLabels": { + "additionalProperties": { + "type": "string" + }, + "description": "The resource labels for the cluster to use to annotate any related\nGoogle Compute Engine resources.", + "type": "object" + }, + "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" + }, + "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." + }, + "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" + }, + "legacyAbac": { + "description": "Configuration for the legacy ABAC authorization mode.", + "$ref": "LegacyAbac" + }, + "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": { + "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": { + "description": "The node pools associated with this cluster.\nThis field should not be set if \"node_config\" or \"initial_node_count\" are\nspecified.", + "type": "array", + "items": { + "$ref": "NodePool" + } + }, + "instanceGroupUrls": { + "description": "Deprecated. Use node_pools.instance_group_urls.", + "type": "array", + "items": { + "type": "string" + } + }, + "servicesIpv4Cidr": { + "type": "string", + "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." + }, + "networkPolicy": { + "$ref": "NetworkPolicy", + "description": "Configuration options for the NetworkPolicy feature." + }, + "enableKubernetesAlpha": { + "type": "boolean", + "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." + }, + "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": { + "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" + }, + "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" + }, + "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" + }, + "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" + }, + "masterAuthorizedNetworksConfig": { + "$ref": "MasterAuthorizedNetworksConfig", + "description": "Master authorized networks is a Beta feature.\nThe configuration options for master authorized networks feature." + }, + "statusMessage": { + "type": "string", + "description": "[Output only] Additional information about the current status of this\ncluster, if available." + }, + "masterAuth": { + "description": "The authentication information for accessing the master endpoint.", + "$ref": "MasterAuth" + }, + "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" + ] + } + }, + "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": { + "description": "The authentication information for accessing the master endpoint.\nAuthentication can be done using HTTP basic auth or using client\ncertificates.", + "type": "object", + "properties": { + "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" + }, + "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." + } + }, + "id": "MasterAuth" + }, + "DailyMaintenanceWindow": { + "id": "DailyMaintenanceWindow", + "description": "Time window specified for daily maintenance operations.", + "type": "object", + "properties": { + "startTime": { + "type": "string", + "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." + }, + "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" + } } - } - }, - "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" + "MaintenancePolicy": { + "description": "MaintenancePolicy defines the maintenance policy to be used for the cluster.", + "type": "object", + "properties": { + "window": { + "$ref": "MaintenanceWindow", + "description": "Specifies the maintenance window in which maintenance may be performed." + } + }, + "id": "MaintenancePolicy" }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" + "ClientCertificateConfig": { + "id": "ClientCertificateConfig", + "description": "Configuration for client certificates on the cluster.", + "type": "object", + "properties": { + "issueClientCertificate": { + "description": "Issue a client certificate.", + "type": "boolean" + } + } }, - "uploadType": { - "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" + "SetLoggingServiceRequest": { + "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", + "description": "SetLoggingServiceRequest sets the logging service of a cluster.", + "type": "object" }, - "$.xgafv": { - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query" + "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" }, - "callback": { - "location": "query", - "description": "JSONP", - "type": "string" + "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 `{}`." }, - "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" + "ListNodePoolsResponse": { + "description": "ListNodePoolsResponse is the result of ListNodePoolsRequest.", + "type": "object", + "properties": { + "nodePools": { + "description": "A list of node pools for a cluster.", + "type": "array", + "items": { + "$ref": "NodePool" + } + } + }, + "id": "ListNodePoolsResponse" }, - "access_token": { - "type": "string", - "location": "query", - "description": "OAuth access token." + "CompleteIPRotationRequest": { + "description": "CompleteIPRotationRequest moves the cluster master back into single-IP mode.", + "type": "object", + "properties": {}, + "id": "CompleteIPRotationRequest" }, - "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" + "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": {}, + "id": "StartIPRotationRequest" }, - "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" + "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": { + "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": { + "$ref": "NodePoolAutoscaling", + "description": "Autoscaler configuration for this NodePool. Autoscaler is enabled\nonly if a valid configuration is present." + }, + "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" + }, + "management": { + "description": "NodeManagement configuration for this NodePool.", + "$ref": "NodeManagement" + }, + "selfLink": { + "type": "string", + "description": "[Output only] Server-defined URL for the resource." + }, + "version": { + "description": "The version of the Kubernetes of this node.", + "type": "string" + }, + "instanceGroupUrls": { + "type": "array", + "items": { + "type": "string" + }, + "description": "[Output only] The resource URLs of the [managed instance\ngroups](/compute/docs/instance-groups/creating-groups-of-managed-instances)\nassociated with this node pool." + }, + "status": { + "type": "string", + "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." + } + }, + "id": "NodePool" }, - "pp": { - "location": "query", - "description": "Pretty-print response.", - "default": "true", - "type": "boolean" + "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" + } + }, + "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" + } + }, + "id": "SetLabelsRequest" }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" + "NodeManagement": { + "description": "NodeManagement defines the set of node management services turned on for the\nnode pool.", + "type": "object", + "properties": { + "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" + }, + "upgradeOptions": { + "description": "Specifies the Auto Upgrade knobs for the node pool.", + "$ref": "AutoUpgradeOptions" + } + }, + "id": "NodeManagement" + }, + "CancelOperationRequest": { + "description": "CancelOperationRequest cancels a single operation.", + "type": "object", + "properties": {}, + "id": "CancelOperationRequest" }, - "oauth_token": { - "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" - } - }, - "schemas": { "KubernetesDashboard": { "properties": { "disabled": { @@ -1379,8 +520,19 @@ "description": "This operation resource represents operations that may have happened or are\nhappening on the cluster. All fields are output only.", "type": "object", "properties": { + "detail": { + "description": "Detailed operation progress, if available.", + "type": "string" + }, + "targetLink": { + "type": "string", + "description": "Server-defined URL for the target of the operation." + }, + "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.", @@ -1419,7 +571,8 @@ "SET_NODE_POOL_SIZE", "SET_NETWORK_POLICY", "SET_MAINTENANCE_POLICY" - ] + ], + "description": "The operation type." }, "startTime": { "description": "[Output only] The time the operation started, in\n[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", @@ -1430,6 +583,8 @@ "type": "string" }, "status": { + "description": "The current status of the operation.", + "type": "string", "enumDescriptions": [ "Not set.", "The operation has been created.", @@ -1443,33 +598,19 @@ "RUNNING", "DONE", "ABORTING" - ], - "description": "The current status of the operation.", + ] + }, + "statusMessage": { + "description": "If an error has occurred, a textual description of the error.", "type": "string" }, "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" - }, "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" - }, - "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" @@ -1478,18 +619,18 @@ "type": "object", "properties": { "dailyMaintenanceWindow": { - "$ref": "DailyMaintenanceWindow", - "description": "DailyMaintenanceWindow specifies a daily maintenance operation window." + "description": "DailyMaintenanceWindow specifies a daily maintenance operation window.", + "$ref": "DailyMaintenanceWindow" } }, "id": "MaintenanceWindow", "description": "MaintenanceWindow defines the maintenance window to be used for the cluster." }, "RollbackNodePoolUpgradeRequest": { - "id": "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": {} + "properties": {}, + "id": "RollbackNodePoolUpgradeRequest" }, "NetworkPolicy": { "description": "Configuration options for the NetworkPolicy feature.\nhttps://kubernetes.io/docs/concepts/services-networking/networkpolicies/", @@ -1500,8 +641,6 @@ "description": "Whether network policy is enabled on the cluster." }, "provider": { - "description": "The selected network policy provider.", - "type": "string", "enumDescriptions": [ "Not set", "Tigera (Calico Felix)." @@ -1509,7 +648,9 @@ "enum": [ "PROVIDER_UNSPECIFIED", "CALICO" - ] + ], + "description": "The selected network policy provider.", + "type": "string" } }, "id": "NetworkPolicy" @@ -1529,24 +670,25 @@ "description": "ListOperationsResponse is the result of ListOperationsRequest.", "type": "object", "properties": { - "operations": { - "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" + } + }, + "operations": { + "description": "A list of operations in the project in the specified zone.", + "type": "array", + "items": { + "$ref": "Operation" + } } }, "id": "ListOperationsResponse" }, "CidrBlock": { + "description": "CidrBlock contains an optional name and one CIDR block.", "type": "object", "properties": { "displayName": { @@ -1558,89 +700,68 @@ "type": "string" } }, - "id": "CidrBlock", - "description": "CidrBlock contains an optional name and one CIDR block." + "id": "CidrBlock" }, "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" + "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" } }, "id": "SetMonitoringServiceRequest" }, "ServerConfig": { + "description": "Container Engine service configuration.", + "type": "object", "properties": { "validMasterVersions": { "description": "List of valid master versions.", + "type": "array", "items": { "type": "string" - }, - "type": "array" - }, - "defaultImageType": { - "description": "Default image type.", - "type": "string" + } }, "defaultClusterVersion": { "description": "Version of Kubernetes the service deploys by default.", "type": "string" }, - "validImageTypes": { - "description": "List of valid image types.", - "items": { - "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" - }, - "type": "array" + } + }, + "validImageTypes": { + "description": "List of valid image types.", + "type": "array", + "items": { + "type": "string" + } } }, - "id": "ServerConfig", - "description": "Container Engine service configuration.", - "type": "object" + "id": "ServerConfig" }, "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", + "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", - "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.", + "type": "array", "items": { "$ref": "AcceleratorConfig" }, - "type": "array" + "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." }, "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`.", @@ -1655,30 +776,50 @@ "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.", + "format": "int32", "type": "integer" }, "metadata": { + "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", "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" + } }, "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" + }, + "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.", + "type": "array", + "items": { + "type": "string" + } + }, + "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:\nhttps://kubernetes.io/docs/concepts/overview/working-with-objects/labels/" } }, - "id": "NodeConfig" + "id": "NodeConfig", + "description": "Parameters that describe the nodes in a cluster.", + "type": "object" }, "AutoUpgradeOptions": { "description": "AutoUpgradeOptions defines the set of options for the user to control how\nthe Auto Upgrades will proceed.", @@ -1696,28 +837,27 @@ "id": "AutoUpgradeOptions" }, "ListClustersResponse": { + "description": "ListClustersResponse is the result of ListClustersRequest.", + "type": "object", "properties": { + "missingZones": { + "description": "If any zones are listed here, the list of clusters returned\nmay be missing those zones.", + "type": "array", + "items": { + "type": "string" + } + }, "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.", - "items": { - "type": "string" - }, - "type": "array" + "description": "A list of clusters in the project in the specified zone, or\nacross all ones." } }, - "id": "ListClustersResponse", - "description": "ListClustersResponse is the result of ListClustersRequest.", - "type": "object" + "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": { @@ -1725,10 +865,10 @@ "type": "boolean" } }, - "id": "HttpLoadBalancing" + "id": "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." }, "SetMasterAuthRequest": { - "description": "SetMasterAuthRequest updates the admin password of a cluster.", "type": "object", "properties": { "update": { @@ -1736,21 +876,45 @@ "$ref": "MasterAuth" }, "action": { + "description": "The exact form of action to be taken on the master auth.", "type": "string", "enumDescriptions": [ - "Operation is unknown and will error out", + "Operation is unknown and will error out.", "Set the password to a user generated value.", - "Generate a new password and set it to that." + "Generate a new password and set it to that.", + "Set the username. If an empty username is provided, basic authentication\nis disabled for the cluster. If a non-empty username is provided, basic\nauthentication is enabled, with either a provided password or a generated\none." ], "enum": [ "UNKNOWN", "SET_PASSWORD", - "GENERATE_PASSWORD" - ], - "description": "The exact form of action to be taken on the master auth" + "GENERATE_PASSWORD", + "SET_USERNAME" + ] } }, - "id": "SetMasterAuthRequest" + "id": "SetMasterAuthRequest", + "description": "SetMasterAuthRequest updates the admin password of a cluster." + }, + "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" }, "SetNetworkPolicyRequest": { "description": "SetNetworkPolicyRequest enables/disables network policy for a cluster.", @@ -1763,34 +927,71 @@ }, "id": "SetNetworkPolicyRequest" }, - "NodePoolAutoscaling": { - "description": "NodePoolAutoscaling contains information required by cluster autoscaler to\nadjust the size of the node pool to the current cluster usage.", + "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": { - "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" + "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" }, - "minNodeCount": { - "format": "int32", - "description": "Minimum number of nodes in the NodePool. Must be \u003e= 1 and \u003c=\nmax_node_count.", - "type": "integer" + "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" }, - "enabled": { - "description": "Is autoscaling enabled for this node pool.", - "type": "boolean" + "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" + }, + "desiredMasterAuthorizedNetworksConfig": { + "$ref": "MasterAuthorizedNetworksConfig", + "description": "Master authorized networks is a Beta feature.\nThe desired configuration options for master authorized networks feature." + }, + "desiredNodePoolAutoscaling": { + "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" + }, + "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" + } + }, + "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": { + "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" } }, - "id": "NodePoolAutoscaling" + "id": "ClusterUpdate" }, "IPAllocationPolicy": { "description": "Configuration for controlling how IPs are allocated in the cluster.", "type": "object", "properties": { + "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" + }, + "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" + }, + "clusterIpv4Cidr": { + "description": "This field is deprecated, use cluster_ipv4_cidr_block.", + "type": "string" + }, "nodeIpv4Cidr": { - "type": "string", - "description": "This field is deprecated, use node_ipv4_cidr_block." + "description": "This field is deprecated, use node_ipv4_cidr_block.", + "type": "string" }, "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.", @@ -1808,79 +1009,21 @@ "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" + "createSubnetwork": { + "description": "Whether a new subnetwork will be created automatically for the cluster.\n\nThis field is only applicable when `use_ip_aliases` is true.", + "type": "boolean" }, "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.", + "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" } }, "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" - }, - "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" - }, - "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.", - "items": { - "type": "string" - }, - "type": "array" - }, - "desiredNodePoolAutoscaling": { - "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": { - "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" - } - }, - "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", @@ -1892,25 +1035,8 @@ }, "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": { + "id": "SetNodePoolManagementRequest", "description": "SetNodePoolManagementRequest sets the node management properties of a node\npool.", "type": "object", "properties": { @@ -1918,21 +1044,39 @@ "$ref": "NodeManagement", "description": "NodeManagement configuration for the node pool." } + } + }, + "MasterAuthorizedNetworksConfig": { + "properties": { + "enabled": { + "description": "Whether or not master authorized networks is enabled.", + "type": "boolean" + }, + "cidrBlocks": { + "type": "array", + "items": { + "$ref": "CidrBlock" + }, + "description": "cidr_blocks define up to 10 external networks that could access\nKubernetes master through HTTPS." + } }, - "id": "SetNodePoolManagementRequest" + "id": "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" }, "SetNodePoolAutoscalingRequest": { - "id": "SetNodePoolAutoscalingRequest", "description": "SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool.", "type": "object", "properties": { "autoscaling": { - "$ref": "NodePoolAutoscaling", - "description": "Autoscaling configuration for the node pool." + "description": "Autoscaling configuration for the node pool.", + "$ref": "NodePoolAutoscaling" } - } + }, + "id": "SetNodePoolAutoscalingRequest" }, "CreateClusterRequest": { + "id": "CreateClusterRequest", "description": "CreateClusterRequest creates a cluster.", "type": "object", "properties": { @@ -1940,41 +1084,26 @@ "description": "A [cluster\nresource](/container-engine/reference/rest/v1/projects.zones.clusters)", "$ref": "Cluster" } - }, - "id": "CreateClusterRequest" - }, - "UpdateNodePoolRequest": { - "description": "UpdateNodePoolRequests update a node pool's image and/or version.", - "type": "object", - "properties": { - "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": "UpdateNodePoolRequest" + } }, "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)", + "acceleratorCount": { + "description": "The number of the accelerator cards exposed to an instance.", + "format": "int64", "type": "string" }, - "acceleratorCount": { - "format": "int64", - "description": "The number of the accelerator cards exposed to an instance.", + "acceleratorType": { + "description": "The accelerator type resource name. List of supported accelerators\n[here](/compute/docs/gpus/#Introduction)", "type": "string" } }, "id": "AcceleratorConfig" }, "LegacyAbac": { + "id": "LegacyAbac", "description": "Configuration for the legacy Attribute Based Access Control authorization\nmode.", "type": "object", "properties": { @@ -1982,10 +1111,25 @@ "description": "Whether the ABAC authorizer is enabled for this cluster. When enabled,\nidentities in the system, including service accounts, nodes, and\ncontrollers, will have statically granted permissions beyond those\nprovided by the RBAC configuration or IAM.", "type": "boolean" } + } + }, + "UpdateNodePoolRequest": { + "description": "UpdateNodePoolRequests update a node pool's image and/or version.", + "type": "object", + "properties": { + "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" + }, + "imageType": { + "description": "The desired image type for the node pool.", + "type": "string" + } }, - "id": "LegacyAbac" + "id": "UpdateNodePoolRequest" }, "SetAddonsConfigRequest": { + "id": "SetAddonsConfigRequest", "description": "SetAddonsConfigRequest sets the addons associated with the cluster.", "type": "object", "properties": { @@ -1993,518 +1137,1377 @@ "$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" - } - }, - "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" - } - }, - "id": "SetLabelsRequest" - }, - "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": { - "type": "string", - "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." - }, - "config": { - "$ref": "NodeConfig", - "description": "The node configuration of the pool." - }, - "name": { - "description": "The name of the node pool.", - "type": "string" - }, - "statusMessage": { - "description": "[Output only] Additional information about the current status of this\nnode pool instance, if available.", - "type": "string" - }, - "autoscaling": { - "$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." - }, - "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.", - "items": { - "type": "string" - }, - "type": "array" - }, - "version": { - "description": "[Output only] The version of the Kubernetes of this node.", - "type": "string" - } - }, - "id": "NodePool" - }, - "NodeManagement": { - "description": "NodeManagement defines the set of node management services turned on for the\nnode pool.", - "type": "object", - "properties": { - "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" - }, - "CancelOperationRequest": { - "description": "CancelOperationRequest cancels a single operation.", - "type": "object", - "properties": {}, - "id": "CancelOperationRequest" + } } }, - "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", + "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", + "fullyEncodeReservedExpansion": true, + "title": "Google Container Engine API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "zones": { + "methods": { + "getServerconfig": { + "path": "v1/projects/{projectId}/zones/{zone}/serverconfig", + "id": "container.projects.zones.getServerconfig", + "description": "Returns configuration info about the Container Engine service.", + "response": { + "$ref": "ServerConfig" + }, + "parameterOrder": [ + "projectId", + "zone" + ], + "httpMethod": "GET", + "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": { + "required": true, + "type": "string", + "location": "path", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available)\nto return operations for." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/serverconfig" + } + }, + "resources": { + "clusters": { + "methods": { + "setMasterAuth": { + "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": { + "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" + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth", + "path": "v1/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 the password.", + "request": { + "$ref": "SetMasterAuthRequest" + } + }, + "logging": { + "description": "Sets the logging service of a specific cluster.", + "request": { + "$ref": "SetLoggingServiceRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "clusterId": { + "description": "The name of the cluster to upgrade.", + "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" + }, + "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" + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging", + "id": "container.projects.zones.clusters.logging" + }, + "list": { + "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.", + "httpMethod": "GET", + "parameterOrder": [ + "projectId", + "zone" + ], + "response": { + "$ref": "ListClustersResponse" + }, + "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": { + "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" + }, + "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": { + "request": { + "$ref": "SetLabelsRequest" + }, + "description": "Sets labels on a cluster.", + "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": { + "location": "path", + "description": "The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).", + "required": true, + "type": "string" + } + }, + "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" + }, + "completeIpRotation": { + "request": { + "$ref": "CompleteIPRotationRequest" + }, + "description": "Completes master IP rotation.", + "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).", + "required": true, + "type": "string", + "location": "path" + }, + "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." + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster.", + "required": true, + "type": "string" + } + }, + "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" + }, + "setNetworkPolicy": { + "request": { + "$ref": "SetNetworkPolicyRequest" + }, + "description": "Enables/Disables Network Policy for a cluster.", + "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).", + "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": { + "required": true, + "type": "string", + "location": "path", + "description": "The name of the cluster." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy", + "id": "container.projects.zones.clusters.setNetworkPolicy", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy" + }, + "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" + }, + "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).", + "required": true, + "type": "string", + "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" + }, + "clusterId": { + "description": "The name of the cluster to update.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac" + }, + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Cluster" + }, + "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": { + "location": "path", + "description": "The name of the cluster to retrieve.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "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." + }, + "startIpRotation": { + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation", + "id": "container.projects.zones.clusters.startIpRotation", + "request": { + "$ref": "StartIPRotationRequest" + }, + "description": "Start master IP rotation.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "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" + ] + }, + "setMaintenancePolicy": { + "description": "Sets the maintenance policy for a cluster.", + "request": { + "$ref": "SetMaintenancePolicyRequest" + }, + "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://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" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to update.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy", + "id": "container.projects.zones.clusters.setMaintenancePolicy" + }, + "addons": { + "httpMethod": "POST", + "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": { + "location": "path", + "description": "The name of the cluster to upgrade.", + "required": true, + "type": "string" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons", + "id": "container.projects.zones.clusters.addons", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/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.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "DELETE", + "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": { + "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": { + "required": true, + "type": "string", + "location": "path", + "description": "The name of the cluster to delete." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "id": "container.projects.zones.clusters.delete" + }, + "locations": { + "request": { + "$ref": "SetLocationsRequest" + }, + "description": "Sets the locations of a specific cluster.", + "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).", + "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." + }, + "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}/locations", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations", + "id": "container.projects.zones.clusters.locations" + }, + "update": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "PUT", + "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.", + "required": true, + "type": "string" + }, + "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}", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "id": "container.projects.zones.clusters.update", + "request": { + "$ref": "UpdateClusterRequest" + }, + "description": "Updates the settings of a specific cluster." + }, + "monitoring": { + "request": { + "$ref": "SetMonitoringServiceRequest" + }, + "description": "Sets the monitoring service of a specific cluster.", + "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": { + "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 upgrade.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring", + "id": "container.projects.zones.clusters.monitoring" + }, + "master": { + "request": { + "$ref": "UpdateMasterRequest" + }, + "description": "Updates the master of a specific cluster.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "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": { + "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 upgrade.", + "required": true, + "type": "string", + "location": "path" + } + }, + "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" + } + }, + "resources": { + "nodePools": { + "methods": { + "get": { + "description": "Retrieves the node pool requested.", + "httpMethod": "GET", + "response": { + "$ref": "NodePool" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "parameters": { + "projectId": { + "required": true, + "type": "string", + "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.", + "required": true, + "type": "string" + }, + "clusterId": { + "required": true, + "type": "string", + "location": "path", + "description": "The name of the cluster." + }, + "nodePoolId": { + "location": "path", + "description": "The name of the node pool.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "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}" + }, + "update": { + "id": "container.projects.zones.clusters.nodePools.update", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update", + "request": { + "$ref": "UpdateNodePoolRequest" + }, + "description": "Updates the version and/or image type of a specific node pool.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + }, + "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": { + "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 upgrade.", + "required": true, + "type": "string", + "location": "path" + }, + "nodePoolId": { + "location": "path", + "description": "The name of the node pool to upgrade.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update" + }, + "delete": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "httpMethod": "DELETE", + "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": { + "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" + }, + "nodePoolId": { + "description": "The name of the node pool to delete.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}", + "id": "container.projects.zones.clusters.nodePools.delete", + "description": "Deletes a node pool from a cluster." + }, + "setManagement": { + "request": { + "$ref": "SetNodePoolManagementRequest" + }, + "description": "Sets the NodeManagement options for a node pool.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "httpMethod": "POST", + "parameters": { + "nodePoolId": { + "description": "The name of the node pool to update.", + "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" + }, + "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" + } + }, + "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" + }, + "setSize": { + "description": "Sets the size of a specific node pool.", + "request": { + "$ref": "SetNodePoolSizeRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "clusterId": { + "required": true, + "type": "string", + "location": "path", + "description": "The name of the cluster to update." + }, + "nodePoolId": { + "description": "The name of the node pool to update.", + "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" + }, + "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" + } + }, + "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" + }, + "list": { + "response": { + "$ref": "ListNodePoolsResponse" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "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).", + "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" + }, + "clusterId": { + "description": "The name of the cluster.", + "required": true, + "type": "string", + "location": "path" + } + }, + "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", + "description": "Lists the node pools for a cluster." + }, + "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" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "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://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" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to rollback.", + "required": true, + "type": "string" + }, + "nodePoolId": { + "description": "The name of the node pool to rollback.", + "required": true, + "type": "string", + "location": "path" + } + } + }, + "create": { + "flatPath": "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" + }, + "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": { + "description": "The name of the cluster.", + "required": true, + "type": "string", + "location": "path" + } + } + }, + "autoscaling": { + "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", + "request": { + "$ref": "SetNodePoolAutoscalingRequest" + }, + "description": "Sets the autoscaling settings of a specific node pool.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + }, + "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": { + "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": { + "location": "path", + "description": "The name of the cluster to upgrade.", + "required": true, + "type": "string" + }, + "nodePoolId": { + "location": "path", + "description": "The name of the node pool to upgrade.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "operations": { + "methods": { + "cancel": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "projectId", + "zone", + "operationId" + ], + "httpMethod": "POST", + "parameters": { + "operationId": { + "location": "path", + "description": "The server-assigned `name` of the operation.", + "required": true, + "type": "string" + }, + "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": { + "location": "path", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the operation resides.", + "required": true, + "type": "string" + } + }, + "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", + "request": { + "$ref": "CancelOperationRequest" + }, + "description": "Cancels the specified operation." + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "projectId", + "zone" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "parameters": { + "zone": { + "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", + "location": "path" + }, + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectId}/zones/{zone}/operations", + "id": "container.projects.zones.operations.list", + "path": "v1/projects/{projectId}/zones/{zone}/operations", + "description": "Lists all operations in a project in a specific zone or all zones." + }, + "get": { + "description": "Gets the specified operation.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "operationId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "operationId": { + "location": "path", + "description": "The server-assigned `name` of the operation.", + "required": true, + "type": "string" + }, + "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" + } + }, + "flatPath": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}", + "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}", + "id": "container.projects.zones.operations.get" + } + } + } + } + } + } + } + }, + "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" + }, + "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": { + "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": { + "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": { + "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": { + "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" + } + }, + "version": "v1", + "baseUrl": "https://container.googleapis.com/", + "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": "", + "basePath": "", + "id": "container:v1", + "documentationLink": "https://cloud.google.com/container-engine/", + "revision": "20171111", + "discoveryVersion": "v1" } diff --git a/etc/api/container/v1beta1/container-api.json b/etc/api/container/v1beta1/container-api.json index 94d21b7c54..237391adcd 100644 --- a/etc/api/container/v1beta1/container-api.json +++ b/etc/api/container/v1beta1/container-api.json @@ -1,25 +1,916 @@ { - "documentationLink": "https://cloud.google.com/container-engine/", - "revision": "20170915", + "version": "v1beta1", + "baseUrl": "https://container.googleapis.com/", + "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": "", + "basePath": "", "id": "container:v1beta1", + "documentationLink": "https://cloud.google.com/container-engine/", + "revision": "20171111", "discoveryVersion": "v1", "version_module": true, "schemas": { - "AcceleratorConfig": { - "description": "AcceleratorConfig represents a Hardware Accelerator request.", - "type": "object", + "IPAllocationPolicy": { "properties": { - "acceleratorType": { - "description": "The accelerator type resource name. List of supported accelerators\n[here](/compute/docs/gpus/#Introduction)", + "clusterIpv4Cidr": { + "description": "This field is deprecated, use cluster_ipv4_cidr_block.", "type": "string" }, - "acceleratorCount": { - "format": "int64", - "description": "The number of the accelerator cards exposed to an instance.", + "servicesIpv4Cidr": { + "description": "This field is deprecated, use services_ipv4_cidr_block.", + "type": "string" + }, + "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" + }, + "allowRouteOverlap": { + "description": "If true, allow allocation of cluster CIDR ranges that overlap with certain\nkinds of network routes. By default we do not allow cluster CIDR ranges to\nintersect with any user declared routes. With allow_route_overlap == true,\nwe allow overlapping with CIDR ranges that are larger than the cluster CIDR\nrange.\n\nIf this field is set to true, then cluster and services CIDRs must be\nfully-specified (e.g. `10.96.0.0/14`, but not `/14`), which means:\n1) When `use_ip_aliases` is true, `cluster_ipv4_cidr_block` and\n `services_ipv4_cidr_block` must be fully-specified.\n2) When `use_ip_aliases` is false, `cluster.cluster_ipv4_cidr` muse be\n fully-specified.", + "type": "boolean" + }, + "nodeIpv4Cidr": { + "description": "This field is deprecated, use node_ipv4_cidr_block.", + "type": "string" + }, + "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 and\ncreate_subnetwork is false.", + "type": "string" + }, + "nodeIpv4CidrBlock": { + "type": "string", + "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." + }, + "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." + }, + "useIpAliases": { + "description": "Whether alias IPs will be used for pod IPs in the cluster.", + "type": "boolean" + }, + "servicesSecondaryRangeName": { + "type": "string", + "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." + }, + "subnetworkName": { + "type": "string", + "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." + } + }, + "id": "IPAllocationPolicy", + "description": "Configuration for controlling how IPs are allocated in the cluster.", + "type": "object" + }, + "ClusterUpdate": { + "type": "object", + "properties": { + "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" + }, + "desiredPodSecurityPolicyConfig": { + "$ref": "PodSecurityPolicyConfig", + "description": "The desired configuration options for the PodSecurityPolicy feature." + }, + "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" + }, + "desiredMasterAuthorizedNetworksConfig": { + "description": "The desired configuration options for master authorized networks feature.", + "$ref": "MasterAuthorizedNetworksConfig" + }, + "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" + } + }, + "desiredNodePoolAutoscaling": { + "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" + }, + "desiredImageType": { + "description": "The desired image type for the node pool.\nNOTE: Set the \"desired_node_pool\" field as well.", + "type": "string" + }, + "desiredAddonsConfig": { + "$ref": "AddonsConfig", + "description": "Configurations for the various addons available to run in the cluster." + } + }, + "id": "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." + }, + "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": { + "type": "boolean", + "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." + } + }, + "id": "HorizontalPodAutoscaling" + }, + "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.", + "type": "array", + "items": { + "$ref": "CidrBlock" + } + } + }, + "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" + }, + "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": { + "$ref": "NodeManagement", + "description": "NodeManagement configuration for the node pool." + }, + "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": "AcceleratorConfig" + "id": "SetNodePoolManagementRequest" + }, + "SetNodePoolAutoscalingRequest": { + "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" + }, + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "nodePoolId": { + "description": "The name of the node pool to upgrade.\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" + }, + "name": { + "description": "The name (project, location, cluster, node pool) of the node pool to set\nautoscaler settings. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.", + "type": "string" + }, + "autoscaling": { + "$ref": "NodePoolAutoscaling", + "description": "Autoscaling configuration for the node pool." + } + }, + "id": "SetNodePoolAutoscalingRequest", + "description": "SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool." + }, + "CreateClusterRequest": { + "description": "CreateClusterRequest creates a cluster.", + "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 parent instead.", + "type": "string" + }, + "cluster": { + "$ref": "Cluster", + "description": "A [cluster\nresource](/container-engine/reference/rest/v1beta1/projects.zones.clusters)" + }, + "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 and location) where the cluster will be created.\nSpecified in the format 'projects/*/locations/*'.", + "type": "string" + } + }, + "id": "CreateClusterRequest" + }, + "AcceleratorConfig": { + "id": "AcceleratorConfig", + "description": "AcceleratorConfig represents a Hardware Accelerator request.", + "type": "object", + "properties": { + "acceleratorCount": { + "description": "The number of the accelerator cards exposed to an instance.", + "format": "int64", + "type": "string" + }, + "acceleratorType": { + "description": "The accelerator type resource name. List of supported accelerators\n[here](/compute/docs/gpus/#Introduction)", + "type": "string" + } + } + }, + "UpdateNodePoolRequest": { + "description": "SetNodePoolVersionRequest updates the version of a node pool.", + "type": "object", + "properties": { + "name": { + "description": "The name (project, location, cluster, node pool) of the node pool to update.\nSpecified in the format '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" + }, + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "nodePoolId": { + "description": "The name of the node pool to upgrade.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "imageType": { + "description": "The desired image type for the node pool.", + "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" + }, + "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": "UpdateNodePoolRequest" + }, + "SetAddonsConfigRequest": { + "id": "SetAddonsConfigRequest", + "description": "SetAddonsRequest sets the addons associated with the cluster.", + "type": "object", + "properties": { + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "addonsConfig": { + "description": "The desired configurations for the various addons available to run in the\ncluster.", + "$ref": "AddonsConfig" + }, + "name": { + "description": "The name (project, location, cluster) of the cluster to set addons.\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" + } + } + }, + "NodeTaint": { + "type": "object", + "properties": { + "key": { + "description": "Key for taint.", + "type": "string" + }, + "value": { + "description": "Value for taint.", + "type": "string" + }, + "effect": { + "description": "Effect for taint.", + "type": "string", + "enumDescriptions": [ + "Not set", + "NoSchedule", + "PreferNoSchedule", + "NoExecute" + ], + "enum": [ + "EFFECT_UNSPECIFIED", + "NO_SCHEDULE", + "PREFER_NO_SCHEDULE", + "NO_EXECUTE" + ] + } + }, + "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/" + }, + "SetLegacyAbacRequest": { + "description": "SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for\na cluster.", + "type": "object", + "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": { + "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." + }, + "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": { + "type": "string", + "description": "The name of the cluster to update.\nThis field is deprecated, use name instead." + } + }, + "id": "SetLegacyAbacRequest" + }, + "AddonsConfig": { + "description": "Configuration for the addons that can be automatically spun up in the\ncluster, enabling additional functionality.", + "type": "object", + "properties": { + "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.", + "$ref": "HorizontalPodAutoscaling" + }, + "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" + }, + "SetLocationsRequest": { + "description": "SetLocationsRequest sets the locations of the cluster.", + "type": "object", + "properties": { + "name": { + "description": "The name (project, location, cluster) of the cluster to set locations.\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" + }, + "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.", + "type": "array", + "items": { + "type": "string" + } + }, + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "type": "string" + } + }, + "id": "SetLocationsRequest" + }, + "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", + "properties": { + "disabled": { + "description": "Whether NetworkPolicy is enabled for this cluster.", + "type": "boolean" + } + }, + "id": "NetworkPolicyConfig" + }, + "UpdateClusterRequest": { + "properties": { + "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" + }, + "update": { + "$ref": "ClusterUpdate", + "description": "A description of the update." + } + }, + "id": "UpdateClusterRequest", + "description": "UpdateClusterRequest updates the settings of a cluster.", + "type": "object" + }, + "Cluster": { + "type": "object", + "properties": { + "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" + }, + "nodePools": { + "description": "The node pools associated with this cluster.\nThis field should not be set if \"node_config\" or \"initial_node_count\" are\nspecified.", + "type": "array", + "items": { + "$ref": "NodePool" + } + }, + "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" + } + }, + "selfLink": { + "description": "[Output only] Server-defined URL for the resource.", + "type": "string" + }, + "instanceGroupUrls": { + "description": "Deprecated. Use node_pools.instance_group_urls.", + "type": "array", + "items": { + "type": "string" + } + }, + "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": { + "type": "string", + "description": "An optional description of this cluster." + }, + "currentNodeCount": { + "description": "[Output only] The number of nodes currently in the cluster.", + "format": "int32", + "type": "integer" + }, + "monitoringService": { + "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.\n* if left as an empty string, `monitoring.googleapis.com` will be used." + }, + "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" + }, + "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" + }, + "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" + }, + "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" + }, + "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" + }, + "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": { + "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.", + "$ref": "NodeConfig" + }, + "addonsConfig": { + "$ref": "AddonsConfig", + "description": "Configurations for the various addons available to run in the cluster." + }, + "podSecurityPolicyConfig": { + "$ref": "PodSecurityPolicyConfig", + "description": "Configuration for the PodSecurityPolicy feature." + }, + "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" + ] + }, + "subnetwork": { + "description": "The name of the Google Compute Engine\n[subnetwork](/compute/docs/subnetworks) to which the\ncluster is connected.", + "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" + }, + "maintenancePolicy": { + "$ref": "MaintenancePolicy", + "description": "Configure the maintenance policy for this cluster." + }, + "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" + }, + "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." + }, + "endpoint": { + "type": "string", + "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." + }, + "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" + }, + "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" + } + }, + "id": "Cluster", + "description": "A Google Container Engine cluster." + }, + "CreateNodePoolRequest": { + "description": "CreateNodePoolRequest creates a node pool for a cluster.", + "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 parent instead.", + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use parent instead.", + "type": "string" + }, + "nodePool": { + "$ref": "NodePool", + "description": "The node pool to create." + }, + "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" + }, + "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" + } + }, + "id": "CreateNodePoolRequest" + }, + "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": { + "type": "object", + "properties": { + "duration": { + "description": "[Output only] Duration of the time window, automatically chosen to be\nsmallest possible in the given scenario.", + "type": "string" + }, + "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", + "description": "Time window specified for daily maintenance operations." + }, + "ClientCertificateConfig": { + "description": "Configuration for client certificates on the cluster.", + "type": "object", + "properties": { + "issueClientCertificate": { + "description": "Issue a client certificate.", + "type": "boolean" + } + }, + "id": "ClientCertificateConfig" + }, + "MaintenancePolicy": { + "description": "MaintenancePolicy defines the maintenance policy to be used for the cluster.", + "type": "object", + "properties": { + "window": { + "$ref": "MaintenanceWindow", + "description": "Specifies the maintenance window in which maintenance may be performed." + } + }, + "id": "MaintenancePolicy" + }, + "SetLoggingServiceRequest": { + "description": "SetLoggingServiceRequest sets the logging service of a cluster.", + "type": "object", + "properties": { + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "type": "string" + }, + "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" + }, + "name": { + "description": "The name (project, location, cluster) of the cluster to set logging.\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": { + "type": "string", + "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides." + } + }, + "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" + }, + "name": { + "description": "The name (project, location, cluster id) of the cluster to set maintenance\npolicy.\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).", + "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" + } + }, + "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": { + "type": "array", + "items": { + "$ref": "NodePool" + }, + "description": "A list of node pools for a cluster." + } + }, + "id": "ListNodePoolsResponse" + }, + "CompleteIPRotationRequest": { + "description": "CompleteIPRotationRequest moves the cluster master back into single-IP mode.", + "type": "object", + "properties": { + "name": { + "description": "The name (project, location, cluster id) of the cluster to complete IP rotation.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + }, + "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": { + "type": "string", + "description": "The name of the cluster.\nThis field is deprecated, use name instead." + } + }, + "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": { + "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 start IP rotation.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + } + }, + "id": "StartIPRotationRequest" + }, + "NodePool": { + "type": "object", + "properties": { + "autoscaling": { + "$ref": "NodePoolAutoscaling", + "description": "Autoscaler configuration for this NodePool. Autoscaler is enabled\nonly if a valid configuration is present." + }, + "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" + }, + "version": { + "description": "The version of the Kubernetes of this node.", + "type": "string" + }, + "instanceGroupUrls": { + "type": "array", + "items": { + "type": "string" + }, + "description": "[Output only] The resource URLs of the [managed instance\ngroups](/compute/docs/instance-groups/creating-groups-of-managed-instances)\nassociated with this node pool." + }, + "status": { + "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", + "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." + ] + }, + "config": { + "description": "The node configuration of the pool.", + "$ref": "NodeConfig" + }, + "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" + } + }, + "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." }, "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", @@ -33,17 +924,17 @@ "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" }, + "resourceLabels": { + "description": "The labels to set for that cluster.", + "type": "object", + "additionalProperties": { + "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" @@ -55,131 +946,29 @@ }, "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" + "autoUpgrade": { + "description": "Whether the nodes will be automatically upgraded.", + "type": "boolean" }, "autoRepair": { "description": "Whether the nodes will be automatically repaired.", "type": "boolean" }, - "autoUpgrade": { - "description": "Whether the nodes will be automatically upgraded.", - "type": "boolean" + "upgradeOptions": { + "description": "Specifies the Auto Upgrade knobs for the node pool.", + "$ref": "AutoUpgradeOptions" } }, "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" @@ -189,8 +978,12 @@ "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." + "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 operation resides.\nThis field is deprecated, use name instead.", + "type": "string" } }, "id": "CancelOperationRequest" @@ -206,60 +999,31 @@ }, "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." + "description": "Server-defined URL for the resource.", + "type": "string" }, "detail": { "description": "Detailed operation progress, if available.", "type": "string" }, "targetLink": { - "description": "Server-defined URL for the target of the operation.", - "type": "string" + "type": "string", + "description": "Server-defined URL for the target of the operation." }, "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" + "type": "string", + "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." }, "endTime": { - "description": "[Output only] The time the operation completed, in\n[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.", - "type": "string" + "type": "string", + "description": "[Output only] The time the operation completed, in\n[RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format." }, "operationType": { - "description": "The operation type.", "type": "string", "enumDescriptions": [ "Not set.", @@ -298,15 +1062,16 @@ "SET_NODE_POOL_SIZE", "SET_NETWORK_POLICY", "SET_MAINTENANCE_POLICY" - ] + ], + "description": "The operation type." }, "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" + "type": "string", + "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." }, "status": { "enum": [ @@ -326,58 +1091,45 @@ "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" + }, + "name": { + "description": "The server-assigned ID for the operation.", + "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." - } - } + }, + "id": "Operation" }, "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." + "description": "DailyMaintenanceWindow specifies a daily maintenance operation window.", + "$ref": "DailyMaintenanceWindow" } }, "id": "MaintenanceWindow" }, "RollbackNodePoolUpgradeRequest": { + "id": "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.", + "nodePoolId": { + "description": "The name of the node pool to rollback.\nThis field is deprecated, use name instead.", "type": "string" }, + "name": { + "description": "The name (project, location, cluster, node pool id) of the node poll to\nrollback upgrade.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + "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." + }, "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" @@ -385,65 +1137,18 @@ "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": { + "description": "The selected network policy provider.", + "type": "string", "enumDescriptions": [ "Not set", "Tigera (Calico Felix)." @@ -451,179 +1156,39 @@ "enum": [ "PROVIDER_UNSPECIFIED", "CALICO" - ], - "description": "The selected network policy provider.", - "type": "string" + ] } }, - "id": "NetworkPolicy" + "id": "NetworkPolicy", + "description": "Configuration options for the NetworkPolicy feature.\nhttps://kubernetes.io/docs/concepts/services-networking/networkpolicies/", + "type": "object" }, - "Cluster": { - "description": "A Google Container Engine cluster.", + "UpdateMasterRequest": { + "description": "UpdateMasterRequest updates the master of the 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.", + "name": { + "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", "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`.", + "projectId": { + "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).", "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.", + "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" }, - "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.", + "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" }, - "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.", + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", "type": "string" } }, - "id": "Cluster" + "id": "UpdateMasterRequest" }, "ListOperationsResponse": { "description": "ListOperationsResponse is the result of ListOperationsRequest.", @@ -631,109 +1196,125 @@ "properties": { "operations": { "description": "A list of operations in the project in the specified zone.", + "type": "array", "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.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } } }, "id": "ListOperationsResponse" }, - "CreateNodePoolRequest": { + "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" + }, + "name": { + "description": "The name (project, location, cluster) of the cluster to set monitoring.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + }, "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.", + "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 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" + "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.\nThis field is deprecated, use parent instead.", + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", "type": "string" } }, - "id": "CreateNodePoolRequest", - "description": "CreateNodePoolRequest creates a node pool for a cluster.", - "type": "object" + "id": "SetMonitoringServiceRequest" }, "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" + }, + "displayName": { + "description": "display_name is an optional field for users to identify CIDR blocks.", + "type": "string" } - } + }, + "id": "CidrBlock" }, "ServerConfig": { + "id": "ServerConfig", "description": "Container Engine service configuration.", "type": "object", "properties": { - "validMasterVersions": { - "description": "List of valid master versions.", - "items": { - "type": "string" - }, - "type": "array" + "defaultClusterVersion": { + "description": "Version of Kubernetes the service deploys by default.", + "type": "string" }, "defaultImageType": { "description": "Default image type.", "type": "string" }, - "defaultClusterVersion": { - "type": "string", - "description": "Version of Kubernetes the service deploys by default." + "validNodeVersions": { + "description": "List of valid node upgrade target versions.", + "type": "array", + "items": { + "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.", + "validMasterVersions": { + "description": "List of valid master versions.", + "type": "array", "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": { + "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": { + "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" + }, + "metadata": { + "additionalProperties": { "type": "string" }, - "type": "array" + "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" + }, + "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" + } }, "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.", @@ -744,112 +1325,51 @@ "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.", + "type": "array", "items": { "type": "string" }, - "type": "array" + "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." }, "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/", + "type": "array", "items": { "$ref": "NodeTaint" - }, - "type": "array" + } }, "labels": { + "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", "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.", + "format": "int32", "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.", + "type": "array", "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" + "type": "string", + "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)" } }, "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": { + "description": "AutoUpgradeOptions defines the set of options for the user to control how\nthe Auto Upgrades will proceed.", "type": "object", "properties": { "description": { @@ -861,29 +1381,39 @@ "type": "string" } }, - "id": "AutoUpgradeOptions", - "description": "AutoUpgradeOptions defines the set of options for the user to control how\nthe Auto Upgrades will proceed." + "id": "AutoUpgradeOptions" }, "ListClustersResponse": { + "id": "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" + "description": "A list of clusters in the project in the specified zone, or\nacross all ones." }, "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" + } + } + } + }, + "PodSecurityPolicyConfig": { + "description": "Configuration for the PodSecurityPolicy feature.", + "type": "object", + "properties": { + "enabled": { + "description": "Enable the PodSecurityPolicy controller for this cluster. If enabled, pods\nmust be valid under a PodSecurityPolicy to be created.", + "type": "boolean" } }, - "id": "ListClustersResponse" + "id": "PodSecurityPolicyConfig" }, "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.", @@ -897,16 +1427,14 @@ "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/*'." + "description": "The name (project, location, cluster id) of the cluster to set networking policy.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" }, "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.", @@ -921,371 +1449,80 @@ "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.", + "id": "SetNetworkPolicyRequest", + "description": "SetNetworkPolicyRequest enables/disables network policy for 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.", + "format": "int32", "type": "integer" }, "minNodeCount": { - "format": "int32", "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" } - } - }, - "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" + "id": "NodePoolAutoscaling" }, - "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.", + "SetMasterAuthRequest": { "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" }, + "action": { + "enum": [ + "UNKNOWN", + "SET_PASSWORD", + "GENERATE_PASSWORD", + "SET_USERNAME" + ], + "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.", + "Set the username. If an empty username is provided, basic authentication\nis disabled for the cluster. If a non-empty username is provided, basic\nauthentication is enabled, with either a provided password or a generated\none." + ] + }, "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/*'.", + "description": "The name (project, location, cluster) of the cluster to set auth.\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" }, - "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." + "description": "The name of the cluster to upgrade.\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" + "update": { + "$ref": "MasterAuth", + "description": "A description of the update." } }, - "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" + "id": "SetMasterAuthRequest", + "description": "SetMasterAuthRequest updates the admin password of a cluster." } }, + "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", "canonicalName": "Container", "auth": { "oauth2": { @@ -1300,979 +1537,38 @@ "ownerDomain": "google.com", "name": "container", "batchPath": "batch", + "fullyEncodeReservedExpansion": true, "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", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/serverConfig", "id": "container.projects.locations.getServerConfig", + "path": "v1beta1/{+name}/serverConfig", "description": "Returns configuration info about the Container Engine service.", "httpMethod": "GET", - "parameterOrder": [ - "name" - ], "response": { "$ref": "ServerConfig" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" + "parameterOrder": [ + "name" ], "parameters": { "name": { "description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.", - "type": "string", "required": true, + "type": "string", "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" + "type": "string", + "location": "query" }, "zone": { "location": "query", @@ -2280,19 +1576,122 @@ "type": "string" } }, - "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/serverConfig" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } }, "resources": { + "operations": { + "methods": { + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "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 parent instead.", + "type": "string" + }, + "zone": { + "location": "query", + "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" + }, + "parent": { + "location": "path", + "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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "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." + }, + "get": { + "description": "Gets the specified operation.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$" + }, + "operationId": { + "description": "The server-assigned `name` of the operation.\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + }, + "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\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use name instead.", + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", + "path": "v1beta1/{+name}", + "id": "container.projects.locations.operations.get" + }, + "cancel": { + "description": "Cancels the specified operation.", + "request": { + "$ref": "CancelOperationRequest" + }, + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name (project, location, operation id) of the operation to cancel.\nSpecified in the format 'projects/*/locations/*/operations/*'.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", + "path": "v1beta1/{+name}:cancel", + "id": "container.projects.locations.operations.cancel" + } + } + }, "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" }, @@ -2300,19 +1699,25 @@ "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}" + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path", + "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}", + "path": "v1beta1/{+name}", + "id": "container.projects.locations.clusters.update", + "description": "Updates the settings of a specific cluster.", + "request": { + "$ref": "UpdateClusterRequest" + } }, "setMasterAuth": { "response": { @@ -2322,38 +1727,62 @@ "name" ], "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], "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, + "type": "string", "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", + "id": "container.projects.locations.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" } }, + "setLogging": { + "id": "container.projects.locations.clusters.setLogging", + "path": "v1beta1/{+name}:setLogging", + "request": { + "$ref": "SetLoggingServiceRequest" + }, + "description": "Sets the logging service of a specific cluster.", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path", + "description": "The name (project, location, cluster) of the cluster to set logging.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLogging" + }, "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" ], + "httpMethod": "GET", "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.", @@ -2366,16 +1795,20 @@ "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", + "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.", "required": true, + "type": "string", "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." + "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" - ] + ], + "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." }, "create": { "scopes": [ @@ -2383,33 +1816,29 @@ ], "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" + "location": "path", + "description": "The parent (project and location) where the cluster will be created.\nSpecified in the format 'projects/*/locations/*'.", + "required": true, + "type": "string" } }, "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters", "path": "v1beta1/{+parent}/clusters", "id": "container.projects.locations.clusters.create", + "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" }, - "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", + "response": { + "$ref": "Operation" + }, "parameterOrder": [ "parent" ], - "response": { - "$ref": "Operation" - } + "httpMethod": "POST" }, "completeIpRotation": { - "request": { - "$ref": "CompleteIPRotationRequest" - }, - "description": "Completes master IP rotation.", "response": { "$ref": "Operation" }, @@ -2425,55 +1854,26 @@ "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 + "required": true, + "type": "string" } }, "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:completeIpRotation", + "path": "v1beta1/{+name}: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}" + "description": "Completes master IP rotation.", + "request": { + "$ref": "CompleteIPRotationRequest" + } }, "setNetworkPolicy": { + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setNetworkPolicy", + "path": "v1beta1/{+name}:setNetworkPolicy", + "id": "container.projects.locations.clusters.setNetworkPolicy", + "description": "Enables/Disables Network Policy for a cluster.", + "request": { + "$ref": "SetNetworkPolicyRequest" + }, "response": { "$ref": "Operation" }, @@ -2487,19 +1887,80 @@ "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, + "type": "string", "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", "location": "path" } + } + }, + "get": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "clusterId": { + "description": "The name of the cluster to retrieve.\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + }, + "name": { + "location": "path", + "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$" + }, + "projectId": { + "type": "string", + "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." + }, + "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" + } }, - "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setNetworkPolicy", - "id": "container.projects.locations.clusters.setNetworkPolicy", - "path": "v1beta1/{+name}:setNetworkPolicy", + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}", + "path": "v1beta1/{+name}", + "id": "container.projects.locations.clusters.get", + "description": "Gets the details of a specific cluster.", + "response": { + "$ref": "Cluster" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET" + }, + "setAddons": { + "path": "v1beta1/{+name}:setAddons", + "id": "container.projects.locations.clusters.setAddons", "request": { - "$ref": "SetNetworkPolicyRequest" + "$ref": "SetAddonsConfigRequest" }, - "description": "Enables/Disables Network Policy for a cluster." + "description": "Sets the addons of a specific cluster.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path", + "description": "The name (project, location, cluster) of the cluster to set addons.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setAddons" }, "startIpRotation": { "response": { @@ -2512,8 +1973,8 @@ "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, + "type": "string", "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", "location": "path" } @@ -2522,20 +1983,14 @@ "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.", + "id": "container.projects.locations.clusters.startIpRotation", "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" }, + "description": "Start master IP rotation." + }, + "setMonitoring": { "httpMethod": "POST", "parameterOrder": [ "name" @@ -2546,16 +2001,50 @@ "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", + "description": "The name (project, location, cluster) of the cluster to set monitoring.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", "required": true, + "type": "string", "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], - "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMaintenancePolicy" + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMonitoring", + "id": "container.projects.locations.clusters.setMonitoring", + "path": "v1beta1/{+name}:setMonitoring", + "request": { + "$ref": "SetMonitoringServiceRequest" + }, + "description": "Sets the monitoring service of a specific cluster." + }, + "setMaintenancePolicy": { + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMaintenancePolicy", + "id": "container.projects.locations.clusters.setMaintenancePolicy", + "path": "v1beta1/{+name}:setMaintenancePolicy", + "request": { + "$ref": "SetMaintenancePolicyRequest" + }, + "description": "Sets the maintenance policy for a cluster.", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path", + "description": "The name (project, location, cluster id) of the cluster to set maintenance\npolicy.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] }, "delete": { "response": { @@ -2565,19 +2054,10 @@ "name" ], "httpMethod": "DELETE", + "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", - "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", @@ -2587,76 +2067,242 @@ "location": "query", "description": "The name of the cluster to delete.\nThis field is deprecated, use name instead.", "type": "string" + }, + "name": { + "location": "path", + "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$" + }, + "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" } }, - "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}", + "id": "container.projects.locations.clusters.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." }, - "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", + "description": "Sets labels on a cluster.", "request": { "$ref": "SetLabelsRequest" }, - "description": "Sets labels on a cluster." + "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 set labels.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setResourceLabels", + "path": "v1beta1/{+name}:setResourceLabels", + "id": "container.projects.locations.clusters.setResourceLabels" + }, + "setLegacyAbac": { + "description": "Enables or disables the ABAC authorization mechanism on a cluster.", + "request": { + "$ref": "SetLegacyAbacRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name (project, location, cluster id) of the cluster to set legacy abac.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLegacyAbac", + "path": "v1beta1/{+name}:setLegacyAbac", + "id": "container.projects.locations.clusters.setLegacyAbac" + }, + "updateMaster": { + "request": { + "$ref": "UpdateMasterRequest" + }, + "description": "Updates the master of a specific cluster.", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path", + "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:updateMaster", + "id": "container.projects.locations.clusters.updateMaster", + "path": "v1beta1/{+name}:updateMaster" + }, + "setLocations": { + "request": { + "$ref": "SetLocationsRequest" + }, + "description": "Sets the locations of a specific cluster.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "description": "The name (project, location, cluster) of the cluster to set locations.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLocations", + "path": "v1beta1/{+name}:setLocations", + "id": "container.projects.locations.clusters.setLocations" } }, "resources": { "nodePools": { "methods": { + "setAutoscaling": { + "id": "container.projects.locations.clusters.nodePools.setAutoscaling", + "path": "v1beta1/{+name}:setAutoscaling", + "request": { + "$ref": "SetNodePoolAutoscalingRequest" + }, + "description": "Sets the autoscaling settings of a specific node pool.", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$", + "location": "path", + "description": "The name (project, location, cluster, node pool) of the node pool to set\nautoscaler settings. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setAutoscaling" + }, + "setManagement": { + "parameters": { + "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/*'.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setManagement", + "path": "v1beta1/{+name}:setManagement", + "id": "container.projects.locations.clusters.nodePools.setManagement", + "request": { + "$ref": "SetNodePoolManagementRequest" + }, + "description": "Sets the NodeManagement options for a node pool.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST" + }, + "delete": { + "description": "Deletes a node pool from a cluster.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name (project, location, cluster, node pool id) of the node pool to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$", + "location": "path" + }, + "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": { + "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": { + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "type": "string", + "location": "query" + }, + "nodePoolId": { + "type": "string", + "location": "query", + "description": "The name of the node pool to delete.\nThis field is deprecated, use name instead." + } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}", + "path": "v1beta1/{+name}", + "id": "container.projects.locations.clusters.nodePools.delete" + }, "list": { "description": "Lists the node pools for a cluster.", "response": { @@ -2667,51 +2313,55 @@ ], "httpMethod": "GET", "parameters": { - "zone": { + "projectId": { "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.", + "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" }, - "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.", + "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", "location": "query" + }, + "parent": { + "description": "The parent (project, location, cluster id) where the node pools will be listed.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$", + "location": "path" + }, + "clusterId": { + "location": "query", + "description": "The name of the cluster.\nThis field is deprecated, use parent instead.", + "type": "string" } }, "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" + "path": "v1beta1/{+parent}/nodePools", + "id": "container.projects.locations.clusters.nodePools.list" }, "rollback": { - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], + "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.", "response": { "$ref": "Operation" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", "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/*'." + "description": "The name (project, location, cluster, node pool id) of the node poll to\nrollback upgrade.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$" } }, "scopes": [ @@ -2719,39 +2369,35 @@ ], "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" - } + "id": "container.projects.locations.clusters.nodePools.rollback" }, "create": { - "httpMethod": "POST", - "parameterOrder": [ - "parent" - ], "response": { "$ref": "Operation" }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", "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/*'.", + "required": true, "type": "string", - "required": true + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$" } }, "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools", "path": "v1beta1/{+parent}/nodePools", "id": "container.projects.locations.clusters.nodePools.create", + "description": "Creates a node pool for a cluster.", "request": { "$ref": "CreateNodePoolRequest" - }, - "description": "Creates a node pool for a cluster." + } }, "get": { "description": "Retrieves the node pool requested.", @@ -2767,144 +2413,221 @@ ], "parameters": { "nodePoolId": { + "description": "The name of the node pool.\nThis field is deprecated, use name instead.", "type": "string", - "location": "query", - "description": "The name of the node pool.\nThis field is deprecated, use name instead." + "location": "query" }, "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": { + "description": "The name (project, location, cluster, node pool id) of the node pool to get.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'." + }, "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": { + "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.", - "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": { "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" } - } + }, + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}", + "path": "v1beta1/{+name}", + "id": "container.projects.locations.clusters.nodePools.get" + }, + "update": { + "httpMethod": "PUT", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "location": "path", + "description": "The name (project, location, cluster, node pool) of the node pool to update.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}", + "id": "container.projects.locations.clusters.nodePools.update", + "path": "v1beta1/{+name}", + "request": { + "$ref": "UpdateNodePoolRequest" + }, + "description": "Updates the version and/or iamge type of a specific node pool." } } } } - }, + } + } + }, + "zones": { + "methods": { + "getServerconfig": { + "description": "Returns configuration info about the Container Engine service.", + "response": { + "$ref": "ServerConfig" + }, + "parameterOrder": [ + "projectId", + "zone" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "location": "query", + "description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.", + "type": "string" + }, + "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.", + "required": true, + "type": "string" + }, + "zone": { + "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.", + "required": true, + "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": { - "get": { + "cancel": { + "request": { + "$ref": "CancelOperationRequest" + }, + "description": "Cancels the specified operation.", + "response": { + "$ref": "Empty" + }, "parameterOrder": [ - "name" + "projectId", + "zone", + "operationId" + ], + "httpMethod": "POST", + "parameters": { + "operationId": { + "location": "path", + "description": "The server-assigned `name` of the operation.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "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.", + "required": true, + "type": "string" + }, + "zone": { + "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.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel", + "path": "v1beta1/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", + "parameterOrder": [ + "projectId", + "zone" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "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).\nThis field is deprecated, use parent instead.", + "required": true, + "type": "string" + }, + "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.", + "required": true, + "type": "string", + "location": "path" + }, + "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", + "location": "query" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations", + "id": "container.projects.zones.operations.list", + "path": "v1beta1/projects/{projectId}/zones/{zone}/operations" + }, + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "projectId", + "zone", + "operationId" ], "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", + "location": "path", "description": "The server-assigned `name` of the operation.\nThis field is deprecated, use name instead.", + "required": true, "type": "string" }, "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", - "location": "query" + "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.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "name": { + "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.", "type": "string", "location": "query" } @@ -2912,17 +2635,26 @@ "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}", + "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." - }, + } + } + }, + "clusters": { + "methods": { "list": { + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters", + "path": "v1beta1/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.", "response": { - "$ref": "ListOperationsResponse" + "$ref": "ListClustersResponse" }, "parameterOrder": [ - "parent" + "projectId", + "zone" ], "httpMethod": "GET", "scopes": [ @@ -2931,53 +2663,1056 @@ "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.", + "required": true, "type": "string", - "location": "query" + "location": "path" }, "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.", + "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.", + "required": true, "type": "string", - "location": "query" + "location": "path" }, "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" + "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/{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": { + "resourceLabels": { + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels", + "id": "container.projects.zones.clusters.resourceLabels", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels", + "request": { + "$ref": "SetLabelsRequest" + }, + "description": "Sets labels on a cluster.", "httpMethod": "POST", "parameterOrder": [ - "name" + "projectId", + "zone", + "clusterId" ], "response": { - "$ref": "Empty" + "$ref": "Operation" }, "parameters": { - "name": { - "description": "The name (project, location, operation id) of the operation to cancel.\nSpecified in the format 'projects/*/locations/*/operations/*'.", - "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.", "required": true, - "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", + "type": "string", + "location": "path" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "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.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "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" + }, + "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).\nThis field is deprecated, use parent instead.", + "required": true, + "type": "string", + "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 parent instead.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters", + "id": "container.projects.zones.clusters.create" + }, + "completeIpRotation": { + "request": { + "$ref": "CompleteIPRotationRequest" + }, + "description": "Completes master IP rotation.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "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.", + "required": true, + "type": "string" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "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.", + "required": true, + "type": "string", "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.", + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation", + "id": "container.projects.zones.clusters.completeIpRotation" + }, + "get": { + "response": { + "$ref": "Cluster" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "clusterId": { + "description": "The name of the cluster to retrieve.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string", + "location": "path" + }, + "name": { + "type": "string", + "location": "query", + "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'." + }, + "projectId": { + "required": true, + "type": "string", + "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": { + "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.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "id": "container.projects.zones.clusters.get", + "description": "Gets the details of a specific cluster." + }, + "setNetworkPolicy": { + "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).\nThis field is deprecated, use name instead.", + "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.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string", + "location": "path" + }, + "clusterId": { + "required": true, + "type": "string", + "location": "path", + "description": "The name of the cluster.\nThis field is deprecated, use name instead." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "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": "CancelOperationRequest" + "$ref": "SetNetworkPolicyRequest" + }, + "description": "Enables/Disables Network Policy for a cluster." + }, + "legacyAbac": { + "path": "v1beta1/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" + }, + "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).\nThis field is deprecated, use name instead.", + "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.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string", + "location": "path" + }, + "clusterId": { + "description": "The name of the cluster to update.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac" + }, + "startIpRotation": { + "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).\nThis field is deprecated, use name instead.", + "required": true, + "type": "string", + "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.", + "required": true, + "type": "string" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation", + "id": "container.projects.zones.clusters.startIpRotation", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation", + "request": { + "$ref": "StartIPRotationRequest" + }, + "description": "Start master IP rotation." + }, + "addons": { + "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).\nThis field is deprecated, use name instead.", + "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.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string", + "location": "path" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons", + "id": "container.projects.zones.clusters.addons", + "description": "Sets the addons of a specific cluster.", + "request": { + "$ref": "SetAddonsConfigRequest" + } + }, + "setMaintenancePolicy": { + "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" + }, + "clusterId": { + "description": "The name of the cluster to update.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy", + "id": "container.projects.zones.clusters.setMaintenancePolicy", + "request": { + "$ref": "SetMaintenancePolicyRequest" + }, + "description": "Sets the maintenance policy for a cluster.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST" + }, + "delete": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "clusterId": { + "location": "path", + "description": "The name of the cluster to delete.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "name": { + "location": "query", + "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.", + "type": "string" + }, + "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.", + "required": true, + "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.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "id": "container.projects.zones.clusters.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.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "DELETE" + }, + "locations": { + "request": { + "$ref": "SetLocationsRequest" + }, + "description": "Sets the locations of a specific cluster.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "parameters": { + "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.", + "required": true, + "type": "string", + "location": "path" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "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.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations", + "id": "container.projects.zones.clusters.locations" + }, + "update": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "PUT", + "parameters": { + "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.", + "required": true, + "type": "string", + "location": "path" + }, + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "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).\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "id": "container.projects.zones.clusters.update", + "request": { + "$ref": "UpdateClusterRequest" + }, + "description": "Updates the settings of a specific cluster." + }, + "monitoring": { + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring", + "id": "container.projects.zones.clusters.monitoring", + "request": { + "$ref": "SetMonitoringServiceRequest" + }, + "description": "Sets the monitoring service of a specific cluster.", + "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.", + "required": true, + "type": "string", + "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.", + "required": true, + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring" + }, + "master": { + "description": "Updates the master of a specific cluster.", + "request": { + "$ref": "UpdateMasterRequest" + }, + "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.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master", + "id": "container.projects.zones.clusters.master" + }, + "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.\nModify basic_auth.csv and reset the K8S API server.", + "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.", + "required": true, + "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.", + "required": true, + "type": "string", + "location": "path" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth", + "id": "container.projects.zones.clusters.setMasterAuth", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth" + }, + "logging": { + "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).\nThis field is deprecated, use name instead.", + "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" + }, + "clusterId": { + "required": true, + "type": "string", + "location": "path", + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging", + "path": "v1beta1/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." + } + }, + "resources": { + "nodePools": { + "methods": { + "autoscaling": { + "request": { + "$ref": "SetNodePoolAutoscalingRequest" + }, + "description": "Sets the autoscaling settings of a specific node pool.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string", + "location": "path" + }, + "nodePoolId": { + "description": "The name of the node pool to upgrade.\nThis field is deprecated, use name instead.", + "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).\nThis field is deprecated, use name instead.", + "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.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling", + "id": "container.projects.zones.clusters.nodePools.autoscaling", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling" + }, + "get": { + "description": "Retrieves the node pool requested.", + "response": { + "$ref": "NodePool" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "httpMethod": "GET", + "parameters": { + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string", + "location": "path" + }, + "nodePoolId": { + "location": "path", + "description": "The name of the node pool.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "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": { + "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.", + "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.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + } + }, + "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.get" + }, + "update": { + "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.", + "required": true, + "type": "string", + "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.", + "required": true, + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster to upgrade.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string", + "location": "path" + }, + "nodePoolId": { + "description": "The name of the node pool to upgrade.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update", + "id": "container.projects.zones.clusters.nodePools.update", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update", + "request": { + "$ref": "UpdateNodePoolRequest" + }, + "description": "Updates the version and/or iamge type of a specific node pool.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + } + }, + "delete": { + "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.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "httpMethod": "DELETE", + "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.", + "required": true, + "type": "string" + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "nodePoolId": { + "location": "path", + "description": "The name of the node pool to delete.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "name": { + "location": "query", + "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" + }, + "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.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}" + }, + "setManagement": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + }, + "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.", + "required": true, + "type": "string", + "location": "path" + }, + "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.\nThis field is deprecated, use name instead." + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to update.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "nodePoolId": { + "location": "path", + "description": "The name of the node pool to update.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement", + "id": "container.projects.zones.clusters.nodePools.setManagement", + "path": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement", + "request": { + "$ref": "SetNodePoolManagementRequest" + }, + "description": "Sets the NodeManagement options for a node pool." + }, + "list": { + "description": "Lists the node pools for a cluster.", + "response": { + "$ref": "ListNodePoolsResponse" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "GET", + "parameters": { + "clusterId": { + "location": "path", + "description": "The name of the cluster.\nThis field is deprecated, use parent instead.", + "required": true, + "type": "string" + }, + "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" + }, + "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.", + "required": true, + "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.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "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" + }, + "rollback": { + "flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback", + "id": "container.projects.zones.clusters.nodePools.rollback", + "path": "v1beta1/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.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "zone", + "clusterId", + "nodePoolId" + ], + "response": { + "$ref": "Operation" + }, + "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.", + "required": true, + "type": "string", + "location": "path" + }, + "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.\nThis field is deprecated, use name instead." + }, + "clusterId": { + "location": "path", + "description": "The name of the cluster to rollback.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + }, + "nodePoolId": { + "location": "path", + "description": "The name of the node pool to rollback.\nThis field is deprecated, use name instead.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "request": { + "$ref": "CreateNodePoolRequest" + }, + "description": "Creates a node pool for a cluster.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "required": true, + "type": "string", + "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." + }, + "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 parent instead.", + "required": true, + "type": "string" + }, + "clusterId": { + "description": "The name of the cluster.\nThis field is deprecated, use parent instead.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "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" + } } } } @@ -2988,35 +3723,12 @@ } }, "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": { + "location": "query", "description": "JSONP", - "type": "string", - "location": "query" + "type": "string" }, "$.xgafv": { - "description": "V1 error format.", - "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -3025,7 +3737,9 @@ "enum": [ "1", "2" - ] + ], + "description": "V1 error format.", + "type": "string" }, "alt": { "type": "string", @@ -3059,26 +3773,41 @@ "location": "query" }, "pp": { - "description": "Pretty-print response.", - "default": "true", "type": "boolean", - "location": "query" - }, - "oauth_token": { + "default": "true", "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" + "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" + }, + "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" } - }, - "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 9234d15b5d..6478b91db5 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/e0JuGPKREEjV0KDWNAvNTkBRhXc\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/5V_sKJ6Io6zpf4p_quA8NfrV8hw\"", "discoveryVersion": "v1", "id": "content:v2", "name": "content", "canonicalName": "Shopping Content", "version": "v2", - "revision": "20170926", + "revision": "20171207", "title": "Content API for Shopping", "description": "Manages product items, inventory, and Merchant Center accounts for Google Shopping.", "ownerDomain": "google.com", @@ -93,6 +93,10 @@ "$ref": "AccountAdwordsLink" } }, + "googleMyBusinessLink": { + "$ref": "AccountGoogleMyBusinessLink", + "description": "The GMB account which is linked or in the process of being linked with the Merchant Center accounnt." + }, "id": { "type": "string", "description": "Merchant Center account ID.", @@ -161,6 +165,20 @@ } } }, + "AccountGoogleMyBusinessLink": { + "id": "AccountGoogleMyBusinessLink", + "type": "object", + "properties": { + "gmbEmail": { + "type": "string", + "description": "The GMB email address." + }, + "status": { + "type": "string", + "description": "Status of the link between this Merchant Center account and the GMB account." + } + } + }, "AccountIdentifier": { "id": "AccountIdentifier", "type": "object", @@ -396,23 +414,11 @@ "properties": { "channelId": { "type": "string", - "description": "Channel ID.", - "annotations": { - "required": [ - "content.accounts.insert", - "content.accounts.update" - ] - } + "description": "Channel ID." }, "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" - ] - } + "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." } } }, @@ -825,7 +831,7 @@ }, "contentLanguage": { "type": "string", - "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." + "description": "[DEPRECATED] Please use targets[].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", @@ -867,7 +873,7 @@ }, "intendedDestinations": { "type": "array", - "description": "[DEPRECATED] Please use target.includedDestination instead. The list of intended destinations (corresponds to checked check boxes in Merchant Center).", + "description": "[DEPRECATED] Please use targets[].includedDestinations instead. The list of intended destinations (corresponds to checked check boxes in Merchant Center).", "items": { "type": "string" } @@ -888,7 +894,7 @@ }, "targetCountry": { "type": "string", - "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." + "description": "[DEPRECATED] Please use targets[].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", @@ -1387,14 +1393,14 @@ }, "prices": { "type": "array", - "description": "be \"infinity\". For example [{\"value\": \"10\", \"currency\": \"USD\"}, {\"value\": \"500\", \"currency\": \"USD\"}, {\"value\": \"infinity\", \"currency\": \"USD\"}] represents the headers \"\u003c= $10\", \" $500\". All prices within a service must have the same currency. Must be non-empty. Can only be set if all other fields are not set.", + "description": "A list of inclusive order price upper bounds. The last price's value can be \"infinity\". For example [{\"value\": \"10\", \"currency\": \"USD\"}, {\"value\": \"500\", \"currency\": \"USD\"}, {\"value\": \"infinity\", \"currency\": \"USD\"}] represents the headers \"\u003c= $10\", \" $500\". All prices within a service must have the same currency. Must be non-empty. Can only be set if all other fields are not set.", "items": { "$ref": "Price" } }, "weights": { "type": "array", - "description": "be \"infinity\". For example [{\"value\": \"10\", \"unit\": \"kg\"}, {\"value\": \"50\", \"unit\": \"kg\"}, {\"value\": \"infinity\", \"unit\": \"kg\"}] represents the headers \"\u003c= 10kg\", \" 50kg\". All weights within a service must have the same unit. Must be non-empty. Can only be set if all other fields are not set.", + "description": "A list of inclusive order weight upper bounds. The last weight's value can be \"infinity\". For example [{\"value\": \"10\", \"unit\": \"kg\"}, {\"value\": \"50\", \"unit\": \"kg\"}, {\"value\": \"infinity\", \"unit\": \"kg\"}] represents the headers \"\u003c= 10kg\", \" 50kg\". All weights within a service must have the same unit. Must be non-empty. Can only be set if all other fields are not set.", "items": { "$ref": "Weight" } @@ -1854,6 +1860,13 @@ "id": "OrderLineItem", "type": "object", "properties": { + "annotations": { + "type": "array", + "description": "Annotations that are attached to the line item.", + "items": { + "$ref": "OrderMerchantProvidedAnnotation" + } + }, "cancellations": { "type": "array", "description": "Cancellations of the line item.", @@ -2113,6 +2126,20 @@ } } }, + "OrderMerchantProvidedAnnotation": { + "id": "OrderMerchantProvidedAnnotation", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Key for additional merchant provided (as key-value pairs) annotation about the line item." + }, + "value": { + "type": "string", + "description": "Value for additional merchant provided (as key-value pairs) annotation about the line item." + } + } + }, "OrderPaymentMethod": { "id": "OrderPaymentMethod", "type": "object", @@ -2269,7 +2296,7 @@ "properties": { "carrier": { "type": "string", - "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\"" + "description": "The carrier handling the shipment.\n\nAcceptable values are: \n- \"gsx\" \n- \"ups\" \n- \"usps\" \n- \"fedex\" \n- \"dhl\" \n- \"ecourier\" \n- \"cxt\" \n- \"google\" \n- \"ontrac\" \n- \"emsy\" \n- \"ont\" \n- \"deliv\" \n- \"dynamex\" \n- \"lasership\" \n- \"mpx\" \n- \"uds\"" }, "creationDate": { "type": "string", @@ -2306,7 +2333,11 @@ "properties": { "lineItemId": { "type": "string", - "description": "The id of the line item that is shipped." + "description": "The id of the line item that is shipped. Either lineItemId or productId is required." + }, + "productId": { + "type": "string", + "description": "The ID of the product to ship. This is the REST ID used in the products service. Either lineItemId or productId is required." }, "quantity": { "type": "integer", @@ -2359,14 +2390,26 @@ "$ref": "Price", "description": "Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order." }, + "amountPretax": { + "$ref": "Price", + "description": "Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order." + }, + "amountTax": { + "$ref": "Price", + "description": "Tax amount that correspond to cancellation amount in amountPretax." + }, "lineItemId": { "type": "string", - "description": "The ID of the line item to cancel." + "description": "The ID of the line item to cancel. Either lineItemId or productId is required." }, "operationId": { "type": "string", "description": "The ID of the operation. Unique across all operations for a given order." }, + "productId": { + "type": "string", + "description": "The ID of the product to cancel. This is the REST ID used in the products service. Either lineItemId or productId is required." + }, "quantity": { "type": "integer", "description": "The quantity to cancel.", @@ -2518,10 +2561,18 @@ "$ref": "OrdersCustomBatchRequestEntryReturnLineItem", "description": "Required for returnLineItem method." }, + "setLineItemMetadata": { + "$ref": "OrdersCustomBatchRequestEntrySetLineItemMetadata", + "description": "Required for setLineItemMetadata method." + }, "shipLineItems": { "$ref": "OrdersCustomBatchRequestEntryShipLineItems", "description": "Required for shipLineItems method." }, + "updateLineItemShippingDetails": { + "$ref": "OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails", + "description": "Required for updateLineItemShippingDate method." + }, "updateShipment": { "$ref": "OrdersCustomBatchRequestEntryUpdateShipment", "description": "Required for updateShipment method." @@ -2550,9 +2601,21 @@ "$ref": "Price", "description": "Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order." }, + "amountPretax": { + "$ref": "Price", + "description": "Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order." + }, + "amountTax": { + "$ref": "Price", + "description": "Tax amount that correspond to cancellation amount in amountPretax." + }, "lineItemId": { "type": "string", - "description": "The ID of the line item to cancel." + "description": "The ID of the line item to cancel. Either lineItemId or productId is required." + }, + "productId": { + "type": "string", + "description": "The ID of the product to cancel. This is the REST ID used in the products service. Either lineItemId or productId is required." }, "quantity": { "type": "integer", @@ -2577,6 +2640,14 @@ "$ref": "Price", "description": "The amount that is refunded." }, + "amountPretax": { + "$ref": "Price", + "description": "The amount that is refunded. Either amount or amountPretax and amountTax should be filled." + }, + "amountTax": { + "$ref": "Price", + "description": "Tax amount that correspond to refund amount in amountPretax." + }, "reason": { "type": "string", "description": "The reason for the refund." @@ -2593,7 +2664,11 @@ "properties": { "lineItemId": { "type": "string", - "description": "The ID of the line item to return." + "description": "The ID of the line item to return. Either lineItemId or productId is required." + }, + "productId": { + "type": "string", + "description": "The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required." }, "quantity": { "type": "integer", @@ -2610,6 +2685,26 @@ } } }, + "OrdersCustomBatchRequestEntrySetLineItemMetadata": { + "id": "OrdersCustomBatchRequestEntrySetLineItemMetadata", + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "$ref": "OrderMerchantProvidedAnnotation" + } + }, + "lineItemId": { + "type": "string", + "description": "The ID of the line item to set metadata. Either lineItemId or productId is required." + }, + "productId": { + "type": "string", + "description": "The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required." + } + } + }, "OrdersCustomBatchRequestEntryShipLineItems": { "id": "OrdersCustomBatchRequestEntryShipLineItems", "type": "object", @@ -2665,6 +2760,28 @@ } } }, + "OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails": { + "id": "OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails", + "type": "object", + "properties": { + "deliverByDate": { + "type": "string", + "description": "Updated delivery by date, in ISO 8601 format. If not specified only ship by date is updated." + }, + "lineItemId": { + "type": "string", + "description": "The ID of the line item to set metadata. Either lineItemId or productId is required." + }, + "productId": { + "type": "string", + "description": "The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required." + }, + "shipByDate": { + "type": "string", + "description": "Updated ship by date, in ISO 8601 format. If not specified only deliver by date is updated." + } + } + }, "OrdersCustomBatchRequestEntryUpdateShipment": { "id": "OrdersCustomBatchRequestEntryUpdateShipment", "type": "object", @@ -2792,6 +2909,14 @@ "$ref": "Price", "description": "The amount that is refunded." }, + "amountPretax": { + "$ref": "Price", + "description": "The amount that is refunded. Either amount or amountPretax and amountTax should be filled." + }, + "amountTax": { + "$ref": "Price", + "description": "Tax amount that correspond to refund amount in amountPretax." + }, "operationId": { "type": "string", "description": "The ID of the operation. Unique across all operations for a given order." @@ -2827,12 +2952,16 @@ "properties": { "lineItemId": { "type": "string", - "description": "The ID of the line item to return." + "description": "The ID of the line item to return. Either lineItemId or productId is required." }, "operationId": { "type": "string", "description": "The ID of the operation. Unique across all operations for a given order." }, + "productId": { + "type": "string", + "description": "The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required." + }, "quantity": { "type": "integer", "description": "The quantity to return.", @@ -2863,6 +2992,45 @@ } } }, + "OrdersSetLineItemMetadataRequest": { + "id": "OrdersSetLineItemMetadataRequest", + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "$ref": "OrderMerchantProvidedAnnotation" + } + }, + "lineItemId": { + "type": "string", + "description": "The ID of the line item to set metadata. Either lineItemId or productId is required." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "productId": { + "type": "string", + "description": "The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required." + } + } + }, + "OrdersSetLineItemMetadataResponse": { + "id": "OrdersSetLineItemMetadataResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersSetLineItemMetadataResponse\".", + "default": "content#ordersSetLineItemMetadataResponse" + } + } + }, "OrdersShipLineItemsRequest": { "id": "OrdersShipLineItemsRequest", "type": "object", @@ -2914,6 +3082,47 @@ } } }, + "OrdersUpdateLineItemShippingDetailsRequest": { + "id": "OrdersUpdateLineItemShippingDetailsRequest", + "type": "object", + "properties": { + "deliverByDate": { + "type": "string", + "description": "Updated delivery by date, in ISO 8601 format. If not specified only ship by date is updated." + }, + "lineItemId": { + "type": "string", + "description": "The ID of the line item to set metadata. Either lineItemId or productId is required." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "productId": { + "type": "string", + "description": "The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required." + }, + "shipByDate": { + "type": "string", + "description": "Updated ship by date, in ISO 8601 format. If not specified only deliver by date is updated." + } + } + }, + "OrdersUpdateLineItemShippingDetailsResponse": { + "id": "OrdersUpdateLineItemShippingDetailsResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersUpdateLineItemShippingDetailsResponse\".", + "default": "content#ordersUpdateLineItemShippingDetailsResponse" + } + } + }, "OrdersUpdateMerchantOrderIdRequest": { "id": "OrdersUpdateMerchantOrderIdRequest", "type": "object", @@ -3211,7 +3420,7 @@ }, "id": { "type": "string", - "description": "The REST id of the product." + "description": "The REST id of the product. Content API methods that operate on products take this as their productId parameter.\nThe REST id for a product is of the form channel:contentLanguage:targetCountry:offerId." }, "identifierExists": { "type": "boolean", @@ -3275,7 +3484,7 @@ }, "offerId": { "type": "string", - "description": "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.", + "description": "A unique identifier for 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.\nNote: Content API methods that operate on products take the REST id of the product, not this identifier.", "annotations": { "required": [ "content.products.insert" @@ -4211,6 +4420,10 @@ ] } }, + "notificationMode": { + "type": "string", + "description": "Determines if test order must be pulled by merchant or pushed to merchant via push integration." + }, "paymentMethod": { "$ref": "TestOrderPaymentMethod", "description": "The details of the payment method." @@ -4525,7 +4738,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 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.", + "description": "Claims the website of a Merchant Center sub-account.", "parameters": { "accountId": { "type": "string", @@ -4536,7 +4749,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" @@ -4584,7 +4797,7 @@ "id": "content.accounts.delete", "path": "{merchantId}/accounts/{accountId}", "httpMethod": "DELETE", - "description": "Deletes a Merchant Center sub-account. This method can only be called for multi-client accounts.", + "description": "Deletes a Merchant Center sub-account.", "parameters": { "accountId": { "type": "string", @@ -4600,13 +4813,13 @@ }, "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", + "description": "Flag to delete sub-accounts with products. The default value is false.", + "default": "false", "location": "query" }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. This must be a multi-client account, and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" @@ -4624,7 +4837,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", + "description": "Retrieves a Merchant Center account.", "parameters": { "accountId": { "type": "string", @@ -4635,7 +4848,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" @@ -4656,7 +4869,7 @@ "id": "content.accounts.insert", "path": "{merchantId}/accounts", "httpMethod": "POST", - "description": "Creates a Merchant Center sub-account. This method can only be called for multi-client accounts.", + "description": "Creates a Merchant Center sub-account.", "parameters": { "dryRun": { "type": "boolean", @@ -4665,7 +4878,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. This must be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -4688,7 +4901,7 @@ "id": "content.accounts.list", "path": "{merchantId}/accounts", "httpMethod": "GET", - "description": "Lists the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts.", + "description": "Lists the sub-accounts in your Merchant Center account.", "parameters": { "maxResults": { "type": "integer", @@ -4698,7 +4911,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. This must be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -4723,7 +4936,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics.", + "description": "Updates a Merchant Center account. This method supports patch semantics.", "parameters": { "accountId": { "type": "string", @@ -4739,7 +4952,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" @@ -4763,7 +4976,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", + "description": "Updates a Merchant Center account.", "parameters": { "accountId": { "type": "string", @@ -4779,7 +4992,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" @@ -4821,7 +5034,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", + "description": "Retrieves the status of a Merchant Center account.", "parameters": { "accountId": { "type": "string", @@ -4832,7 +5045,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" @@ -4853,7 +5066,7 @@ "id": "content.accountstatuses.list", "path": "{merchantId}/accountstatuses", "httpMethod": "GET", - "description": "Lists the statuses of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts.", + "description": "Lists the statuses of the sub-accounts in your Merchant Center account.", "parameters": { "maxResults": { "type": "integer", @@ -4863,7 +5076,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. This must be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -4914,7 +5127,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", + "description": "Retrieves the tax settings of the account.", "parameters": { "accountId": { "type": "string", @@ -4925,7 +5138,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" @@ -4946,7 +5159,7 @@ "id": "content.accounttax.list", "path": "{merchantId}/accounttax", "httpMethod": "GET", - "description": "Lists the tax settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts.", + "description": "Lists the tax settings of the sub-accounts in your Merchant Center account.", "parameters": { "maxResults": { "type": "integer", @@ -4956,7 +5169,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. This must be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -4981,7 +5194,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics.", + "description": "Updates the tax settings of the account. This method supports patch semantics.", "parameters": { "accountId": { "type": "string", @@ -4997,7 +5210,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" @@ -5021,7 +5234,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", + "description": "Updates the tax settings of the account.", "parameters": { "accountId": { "type": "string", @@ -5037,7 +5250,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" @@ -5086,10 +5299,11 @@ "id": "content.datafeeds.delete", "path": "{merchantId}/datafeeds/{datafeedId}", "httpMethod": "DELETE", - "description": "Deletes a datafeed configuration 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.", "parameters": { "datafeedId": { "type": "string", + "description": "The ID of the datafeed.", "required": true, "format": "uint64", "location": "path" @@ -5101,6 +5315,7 @@ }, "merchantId": { "type": "string", + "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5118,16 +5333,18 @@ "id": "content.datafeeds.get", "path": "{merchantId}/datafeeds/{datafeedId}", "httpMethod": "GET", - "description": "Retrieves a datafeed configuration 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.", "parameters": { "datafeedId": { "type": "string", + "description": "The ID of the datafeed.", "required": true, "format": "uint64", "location": "path" }, "merchantId": { "type": "string", + "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5148,7 +5365,7 @@ "id": "content.datafeeds.insert", "path": "{merchantId}/datafeeds", "httpMethod": "POST", - "description": "Registers a datafeed configuration 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.", "parameters": { "dryRun": { "type": "boolean", @@ -5157,6 +5374,7 @@ }, "merchantId": { "type": "string", + "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5179,7 +5397,7 @@ "id": "content.datafeeds.list", "path": "{merchantId}/datafeeds", "httpMethod": "GET", - "description": "Lists the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Lists the datafeeds in your Merchant Center account.", "parameters": { "maxResults": { "type": "integer", @@ -5189,7 +5407,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the datafeeds. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5214,10 +5432,11 @@ "id": "content.datafeeds.patch", "path": "{merchantId}/datafeeds/{datafeedId}", "httpMethod": "PATCH", - "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.", + "description": "Updates a datafeed configuration of your Merchant Center account. This method supports patch semantics.", "parameters": { "datafeedId": { "type": "string", + "description": "The ID of the datafeed.", "required": true, "format": "uint64", "location": "path" @@ -5229,6 +5448,7 @@ }, "merchantId": { "type": "string", + "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5252,10 +5472,11 @@ "id": "content.datafeeds.update", "path": "{merchantId}/datafeeds/{datafeedId}", "httpMethod": "PUT", - "description": "Updates a datafeed configuration 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.", "parameters": { "datafeedId": { "type": "string", + "description": "The ID of the datafeed.", "required": true, "format": "uint64", "location": "path" @@ -5267,6 +5488,7 @@ }, "merchantId": { "type": "string", + "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5308,7 +5530,7 @@ "id": "content.datafeedstatuses.get", "path": "{merchantId}/datafeedstatuses/{datafeedId}", "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.", + "description": "Retrieves the status of a datafeed from your Merchant Center account.", "parameters": { "country": { "type": "string", @@ -5317,6 +5539,7 @@ }, "datafeedId": { "type": "string", + "description": "The ID of the datafeed.", "required": true, "format": "uint64", "location": "path" @@ -5328,6 +5551,7 @@ }, "merchantId": { "type": "string", + "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5348,7 +5572,7 @@ "id": "content.datafeedstatuses.list", "path": "{merchantId}/datafeedstatuses", "httpMethod": "GET", - "description": "Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Lists the statuses of the datafeeds in your Merchant Center account.", "parameters": { "maxResults": { "type": "integer", @@ -5358,7 +5582,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the datafeeds. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5387,7 +5611,7 @@ "id": "content.inventory.custombatch", "path": "inventory/batch", "httpMethod": "POST", - "description": "Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. This method can only be called for non-multi-client accounts.", + "description": "Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products.", "parameters": { "dryRun": { "type": "boolean", @@ -5409,7 +5633,7 @@ "id": "content.inventory.set", "path": "{merchantId}/inventory/{storeCode}/products/{productId}", "httpMethod": "POST", - "description": "Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product. This method can only be called for non-multi-client accounts.", + "description": "Updates price and availability of a product in your Merchant Center account.", "parameters": { "dryRun": { "type": "boolean", @@ -5418,14 +5642,14 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that contains the product. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" }, "productId": { "type": "string", - "description": "The ID of the product for which to update price and availability.", + "description": "The REST id of the product for which to update price and availability.", "required": true, "location": "path" }, @@ -5459,11 +5683,11 @@ "id": "content.orders.acknowledge", "path": "{merchantId}/orders/{orderId}/acknowledge", "httpMethod": "POST", - "description": "Marks an order as acknowledged. This method can only be called for non-multi-client accounts.", + "description": "Marks an order as acknowledged.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5493,11 +5717,11 @@ "id": "content.orders.advancetestorder", "path": "{merchantId}/testorders/{orderId}/advance", "httpMethod": "POST", - "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\". This method can only be called for non-multi-client accounts.", + "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\".", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5524,11 +5748,11 @@ "id": "content.orders.cancel", "path": "{merchantId}/orders/{orderId}/cancel", "httpMethod": "POST", - "description": "Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts.", + "description": "Cancels all line items in an order, making a full refund.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5558,11 +5782,11 @@ "id": "content.orders.cancellineitem", "path": "{merchantId}/orders/{orderId}/cancelLineItem", "httpMethod": "POST", - "description": "Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts.", + "description": "Cancels a line item, making a full refund.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5592,11 +5816,11 @@ "id": "content.orders.createtestorder", "path": "{merchantId}/testorders", "httpMethod": "POST", - "description": "Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts.", + "description": "Sandbox only. Creates a test order.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that should manage the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5619,7 +5843,7 @@ "id": "content.orders.custombatch", "path": "orders/batch", "httpMethod": "POST", - "description": "Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts.", + "description": "Retrieves or modifies multiple orders in a single request.", "request": { "$ref": "OrdersCustomBatchRequest" }, @@ -5634,11 +5858,11 @@ "id": "content.orders.get", "path": "{merchantId}/orders/{orderId}", "httpMethod": "GET", - "description": "Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Retrieves an order from your Merchant Center account.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5665,11 +5889,11 @@ "id": "content.orders.getbymerchantorderid", "path": "{merchantId}/ordersbymerchantid/{merchantOrderId}", "httpMethod": "GET", - "description": "Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts.", + "description": "Retrieves an order using merchant order id.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5696,11 +5920,11 @@ "id": "content.orders.gettestordertemplate", "path": "{merchantId}/testordertemplates/{templateName}", "httpMethod": "GET", - "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for non-multi-client accounts.", + "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that should manage the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5739,7 +5963,7 @@ "id": "content.orders.list", "path": "{merchantId}/orders", "httpMethod": "GET", - "description": "Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Lists the orders in your Merchant Center account.", "parameters": { "acknowledged": { "type": "boolean", @@ -5754,7 +5978,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5834,11 +6058,11 @@ "id": "content.orders.refund", "path": "{merchantId}/orders/{orderId}/refund", "httpMethod": "POST", - "description": "Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts.", + "description": "Refund a portion of the order, up to the full amount paid.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5868,11 +6092,11 @@ "id": "content.orders.returnlineitem", "path": "{merchantId}/orders/{orderId}/returnLineItem", "httpMethod": "POST", - "description": "Returns a line item. This method can only be called for non-multi-client accounts.", + "description": "Returns a line item.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5898,15 +6122,49 @@ "https://www.googleapis.com/auth/content" ] }, + "setlineitemmetadata": { + "id": "content.orders.setlineitemmetadata", + "path": "{merchantId}/orders/{orderId}/setLineItemMetadata", + "httpMethod": "POST", + "description": "Sets (overrides) merchant provided annotations on the line item.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersSetLineItemMetadataRequest" + }, + "response": { + "$ref": "OrdersSetLineItemMetadataResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, "shiplineitems": { "id": "content.orders.shiplineitems", "path": "{merchantId}/orders/{orderId}/shipLineItems", "httpMethod": "POST", - "description": "Marks line item(s) as shipped. This method can only be called for non-multi-client accounts.", + "description": "Marks line item(s) as shipped.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5932,15 +6190,49 @@ "https://www.googleapis.com/auth/content" ] }, + "updatelineitemshippingdetails": { + "id": "content.orders.updatelineitemshippingdetails", + "path": "{merchantId}/orders/{orderId}/updateLineItemShippingDetails", + "httpMethod": "POST", + "description": "Updates ship by and delivery by dates for a line item.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersUpdateLineItemShippingDetailsRequest" + }, + "response": { + "$ref": "OrdersUpdateLineItemShippingDetailsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, "updatemerchantorderid": { "id": "content.orders.updatemerchantorderid", "path": "{merchantId}/orders/{orderId}/updateMerchantOrderId", "httpMethod": "POST", - "description": "Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts.", + "description": "Updates the merchant order ID for a given order.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -5970,11 +6262,11 @@ "id": "content.orders.updateshipment", "path": "{merchantId}/orders/{orderId}/updateShipment", "httpMethod": "POST", - "description": "Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts.", + "description": "Updates a shipment's status, carrier, and/or tracking ID.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -6008,7 +6300,7 @@ "id": "content.products.custombatch", "path": "products/batch", "httpMethod": "POST", - "description": "Retrieves, inserts, and deletes multiple products in a single request. This method can only be called for non-multi-client accounts.", + "description": "Retrieves, inserts, and deletes multiple products in a single request.", "parameters": { "dryRun": { "type": "boolean", @@ -6030,7 +6322,7 @@ "id": "content.products.delete", "path": "{merchantId}/products/{productId}", "httpMethod": "DELETE", - "description": "Deletes a product from your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Deletes a product from your Merchant Center account.", "parameters": { "dryRun": { "type": "boolean", @@ -6039,14 +6331,14 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that contains the product. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" }, "productId": { "type": "string", - "description": "The ID of the product.", + "description": "The REST id of the product.", "required": true, "location": "path" } @@ -6063,18 +6355,18 @@ "id": "content.products.get", "path": "{merchantId}/products/{productId}", "httpMethod": "GET", - "description": "Retrieves a product from your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Retrieves a product from your Merchant Center account.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that contains the product. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" }, "productId": { "type": "string", - "description": "The ID of the product.", + "description": "The REST id of the product.", "required": true, "location": "path" } @@ -6094,7 +6386,7 @@ "id": "content.products.insert", "path": "{merchantId}/products", "httpMethod": "POST", - "description": "Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. This method can only be called for non-multi-client accounts.", + "description": "Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry.", "parameters": { "dryRun": { "type": "boolean", @@ -6103,7 +6395,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that contains the product. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -6126,7 +6418,7 @@ "id": "content.products.list", "path": "{merchantId}/products", "httpMethod": "GET", - "description": "Lists the products in your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Lists the products in your Merchant Center account.", "parameters": { "includeInvalidInsertedItems": { "type": "boolean", @@ -6141,7 +6433,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that contains the products. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -6170,7 +6462,7 @@ "id": "content.productstatuses.custombatch", "path": "productstatuses/batch", "httpMethod": "POST", - "description": "Gets the statuses of multiple products in a single request. This method can only be called for non-multi-client accounts.", + "description": "Gets the statuses of multiple products in a single request.", "parameters": { "includeAttributes": { "type": "boolean", @@ -6192,7 +6484,7 @@ "id": "content.productstatuses.get", "path": "{merchantId}/productstatuses/{productId}", "httpMethod": "GET", - "description": "Gets the status of a product from your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Gets the status of a product from your Merchant Center account.", "parameters": { "includeAttributes": { "type": "boolean", @@ -6201,14 +6493,14 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that contains the product. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" }, "productId": { "type": "string", - "description": "The ID of the product.", + "description": "The REST id of the product.", "required": true, "location": "path" } @@ -6228,7 +6520,7 @@ "id": "content.productstatuses.list", "path": "{merchantId}/productstatuses", "httpMethod": "GET", - "description": "Lists the statuses of the products in your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Lists the statuses of the products in your Merchant Center account.", "parameters": { "includeAttributes": { "type": "boolean", @@ -6248,7 +6540,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that contains the products. This account cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -6299,7 +6591,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", + "description": "Retrieves the shipping settings of the account.", "parameters": { "accountId": { "type": "string", @@ -6310,7 +6602,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" @@ -6355,7 +6647,7 @@ "id": "content.shippingsettings.list", "path": "{merchantId}/shippingsettings", "httpMethod": "GET", - "description": "Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts.", + "description": "Lists the shipping settings of the sub-accounts in your Merchant Center account.", "parameters": { "maxResults": { "type": "integer", @@ -6365,7 +6657,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. This must be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -6390,7 +6682,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics.", + "description": "Updates the shipping settings of the account. This method supports patch semantics.", "parameters": { "accountId": { "type": "string", @@ -6406,7 +6698,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" @@ -6430,7 +6722,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account.", + "description": "Updates the shipping settings of the account.", "parameters": { "accountId": { "type": "string", @@ -6446,7 +6738,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.", "required": true, "format": "uint64", "location": "path" diff --git a/etc/api/content/v2sandbox/content-api.json b/etc/api/content/v2sandbox/content-api.json index f50e976fa1..59e049c7b5 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/5vl5aa2CUylrEFA9Igu87wDe8Ug\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/sn3kI5v3BSYBkgZLL4qfVbTsTJQ\"", "discoveryVersion": "v1", "id": "content:v2sandbox", "name": "content", "canonicalName": "Shopping Content", "version": "v2sandbox", - "revision": "20170926", + "revision": "20171207", "title": "Content API for Shopping", "description": "Manages product items, inventory, and Merchant Center accounts for Google Shopping.", "ownerDomain": "google.com", @@ -325,6 +325,13 @@ "id": "OrderLineItem", "type": "object", "properties": { + "annotations": { + "type": "array", + "description": "Annotations that are attached to the line item.", + "items": { + "$ref": "OrderMerchantProvidedAnnotation" + } + }, "cancellations": { "type": "array", "description": "Cancellations of the line item.", @@ -584,6 +591,20 @@ } } }, + "OrderMerchantProvidedAnnotation": { + "id": "OrderMerchantProvidedAnnotation", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Key for additional merchant provided (as key-value pairs) annotation about the line item." + }, + "value": { + "type": "string", + "description": "Value for additional merchant provided (as key-value pairs) annotation about the line item." + } + } + }, "OrderPaymentMethod": { "id": "OrderPaymentMethod", "type": "object", @@ -740,7 +761,7 @@ "properties": { "carrier": { "type": "string", - "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\"" + "description": "The carrier handling the shipment.\n\nAcceptable values are: \n- \"gsx\" \n- \"ups\" \n- \"usps\" \n- \"fedex\" \n- \"dhl\" \n- \"ecourier\" \n- \"cxt\" \n- \"google\" \n- \"ontrac\" \n- \"emsy\" \n- \"ont\" \n- \"deliv\" \n- \"dynamex\" \n- \"lasership\" \n- \"mpx\" \n- \"uds\"" }, "creationDate": { "type": "string", @@ -777,7 +798,11 @@ "properties": { "lineItemId": { "type": "string", - "description": "The id of the line item that is shipped." + "description": "The id of the line item that is shipped. Either lineItemId or productId is required." + }, + "productId": { + "type": "string", + "description": "The ID of the product to ship. This is the REST ID used in the products service. Either lineItemId or productId is required." }, "quantity": { "type": "integer", @@ -830,14 +855,26 @@ "$ref": "Price", "description": "Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order." }, + "amountPretax": { + "$ref": "Price", + "description": "Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order." + }, + "amountTax": { + "$ref": "Price", + "description": "Tax amount that correspond to cancellation amount in amountPretax." + }, "lineItemId": { "type": "string", - "description": "The ID of the line item to cancel." + "description": "The ID of the line item to cancel. Either lineItemId or productId is required." }, "operationId": { "type": "string", "description": "The ID of the operation. Unique across all operations for a given order." }, + "productId": { + "type": "string", + "description": "The ID of the product to cancel. This is the REST ID used in the products service. Either lineItemId or productId is required." + }, "quantity": { "type": "integer", "description": "The quantity to cancel.", @@ -989,10 +1026,18 @@ "$ref": "OrdersCustomBatchRequestEntryReturnLineItem", "description": "Required for returnLineItem method." }, + "setLineItemMetadata": { + "$ref": "OrdersCustomBatchRequestEntrySetLineItemMetadata", + "description": "Required for setLineItemMetadata method." + }, "shipLineItems": { "$ref": "OrdersCustomBatchRequestEntryShipLineItems", "description": "Required for shipLineItems method." }, + "updateLineItemShippingDetails": { + "$ref": "OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails", + "description": "Required for updateLineItemShippingDate method." + }, "updateShipment": { "$ref": "OrdersCustomBatchRequestEntryUpdateShipment", "description": "Required for updateShipment method." @@ -1021,9 +1066,21 @@ "$ref": "Price", "description": "Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order." }, + "amountPretax": { + "$ref": "Price", + "description": "Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order." + }, + "amountTax": { + "$ref": "Price", + "description": "Tax amount that correspond to cancellation amount in amountPretax." + }, "lineItemId": { "type": "string", - "description": "The ID of the line item to cancel." + "description": "The ID of the line item to cancel. Either lineItemId or productId is required." + }, + "productId": { + "type": "string", + "description": "The ID of the product to cancel. This is the REST ID used in the products service. Either lineItemId or productId is required." }, "quantity": { "type": "integer", @@ -1048,6 +1105,14 @@ "$ref": "Price", "description": "The amount that is refunded." }, + "amountPretax": { + "$ref": "Price", + "description": "The amount that is refunded. Either amount or amountPretax and amountTax should be filled." + }, + "amountTax": { + "$ref": "Price", + "description": "Tax amount that correspond to refund amount in amountPretax." + }, "reason": { "type": "string", "description": "The reason for the refund." @@ -1064,7 +1129,11 @@ "properties": { "lineItemId": { "type": "string", - "description": "The ID of the line item to return." + "description": "The ID of the line item to return. Either lineItemId or productId is required." + }, + "productId": { + "type": "string", + "description": "The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required." }, "quantity": { "type": "integer", @@ -1081,6 +1150,26 @@ } } }, + "OrdersCustomBatchRequestEntrySetLineItemMetadata": { + "id": "OrdersCustomBatchRequestEntrySetLineItemMetadata", + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "$ref": "OrderMerchantProvidedAnnotation" + } + }, + "lineItemId": { + "type": "string", + "description": "The ID of the line item to set metadata. Either lineItemId or productId is required." + }, + "productId": { + "type": "string", + "description": "The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required." + } + } + }, "OrdersCustomBatchRequestEntryShipLineItems": { "id": "OrdersCustomBatchRequestEntryShipLineItems", "type": "object", @@ -1136,6 +1225,28 @@ } } }, + "OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails": { + "id": "OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails", + "type": "object", + "properties": { + "deliverByDate": { + "type": "string", + "description": "Updated delivery by date, in ISO 8601 format. If not specified only ship by date is updated." + }, + "lineItemId": { + "type": "string", + "description": "The ID of the line item to set metadata. Either lineItemId or productId is required." + }, + "productId": { + "type": "string", + "description": "The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required." + }, + "shipByDate": { + "type": "string", + "description": "Updated ship by date, in ISO 8601 format. If not specified only deliver by date is updated." + } + } + }, "OrdersCustomBatchRequestEntryUpdateShipment": { "id": "OrdersCustomBatchRequestEntryUpdateShipment", "type": "object", @@ -1263,6 +1374,14 @@ "$ref": "Price", "description": "The amount that is refunded." }, + "amountPretax": { + "$ref": "Price", + "description": "The amount that is refunded. Either amount or amountPretax and amountTax should be filled." + }, + "amountTax": { + "$ref": "Price", + "description": "Tax amount that correspond to refund amount in amountPretax." + }, "operationId": { "type": "string", "description": "The ID of the operation. Unique across all operations for a given order." @@ -1298,12 +1417,16 @@ "properties": { "lineItemId": { "type": "string", - "description": "The ID of the line item to return." + "description": "The ID of the line item to return. Either lineItemId or productId is required." }, "operationId": { "type": "string", "description": "The ID of the operation. Unique across all operations for a given order." }, + "productId": { + "type": "string", + "description": "The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required." + }, "quantity": { "type": "integer", "description": "The quantity to return.", @@ -1334,6 +1457,45 @@ } } }, + "OrdersSetLineItemMetadataRequest": { + "id": "OrdersSetLineItemMetadataRequest", + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "$ref": "OrderMerchantProvidedAnnotation" + } + }, + "lineItemId": { + "type": "string", + "description": "The ID of the line item to set metadata. Either lineItemId or productId is required." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "productId": { + "type": "string", + "description": "The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required." + } + } + }, + "OrdersSetLineItemMetadataResponse": { + "id": "OrdersSetLineItemMetadataResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersSetLineItemMetadataResponse\".", + "default": "content#ordersSetLineItemMetadataResponse" + } + } + }, "OrdersShipLineItemsRequest": { "id": "OrdersShipLineItemsRequest", "type": "object", @@ -1385,6 +1547,47 @@ } } }, + "OrdersUpdateLineItemShippingDetailsRequest": { + "id": "OrdersUpdateLineItemShippingDetailsRequest", + "type": "object", + "properties": { + "deliverByDate": { + "type": "string", + "description": "Updated delivery by date, in ISO 8601 format. If not specified only ship by date is updated." + }, + "lineItemId": { + "type": "string", + "description": "The ID of the line item to set metadata. Either lineItemId or productId is required." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "productId": { + "type": "string", + "description": "The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required." + }, + "shipByDate": { + "type": "string", + "description": "Updated ship by date, in ISO 8601 format. If not specified only deliver by date is updated." + } + } + }, + "OrdersUpdateLineItemShippingDetailsResponse": { + "id": "OrdersUpdateLineItemShippingDetailsResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersUpdateLineItemShippingDetailsResponse\".", + "default": "content#ordersUpdateLineItemShippingDetailsResponse" + } + } + }, "OrdersUpdateMerchantOrderIdRequest": { "id": "OrdersUpdateMerchantOrderIdRequest", "type": "object", @@ -1499,6 +1702,10 @@ ] } }, + "notificationMode": { + "type": "string", + "description": "Determines if test order must be pulled by merchant or pushed to merchant via push integration." + }, "paymentMethod": { "$ref": "TestOrderPaymentMethod", "description": "The details of the payment method." @@ -1760,11 +1967,11 @@ "id": "content.orders.acknowledge", "path": "{merchantId}/orders/{orderId}/acknowledge", "httpMethod": "POST", - "description": "Marks an order as acknowledged. This method can only be called for non-multi-client accounts.", + "description": "Marks an order as acknowledged.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -1794,11 +2001,11 @@ "id": "content.orders.advancetestorder", "path": "{merchantId}/testorders/{orderId}/advance", "httpMethod": "POST", - "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\". This method can only be called for non-multi-client accounts.", + "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\".", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -1825,11 +2032,11 @@ "id": "content.orders.cancel", "path": "{merchantId}/orders/{orderId}/cancel", "httpMethod": "POST", - "description": "Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts.", + "description": "Cancels all line items in an order, making a full refund.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -1859,11 +2066,11 @@ "id": "content.orders.cancellineitem", "path": "{merchantId}/orders/{orderId}/cancelLineItem", "httpMethod": "POST", - "description": "Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts.", + "description": "Cancels a line item, making a full refund.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -1893,11 +2100,11 @@ "id": "content.orders.createtestorder", "path": "{merchantId}/testorders", "httpMethod": "POST", - "description": "Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts.", + "description": "Sandbox only. Creates a test order.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that should manage the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -1920,7 +2127,7 @@ "id": "content.orders.custombatch", "path": "orders/batch", "httpMethod": "POST", - "description": "Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts.", + "description": "Retrieves or modifies multiple orders in a single request.", "request": { "$ref": "OrdersCustomBatchRequest" }, @@ -1935,11 +2142,11 @@ "id": "content.orders.get", "path": "{merchantId}/orders/{orderId}", "httpMethod": "GET", - "description": "Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Retrieves an order from your Merchant Center account.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -1966,11 +2173,11 @@ "id": "content.orders.getbymerchantorderid", "path": "{merchantId}/ordersbymerchantid/{merchantOrderId}", "httpMethod": "GET", - "description": "Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts.", + "description": "Retrieves an order using merchant order id.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -1997,11 +2204,11 @@ "id": "content.orders.gettestordertemplate", "path": "{merchantId}/testordertemplates/{templateName}", "httpMethod": "GET", - "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for non-multi-client accounts.", + "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that should manage the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -2040,7 +2247,7 @@ "id": "content.orders.list", "path": "{merchantId}/orders", "httpMethod": "GET", - "description": "Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts.", + "description": "Lists the orders in your Merchant Center account.", "parameters": { "acknowledged": { "type": "boolean", @@ -2055,7 +2262,7 @@ }, "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -2135,11 +2342,11 @@ "id": "content.orders.refund", "path": "{merchantId}/orders/{orderId}/refund", "httpMethod": "POST", - "description": "Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts.", + "description": "Refund a portion of the order, up to the full amount paid.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -2169,11 +2376,11 @@ "id": "content.orders.returnlineitem", "path": "{merchantId}/orders/{orderId}/returnLineItem", "httpMethod": "POST", - "description": "Returns a line item. This method can only be called for non-multi-client accounts.", + "description": "Returns a line item.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -2199,15 +2406,49 @@ "https://www.googleapis.com/auth/content" ] }, + "setlineitemmetadata": { + "id": "content.orders.setlineitemmetadata", + "path": "{merchantId}/orders/{orderId}/setLineItemMetadata", + "httpMethod": "POST", + "description": "Sets (overrides) merchant provided annotations on the line item.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersSetLineItemMetadataRequest" + }, + "response": { + "$ref": "OrdersSetLineItemMetadataResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, "shiplineitems": { "id": "content.orders.shiplineitems", "path": "{merchantId}/orders/{orderId}/shipLineItems", "httpMethod": "POST", - "description": "Marks line item(s) as shipped. This method can only be called for non-multi-client accounts.", + "description": "Marks line item(s) as shipped.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -2233,15 +2474,49 @@ "https://www.googleapis.com/auth/content" ] }, + "updatelineitemshippingdetails": { + "id": "content.orders.updatelineitemshippingdetails", + "path": "{merchantId}/orders/{orderId}/updateLineItemShippingDetails", + "httpMethod": "POST", + "description": "Updates ship by and delivery by dates for a line item.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersUpdateLineItemShippingDetailsRequest" + }, + "response": { + "$ref": "OrdersUpdateLineItemShippingDetailsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, "updatemerchantorderid": { "id": "content.orders.updatemerchantorderid", "path": "{merchantId}/orders/{orderId}/updateMerchantOrderId", "httpMethod": "POST", - "description": "Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts.", + "description": "Updates the merchant order ID for a given order.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" @@ -2271,11 +2546,11 @@ "id": "content.orders.updateshipment", "path": "{merchantId}/orders/{orderId}/updateShipment", "httpMethod": "POST", - "description": "Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts.", + "description": "Updates a shipment's status, carrier, and/or tracking ID.", "parameters": { "merchantId": { "type": "string", - "description": "The ID of the managing account.", + "description": "The ID of the account that manages the order. This cannot be a multi-client account.", "required": true, "format": "uint64", "location": "path" diff --git a/etc/api/customsearch/v1/customsearch-api.json b/etc/api/customsearch/v1/customsearch-api.json index ba2e94c0df..30705c2be5 100644 --- a/etc/api/customsearch/v1/customsearch-api.json +++ b/etc/api/customsearch/v1/customsearch-api.json @@ -20,7 +20,7 @@ "basePath": "/customsearch/", "rootUrl": "https://www.googleapis.com/", "servicePath": "customsearch/", - "batchPath": "batch", + "batchPath": "batch/customsearch/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/dataflow/v1b3/dataflow-api.json b/etc/api/dataflow/v1b3/dataflow-api.json index 9cdc33400c..6703d8b332 100644 --- a/etc/api/dataflow/v1b3/dataflow-api.json +++ b/etc/api/dataflow/v1b3/dataflow-api.json @@ -1,42 +1,37 @@ { - "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", + "revision": "20171202", "documentationLink": "https://cloud.google.com/dataflow", "id": "dataflow:v1b3", - "revision": "20170918", "title": "Google Dataflow API", - "ownerName": "Google", "discoveryVersion": "v1", + "ownerName": "Google", "resources": { "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" - ], + "description": "Send a worker_message to the service.", "response": { "$ref": "SendWorkerMessagesResponse" }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", "parameters": { "projectId": { "location": "path", "description": "The project to send the WorkerMessages to.", - "type": "string", - "required": true + "required": true, + "type": "string" } }, "scopes": [ @@ -44,37 +39,117 @@ "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" - ] + ], + "flatPath": "v1b3/projects/{projectId}/WorkerMessages" } }, "resources": { - "locations": { + "templates": { "methods": { - "workerMessages": { - "description": "Send a worker_message to the service.", - "request": { - "$ref": "SendWorkerMessagesRequest" - }, - "httpMethod": "POST", + "get": { + "description": "Get the template associated with a template.", + "httpMethod": "GET", "parameterOrder": [ - "projectId", - "location" + "projectId" ], "response": { - "$ref": "SendWorkerMessagesResponse" + "$ref": "GetTemplateResponse" + }, + "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": { + "required": true, + "type": "string", + "location": "path", + "description": "Required. The ID of the Cloud Platform project that the job belongs to." + }, + "view": { + "description": "The view to retrieve. Defaults to METADATA_ONLY.", + "type": "string", + "location": "query", + "enum": [ + "METADATA_ONLY" + ] + }, + "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" + } + }, + "flatPath": "v1b3/projects/{projectId}/templates:get", + "id": "dataflow.projects.templates.get", + "path": "v1b3/projects/{projectId}/templates:get" + }, + "create": { + "description": "Creates a Cloud Dataflow job from a template.", + "request": { + "$ref": "CreateJobFromTemplateRequest" + }, + "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/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "parameters": { + "projectId": { + "description": "Required. The ID of the Cloud Platform project that the job belongs to.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1b3/projects/{projectId}/templates", + "path": "v1b3/projects/{projectId}/templates", + "id": "dataflow.projects.templates.create" + }, + "launch": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "LaunchTemplateResponse" }, "parameters": { - "location": { - "description": "The location which contains the job", + "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", - "required": true, - "location": "path" + "location": "query" + }, + "location": { + "description": "The location to which to direct the request.", + "type": "string", + "location": "query" + }, + "validateOnly": { + "location": "query", + "description": "If true, the request is validated but not actually executed.\nDefaults to false.", + "type": "boolean" }, "projectId": { - "description": "The project to send the WorkerMessages to.", - "type": "string", "required": true, - "location": "path" + "type": "string", + "location": "path", + "description": "Required. The ID of the Cloud Platform project that the job belongs to." } }, "scopes": [ @@ -83,9 +158,54 @@ "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" ], + "flatPath": "v1b3/projects/{projectId}/templates:launch", + "id": "dataflow.projects.templates.launch", + "path": "v1b3/projects/{projectId}/templates:launch", + "request": { + "$ref": "LaunchTemplateParameters" + }, + "description": "Launch a template." + } + } + }, + "locations": { + "methods": { + "workerMessages": { + "response": { + "$ref": "SendWorkerMessagesResponse" + }, + "parameterOrder": [ + "projectId", + "location" + ], + "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": { + "description": "The project to send the WorkerMessages to.", + "required": true, + "type": "string", + "location": "path" + }, + "location": { + "description": "The location which contains the job", + "required": true, + "type": "string", + "location": "path" + } + }, "flatPath": "v1b3/projects/{projectId}/locations/{location}/WorkerMessages", "path": "v1b3/projects/{projectId}/locations/{location}/WorkerMessages", - "id": "dataflow.projects.locations.workerMessages" + "id": "dataflow.projects.locations.workerMessages", + "description": "Send a worker_message to the service.", + "request": { + "$ref": "SendWorkerMessagesRequest" + } } }, "resources": { @@ -101,12 +221,18 @@ "location" ], "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": { + "projectId": { "location": "path", - "description": "The location to which to direct the request.", - "type": "string", - "required": true + "description": "Required. The ID of the Cloud Platform project that the job belongs to.", + "required": true, + "type": "string" }, "view": { "location": "query", @@ -116,33 +242,23 @@ "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" + "path": "v1b3/projects/{projectId}/locations/{location}/templates:get", + "id": "dataflow.projects.locations.templates.get" }, "create": { - "description": "Creates a Cloud Dataflow job from a template.", - "request": { - "$ref": "CreateJobFromTemplateRequest" - }, "response": { "$ref": "Job" }, @@ -153,16 +269,16 @@ "httpMethod": "POST", "parameters": { "location": { + "location": "path", "description": "The location to which to direct the request.", - "type": "string", "required": true, - "location": "path" + "type": "string" }, "projectId": { + "location": "path", "description": "Required. The ID of the Cloud Platform project that the job belongs to.", - "type": "string", "required": true, - "location": "path" + "type": "string" } }, "scopes": [ @@ -172,8 +288,12 @@ "https://www.googleapis.com/auth/userinfo.email" ], "flatPath": "v1b3/projects/{projectId}/locations/{location}/templates", + "path": "v1b3/projects/{projectId}/locations/{location}/templates", "id": "dataflow.projects.locations.templates.create", - "path": "v1b3/projects/{projectId}/locations/{location}/templates" + "request": { + "$ref": "CreateJobFromTemplateRequest" + }, + "description": "Creates a Cloud Dataflow job from a template." }, "launch": { "request": { @@ -188,78 +308,78 @@ "response": { "$ref": "LaunchTemplateResponse" }, + "parameters": { + "location": { + "location": "path", + "description": "The location to which to direct the request.", + "required": true, + "type": "string" + }, + "validateOnly": { + "type": "boolean", + "location": "query", + "description": "If true, the request is validated but not actually executed.\nDefaults to false." + }, + "projectId": { + "required": true, + "type": "string", + "location": "path", + "description": "Required. The ID of the Cloud Platform project that the job belongs to." + }, + "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" ], - "parameters": { - "location": { - "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:launch", - "path": "v1b3/projects/{projectId}/locations/{location}/templates:launch", - "id": "dataflow.projects.locations.templates.launch" + "id": "dataflow.projects.locations.templates.launch", + "path": "v1b3/projects/{projectId}/locations/{location}/templates:launch" } } }, "jobs": { "methods": { "getMetrics": { - "httpMethod": "GET", + "response": { + "$ref": "JobMetrics" + }, "parameterOrder": [ "projectId", "location", "jobId" ], - "response": { - "$ref": "JobMetrics" - }, + "httpMethod": "GET", "parameters": { - "location": { + "projectId": { + "required": true, + "type": "string", "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" + "description": "A project id." }, "jobId": { "description": "The job to get messages for.", - "type": "string", "required": true, + "type": "string", "location": "path" }, - "projectId": { - "description": "A project id.", - "type": "string", + "location": { + "description": "The location which contains the job specified by job_id.", "required": true, + "type": "string", "location": "path" + }, + "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": [ @@ -273,75 +393,9 @@ "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" - ] - }, - "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", - "id": "dataflow.projects.locations.jobs.list", - "path": "v1b3/projects/{projectId}/locations/{location}/jobs" - }, "get": { "description": "Gets the state of the specified Cloud Dataflow job.", + "httpMethod": "GET", "response": { "$ref": "Job" }, @@ -350,12 +404,23 @@ "location", "jobId" ], - "httpMethod": "GET", "parameters": { "location": { + "location": "path", "description": "The location that contains this job.", - "type": "string", "required": true, + "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": { @@ -368,18 +433,6 @@ "JOB_VIEW_ALL", "JOB_VIEW_DESCRIPTION" ] - }, - "jobId": { - "location": "path", - "description": "The job ID.", - "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": [ @@ -392,10 +445,77 @@ "id": "dataflow.projects.locations.jobs.get", "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}" }, + "list": { + "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.", + "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": { + "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": { + "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": { + "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}/locations/{location}/jobs", + "path": "v1b3/projects/{projectId}/locations/{location}/jobs", + "id": "dataflow.projects.locations.jobs.list", + "description": "List the jobs of a project in a given region.", + "response": { + "$ref": "ListJobsResponse" + }, + "parameterOrder": [ + "projectId", + "location" + ], + "httpMethod": "GET" + }, "update": { "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}", - "id": "dataflow.projects.locations.jobs.update", "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}", + "id": "dataflow.projects.locations.jobs.update", "request": { "$ref": "Job" }, @@ -409,46 +529,46 @@ "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": { - "description": "The location that contains this job.", - "type": "string", "required": true, + "type": "string", + "location": "path", + "description": "The location that contains this job." + }, + "projectId": { + "description": "The ID of the Cloud Platform project that the job belongs to.", + "required": true, + "type": "string", "location": "path" }, "jobId": { "location": "path", "description": "The job ID.", - "type": "string", - "required": true - }, - "projectId": { - "location": "path", - "description": "The ID of the Cloud Platform project that the job belongs to.", - "type": "string", - "required": true + "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" + ] }, "create": { + "description": "Creates a Cloud Dataflow job.", "request": { "$ref": "Job" }, - "description": "Creates a Cloud Dataflow job.", - "httpMethod": "POST", + "response": { + "$ref": "Job" + }, "parameterOrder": [ "projectId", "location" ], - "response": { - "$ref": "Job" - }, + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", @@ -456,6 +576,12 @@ "https://www.googleapis.com/auth/userinfo.email" ], "parameters": { + "projectId": { + "description": "The ID of the Cloud Platform project that the job belongs to.", + "required": true, + "type": "string", + "location": "path" + }, "view": { "location": "query", "enum": [ @@ -467,22 +593,16 @@ "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", - "required": true + "location": "path" }, "replaceJobId": { - "location": "query", "description": "Deprecated. This field is now in the Job message.", - "type": "string" + "type": "string", + "location": "query" } }, "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs", @@ -491,203 +611,21 @@ } }, "resources": { - "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": { - "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 - }, - "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" - }, - "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": { - "jobId": { - "location": "path", - "description": "The job id.", - "type": "string", - "required": true - }, - "projectId": { - "description": "The project id.", - "type": "string", - "required": true, - "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 id.", - "type": "string", - "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}/debug/getConfig", - "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/getConfig", - "id": "dataflow.projects.locations.jobs.debug.getConfig" - } - } - }, "messages": { "methods": { "list": { + "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/messages", + "id": "dataflow.projects.locations.jobs.messages.list", "description": "Request the job status.", - "httpMethod": "GET", + "response": { + "$ref": "ListJobMessagesResponse" + }, "parameterOrder": [ "projectId", "location", "jobId" ], - "response": { - "$ref": "ListJobMessagesResponse" - }, + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute", @@ -697,48 +635,46 @@ "parameters": { "jobId": { "description": "The job to get messages about.", - "type": "string", "required": true, + "type": "string", "location": "path" }, "projectId": { - "location": "path", "description": "A project id.", - "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.", - "type": "string", "required": true, + "type": "string", "location": "path" }, - "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" + "location": { + "location": "path", + "description": "The location which contains the job specified by job_id.", + "required": true, + "type": "string" + }, + "endTime": { + "location": "query", + "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", + "type": "string" }, "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).", + "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": { - "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.", + "format": "int32", "type": "integer", "location": "query" }, "minimumImportance": { - "description": "Filter to only get messages with importance \u003e= level", - "type": "string", "location": "query", "enum": [ "JOB_MESSAGE_IMPORTANCE_UNKNOWN", @@ -747,12 +683,196 @@ "JOB_MESSAGE_BASIC", "JOB_MESSAGE_WARNING", "JOB_MESSAGE_ERROR" - ] + ], + "description": "Filter to only get messages with importance \u003e= level", + "type": "string" } }, - "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" + "flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/messages" + } + } + }, + "debug": { + "methods": { + "getConfig": { + "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/compute.readonly", + "https://www.googleapis.com/auth/userinfo.email" + ], + "parameters": { + "projectId": { + "description": "The project id.", + "required": true, + "type": "string", + "location": "path" + }, + "jobId": { + "description": "The job id.", + "required": true, + "type": "string", + "location": "path" + }, + "location": { + "location": "path", + "description": "The location which contains the job specified by job_id.", + "required": true, + "type": "string" + } + }, + "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", + "description": "Get encoded debug configuration for component. Not cacheable.", + "request": { + "$ref": "GetDebugConfigRequest" + } + }, + "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.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "location", + "jobId" + ], + "response": { + "$ref": "SendDebugCaptureResponse" + }, + "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": { + "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" + ] + } + } + }, + "workItems": { + "methods": { + "reportStatus": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "location", + "jobId" + ], + "response": { + "$ref": "ReportWorkItemStatusResponse" + }, + "parameters": { + "location": { + "location": "path", + "description": "The location which contains the WorkItem's job.", + "required": true, + "type": "string" + }, + "projectId": { + "description": "The project which owns the WorkItem's job.", + "required": true, + "type": "string", + "location": "path" + }, + "jobId": { + "description": "The job which the WorkItem is part of.", + "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}/workItems:reportStatus", + "id": "dataflow.projects.locations.jobs.workItems.reportStatus", + "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:reportStatus", + "request": { + "$ref": "ReportWorkItemStatusRequest" + }, + "description": "Reports the status of dataflow WorkItems leased by a worker." + }, + "lease": { + "response": { + "$ref": "LeaseWorkItemResponse" + }, + "parameterOrder": [ + "projectId", + "location", + "jobId" + ], + "httpMethod": "POST", + "parameters": { + "location": { + "location": "path", + "description": "The location which contains the WorkItem's job.", + "required": true, + "type": "string" + }, + "projectId": { + "description": "Identifies the project this worker belongs to.", + "required": true, + "type": "string", + "location": "path" + }, + "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}/locations/{location}/jobs/{jobId}/workItems:lease", + "path": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:lease", + "id": "dataflow.projects.locations.jobs.workItems.lease", + "request": { + "$ref": "LeaseWorkItemRequest" + }, + "description": "Leases a dataflow WorkItem to run." } } } @@ -760,574 +880,11 @@ } } }, - "templates": { - "methods": { - "launch": { - "description": "Launch a template.", - "request": { - "$ref": "LaunchTemplateParameters" - }, - "httpMethod": "POST", - "parameterOrder": [ - "projectId" - ], - "response": { - "$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": { - "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", - "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" - }, - "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" - } - }, - "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, - "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" - ] - }, - "get": { - "flatPath": "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" - }, - "parameterOrder": [ - "projectId", - "jobId" - ], - "httpMethod": "GET", - "parameters": { - "view": { - "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" - }, - "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" - } - }, - "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": { - "workItems": { - "methods": { - "lease": { - "request": { - "$ref": "LeaseWorkItemRequest" - }, - "description": "Leases a dataflow WorkItem to run.", - "response": { - "$ref": "LeaseWorkItemResponse" - }, - "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": "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": { - "response": { - "$ref": "ReportWorkItemStatusResponse" - }, - "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 which the WorkItem is part of.", - "type": "string", - "required": true, - "location": "path" - }, - "projectId": { - "location": "path", - "description": "The project which owns the WorkItem's job.", - "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" }, @@ -1343,88 +900,47 @@ "https://www.googleapis.com/auth/userinfo.email" ], "parameters": { + "projectId": { + "location": "path", + "description": "The project id.", + "required": true, + "type": "string" + }, "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", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/debug/getConfig", "id": "dataflow.projects.jobs.debug.getConfig", - "path": "v1b3/projects/{projectId}/jobs/{jobId}/debug/getConfig" - } - } - }, - "messages": { - "methods": { - "list": { - "response": { - "$ref": "ListJobMessagesResponse" - }, + "description": "Get encoded debug configuration for component. Not cacheable.", + "request": { + "$ref": "GetDebugConfigRequest" + } + }, + "sendCapture": { + "httpMethod": "POST", "parameterOrder": [ "projectId", "jobId" ], - "httpMethod": "GET", + "response": { + "$ref": "SendDebugCaptureResponse" + }, "parameters": { - "pageSize": { - "location": "query", - "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": { - "location": "query", - "enum": [ - "JOB_MESSAGE_IMPORTANCE_UNKNOWN", - "JOB_MESSAGE_DEBUG", - "JOB_MESSAGE_DETAILED", - "JOB_MESSAGE_BASIC", - "JOB_MESSAGE_WARNING", - "JOB_MESSAGE_ERROR" - ], - "description": "Filter to only get messages with importance \u003e= level", + "projectId": { + "location": "path", + "description": "The project id.", + "required": true, "type": "string" }, "jobId": { - "description": "The job to get messages about.", - "type": "string", - "required": true, - "location": "path" - }, - "projectId": { "location": "path", - "description": "A project id.", - "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" - }, - "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).", + "description": "The job id.", + "required": true, "type": "string" } }, @@ -1434,12 +950,492 @@ "https://www.googleapis.com/auth/compute.readonly", "https://www.googleapis.com/auth/userinfo.email" ], - "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/messages", - "id": "dataflow.projects.jobs.messages.list", - "path": "v1b3/projects/{projectId}/jobs/{jobId}/messages", - "description": "Request the job status." + "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/debug/sendCapture", + "id": "dataflow.projects.jobs.debug.sendCapture", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/debug/sendCapture", + "request": { + "$ref": "SendDebugCaptureRequest" + }, + "description": "Send encoded debug capture data for component." } } + }, + "workItems": { + "methods": { + "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" + }, + "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": { + "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", + "location": "path" + } + } + }, + "lease": { + "request": { + "$ref": "LeaseWorkItemRequest" + }, + "description": "Leases a dataflow WorkItem to run.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "LeaseWorkItemResponse" + }, + "parameters": { + "projectId": { + "location": "path", + "description": "Identifies the project this worker belongs to.", + "required": true, + "type": "string" + }, + "jobId": { + "location": "path", + "description": "Identifies the workflow job this worker belongs to.", + "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}/jobs/{jobId}/workItems:lease", + "id": "dataflow.projects.jobs.workItems.lease", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:lease" + } + } + }, + "messages": { + "methods": { + "list": { + "description": "Request the job status.", + "response": { + "$ref": "ListJobMessagesResponse" + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "httpMethod": "GET", + "parameters": { + "location": { + "location": "query", + "description": "The location which contains the job specified by job_id.", + "type": "string" + }, + "endTime": { + "location": "query", + "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", + "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" + }, + "startTime": { + "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", + "location": "query" + }, + "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" + }, + "minimumImportance": { + "enum": [ + "JOB_MESSAGE_IMPORTANCE_UNKNOWN", + "JOB_MESSAGE_DEBUG", + "JOB_MESSAGE_DETAILED", + "JOB_MESSAGE_BASIC", + "JOB_MESSAGE_WARNING", + "JOB_MESSAGE_ERROR" + ], + "description": "Filter to only get messages with importance \u003e= level", + "type": "string", + "location": "query" + }, + "projectId": { + "location": "path", + "description": "A project id.", + "required": true, + "type": "string" + }, + "jobId": { + "description": "The job to get messages about.", + "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}/messages", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/messages", + "id": "dataflow.projects.jobs.messages.list" + } + } + } + }, + "methods": { + "get": { + "id": "dataflow.projects.jobs.get", + "path": "v1b3/projects/{projectId}/jobs/{jobId}", + "description": "Gets the state of the specified Cloud Dataflow job.", + "httpMethod": "GET", + "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" + }, + "projectId": { + "description": "The ID of the Cloud Platform project that the job belongs to.", + "required": true, + "type": "string", + "location": "path" + }, + "jobId": { + "description": "The job ID.", + "required": true, + "type": "string", + "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" + ] + } + }, + "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}" + }, + "update": { + "path": "v1b3/projects/{projectId}/jobs/{jobId}", + "id": "dataflow.projects.jobs.update", + "request": { + "$ref": "Job" + }, + "description": "Updates the state of an existing Cloud Dataflow job.", + "response": { + "$ref": "Job" + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "httpMethod": "PUT", + "parameters": { + "location": { + "description": "The location that contains this job.", + "type": "string", + "location": "query" + }, + "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" + } + }, + "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}" + }, + "aggregated": { + "httpMethod": "GET", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ListJobsResponse" + }, + "parameters": { + "projectId": { + "required": true, + "type": "string", + "location": "path", + "description": "The project which owns the jobs." + }, + "filter": { + "location": "query", + "enum": [ + "UNKNOWN", + "ALL", + "TERMINATED", + "ACTIVE" + ], + "description": "The kind of filter to use.", + "type": "string" + }, + "location": { + "location": "query", + "description": "The location that contains this job.", + "type": "string" + }, + "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", + "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" + }, + "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" + ] + } + }, + "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:aggregated", + "id": "dataflow.projects.jobs.aggregated", + "path": "v1b3/projects/{projectId}/jobs:aggregated", + "description": "List the jobs of a project across all regions." + }, + "list": { + "description": "List the jobs of a project in a given region.", + "response": { + "$ref": "ListJobsResponse" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "GET", + "parameters": { + "projectId": { + "location": "path", + "description": "The project which owns the jobs.", + "required": true, + "type": "string" + }, + "filter": { + "location": "query", + "enum": [ + "UNKNOWN", + "ALL", + "TERMINATED", + "ACTIVE" + ], + "description": "The kind of filter to use.", + "type": "string" + }, + "location": { + "location": "query", + "description": "The location that contains this job.", + "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": { + "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", + "type": "integer" + }, + "view": { + "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", + "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}/jobs", + "path": "v1b3/projects/{projectId}/jobs", + "id": "dataflow.projects.jobs.list" + }, + "create": { + "request": { + "$ref": "Job" + }, + "description": "Creates a Cloud Dataflow job.", + "response": { + "$ref": "Job" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "description": "The ID of the Cloud Platform project that the job belongs to.", + "required": true, + "type": "string", + "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" + ] + }, + "location": { + "location": "query", + "description": "The location that contains this job.", + "type": "string" + }, + "replaceJobId": { + "description": "Deprecated. This field is now in the Job message.", + "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}/jobs", + "path": "v1b3/projects/{projectId}/jobs", + "id": "dataflow.projects.jobs.create" + }, + "getMetrics": { + "description": "Request the job status.", + "response": { + "$ref": "JobMetrics" + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "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": { + "location": "path", + "description": "A project id.", + "required": true, + "type": "string" + }, + "jobId": { + "required": true, + "type": "string", + "location": "path", + "description": "The job to get messages for." + }, + "location": { + "location": "query", + "description": "The location which contains the job specified by job_id.", + "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" + } + }, + "flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/metrics", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/metrics", + "id": "dataflow.projects.jobs.getMetrics" } } } @@ -1447,6 +1443,48 @@ } }, "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.", + "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": { + "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.", @@ -1458,7 +1496,6 @@ "location": "query" }, "$.xgafv": { - "description": "V1 error format.", "type": "string", "enumDescriptions": [ "v1 error format", @@ -1468,7 +1505,8 @@ "enum": [ "1", "2" - ] + ], + "description": "V1 error format." }, "callback": { "description": "JSONP", @@ -1476,6 +1514,7 @@ "location": "query" }, "alt": { + "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -1488,1310 +1527,40 @@ "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" - }, - "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": { - "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": { - "SendDebugCaptureRequest": { - "description": "Request to send encoded debug information.", + "InstructionInput": { + "id": "InstructionInput", + "description": "An input of an instruction, as a reference to an output of a\nproducer instruction.", "type": "object", "properties": { - "componentId": { - "description": "The internal component id for which debug information is sent.", - "type": "string" - }, - "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" - }, - "GetDebugConfigResponse": { - "description": "Response to a get debug configuration request.", - "type": "object", - "properties": { - "config": { - "description": "The encoded debug configuration for the requested component.", - "type": "string" - } - }, - "id": "GetDebugConfigResponse" - }, - "ComponentTransform": { - "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" - }, - "name": { - "description": "Dataflow service generated name for this source.", - "type": "string" - } - }, - "id": "ComponentTransform" - }, - "StreamingSetupTask": { - "description": "A task which initializes part of a streaming Dataflow job.", - "type": "object", - "properties": { - "streamingComputationTopology": { - "$ref": "TopologyConfig", - "description": "The global topology of the streaming Dataflow job." - }, - "drain": { - "description": "The user has requested drain.", - "type": "boolean" - }, - "workerHarnessPort": { + "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", - "description": "The TCP port used by the worker to communicate with the Dataflow\nworker harness.", "type": "integer" }, - "receiveWorkPort": { + "outputNum": { + "description": "The output index (origin zero) within the producer.", "format": "int32", - "description": "The TCP port on which the worker should listen for messages from\nother streaming computation workers.", "type": "integer" } - }, - "id": "StreamingSetupTask" - }, - "PubsubLocation": { - "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" - }, - "dropLateData": { - "description": "Indicates whether the pipeline allows late-arriving data.", - "type": "boolean" - }, - "trackingSubscription": { - "description": "If set, specifies the pubsub subscription that will be used for tracking\ncustom time timestamps for watermark estimation.", - "type": "string" - }, - "withAttributes": { - "description": "If true, then the client has requested to get pubsub attributes.", - "type": "boolean" - }, - "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" - } - }, - "id": "PubsubLocation" - }, - "WorkerHealthReport": { - "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": { - "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" - }, - "pods": { - "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.", - "type": "any" - }, - "type": "object" - }, - "type": "array" - }, - "vmStartupTime": { - "format": "google-datetime", - "description": "The time the VM was booted.", - "type": "string" - } - }, - "id": "WorkerHealthReport" - }, - "JobMessage": { - "description": "A particular message pertaining to a Dataflow job.", - "type": "object", - "properties": { - "time": { - "format": "google-datetime", - "description": "The timestamp of the message.", - "type": "string" - }, - "id": { - "description": "Deprecated.", - "type": "string" - }, - "messageImportance": { - "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.", - "The message is at the 'detailed' level: somewhat verbose, but\npotentially useful to users. Typically, Dataflow pipeline\nrunners do not display log messages at this level by default.\nThese messages are displayed by default in the Dataflow\nmonitoring UI.", - "The message is at the 'basic' level: useful for keeping\ntrack of the execution of a Dataflow pipeline. Typically,\nDataflow pipeline runners display log messages at this level by\ndefault, and these messages are displayed by default in the\nDataflow monitoring UI.", - "The message is at the 'warning' level: indicating a condition\npertaining to a job which may require human intervention.\nTypically, Dataflow pipeline runners display log messages at this\nlevel by default, and these messages are displayed by default in\nthe Dataflow monitoring UI.", - "The message is at the 'error' level: indicating a condition\npreventing a job from succeeding. Typically, Dataflow pipeline\nrunners display log messages at this level by default, and these\nmessages are displayed by default in the Dataflow monitoring UI." - ], - "enum": [ - "JOB_MESSAGE_IMPORTANCE_UNKNOWN", - "JOB_MESSAGE_DEBUG", - "JOB_MESSAGE_DETAILED", - "JOB_MESSAGE_BASIC", - "JOB_MESSAGE_WARNING", - "JOB_MESSAGE_ERROR" - ], - "description": "Importance level of the message.", - "type": "string" - }, - "messageText": { - "description": "The text of the message.", - "type": "string" - } - }, - "id": "JobMessage" - }, - "ParameterMetadata": { - "description": "Metadata for a specific parameter.", - "type": "object", - "properties": { - "helpText": { - "description": "Required. The help text to display for the parameter.", - "type": "string" - }, - "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" - }, - "MultiOutputInfo": { - "description": "Information about an output of a multi-output DoFn.", - "type": "object", - "properties": { - "tag": { - "description": "The id of the tag the user code will emit to this output by; this\nshould correspond to the tag of some SideInputInfo.", - "type": "string" - } - }, - "id": "MultiOutputInfo" - }, - "SourceSplitRequest": { - "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" - } - }, - "id": "SourceSplitRequest" - }, - "SourceGetMetadataResponse": { - "description": "The result of a SourceGetMetadataOperation.", - "type": "object", - "properties": { - "metadata": { - "$ref": "SourceMetadata", - "description": "The computed metadata." - } - }, - "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": { - "format": "int32", - "description": "Exit code for the task.", - "type": "integer" - }, - "command": { - "description": "The shell command to run.", - "type": "string" - } - }, - "id": "ShellTask" - }, - "AutoscalingEvent": { - "description": "A structured message reporting an autoscaling decision made by the Dataflow\nservice.", - "type": "object", - "properties": { - "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.", - "The TARGET_NUM_WORKERS_CHANGED type should be used when the target\nworker pool size has changed at the start of an actuation. An event\nshould always be specified as TARGET_NUM_WORKERS_CHANGED if it reflects\na change in the target_num_workers.", - "The CURRENT_NUM_WORKERS_CHANGED type should be used when actual worker\npool size has been changed, but the target_num_workers has not changed.", - "The ACTUATION_FAILURE type should be used when we want to report\nan error to the user indicating why the current number of workers\nin the pool could not be changed.\nDisplayed in the current status and history widgets.", - "Used when we want to report to the user a reason why we are\nnot currently adjusting the number of workers.\nShould specify both target_num_workers, current_num_workers and a\ndecision_message." - ], - "enum": [ - "TYPE_UNKNOWN", - "TARGET_NUM_WORKERS_CHANGED", - "CURRENT_NUM_WORKERS_CHANGED", - "ACTUATION_FAILURE", - "NO_CHANGE" - ], - "description": "The type of autoscaling event to report.", - "type": "string" - }, - "targetNumWorkers": { - "format": "int64", - "description": "The target number of workers the worker pool wants to resize to use.", - "type": "string" - }, - "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/\"", - "type": "string" - }, - "logToSerialconsole": { - "description": "Whether to send taskrunner log info to Google Compute Engine VM serial\nconsole.", - "type": "boolean" - }, - "continueOnException": { - "description": "Whether to continue taskrunner if an exception is hit.", - "type": "boolean" - }, - "parallelWorkerSettings": { - "$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" - }, - "taskGroup": { - "description": "The UNIX group ID on the worker VM to use for tasks launched by\ntaskrunner; e.g. \"wheel\".", - "type": "string" - }, - "harnessCommand": { - "description": "The command to launch the worker harness.", - "type": "string" - }, - "logDir": { - "description": "The directory on the VM to store logs.", - "type": "string" - }, - "dataflowApiVersion": { - "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.", - "items": { - "type": "string" - }, - "type": "array" - }, - "streamingWorkerMainClass": { - "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": { - "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": { - "description": "The location on the worker for task-specific subdirectories.", - "type": "string" - } - }, - "id": "TaskRunnerSettings" - }, - "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": { - "format": "int64", - "description": "Position is a record index.", - "type": "string" - }, - "shufflePosition": { - "description": "CloudPosition is a base64 encoded BatchShufflePosition (with FIXED\nsharding).", - "type": "string" - }, - "concatPosition": { - "description": "CloudPosition is a concat position.", - "$ref": "ConcatPosition" - }, - "byteOffset": { - "format": "int64", - "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": { - "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).", - "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" - } - } - }, - "id": "Source" - }, - "SplitInt64": { - "description": "A representation of an int64, n, that is immune to precision loss when\nencoded in JSON.", - "type": "object", - "properties": { - "lowBits": { - "format": "uint32", - "description": "The low order bits: n & 0xffffffff.", - "type": "integer" - }, - "highBits": { - "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" - }, - "diskSourceImage": { - "description": "Fully qualified source image for disks.", - "type": "string" - }, - "packages": { - "description": "Packages to be installed on workers.", - "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.", - "type": "string", - "enumDescriptions": [ - "The teardown policy isn't specified, or is unknown.", - "Always teardown the resource.", - "Teardown the resource on success. This is useful for debugging\nfailures.", - "Never teardown the resource. This is useful for debugging and\ndevelopment." - ], - "enum": [ - "TEARDOWN_POLICY_UNKNOWN", - "TEARDOWN_ALWAYS", - "TEARDOWN_ON_SUCCESS", - "TEARDOWN_NEVER" - ] - }, - "onHostMaintenance": { - "description": "The action to take on host maintenance, as defined by the Google\nCompute Engine API.", - "type": "string" - }, - "poolArgs": { - "description": "Extra arguments for this worker pool.", - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - }, - "diskSizeGb": { - "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" - } - }, - "id": "WorkerPool" - }, - "SourceOperationRequest": { - "description": "A work item that represents the different operations that can be\nperformed on a user-defined Source specification.", - "type": "object", - "properties": { - "split": { - "description": "Information about a request to split a source.", - "$ref": "SourceSplitRequest" - }, - "getMetadata": { - "$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": { - "streamingComputationTask": { - "description": "Additional information for StreamingComputationTask WorkItems.", - "$ref": "StreamingComputationTask" - }, - "shellTask": { - "$ref": "ShellTask", - "description": "Additional information for ShellTask WorkItems." - }, - "jobId": { - "description": "Identifies the workflow job this WorkItem belongs to.", - "type": "string" - }, - "id": { - "format": "int64", - "description": "Identifies this WorkItem.", - "type": "string" - }, - "configuration": { - "description": "Work item-specific configuration as an opaque blob.", - "type": "string" - }, - "mapTask": { - "description": "Additional information for MapTask WorkItems.", - "$ref": "MapTask" - }, - "seqMapTask": { - "description": "Additional information for SeqMapTask WorkItems.", - "$ref": "SeqMapTask" - }, - "packages": { - "description": "Any required packages that need to be fetched in order to execute\nthis WorkItem.", - "items": { - "$ref": "Package" - }, - "type": "array" - }, - "projectId": { - "description": "Identifies the cloud project this WorkItem belongs to.", - "type": "string" - }, - "reportStatusInterval": { - "format": "google-duration", - "description": "Recommended reporting interval.", - "type": "string" - }, - "streamingSetupTask": { - "description": "Additional information for StreamingSetupTask WorkItems.", - "$ref": "StreamingSetupTask" - }, - "sourceOperationTask": { - "$ref": "SourceOperationRequest", - "description": "Additional information for source operation WorkItems." - }, - "streamingConfigTask": { - "description": "Additional information for StreamingConfigTask WorkItems.", - "$ref": "StreamingConfigTask" - }, - "leaseExpireTime": { - "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" - } - }, - "id": "WorkItem" - }, - "StructuredMessage": { - "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": { - "messageKey": { - "description": "Idenfier for this message type. Used by external systems to\ninternationalize or personalize message.", - "type": "string" - }, - "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" - }, - "ReportedParallelism": { - "description": "Represents the level of parallelism in a WorkItem's input,\nreported by the worker.", - "type": "object", - "properties": { - "isInfinite": { - "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": { - "format": "double", - "description": "Specifies the level of parallelism in case it is finite.", - "type": "number" - } - }, - "id": "ReportedParallelism" - }, - "ResourceUtilizationReport": { - "description": "Worker metrics exported from workers. This contains resource utilization\nmetrics accumulated from a variety of sources. For more information, see\ngo/df-resource-signals.", - "type": "object", - "properties": { - "cpuTime": { - "description": "CPU utilization samples.", - "items": { - "$ref": "CPUTime" - }, - "type": "array" - } - }, - "id": "ResourceUtilizationReport" - }, - "TopologyConfig": { - "description": "Global topology of the streaming Dataflow job, including all\ncomputations and their sharded locations.", - "type": "object", - "properties": { - "userStageToComputationNameMap": { - "description": "Maps user stage names to stable computation names.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "computations": { - "description": "The computations associated with a streaming Dataflow job.", - "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.", - "items": { - "$ref": "DataDiskAssignment" - }, - "type": "array" - }, - "forwardingKeyBits": { - "format": "int32", - "description": "The size (in bits) of keys that will be assigned to source messages.", - "type": "integer" - } - }, - "id": "TopologyConfig" - }, - "SourceSplitOptions": { - "description": "Hints for splitting a Source into bundles (parts for parallel\nprocessing) using SourceSplitRequest.", - "type": "object", - "properties": { - "desiredBundleSizeBytes": { - "format": "int64", - "description": "The source should be split into a set of bundles where the estimated size\nof each is approximately this many bytes.", - "type": "string" - }, - "desiredShardSizeBytes": { - "format": "int64", - "description": "DEPRECATED in favor of desired_bundle_size_bytes.", - "type": "string" - } - }, - "id": "SourceSplitOptions" - }, - "ReadInstruction": { - "description": "An instruction that reads records.\nTakes no inputs, produces one output.", - "type": "object", - "properties": { - "source": { - "description": "The source to read from.", - "$ref": "Source" - } - }, - "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/\"", - "type": "string" - }, - "reportingEnabled": { - "description": "Whether to send work progress updates to the service.", - "type": "boolean" - }, - "servicePath": { - "description": "The Cloud Dataflow service path relative to the root URL, for example,\n\"dataflow/v1b3/projects\".", - "type": "string" - }, - "shuffleServicePath": { - "description": "The Shuffle service path relative to the root URL, for example,\n\"shuffle/v1beta1\".", - "type": "string" - }, - "workerId": { - "description": "The ID of the worker running this pipeline.", - "type": "string" - }, - "tempStoragePrefix": { - "description": "The prefix of the resources the system should use for temporary\nstorage.\n\nThe supported resource type is:\n\nGoogle Cloud Storage:\n\n storage.googleapis.com/{bucket}/{object}\n bucket.storage.googleapis.com/{object}", - "type": "string" - } - }, - "id": "WorkerSettings" - }, - "StreamingStageLocation": { - "description": "Identifies the location of a streaming computation stage, for\nstage-to-stage communication.", - "type": "object", - "properties": { - "streamId": { - "description": "Identifies the particular stream within the streaming Dataflow\njob.", - "type": "string" - } - }, - "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" - } - }, - "id": "DataDiskAssignment" - }, - "ApproximateSplitRequest": { - "description": "A suggestion by the service to the worker to dynamically split the WorkItem.", - "type": "object", - "properties": { - "position": { - "$ref": "Position", - "description": "A Position at which to split the work item." - }, - "fractionConsumed": { - "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" - } - }, - "id": "ApproximateSplitRequest" - }, - "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": { - "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": { - "executionStageState": { - "description": "Executions stage states allow the same set of values as JobState.", - "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" - ] - }, - "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" - }, - "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": { - "$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" - }, - "SendWorkerMessagesResponse": { - "description": "The response to the worker messages.", - "type": "object", - "properties": { - "workerMessageResponses": { - "description": "The servers response to the worker messages.", - "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" - }, - "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.", - "items": { - "$ref": "ParallelInstruction" - }, - "type": "array" - } - }, - "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", - "GROUP_BY_KEY_KIND", - "FLATTEN_KIND", - "READ_KIND", - "WRITE_KIND", - "CONSTANT_KIND", - "SINGLETON_KIND", - "SHUFFLE_KIND" - ], - "description": "Type of transform.", - "type": "string" - }, - "inputCollectionName": { - "description": "User names for all collection inputs to this transform.", - "items": { - "type": "string" - }, - "type": "array" - }, - "name": { - "description": "User provided name for this transform instance.", - "type": "string" - }, - "id": { - "description": "SDK generated id of this transform instance.", - "type": "string" - }, - "displayData": { - "description": "Transform-specific display data.", - "items": { - "$ref": "DisplayData" - }, - "type": "array" - }, - "outputCollectionName": { - "description": "User names for all collection outputs to this transform.", - "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.", - "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": "LaunchTemplateParameters" - }, - "Sink": { - "description": "A sink that records can be encoded and written to.", - "type": "object", - "properties": { - "codec": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The codec to use to encode data written to the sink.", - "type": "object" - }, - "spec": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The sink to write to, plus its parameters.", - "type": "object" - } - }, - "id": "Sink" - }, - "FlattenInstruction": { - "description": "An instruction that copies its inputs (zero or more) to its (single) output.", - "type": "object", - "properties": { - "inputs": { - "description": "Describes the inputs to the flatten instruction.", - "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": { - "input": { - "$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" - } - }, - "valueCombiningFn": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The value combining function to invoke.", - "type": "object" - }, - "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" - }, - "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": "PartialGroupByKeyInstruction" + } }, "StageSource": { "description": "Description of an input or output of an execution stage.", "type": "object", "properties": { - "sizeBytes": { - "format": "int64", - "description": "Size of the source, if measurable.", - "type": "string" - }, "name": { "description": "Dataflow service generated name for this source.", "type": "string" }, + "sizeBytes": { + "description": "Size of the source, if measurable.", + "format": "int64", + "type": "string" + }, "userName": { "description": "Human-readable name for this source; may be user or system generated.", "type": "string" @@ -2803,44 +1572,52 @@ }, "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" + "description": "Elements of the list." } }, - "id": "StringList" + "id": "StringList", + "description": "A metric value representing a list of strings.", + "type": "object" }, "DisplayData": { "description": "Data provided with a pipeline or transform to provide descriptive info.", "type": "object", "properties": { + "namespace": { + "description": "The namespace for the key. This is usually a class name or programming\nlanguage namespace (i.e. python module) which defines the display data.\nThis allows a dax monitoring system to specially handle the data\nand perform custom rendering.", + "type": "string" + }, + "floatValue": { + "description": "Contains value if the data is of float type.", + "format": "float", + "type": "number" + }, + "key": { + "description": "The key identifying the display data.\nThis is intended to be used as a label for the display data\nwhen viewed in a dax monitoring system.", + "type": "string" + }, + "shortStrValue": { + "description": "A possible additional shorter value to display.\nFor example a java_class_name_value of com.mypackage.MyDoFn\nwill be stored with MyDoFn as the short_str_value and\ncom.mypackage.MyDoFn as the java_class_name value.\nshort_str_value can be displayed and java_class_name_value\nwill be displayed as a tooltip.", + "type": "string" + }, + "url": { + "description": "An optional full URL.", + "type": "string" + }, + "label": { + "description": "An optional label to display in a dax UI for the element.", + "type": "string" + }, "timestampValue": { - "format": "google-datetime", "description": "Contains value if the data is of timestamp type.", + "format": "google-datetime", "type": "string" }, "javaClassValue": { @@ -2856,38 +1633,13 @@ "type": "string" }, "int64Value": { - "format": "int64", "description": "Contains value if the data is of int64 type.", + "format": "int64", "type": "string" }, "durationValue": { - "format": "google-duration", "description": "Contains value if the data is of duration type.", - "type": "string" - }, - "namespace": { - "description": "The namespace for the key. This is usually a class name or programming\nlanguage namespace (i.e. python module) which defines the display data.\nThis allows a dax monitoring system to specially handle the data\nand perform custom rendering.", - "type": "string" - }, - "floatValue": { - "format": "float", - "description": "Contains value if the data is of float type.", - "type": "number" - }, - "key": { - "description": "The key identifying the display data.\nThis is intended to be used as a label for the display data\nwhen viewed in a dax monitoring system.", - "type": "string" - }, - "shortStrValue": { - "description": "A possible additional shorter value to display.\nFor example a java_class_name_value of com.mypackage.MyDoFn\nwill be stored with MyDoFn as the short_str_value and\ncom.mypackage.MyDoFn as the java_class_name value.\nshort_str_value can be displayed and java_class_name_value\nwill be displayed as a tooltip.", - "type": "string" - }, - "label": { - "description": "An optional label to display in a dax UI for the element.", - "type": "string" - }, - "url": { - "description": "An optional full URL.", + "format": "google-duration", "type": "string" } }, @@ -2902,8 +1654,8 @@ "type": "string" }, "workerId": { - "description": "The worker id, i.e., VM hostname.", - "type": "string" + "type": "string", + "description": "The worker id, i.e., VM hostname." }, "location": { "description": "The location which contains the job specified by job_id.", @@ -2916,55 +1668,55 @@ "description": "Request to lease WorkItems.", "type": "object", "properties": { - "currentWorkerTime": { - "format": "google-datetime", - "description": "The current timestamp at the worker.", - "type": "string" - }, "location": { "description": "The location which contains the WorkItem's job.", "type": "string" }, "workItemTypes": { "description": "Filter for WorkItem type.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "workerCapabilities": { - "description": "Worker capabilities. WorkItems might be limited to workers with specific\ncapabilities.", + "type": "array", "items": { "type": "string" }, - "type": "array" + "description": "Worker capabilities. WorkItems might be limited to workers with specific\ncapabilities." }, "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.", + "format": "google-duration", + "type": "string" + }, + "currentWorkerTime": { + "description": "The current timestamp at the worker.", + "format": "google-datetime", "type": "string" } }, "id": "LeaseWorkItemRequest" }, "GetTemplateResponse": { - "description": "The response to a GetTemplate request.", "type": "object", "properties": { - "metadata": { - "$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" + "$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" } }, - "id": "GetTemplateResponse" + "id": "GetTemplateResponse", + "description": "The response to a GetTemplate request." }, "Parameter": { "description": "Structured data associated with this message.", @@ -2985,25 +1737,25 @@ "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": { + "description": "The current timestamp at the worker.", + "format": "google-datetime", + "type": "string" + }, "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" + "description": "The order is unimportant, except that the order of the\nWorkItemServiceState messages in the ReportWorkItemStatusResponse\ncorresponds to the order of WorkItemStatus messages here." } }, "id": "ReportWorkItemStatusRequest" @@ -3020,16 +1772,16 @@ "type": "object" }, "windmillServicePort": { - "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.", + "format": "int64", "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.", @@ -3044,24 +1796,24 @@ "properties": { "originalPipelineTransform": { "description": "Description of each transform in the pipeline and collections between them.", + "type": "array", "items": { "$ref": "TransformSummary" - }, - "type": "array" + } }, "displayData": { "description": "Pipeline level display data.", + "type": "array", "items": { "$ref": "DisplayData" - }, - "type": "array" + } }, "executionPipelineStage": { "description": "Description of each stage of execution of the pipeline.", + "type": "array", "items": { "$ref": "ExecutionStageSummary" - }, - "type": "array" + } } }, "id": "PipelineDescription" @@ -3070,10 +1822,6 @@ "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": { - "description": "The kind of step in the Cloud Dataflow job.", - "type": "string" - }, "properties": { "additionalProperties": { "description": "Properties of the object.", @@ -3085,6 +1833,10 @@ "name": { "description": "The name that identifies the step. This must be unique for each\nstep with respect to all other steps in the Cloud Dataflow job.", "type": "string" + }, + "kind": { + "description": "The kind of step in the Cloud Dataflow job.", + "type": "string" } }, "id": "Step" @@ -3104,29 +1856,29 @@ "id": "JobExecutionInfo" }, "FailedLocation": { - "description": "Indicates which location failed to respond to a request for data.", - "type": "object", "properties": { "name": { "description": "The name of the failed location.", "type": "string" } }, - "id": "FailedLocation" + "id": "FailedLocation", + "description": "Indicates which location failed to respond to a request for data.", + "type": "object" }, "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": { "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.", "type": "string" @@ -3134,42 +1886,11 @@ }, "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": { - "description": { - "description": "Human-readable description of the counter semantics.", - "type": "string" - }, "kind": { - "description": "Counter aggregation kind.", - "type": "string", "enumDescriptions": [ "Counter aggregation kind was not set.", "Aggregated value is the sum of all contributed values.", @@ -3191,10 +1912,15 @@ "AND", "SET", "DISTRIBUTION" - ] + ], + "description": "Counter aggregation kind.", + "type": "string" + }, + "description": { + "description": "Human-readable description of the counter semantics.", + "type": "string" }, "standardUnits": { - "description": "System defined Units, see above enum.", "type": "string", "enumDescriptions": [ "Counter returns a value in bytes.", @@ -3215,7 +1941,8 @@ "TIMESTAMP_MSEC", "TIMESTAMP_USEC", "TIMESTAMP_NSEC" - ] + ], + "description": "System defined Units, see above enum." }, "otherUnits": { "description": "A string referring to the unit type.", @@ -3224,55 +1951,80 @@ }, "id": "CounterMetadata" }, - "ApproximateReportedProgress": { - "description": "A progress measurement of a WorkItem by a worker.", + "ListJobMessagesResponse": { + "description": "Response to a request to list job messages.", "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." + "jobMessages": { + "description": "Messages in ascending timestamp order.", + "type": "array", + "items": { + "$ref": "JobMessage" + } }, - "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" + "nextPageToken": { + "description": "The token to obtain the next page of results if there are more.", + "type": "string" }, + "autoscalingEvents": { + "description": "Autoscaling events in ascending timestamp order.", + "type": "array", + "items": { + "$ref": "AutoscalingEvent" + } + } + }, + "id": "ListJobMessagesResponse" + }, + "ApproximateReportedProgress": { + "properties": { "position": { "description": "A Position within the work to represent a progress.", "$ref": "Position" }, "fractionConsumed": { - "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", "type": "number" + }, + "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" + }, + "remainingParallelism": { + "$ref": "ReportedParallelism", + "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." } }, - "id": "ApproximateReportedProgress" + "id": "ApproximateReportedProgress", + "description": "A progress measurement of a WorkItem by a worker.", + "type": "object" }, "IntegerList": { - "description": "A metric value representing a list of integers.", "type": "object", "properties": { "elements": { "description": "Elements of the list.", + "type": "array", "items": { "$ref": "SplitInt64" - }, - "type": "array" + } } }, - "id": "IntegerList" + "id": "IntegerList", + "description": "A metric value representing a list of integers." }, "StateFamilyConfig": { "description": "State family configuration.", "type": "object", "properties": { - "stateFamily": { - "description": "The state family value.", - "type": "string" - }, "isRead": { "description": "If true, this family corresponds to a read operation.", "type": "boolean" + }, + "stateFamily": { + "description": "The state family value.", + "type": "string" } }, "id": "StateFamilyConfig" @@ -3287,33 +2039,33 @@ "description": "The response to a SourceSplitRequest.", "type": "object", "properties": { + "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" + } + }, "shards": { "description": "DEPRECATED in favor of bundles.", + "type": "array", "items": { "$ref": "SourceSplitShard" - }, - "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" - }, - "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.", - "items": { - "$ref": "DerivedSource" - }, - "type": "array" + "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." + ] } }, "id": "SourceSplitResponse" @@ -3322,44 +2074,44 @@ "description": "Describes a particular operation comprising a MapTask.", "type": "object", "properties": { - "originalName": { - "description": "System-defined name for the operation in the original workflow graph.", - "type": "string" - }, - "flatten": { - "description": "Additional information for Flatten instructions.", - "$ref": "FlattenInstruction" - }, - "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" + }, + "parDo": { + "$ref": "ParDoInstruction", + "description": "Additional information for ParDo instructions." + }, + "originalName": { + "type": "string", + "description": "System-defined name for the operation in the original workflow graph." + }, + "flatten": { + "$ref": "FlattenInstruction", + "description": "Additional information for Flatten instructions." + }, + "systemName": { + "type": "string", + "description": "System-defined name of this operation.\nUnique across the workflow." + }, + "write": { + "description": "Additional information for Write instructions.", + "$ref": "WriteInstruction" + }, + "partialGroupByKey": { + "$ref": "PartialGroupByKeyInstruction", + "description": "Additional information for PartialGroupByKey instructions." } }, "id": "ParallelInstruction" @@ -3368,78 +2120,96 @@ "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/", - "type": "string" - }, "name": { "description": "The name of the package.", "type": "string" + }, + "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/", + "type": "string" } }, "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.", "type": "object", "properties": { - "end": { - "description": "The end (exclusive) of the key range.", + "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.", + "end": { + "description": "The end (exclusive) of the key range.", "type": "string" } }, - "id": "KeyRangeDataDiskAssignment" + "id": "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." }, "ParDoInstruction": { + "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", "properties": { - "numOutputs": { - "format": "int32", - "description": "The number of outputs.", - "type": "integer" - }, - "sideInputs": { - "description": "Zero or more side inputs.", - "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" - } + "type": "any", + "description": "Properties of the object." + }, + "description": "The user function to invoke.", + "type": "object" }, "input": { "$ref": "InstructionInput", "description": "The input." + }, + "numOutputs": { + "description": "The number of outputs.", + "format": "int32", + "type": "integer" + }, + "sideInputs": { + "description": "Zero or more side inputs.", + "type": "array", + "items": { + "$ref": "SideInputInfo" + } } - }, - "id": "ParDoInstruction" + } }, "MetricUpdate": { + "id": "MetricUpdate", "description": "Describes the state of a metric.", "type": "object", "properties": { + "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", + "type": "string" + }, + "name": { + "description": "Name of the metric.", + "$ref": "MetricStructuredName" + }, + "distribution": { + "description": "A struct value describing properties of a distribution of numeric values.", + "type": "any" + }, + "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" @@ -3463,64 +2233,28 @@ "meanSum": { "description": "Worker-computed aggregate value for the \"Mean\" aggregation kind.\nThis holds the sum of the aggregated values and is used in combination\nwith mean_count below to obtain the actual mean aggregate value.\nThe only possible value types are Long and Double.", "type": "any" - }, - "updateTime": { - "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": { - "description": "Name of the metric.", - "$ref": "MetricStructuredName" - }, - "distribution": { - "description": "A struct value describing properties of a distribution of numeric values.", - "type": "any" - }, - "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" } - }, - "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" + "type": "string", + "description": "ID of a particular worker." }, "originNamespace": { "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." + "executionStepName": { + "description": "Name of the stage. An execution step contains multiple component steps.", + "type": "string" + }, + "name": { + "description": "Counter name. Not necessarily globally-unique, but unique within the\ncontext of the other fields.\nRequired.", + "type": "string" }, "origin": { "enumDescriptions": [ @@ -3534,49 +2268,68 @@ "description": "One of the standard Origins defined above.", "type": "string" }, - "name": { - "description": "Counter name. Not necessarily globally-unique, but unique within the\ncontext of the other fields.\nRequired.", + "originalRequestingStepName": { + "description": "The step name requesting an operation, such as GBK.\nI.e. the ParDo causing a read/write from shuffle to occur, or a\nread from side inputs.", "type": "string" }, - "executionStepName": { - "description": "Name of the stage. An execution step contains multiple component steps.", - "type": "string" + "inputIndex": { + "description": "Index of an input collection that's being read from/written to as a side\ninput.\nThe index identifies a step's side inputs starting by 1 (e.g. the first\nside input has input_index 1, the third has input_index 3).\nSide inputs are identified by a pair of (original_step_name, input_index).\nThis field helps uniquely identify them.", + "format": "int32", + "type": "integer" }, "componentStepName": { "description": "Name of the optimized step being executed by the workers.", "type": "string" + }, + "portion": { + "enumDescriptions": [ + "Counter portion has not been set.", + "Counter reports a key.", + "Counter reports a value." + ], + "enum": [ + "ALL", + "KEY", + "VALUE" + ], + "description": "Portion of this counter, either key or value.", + "type": "string" + }, + "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.", + "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.", "type": "string" } }, - "id": "WorkerShutdownNotice" + "id": "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." }, "ApproximateProgress": { "description": "Obsolete in favor of ApproximateReportedProgress and ApproximateSplitRequest.", "type": "object", "properties": { - "position": { - "$ref": "Position", - "description": "Obsolete." - }, "percentComplete": { - "format": "float", "description": "Obsolete.", + "format": "float", "type": "number" }, "remainingTime": { - "format": "google-duration", "description": "Obsolete.", + "format": "google-duration", "type": "string" + }, + "position": { + "$ref": "Position", + "description": "Obsolete." } }, "id": "ApproximateProgress" @@ -3585,14 +2338,14 @@ "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": { "description": "Service's response to reporting worker metrics (currently empty).", "$ref": "ResourceUtilizationReportResponse" }, + "workerShutdownNoticeResponse": { + "$ref": "WorkerShutdownNoticeResponse", + "description": "Service's response to shutdown notice (currently empty)." + }, "workerHealthReportResponse": { "$ref": "WorkerHealthReportResponse", "description": "The service's response to a worker's health report." @@ -3601,43 +2354,33 @@ "id": "WorkerMessageResponse" }, "TemplateMetadata": { + "id": "TemplateMetadata", "description": "Metadata describing a template.", "type": "object", "properties": { - "description": { - "description": "Optional. A description of the template.", - "type": "string" - }, - "parameters": { - "description": "The parameters for the template.", - "items": { - "$ref": "ParameterMetadata" - }, - "type": "array" - }, "name": { "description": "Required. The name of the template.", "type": "string" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "ParameterMetadata" + }, + "description": "The parameters for the template." + }, + "description": { + "description": "Optional. A description of the template.", + "type": "string" } - }, - "id": "TemplateMetadata" + } }, "WorkerMessage": { - "description": "WorkerMessage provides information to the backend about a worker.", "type": "object", "properties": { - "time": { - "format": "google-datetime", - "description": "The timestamp of the worker_message.", - "type": "string" - }, - "workerShutdownNotice": { - "$ref": "WorkerShutdownNotice", - "description": "Shutdown notice by workers." - }, "workerHealthReport": { - "description": "The health of a worker.", - "$ref": "WorkerHealthReport" + "$ref": "WorkerHealthReport", + "description": "The health of a worker." }, "workerMessageCode": { "$ref": "WorkerMessageCode", @@ -3648,33 +2391,43 @@ "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" + } + }, + "time": { + "description": "The timestamp of the worker_message.", + "format": "google-datetime", + "type": "string" + }, + "workerShutdownNotice": { + "$ref": "WorkerShutdownNotice", + "description": "Shutdown notice by workers." } }, - "id": "WorkerMessage" + "id": "WorkerMessage", + "description": "WorkerMessage provides information to the backend about a worker." }, "JobMetrics": { + "id": "JobMetrics", "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.", @@ -3688,171 +2441,174 @@ "properties": { "elements": { "description": "Elements of the list.", + "type": "array", "items": { - "format": "double", - "type": "number" - }, - "type": "array" + "type": "number", + "format": "double" + } } }, "id": "FloatingPointList" }, "CounterUpdate": { - "description": "An update to a Counter sent from a worker.", "type": "object", "properties": { + "integer": { + "description": "Integer value for Sum, Max, Min.", + "$ref": "SplitInt64" + }, "integerList": { "description": "List of integers, for Set.", "$ref": "IntegerList" }, "structuredNameAndMetadata": { - "description": "Counter structured name and metadata.", - "$ref": "CounterStructuredNameAndMetadata" - }, - "floatingPoint": { - "format": "double", - "description": "Floating point value for Sum, Max, Min.", - "type": "number" + "$ref": "CounterStructuredNameAndMetadata", + "description": "Counter structured name and metadata." }, "integerMean": { - "$ref": "IntegerMean", - "description": "Integer mean aggregation value for Mean." + "description": "Integer mean aggregation value for Mean.", + "$ref": "IntegerMean" }, - "cumulative": { - "description": "True if this counter 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 counter is reported\nas a delta.", - "type": "boolean" + "floatingPoint": { + "description": "Floating point value for Sum, Max, Min.", + "format": "double", + "type": "number" }, "internal": { "description": "Value for internally-defined counters used by the Dataflow service.", "type": "any" }, - "floatingPointMean": { - "description": "Floating point mean aggregation value for Mean.", - "$ref": "FloatingPointMean" - }, - "boolean": { - "description": "Boolean value for And, Or.", + "cumulative": { + "description": "True if this counter 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 counter is reported\nas a delta.", "type": "boolean" }, + "floatingPointMean": { + "$ref": "FloatingPointMean", + "description": "Floating point mean aggregation value for Mean." + }, + "boolean": { + "type": "boolean", + "description": "Boolean value for And, Or." + }, "nameAndKind": { - "$ref": "NameAndKind", - "description": "Counter name and aggregation type." + "description": "Counter name and aggregation type.", + "$ref": "NameAndKind" }, "distribution": { "$ref": "DistributionUpdate", "description": "Distribution data" }, "stringList": { - "description": "List of strings, for Set.", - "$ref": "StringList" + "$ref": "StringList", + "description": "List of strings, for Set." }, "shortId": { - "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.", + "format": "int64", "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" + "id": "CounterUpdate", + "description": "An update to a Counter sent from a worker." }, "SourceMetadata": { - "description": "Metadata about a Source useful for automatically optimizing\nand tuning the pipeline, etc.", "type": "object", "properties": { - "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" + "producesSortedKeys": { + "description": "Whether this source is known to produce key/value pairs with\nthe (encoded) keys in lexicographically sorted order.", + "type": "boolean" }, "infinite": { "description": "Specifies that the size of this source is known to be infinite\n(this is a streaming source).", "type": "boolean" }, - "producesSortedKeys": { - "description": "Whether this source is known to produce key/value pairs with\nthe (encoded) keys in lexicographically sorted order.", - "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" } }, - "id": "SourceMetadata" + "id": "SourceMetadata", + "description": "Metadata about a Source useful for automatically optimizing\nand tuning the pipeline, etc." }, "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" - }, "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." + "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.", + "$ref": "SplitInt64" }, "histogram": { "$ref": "Histogram", "description": "(Optional) Histogram of value counts for the distribution." }, "max": { - "description": "The maximum value present in the distribution.", + "$ref": "SplitInt64", + "description": "The maximum value present in the distribution." + }, + "count": { + "$ref": "SplitInt64", + "description": "The count of the number of elements present in the distribution." + }, + "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" } }, - "id": "DistributionUpdate" + "id": "DistributionUpdate", + "description": "A metric value representing a distribution.", + "type": "object" }, "WorkerHealthReportResponse": { "description": "WorkerHealthReportResponse contains information returned to the worker\nin response to a health ping.", "type": "object", "properties": { "reportInterval": { - "format": "google-duration", + "type": "string", "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" + "format": "google-duration" } }, "id": "WorkerHealthReportResponse" }, "SourceFork": { - "description": "DEPRECATED in favor of DynamicSourceSplit.", "type": "object", "properties": { "residual": { - "$ref": "SourceSplitShard", - "description": "DEPRECATED" + "description": "DEPRECATED", + "$ref": "SourceSplitShard" }, "residualSource": { - "description": "DEPRECATED", - "$ref": "DerivedSource" + "$ref": "DerivedSource", + "description": "DEPRECATED" }, "primary": { "$ref": "SourceSplitShard", "description": "DEPRECATED" }, "primarySource": { - "description": "DEPRECATED", - "$ref": "DerivedSource" + "$ref": "DerivedSource", + "description": "DEPRECATED" } }, - "id": "SourceFork" + "id": "SourceFork", + "description": "DEPRECATED in favor of DynamicSourceSplit." }, "WorkItemStatus": { - "description": "Conveys a worker's progress through the work described by a WorkItem.", - "type": "object", "properties": { + "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" @@ -3862,42 +2618,42 @@ "type": "boolean" }, "reportedProgress": { - "$ref": "ApproximateReportedProgress", - "description": "The worker's progress through this WorkItem." + "description": "The worker's progress through this WorkItem.", + "$ref": "ApproximateReportedProgress" }, "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.", + "format": "double", "type": "number" }, "counterUpdates": { "description": "Worker output counters for this WorkItem.", + "type": "array", "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.", + "type": "array", "items": { "$ref": "MetricUpdate" - }, - "type": "array" + } + }, + "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" + } }, "dynamicSourceSplit": { "$ref": "DynamicSourceSplit", @@ -3912,26 +2668,17 @@ "$ref": "ApproximateProgress" }, "requestedLeaseDuration": { - "format": "google-duration", + "type": "string", "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" + "format": "google-duration" } }, - "id": "WorkItemStatus" + "id": "WorkItemStatus", + "description": "Conveys a worker's progress through the work described by a WorkItem.", + "type": "object" }, "ComponentSource": { - "description": "Description of an interstitial value between transforms in an execution\nstage.", - "type": "object", "properties": { - "userName": { - "description": "Human-readable name for this transform; may be user or system generated.", - "type": "string" - }, "originalTransformOrCollection": { "description": "User name for the original user transform or collection with which this\nsource is most closely associated.", "type": "string" @@ -3939,75 +2686,81 @@ "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": "ComponentSource" + "id": "ComponentSource", + "description": "Description of an interstitial value between transforms in an execution\nstage.", + "type": "object" }, "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]", + "format": "int32", "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).", + "type": "array", "items": { "format": "int64", "type": "string" - }, - "type": "array" + } } }, - "id": "Histogram" + "id": "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" }, "WorkItemServiceState": { "description": "The Dataflow service's idea of the current state of a WorkItem\nbeing processed by a worker.", "type": "object", "properties": { + "splitRequest": { + "$ref": "ApproximateSplitRequest", + "description": "The progress point in the WorkItem where the Dataflow service\nsuggests that the worker truncate the task." + }, "reportStatusInterval": { - "format": "google-duration", + "type": "string", "description": "New recommended reporting interval.", - "type": "string" + "format": "google-duration" }, "suggestedStopPosition": { "$ref": "Position", "description": "Obsolete, always empty." }, "harnessData": { - "description": "Other data returned by the service, specific to the particular\nworker harness.", - "type": "object", "additionalProperties": { "description": "Properties of the object.", "type": "any" - } + }, + "description": "Other data returned by the service, specific to the particular\nworker harness.", + "type": "object" }, "leaseExpireTime": { - "format": "google-datetime", "description": "Time at which the current lease will expire.", + "format": "google-datetime", "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": { - "format": "int64", + "type": "string", "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" + "format": "int64" }, "suggestedStopPoint": { "$ref": "ApproximateProgress", "description": "DEPRECATED in favor of split_request." - }, - "splitRequest": { - "$ref": "ApproximateSplitRequest", - "description": "The progress point in the WorkItem where the Dataflow service\nsuggests that the worker truncate the task." } }, "id": "WorkItemServiceState" @@ -4016,14 +2769,14 @@ "description": "Identifies a metric, by describing the source which generated the\nmetric.", "type": "object", "properties": { - "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" }, + "name": { + "type": "string", + "description": "Worker-defined metric name." + }, "context": { "additionalProperties": { "type": "string" @@ -4039,8 +2792,8 @@ "type": "object", "properties": { "sink": { - "$ref": "Sink", - "description": "The sink to write the output value to." + "description": "The sink to write the output value to.", + "$ref": "Sink" }, "tag": { "description": "The id of the TupleTag the user code will tag the output value by.", @@ -4050,23 +2803,34 @@ "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" + "id": "JobExecutionStageInfo", + "description": "Contains information about how a particular\ngoogle.dataflow.v1beta3.Step will be executed." }, "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": { + "deliveryEndpoint": { + "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.", "type": "string" @@ -4074,78 +2838,30 @@ "deprecatedPersistentDirectory": { "description": "DEPRECATED. The location of the persistent state for this range, as a\npersistent directory in the worker local filesystem.", "type": "string" - }, - "deliveryEndpoint": { - "description": "The physical location of this range assignment to be used for\nstreaming computation cross-worker message delivery.", - "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": "KeyRangeLocation" + "id": "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." }, "SourceGetMetadataRequest": { "description": "A request to compute the SourceMetadata of a Source.", "type": "object", "properties": { "source": { - "description": "Specification of the source whose metadata should be computed.", - "$ref": "Source" + "$ref": "Source", + "description": "Specification of the source whose metadata should be computed." } }, "id": "SourceGetMetadataRequest" }, - "SeqMapTask": { - "description": "Describes a particular function to invoke.", - "type": "object", - "properties": { - "outputInfos": { - "description": "Information about each of the outputs.", - "items": { - "$ref": "SeqMapTaskOutputInfo" - }, - "type": "array" - }, - "inputs": { - "description": "Information about each of the inputs.", - "items": { - "$ref": "SideInputInfo" - }, - "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.", - "type": "any" - }, - "description": "The user function to invoke.", - "type": "object" - }, - "name": { - "description": "The user-provided name of the SeqDo operation.", - "type": "string" - } - }, - "id": "SeqMapTask" - }, "NameAndKind": { "description": "Basic metadata about a counter.", "type": "object", "properties": { + "name": { + "description": "Name of the counter.", + "type": "string" + }, "kind": { "description": "Counter aggregation kind.", "type": "string", @@ -4171,25 +2887,62 @@ "SET", "DISTRIBUTION" ] - }, - "name": { - "description": "Name of the counter.", - "type": "string" } }, "id": "NameAndKind" }, + "SeqMapTask": { + "description": "Describes a particular function to invoke.", + "type": "object", + "properties": { + "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" + }, + "stageName": { + "description": "System-defined name of the stage containing the SeqDo operation.\nUnique across the workflow.", + "type": "string" + }, + "userFn": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "The user function to invoke.", + "type": "object" + }, + "name": { + "description": "The user-provided name of the SeqDo operation.", + "type": "string" + }, + "outputInfos": { + "description": "Information about each of the outputs.", + "type": "array", + "items": { + "$ref": "SeqMapTaskOutputInfo" + } + } + }, + "id": "SeqMapTask" + }, "WorkerMessageCode": { "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": { "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", "additionalProperties": { "description": "Properties of the object.", "type": "any" - } + }, + "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" }, "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.", @@ -4213,20 +2966,20 @@ "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": { + "systemName": { + "type": "string", + "description": "System-defined name of this MapTask.\nUnique across the workflow." + }, "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" - }, "instructions": { "description": "The instructions in the MapTask.", + "type": "array", "items": { "$ref": "ParallelInstruction" - }, - "type": "array" + } } }, "id": "MapTask" @@ -4240,8 +2993,8 @@ "description": "The number of values being aggregated." }, "sum": { - "format": "double", "description": "The sum of all values being aggregated.", + "format": "double", "type": "number" } }, @@ -4253,10 +3006,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" @@ -4265,18 +3018,14 @@ "description": "An output of an instruction.", "type": "object", "properties": { - "originalName": { - "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.", + "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" @@ -4292,6 +3041,10 @@ "name": { "description": "The user-provided name of this output.", "type": "string" + }, + "originalName": { + "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" } }, "id": "InstructionOutput" @@ -4300,10 +3053,6 @@ "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" @@ -4322,11 +3071,16 @@ "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": { + "description": "The runtime environment for the job.", + "$ref": "RuntimeEnvironment" } }, "id": "CreateJobFromTemplateRequest" }, "IntegerMean": { + "id": "IntegerMean", "description": "A representation of an integer mean metric contribution.", "type": "object", "properties": { @@ -4335,54 +3089,51 @@ "$ref": "SplitInt64" }, "count": { - "$ref": "SplitInt64", - "description": "The number of values being aggregated." + "description": "The number of values being aggregated.", + "$ref": "SplitInt64" } - }, - "id": "IntegerMean" + } }, "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": { - "failedLocation": { - "description": "Zero or more messages describing locations that failed to respond.", + "jobs": { + "description": "A subset of the requested job information.", + "type": "array", "items": { - "$ref": "FailedLocation" - }, - "type": "array" + "$ref": "Job" + } }, "nextPageToken": { "description": "Set if there may be more results than fit in this response.", "type": "string" }, - "jobs": { - "description": "A subset of the requested job information.", + "failedLocation": { + "description": "Zero or more messages describing locations that failed to respond.", + "type": "array", "items": { - "$ref": "Job" - }, - "type": "array" + "$ref": "FailedLocation" + } } }, "id": "ListJobsResponse" }, "ComputationTopology": { - "description": "All configuration data for a particular Computation.", - "type": "object", "properties": { - "outputs": { - "description": "The outputs from the computation.", - "items": { - "$ref": "StreamLocation" - }, - "type": "array" - }, "stateFamilies": { "description": "The state family values.", + "type": "array", "items": { "$ref": "StateFamilyConfig" - }, - "type": "array" + } + }, + "outputs": { + "description": "The outputs from the computation.", + "type": "array", + "items": { + "$ref": "StreamLocation" + } }, "systemStageName": { "description": "The system stage name.", @@ -4394,37 +3145,35 @@ }, "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" + "id": "ComputationTopology", + "description": "All configuration data for a particular Computation.", + "type": "object" }, "RuntimeEnvironment": { + "id": "RuntimeEnvironment", "description": "The environment values to set at runtime.", "type": "object", "properties": { - "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.", "type": "string" }, "tempLocation": { - "description": "The Cloud Storage path to use for temporary files.\nMust be a valid Cloud Storage URL, beginning with `gs://`.", - "type": "string" + "type": "string", + "description": "The Cloud Storage path to use for temporary files.\nMust be a valid Cloud Storage URL, beginning with `gs://`." }, "bypassTempDirValidation": { "description": "Whether to bypass the safety checks for the job's temporary directory.\nUse with caution.", @@ -4437,13 +3186,26 @@ "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": { + "description": "The maximum number of Google Compute Engine instances to be made\navailable to your pipeline during execution, from 1 to 1000.", + "format": "int32", + "type": "integer" + } + } + }, + "MountedDataDisk": { + "properties": { + "dataDisk": { + "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": "RuntimeEnvironment" + "id": "MountedDataDisk", + "description": "Describes mounted data disk.", + "type": "object" }, "StreamingSideInputLocation": { - "description": "Identifies the location of a streaming side input.", - "type": "object", "properties": { "stateFamily": { "description": "Identifies the state family where this side input is stored.", @@ -4454,18 +3216,9 @@ "type": "string" } }, - "id": "StreamingSideInputLocation" - }, - "MountedDataDisk": { - "description": "Describes mounted data disk.", - "type": "object", - "properties": { - "dataDisk": { - "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" + "id": "StreamingSideInputLocation", + "description": "Identifies the location of a streaming side input.", + "type": "object" }, "LaunchTemplateResponse": { "description": "Response to the request to launch a template.", @@ -4478,101 +3231,11 @@ }, "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.", - "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": "What source to base the produced source on (if any).", - "type": "string" - }, - "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.", + "format": "google-datetime", "type": "string" }, "environment": { @@ -4588,10 +3251,14 @@ }, "stageStates": { "description": "This field may be mutated by the Cloud Dataflow service;\ncallers cannot mutate it.", + "type": "array", "items": { "$ref": "ExecutionStageState" - }, - "type": "array" + } + }, + "projectId": { + "description": "The ID of the Cloud Platform project that the job belongs to.", + "type": "string" }, "type": { "description": "The type of Cloud Dataflow job.", @@ -4607,10 +3274,6 @@ "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" @@ -4651,10 +3314,10 @@ }, "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}", + "type": "array", "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.", @@ -4664,17 +3327,17 @@ "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" }, + "steps": { + "description": "The top-level steps that constitute the entire job.", + "type": "array", + "items": { + "$ref": "Step" + } + }, "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" @@ -4682,27 +3345,102 @@ "executionInfo": { "$ref": "JobExecutionInfo", "description": "Deprecated." + }, + "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": { + "type": "string", + "description": "The location that contains this job." + }, + "currentStateTime": { + "description": "The timestamp associated with the current state.", + "format": "google-datetime", + "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" } }, - "id": "Job" + "id": "Job", + "description": "Defines a job to be run by the Cloud Dataflow service.", + "type": "object" }, - "SideInputId": { - "description": "Uniquely identifies a side input.", + "DynamicSourceSplit": { + "properties": { + "residual": { + "description": "Residual part (returned to the pool of work).\nSpecified relative to the previously-current source.", + "$ref": "DerivedSource" + }, + "primary": { + "description": "Primary part (continued to be processed by worker).\nSpecified relative to the previously-current source.\nBecomes current.", + "$ref": "DerivedSource" + } + }, + "id": "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" + }, + "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.", "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.", + "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": "What source to base the produced source on (if any).", "type": "string" + }, + "source": { + "$ref": "Source", + "description": "Specification of the source." } }, - "id": "SideInputId" + "id": "DerivedSource" }, "SourceOperationResponse": { + "id": "SourceOperationResponse", "description": "The result of a SourceOperationRequest, specified in\nReportWorkItemStatusRequest.source_operation when the work item\nis completed.", "type": "object", "properties": { @@ -4714,8 +3452,7 @@ "$ref": "SourceSplitResponse", "description": "A response to a request to split a source." } - }, - "id": "SourceOperationResponse" + } }, "SendDebugCaptureResponse": { "description": "Response to a send capture request.\nnothing", @@ -4724,30 +3461,30 @@ "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" + "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": { + "type": "object", "additionalProperties": { "description": "Properties of the object.", "type": "any" }, - "description": "How to interpret the source element(s) as a side input value.", - "type": "object" + "description": "How to interpret the source element(s) as a side input value." }, - "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" + "tag": { + "type": "string", + "description": "The id of the tag the user code will access this side input by;\nthis should correspond to the tag of some MultiOutputInfo." } }, - "id": "SideInputInfo" + "id": "SideInputInfo", + "description": "Information about a side input of a DoFn or an input of a SeqDoFn.", + "type": "object" }, "CounterStructuredNameAndMetadata": { "description": "A single message which encapsulates structured name and metadata for a given\ncounter.", @@ -4758,8 +3495,8 @@ "description": "Structured name of the counter." }, "metadata": { - "$ref": "CounterMetadata", - "description": "Metadata associated with a counter" + "description": "Metadata associated with a counter", + "$ref": "CounterMetadata" } }, "id": "CounterStructuredNameAndMetadata" @@ -4773,8 +3510,8 @@ "$ref": "Position" }, "index": { - "format": "int32", "description": "Index of the inner source.", + "format": "int32", "type": "integer" } }, @@ -4784,13 +3521,13 @@ "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" + "$ref": "Sink", + "description": "The sink to write to." + }, + "input": { + "description": "The input.", + "$ref": "InstructionInput" } }, "id": "WriteInstruction" @@ -4801,10 +3538,10 @@ "properties": { "rangeAssignments": { "description": "Data disk assignments for ranges from this computation.", + "type": "array", "items": { "$ref": "KeyRangeDataDiskAssignment" - }, - "type": "array" + } }, "computationId": { "description": "The ID of the computation.", @@ -4818,7 +3555,6 @@ "type": "object", "properties": { "algorithm": { - "description": "The algorithm to use for autoscaling.", "type": "string", "enumDescriptions": [ "The algorithm is unknown, or unspecified.", @@ -4829,11 +3565,12 @@ "AUTOSCALING_ALGORITHM_UNKNOWN", "AUTOSCALING_ALGORITHM_NONE", "AUTOSCALING_ALGORITHM_BASIC" - ] + ], + "description": "The algorithm to use for autoscaling." }, "maxNumWorkers": { - "format": "int32", "description": "The maximum number of workers to cap scaling at.", + "format": "int32", "type": "integer" } }, @@ -4843,12 +3580,23 @@ "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.", + "outputSource": { + "type": "array", "items": { "$ref": "StageSource" }, - "type": "array" + "description": "Output sources for this stage." + }, + "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.", @@ -4856,21 +3604,19 @@ }, "componentTransform": { "description": "Transforms that comprise this execution stage.", + "type": "array", "items": { "$ref": "ComponentTransform" - }, - "type": "array" + } }, "componentSource": { "description": "Collections produced and consumed by component transforms of this stage.", + "type": "array", "items": { "$ref": "ComponentSource" - }, - "type": "array" + } }, "kind": { - "description": "Type of tranform this stage is executing.", - "type": "string", "enumDescriptions": [ "Unrecognized transform type.", "ParDo transform.", @@ -4892,44 +3638,39 @@ "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.", + ], + "description": "Type of tranform this stage is executing.", "type": "string" } }, "id": "ExecutionStageSummary" }, "SendWorkerMessagesRequest": { + "id": "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" - }, - "workerMessages": { - "description": "The WorkerMessages to send.", - "items": { - "$ref": "WorkerMessage" - }, - "type": "array" } - }, - "id": "SendWorkerMessagesRequest" + } }, "SourceSplitShard": { "description": "DEPRECATED in favor of DerivedSource.", "type": "object", "properties": { + "source": { + "$ref": "Source", + "description": "DEPRECATED" + }, "derivationMode": { "description": "DEPRECATED", "type": "string", @@ -4945,40 +3686,70 @@ "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": { + "rate": { + "description": "Average CPU utilization rate (% non-idle cpu / second) since previous\nsample.", + "format": "double", + "type": "number" + }, "timestamp": { - "format": "google-datetime", "description": "Timestamp of the measurement.", + "format": "google-datetime", "type": "string" }, "totalMs": { - "format": "uint64", "description": "Total active CPU time across all cores (ie., non-idle) in milliseconds\nsince start-up.", + "format": "uint64", "type": "string" - }, - "rate": { - "format": "double", - "description": "Average CPU utilization rate (% non-idle cpu / second) since previous\nsample.", - "type": "number" } }, - "id": "CPUTime" + "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": { + "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" + } + }, + "internalExperiments": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Experimental settings.", + "type": "object" + }, + "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" + } + }, "serviceAccountEmail": { "description": "Identity to run virtual machines as. Defaults to the default account.", "type": "string" @@ -5006,84 +3777,1310 @@ "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": { + "computationRanges": { + "description": "Contains ranges of a streaming computation this task should apply to.", + "type": "array", + "items": { + "$ref": "StreamingComputationRanges" + } + }, + "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)." - ], - "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" + "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": { + "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" + }, + "componentId": { + "description": "The internal component id for which debug information is sent.", + "type": "string" + } + }, + "id": "SendDebugCaptureRequest" + }, + "GetDebugConfigResponse": { + "properties": { + "config": { + "description": "The encoded debug configuration for the requested component.", + "type": "string" + } + }, + "id": "GetDebugConfigResponse", + "description": "Response to a get debug configuration request.", + "type": "object" + }, + "ComponentTransform": { + "description": "Description of a transform executed as part of an execution stage.", + "type": "object", + "properties": { + "originalTransform": { + "description": "User name for the original user transform with which this transform is\nmost closely associated.", + "type": "string" + }, + "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" + }, + "StreamingSetupTask": { + "description": "A task which initializes part of a streaming Dataflow job.", + "type": "object", + "properties": { + "streamingComputationTopology": { + "description": "The global topology of the streaming Dataflow job.", + "$ref": "TopologyConfig" + }, + "workerHarnessPort": { + "description": "The TCP port used by the worker to communicate with the Dataflow\nworker harness.", + "format": "int32", + "type": "integer" + }, + "drain": { + "description": "The user has requested drain.", + "type": "boolean" + }, + "receiveWorkPort": { + "type": "integer", + "description": "The TCP port on which the worker should listen for messages from\nother streaming computation workers.", + "format": "int32" + } + }, + "id": "StreamingSetupTask" + }, + "PubsubLocation": { + "description": "Identifies a pubsub location to use for transferring data into or\nout of a streaming Dataflow job.", + "type": "object", + "properties": { + "withAttributes": { + "description": "If true, then the client has requested to get pubsub attributes.", + "type": "boolean" + }, + "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" + }, + "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" + }, + "dropLateData": { + "description": "Indicates whether the pipeline allows late-arriving data.", + "type": "boolean" + }, + "trackingSubscription": { + "type": "string", + "description": "If set, specifies the pubsub subscription that will be used for tracking\ncustom time timestamps for watermark estimation." + } + }, + "id": "PubsubLocation" + }, + "WorkerHealthReport": { + "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": { + "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", + "items": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "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." + }, + "vmStartupTime": { + "type": "string", + "description": "The time the VM was booted.", + "format": "google-datetime" + } + }, + "id": "WorkerHealthReport" + }, + "JobMessage": { + "description": "A particular message pertaining to a Dataflow job.", + "type": "object", + "properties": { + "id": { + "description": "Deprecated.", + "type": "string" + }, + "messageText": { + "type": "string", + "description": "The text of the message." + }, + "messageImportance": { + "enum": [ + "JOB_MESSAGE_IMPORTANCE_UNKNOWN", + "JOB_MESSAGE_DEBUG", + "JOB_MESSAGE_DETAILED", + "JOB_MESSAGE_BASIC", + "JOB_MESSAGE_WARNING", + "JOB_MESSAGE_ERROR" + ], + "description": "Importance level of the message.", + "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.", + "The message is at the 'detailed' level: somewhat verbose, but\npotentially useful to users. Typically, Dataflow pipeline\nrunners do not display log messages at this level by default.\nThese messages are displayed by default in the Dataflow\nmonitoring UI.", + "The message is at the 'basic' level: useful for keeping\ntrack of the execution of a Dataflow pipeline. Typically,\nDataflow pipeline runners display log messages at this level by\ndefault, and these messages are displayed by default in the\nDataflow monitoring UI.", + "The message is at the 'warning' level: indicating a condition\npertaining to a job which may require human intervention.\nTypically, Dataflow pipeline runners display log messages at this\nlevel by default, and these messages are displayed by default in\nthe Dataflow monitoring UI.", + "The message is at the 'error' level: indicating a condition\npreventing a job from succeeding. Typically, Dataflow pipeline\nrunners display log messages at this level by default, and these\nmessages are displayed by default in the Dataflow monitoring UI." + ] + }, + "time": { + "description": "The timestamp of the message.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "JobMessage" + }, + "ParameterMetadata": { + "type": "object", + "properties": { + "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" + }, + "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.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "ParameterMetadata", + "description": "Metadata for a specific parameter." + }, + "MultiOutputInfo": { + "type": "object", + "properties": { + "tag": { + "description": "The id of the tag the user code will emit to this output by; this\nshould correspond to the tag of some SideInputInfo.", + "type": "string" + } + }, + "id": "MultiOutputInfo", + "description": "Information about an output of a multi-output DoFn." + }, + "SourceSplitRequest": { + "properties": { + "source": { + "$ref": "Source", + "description": "Specification of the source to be split." + }, + "options": { + "description": "Hints for tuning the splitting process.", + "$ref": "SourceSplitOptions" + } + }, + "id": "SourceSplitRequest", + "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" + }, + "SourceGetMetadataResponse": { + "type": "object", + "properties": { + "metadata": { + "description": "The computed metadata.", + "$ref": "SourceMetadata" + } + }, + "id": "SourceGetMetadataResponse", + "description": "The result of a SourceGetMetadataOperation." + }, + "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", + "type": "integer" + }, + "command": { + "description": "The shell command to run.", + "type": "string" + } + }, + "id": "ShellTask" + }, + "MetricShortId": { + "description": "The metric short id is returned to the user alongside an offset into\nReportWorkItemStatusRequest", + "type": "object", + "properties": { + "shortId": { + "description": "The service-generated short identifier for the metric.", + "format": "int64", + "type": "string" + }, + "metricIndex": { + "description": "The index of the corresponding metric in\nthe ReportWorkItemStatusRequest. Required.", + "format": "int32", + "type": "integer" + } + }, + "id": "MetricShortId" + }, + "AutoscalingEvent": { + "id": "AutoscalingEvent", + "description": "A structured message reporting an autoscaling decision made by the Dataflow\nservice.", + "type": "object", + "properties": { + "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": { + "type": "string", + "description": "The time this event was emitted to indicate a new target or current\nnum_workers value.", + "format": "google-datetime" + }, + "targetNumWorkers": { + "description": "The target number of workers the worker pool wants to resize to use.", + "format": "int64", + "type": "string" + }, + "eventType": { + "enumDescriptions": [ + "Default type for the enum. Value should never be returned.", + "The TARGET_NUM_WORKERS_CHANGED type should be used when the target\nworker pool size has changed at the start of an actuation. An event\nshould always be specified as TARGET_NUM_WORKERS_CHANGED if it reflects\na change in the target_num_workers.", + "The CURRENT_NUM_WORKERS_CHANGED type should be used when actual worker\npool size has been changed, but the target_num_workers has not changed.", + "The ACTUATION_FAILURE type should be used when we want to report\nan error to the user indicating why the current number of workers\nin the pool could not be changed.\nDisplayed in the current status and history widgets.", + "Used when we want to report to the user a reason why we are\nnot currently adjusting the number of workers.\nShould specify both target_num_workers, current_num_workers and a\ndecision_message." + ], + "enum": [ + "TYPE_UNKNOWN", + "TARGET_NUM_WORKERS_CHANGED", + "CURRENT_NUM_WORKERS_CHANGED", + "ACTUATION_FAILURE", + "NO_CHANGE" + ], + "description": "The type of autoscaling event to report.", + "type": "string" + }, + "currentNumWorkers": { + "description": "The current number of workers the job has.", + "format": "int64", + "type": "string" + } + } + }, + "TaskRunnerSettings": { + "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/\"", + "type": "string" + }, + "logToSerialconsole": { + "description": "Whether to send taskrunner log info to Google Compute Engine VM serial\nconsole.", + "type": "boolean" + }, + "continueOnException": { + "description": "Whether to continue taskrunner if an exception is hit.", + "type": "boolean" + }, + "parallelWorkerSettings": { + "$ref": "WorkerSettings", + "description": "The settings to pass to the parallel worker harness." + }, + "taskUser": { + "description": "The UNIX user ID on the worker VM to use for tasks launched by\ntaskrunner; e.g. \"root\".", + "type": "string" + }, + "vmId": { + "description": "The ID string of the VM.", + "type": "string" + }, + "alsologtostderr": { + "description": "Whether to also send taskrunner log info to stderr.", + "type": "boolean" + }, + "taskGroup": { + "description": "The UNIX group ID on the worker VM to use for tasks launched by\ntaskrunner; e.g. \"wheel\".", + "type": "string" + }, + "harnessCommand": { + "description": "The command to launch the worker harness.", + "type": "string" + }, + "logDir": { + "description": "The directory on the VM to store logs.", + "type": "string" + }, + "dataflowApiVersion": { + "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" + } + }, + "streamingWorkerMainClass": { + "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": { + "description": "The file to store the workflow in.", + "type": "string" + }, + "baseTaskDir": { + "description": "The location on the worker for task-specific subdirectories.", + "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" + }, + "languageHint": { + "description": "The suggested backend language.", + "type": "string" + }, + "commandlinesFileName": { + "description": "The file to store preprocessing commands in.", + "type": "string" + } + }, + "id": "TaskRunnerSettings", + "description": "Taskrunner configuration settings." + }, + "Position": { + "type": "object", + "properties": { + "recordIndex": { + "description": "Position is a record index.", + "format": "int64", + "type": "string" + }, + "shufflePosition": { + "description": "CloudPosition is a base64 encoded BatchShufflePosition (with FIXED\nsharding).", + "type": "string" + }, + "concatPosition": { + "$ref": "ConcatPosition", + "description": "CloudPosition is a concat position." + }, + "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.", + "type": "string" + } + }, + "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." + }, + "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": { + "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.", + "$ref": "SourceMetadata" + }, + "baseSpecs": { + "type": "array", + "items": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "type": "object" + }, + "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)." + } + }, + "id": "Source" + }, + "SplitInt64": { + "description": "A representation of an int64, n, that is immune to precision loss when\nencoded in JSON.", + "type": "object", + "properties": { + "lowBits": { + "description": "The low order bits: n & 0xffffffff.", + "format": "uint32", + "type": "integer" + }, + "highBits": { + "description": "The high order bits, including the sign: n \u003e\u003e 32.", + "format": "int32", + "type": "integer" + } + }, + "id": "SplitInt64" + }, + "WorkerPool": { + "type": "object", + "properties": { + "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": { + "description": "The kind of the worker pool; currently only `harness` and `shuffle`\nare supported.", + "type": "string" + }, + "dataDisks": { + "type": "array", + "items": { + "$ref": "Disk" + }, + "description": "Data disks that are used by a VM in this workflow." + }, + "subnetwork": { + "description": "Subnetwork to which VMs will be assigned, if desired. Expected to be of\nthe form \"regions/REGION/subnetworks/SUBNETWORK\".", + "type": "string" + }, + "ipConfiguration": { + "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.", + "type": "string" + }, + "taskrunnerSettings": { + "$ref": "TaskRunnerSettings", + "description": "Settings passed through to Google Compute Engine workers when\nusing the standard Dataflow task runner. Users should ignore\nthis field." + }, + "autoscalingSettings": { + "description": "Settings for autoscaling of this WorkerPool.", + "$ref": "AutoscalingSettings" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "Metadata to set on the Google Compute Engine VMs.", + "type": "object" + }, + "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" + ] + }, + "network": { + "description": "Network to which VMs will be assigned. If empty or unspecified,\nthe service will use the network \"default\".", + "type": "string" + }, + "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": { + "description": "Fully qualified source image for disks.", + "type": "string" + }, + "packages": { + "type": "array", + "items": { + "$ref": "Package" + }, + "description": "Packages to be installed on workers." + }, + "teardownPolicy": { + "enum": [ + "TEARDOWN_POLICY_UNKNOWN", + "TEARDOWN_ALWAYS", + "TEARDOWN_ON_SUCCESS", + "TEARDOWN_NEVER" + ], + "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.", + "type": "string", + "enumDescriptions": [ + "The teardown policy isn't specified, or is unknown.", + "Always teardown the resource.", + "Teardown the resource on success. This is useful for debugging\nfailures.", + "Never teardown the resource. This is useful for debugging and\ndevelopment." + ] + }, + "onHostMaintenance": { + "description": "The action to take on host maintenance, as defined by the Google\nCompute Engine API.", + "type": "string" + }, + "poolArgs": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Extra arguments for this worker pool.", + "type": "object" + }, + "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", + "type": "integer" + } + }, + "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." + }, + "SourceOperationRequest": { + "description": "A work item that represents the different operations that can be\nperformed on a user-defined Source specification.", + "type": "object", + "properties": { + "name": { + "description": "User-provided name of the Read instruction for this source.", + "type": "string" + }, + "originalName": { + "description": "System-defined name for the Read instruction for this source\nin the original workflow graph.", + "type": "string" + }, + "systemName": { + "description": "System-defined name of the Read instruction for this source.\nUnique across the workflow.", + "type": "string" + }, + "stageName": { + "description": "System-defined name of the stage containing the source operation.\nUnique across the workflow.", + "type": "string" + }, + "getMetadata": { + "description": "Information about a request to get metadata about a source.", + "$ref": "SourceGetMetadataRequest" + }, + "split": { + "description": "Information about a request to split a source.", + "$ref": "SourceSplitRequest" + } + }, + "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": { + "$ref": "StreamingComputationTask", + "description": "Additional information for StreamingComputationTask WorkItems." + }, + "shellTask": { + "$ref": "ShellTask", + "description": "Additional information for ShellTask WorkItems." + }, + "jobId": { + "description": "Identifies the workflow job this WorkItem belongs to.", + "type": "string" + }, + "id": { + "description": "Identifies this WorkItem.", + "format": "int64", + "type": "string" + }, + "configuration": { + "description": "Work item-specific configuration as an opaque blob.", + "type": "string" + }, + "mapTask": { + "description": "Additional information for MapTask WorkItems.", + "$ref": "MapTask" + }, + "seqMapTask": { + "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" + } + }, + "projectId": { + "description": "Identifies the cloud project this WorkItem belongs to.", + "type": "string" + }, + "sourceOperationTask": { + "$ref": "SourceOperationRequest", + "description": "Additional information for source operation WorkItems." + }, + "streamingSetupTask": { + "description": "Additional information for StreamingSetupTask WorkItems.", + "$ref": "StreamingSetupTask" + }, + "reportStatusInterval": { + "description": "Recommended reporting interval.", + "format": "google-duration", + "type": "string" + }, + "streamingConfigTask": { + "description": "Additional information for StreamingConfigTask WorkItems.", + "$ref": "StreamingConfigTask" + }, + "leaseExpireTime": { + "description": "Time when the lease on this Work will expire.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "WorkItem" + }, + "StructuredMessage": { + "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": { + "messageText": { + "description": "Human-readable version of message.", + "type": "string" + }, + "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" + } + }, + "id": "StructuredMessage" + }, + "ReportedParallelism": { + "description": "Represents the level of parallelism in a WorkItem's input,\nreported by the worker.", + "type": "object", + "properties": { + "isInfinite": { + "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", + "type": "number" + } + }, + "id": "ReportedParallelism" + }, + "ResourceUtilizationReport": { + "description": "Worker metrics exported from workers. This contains resource utilization\nmetrics accumulated from a variety of sources. For more information, see\ngo/df-resource-signals.", + "type": "object", + "properties": { + "cpuTime": { + "type": "array", + "items": { + "$ref": "CPUTime" + }, + "description": "CPU utilization samples." + } + }, + "id": "ResourceUtilizationReport" + }, + "TopologyConfig": { + "properties": { + "userStageToComputationNameMap": { + "additionalProperties": { + "type": "string" + }, + "description": "Maps user stage names to stable computation names.", + "type": "object" + }, + "computations": { + "description": "The computations associated with a streaming Dataflow job.", + "type": "array", + "items": { + "$ref": "ComputationTopology" + } + }, + "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" + }, + "forwardingKeyBits": { + "description": "The size (in bits) of keys that will be assigned to source messages.", + "format": "int32", + "type": "integer" + } + }, + "id": "TopologyConfig", + "description": "Global topology of the streaming Dataflow job, including all\ncomputations and their sharded locations.", + "type": "object" + }, + "SourceSplitOptions": { + "properties": { + "desiredShardSizeBytes": { + "description": "DEPRECATED in favor of desired_bundle_size_bytes.", + "format": "int64", + "type": "string" + }, + "desiredBundleSizeBytes": { + "type": "string", + "description": "The source should be split into a set of bundles where the estimated size\nof each is approximately this many bytes.", + "format": "int64" + } + }, + "id": "SourceSplitOptions", + "description": "Hints for splitting a Source into bundles (parts for parallel\nprocessing) using SourceSplitRequest.", + "type": "object" + }, + "ReadInstruction": { + "id": "ReadInstruction", + "description": "An instruction that reads records.\nTakes no inputs, produces one output.", + "type": "object", + "properties": { + "source": { + "description": "The source to read from.", + "$ref": "Source" + } + } + }, + "WorkerSettings": { + "description": "Provides data to pass through to the worker harness.", + "type": "object", + "properties": { + "servicePath": { + "description": "The Cloud Dataflow service path relative to the root URL, for example,\n\"dataflow/v1b3/projects\".", + "type": "string" + }, + "shuffleServicePath": { + "description": "The Shuffle service path relative to the root URL, for example,\n\"shuffle/v1beta1\".", + "type": "string" + }, + "workerId": { + "description": "The ID of the worker running this pipeline.", + "type": "string" + }, + "tempStoragePrefix": { + "description": "The prefix of the resources the system should use for temporary\nstorage.\n\nThe supported resource type is:\n\nGoogle Cloud Storage:\n\n storage.googleapis.com/{bucket}/{object}\n bucket.storage.googleapis.com/{object}", + "type": "string" + }, + "baseUrl": { + "type": "string", + "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/\"" + }, + "reportingEnabled": { + "type": "boolean", + "description": "Whether to send work progress updates to the service." + } + }, + "id": "WorkerSettings" + }, + "StreamingStageLocation": { + "description": "Identifies the location of a streaming computation stage, for\nstage-to-stage communication.", + "type": "object", + "properties": { + "streamId": { + "description": "Identifies the particular stream within the streaming Dataflow\njob.", + "type": "string" + } + }, + "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\" }.", + "type": "array", + "items": { + "type": "string" + } + }, + "vmInstance": { + "description": "VM instance name the data disks mounted to, for example\n\"myproject-1014-104817-4c2-harness-0\".", + "type": "string" + } + }, + "id": "DataDiskAssignment" + }, + "ApproximateSplitRequest": { + "id": "ApproximateSplitRequest", + "description": "A suggestion by the service to the worker to dynamically split the WorkItem.", + "type": "object", + "properties": { + "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", + "type": "number" + }, + "position": { + "$ref": "Position", + "description": "A Position at which to split the work item." + } + } + }, + "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" + }, + "ExecutionStageState": { + "description": "A message describing the state of a particular execution stage.", + "type": "object", + "properties": { + "executionStageName": { + "type": "string", + "description": "The name of the execution stage." + }, + "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": [ + "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'." + ] + } + }, + "id": "ExecutionStageState" + }, + "StreamLocation": { + "id": "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": { + "$ref": "CustomSourceLocation", + "description": "The stream is a custom source." + }, + "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." + }, + "sideInputLocation": { + "$ref": "StreamingSideInputLocation", + "description": "The stream is a streaming side input." + } + } + }, + "SendWorkerMessagesResponse": { + "description": "The response to the worker messages.", + "type": "object", + "properties": { + "workerMessageResponses": { + "description": "The servers response to the worker messages.", + "type": "array", + "items": { + "$ref": "WorkerMessageResponse" + } + } + }, + "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" + }, + "instructions": { + "description": "Instructions that comprise the computation.", + "type": "array", + "items": { + "$ref": "ParallelInstruction" + } + } + }, + "id": "StreamingComputationConfig" + }, + "TransformSummary": { + "id": "TransformSummary", + "description": "Description of the type, names/ids, and input/outputs for a transform.", + "type": "object", + "properties": { + "name": { + "description": "User provided name for this transform instance.", + "type": "string" + }, + "id": { + "description": "SDK generated id of this transform instance.", + "type": "string" + }, + "displayData": { + "description": "Transform-specific display data.", + "type": "array", + "items": { + "$ref": "DisplayData" + } + }, + "outputCollectionName": { + "description": "User names for all collection outputs to this transform.", + "type": "array", + "items": { + "type": "string" + } + }, + "kind": { + "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" + ], + "description": "Type of transform." + }, + "inputCollectionName": { + "description": "User names for all collection inputs to this transform.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "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" + } + } + }, + "id": "LeaseWorkItemResponse" + }, + "LaunchTemplateParameters": { + "id": "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": { + "$ref": "RuntimeEnvironment", + "description": "The runtime environment for the job." + }, + "parameters": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The runtime parameters to pass to the job." + } + } + }, + "Sink": { + "description": "A sink that records can be encoded and written to.", + "type": "object", + "properties": { + "codec": { + "description": "The codec to use to encode data written to the sink.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + }, + "spec": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "The sink to write to, plus its parameters.", + "type": "object" + } + }, + "id": "Sink" + }, + "FlattenInstruction": { + "properties": { + "inputs": { + "type": "array", + "items": { + "$ref": "InstructionInput" + }, + "description": "Describes the inputs to the flatten instruction." + } + }, + "id": "FlattenInstruction", + "description": "An instruction that copies its inputs (zero or more) to its (single) output.", + "type": "object" + }, + "PartialGroupByKeyInstruction": { + "description": "An instruction that does a partial group-by-key.\nOne input and one output.", + "type": "object", + "properties": { + "inputElementCodec": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "The codec to use for interpreting an element in the input PTable." + }, + "valueCombiningFn": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "The value combining function to invoke.", + "type": "object" + }, + "originalCombineValuesInputStoreName": { + "type": "string", + "description": "If this instruction includes a combining function this is the name of the\nintermediate store between the GBK and the CombineValues." + }, + "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": { + "$ref": "InstructionInput", + "description": "Describes the input to the partial group-by-key instruction." + } + }, + "id": "PartialGroupByKeyInstruction" } }, "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": "v1b3", "baseUrl": "https://dataflow.googleapis.com/", @@ -5104,5 +5101,9 @@ } } } - } + }, + "kind": "discovery#restDescription", + "description": "Manages Google Cloud Dataflow projects on Google Cloud Platform.", + "servicePath": "", + "rootUrl": "https://dataflow.googleapis.com/" } diff --git a/etc/api/dataproc/v1/dataproc-api.json b/etc/api/dataproc/v1/dataproc-api.json index f75e6e7251..c36fcd7bf0 100644 --- a/etc/api/dataproc/v1/dataproc-api.json +++ b/etc/api/dataproc/v1/dataproc-api.json @@ -1,8 +1,11 @@ { + "ownerDomain": "google.com", + "name": "dataproc", "batchPath": "batch", + "revision": "20171207", "documentationLink": "https://cloud.google.com/dataproc/", "id": "dataproc:v1", - "revision": "20170919", + "fullyEncodeReservedExpansion": true, "title": "Google Cloud Dataproc API", "discoveryVersion": "v1", "ownerName": "Google", @@ -14,12 +17,12 @@ "clusters": { "methods": { "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.", + "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", "request": { "$ref": "DiagnoseClusterRequest" }, + "description": "Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation.", "httpMethod": "POST", "parameterOrder": [ "projectId", @@ -31,21 +34,21 @@ }, "parameters": { "region": { + "location": "path", "description": "Required. The Cloud Dataproc region in which to handle the request.", - "type": "string", "required": true, - "location": "path" + "type": "string" }, "clusterName": { + "location": "path", "description": "Required. The cluster name.", - "type": "string", "required": true, - "location": "path" + "type": "string" }, "projectId": { "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", - "type": "string", "required": true, + "type": "string", "location": "path" } }, @@ -55,6 +58,33 @@ "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose" }, "delete": { + "parameters": { + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that 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" + }, + "clusterName": { + "description": "Required. The cluster name.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "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" }, @@ -63,36 +93,10 @@ "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." + "httpMethod": "DELETE" }, "list": { + "description": "Lists all regions/{region}/clusters in a project.", "response": { "$ref": "ListClustersResponse" }, @@ -105,61 +109,52 @@ "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": { "location": "query", "description": "Optional. The standard List page token.", "type": "string" }, "pageSize": { - "format": "int32", "description": "Optional. The standard List page size.", + "format": "int32", "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, + "type": "string", "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." + "id": "dataproc.projects.regions.clusters.list" }, "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 + "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" } }, "scopes": [ @@ -168,50 +163,26 @@ "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", + }, + "description": "Creates a cluster in a project.", "response": { - "$ref": "Cluster" + "$ref": "Operation" }, "parameterOrder": [ "projectId", - "region", - "clusterName" + "region" ], - "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" + "httpMethod": "POST" }, "patch": { + "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "id": "dataproc.projects.regions.clusters.patch", + "request": { + "$ref": "Cluster" + }, + "description": "Updates a cluster in a project.", "response": { "$ref": "Operation" }, @@ -222,74 +193,138 @@ ], "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", + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", + "required": true, "type": "string", - "location": "query" + "location": "path" }, "region": { - "location": "path", "description": "Required. The Cloud Dataproc region in which to handle the request.", + "required": true, "type": "string", - "required": true + "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" }, "clusterName": { "location": "path", "description": "Required. The cluster name.", - "type": "string", - "required": true + "required": true, + "type": "string" }, - "projectId": { - "location": "path", - "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", + "gracefulDecommissionTimeout": { + "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.", + "format": "google-duration", "type": "string", - "required": true + "location": "query" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], + "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}" + }, + "get": { "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": { + "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": { + "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" + }, + "clusterName": { + "location": "path", + "description": "Required. The cluster name.", + "required": true, + "type": "string" + } } } } }, "operations": { "methods": { - "get": { + "cancel": { + "id": "dataproc.projects.regions.operations.cancel", + "path": "v1/{+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.", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, "parameters": { "name": { - "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", - "location": "path", - "description": "The name of the operation resource.", + "description": "The name of the operation resource to be cancelled.", + "required": true, "type": "string", - "required": true + "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", + "location": "path" } }, "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.", + "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel" + }, + "delete": { "response": { - "$ref": "Operation" + "$ref": "Empty" }, "parameterOrder": [ "name" ], - "httpMethod": "GET" + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be deleted.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", + "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." }, "list": { - "id": "dataproc.projects.regions.operations.list", + "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations", "path": "v1/{+name}", + "id": "dataproc.projects.regions.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 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" @@ -302,137 +337,238 @@ "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" }, + "name": { + "description": "The name of the operation's parent resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+/operations$", + "location": "path" + }, "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 + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "type": "integer", + "location": "query" } - }, - "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" - ], + "get": { "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." + "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.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", + "location": "path" + } + } } } }, "jobs": { "methods": { - "patch": { + "submit": { + "parameters": { + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "required": true, + "type": "string" + }, + "region": { + "required": true, + "type": "string", + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "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.", + "response": { "$ref": "Job" }, - "description": "Updates a job in a project.", - "httpMethod": "PATCH", + "parameterOrder": [ + "projectId", + "region" + ], + "httpMethod": "POST" + }, + "delete": { + "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.", + "response": { + "$ref": "Empty" + }, "parameterOrder": [ "projectId", "region", "jobId" ], - "response": { - "$ref": "Job" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], + "httpMethod": "DELETE", "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.", + "required": true, "type": "string", - "required": true + "location": "path" + }, + "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.", - "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" + "type": "string" } }, + "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.patch" + "id": "dataproc.projects.regions.jobs.delete" + }, + "list": { + "description": "Lists regions/{region}/jobs in a project.", + "httpMethod": "GET", + "response": { + "$ref": "ListJobsResponse" + }, + "parameterOrder": [ + "projectId", + "region" + ], + "parameters": { + "filter": { + "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 NON_ACTIVE. 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", + "location": "query" + }, + "jobStateMatcher": { + "location": "query", + "enum": [ + "ALL", + "ACTIVE", + "NON_ACTIVE" + ], + "description": "Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored.", + "type": "string" + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "Optional. The page token, returned by a previous call, to request the next page of results." + }, + "pageSize": { + "location": "query", + "description": "Optional. The number of results to return in each response.", + "format": "int32", + "type": "integer" + }, + "region": { + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "required": true, + "type": "string", + "location": "path" + }, + "clusterName": { + "description": "Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster.", + "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" + } + }, + "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" + }, + "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", + "parameters": { + "projectId": { + "required": true, + "type": "string", + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to." + }, + "jobId": { + "description": "Required. The job ID.", + "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" + } + }, + "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" }, "get": { - "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", - "id": "dataproc.projects.regions.jobs.get", "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", + "id": "dataproc.projects.regions.jobs.get", "description": "Gets the resource representation for a job in a project.", "response": { "$ref": "Job" @@ -448,199 +584,72 @@ ], "parameters": { "region": { - "type": "string", + "location": "path", + "description": "Required. The Cloud Dataproc region in which to handle the request.", "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 + "type": "string" }, "projectId": { "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", - "type": "string", "required": true, + "type": "string", + "location": "path" + }, + "jobId": { + "description": "Required. The job ID.", + "required": true, + "type": "string", "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", + "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}" + }, + "patch": { + "httpMethod": "PATCH", "parameterOrder": [ "projectId", - "region" + "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" + }, + "updateMask": { + "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", + "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" + } + }, "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" - }, - "projectId": { - "type": "string", - "required": true, - "location": "path", - "description": "Required. The ID of the Google Cloud Platform project that the job belongs to." - } - } - }, - "delete": { "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", - "id": "dataproc.projects.regions.jobs.delete", + "id": "dataproc.projects.regions.jobs.patch", "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" - }, - "parameterOrder": [ - "projectId", - "region", - "jobId" - ], - "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.", - "type": "string", - "required": true, - "location": "path" - }, - "region": { - "description": "Required. The Cloud Dataproc region in which to handle the request.", - "type": "string", - "required": true, - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "list": { - "response": { - "$ref": "ListJobsResponse" - }, - "parameterOrder": [ - "projectId", - "region" - ], - "httpMethod": "GET", - "parameters": { - "filter": { - "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", - "location": "query" - }, - "jobStateMatcher": { - "description": "Optional. Specifies enumerated categories of jobs to list (default = match ALL jobs).", - "type": "string", - "location": "query", - "enum": [ - "ALL", - "ACTIVE", - "NON_ACTIVE" - ] - }, - "pageToken": { - "description": "Optional. The page token, returned by a previous call, to request the next page of results.", - "type": "string", - "location": "query" - }, - "pageSize": { - "location": "query", - "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.", - "type": "string", - "required": true - }, - "clusterName": { - "description": "Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster.", - "type": "string", - "location": "query" - }, - "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": "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." - }, - "cancel": { - "response": { + "request": { "$ref": "Job" }, - "parameterOrder": [ - "projectId", - "region", - "jobId" - ], - "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.", - "type": "string", - "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/{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." + "description": "Updates a job in a project." } } } @@ -650,9 +659,62 @@ } }, "parameters": { + "pp": { + "description": "Pretty-print response.", + "type": "boolean", + "default": "true", + "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.", + "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" + }, + "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": { - "description": "Data format for response.", - "default": "json", "enum": [ "json", "media", @@ -664,91 +726,459 @@ "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" + "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" }, - "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", + "access_token": { "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", + "description": "OAuth access token.", "type": "string" }, - "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], + "quotaUser": { "location": "query", - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", + "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" } }, "schemas": { + "ClusterOperationStatus": { + "description": "The status of the operation.", + "type": "object", + "properties": { + "innerState": { + "description": "Output-only. A message containing the detailed operation state.", + "type": "string" + }, + "stateStartTime": { + "description": "Output-only. The time this state was entered.", + "format": "google-datetime", + "type": "string" + }, + "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": "Output-only. A message containing the operation state.", + "type": "string" + }, + "details": { + "description": "Output-only.A message containing any operation metadata details.", + "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": { + "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": { + "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": { + "type": "string", + "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'" + }, + "jarFileUris": { + "description": "Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks.", + "type": "array", + "items": { + "type": "string" + } + }, + "loggingConfig": { + "description": "Optional. The runtime log config for job execution.", + "$ref": "LoggingConfig" + } + }, + "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", + "type": "array", + "items": { + "type": "string" + } + } + }, + "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": { + "state": { + "description": "Required. The application 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" + ] + }, + "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" + }, + "DiagnoseClusterRequest": { + "properties": {}, + "id": "DiagnoseClusterRequest", + "description": "A request to collect cluster diagnostic information.", + "type": "object" + }, + "DiskConfig": { + "type": "object", + "properties": { + "bootDiskSizeGb": { + "description": "Optional. Size in GB of the boot disk (default is 500GB).", + "format": "int32", + "type": "integer" + }, + "numLocalSsds": { + "type": "integer", + "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" + } + }, + "id": "DiskConfig", + "description": "Specifies the config of disk options for a group of VM instances." + }, + "ClusterOperationMetadata": { + "description": "Metadata describing the operation.", + "type": "object", + "properties": { + "statusHistory": { + "description": "Output-only. The previous operation status.", + "type": "array", + "items": { + "$ref": "ClusterOperationStatus" + } + }, + "clusterUuid": { + "description": "Output-only. Cluster UUID for the operation.", + "type": "string" + }, + "clusterName": { + "description": "Output-only. Name of the cluster for the operation.", + "type": "string" + }, + "operationType": { + "description": "Output-only. The operation type.", + "type": "string" + }, + "description": { + "description": "Output-only. Short description of operation.", + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Output-only. Errors encountered during operation execution." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Output-only. Labels associated with the operation", + "type": "object" + }, + "status": { + "description": "Output-only. Current operation status.", + "$ref": "ClusterOperationStatus" + } + }, + "id": "ClusterOperationMetadata" + }, + "HiveJob": { + "properties": { + "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" + }, + "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" + } + }, + "scriptVariables": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Mapping of query variable names to values (equivalent to the Hive command: SET name=\"value\";).", + "type": "object" + } + }, + "id": "HiveJob", + "description": "A Cloud Dataproc job for running Apache Hive (https://hive.apache.org/) queries on YARN.", + "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" + }, + "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" + }, + "ClusterConfig": { + "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" + } + }, + "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" + }, + "workerConfig": { + "description": "Optional. The Google Compute Engine config settings for worker instances in a cluster.", + "$ref": "InstanceGroupConfig" + }, + "gceClusterConfig": { + "$ref": "GceClusterConfig", + "description": "Required. The shared Google Compute Engine config settings for all instances in a cluster." + }, + "softwareConfig": { + "$ref": "SoftwareConfig", + "description": "Optional. The config settings for software inside the cluster." + }, + "masterConfig": { + "description": "Optional. The Google Compute Engine config settings for the master instance in a cluster.", + "$ref": "InstanceGroupConfig" + }, + "secondaryWorkerConfig": { + "description": "Optional. The Google Compute Engine config settings for additional worker instances in a cluster.", + "$ref": "InstanceGroupConfig" + } + }, + "id": "ClusterConfig", + "description": "The cluster config.", + "type": "object" + }, + "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": { + "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" + } + }, + "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" + } + }, + "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.", + "type": "array", + "items": { + "type": "string" + } + }, + "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": { + "description": "Optional. The runtime log config for job execution.", + "$ref": "LoggingConfig" + }, + "properties": { + "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." + }, + "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": "PySparkJob" + }, + "GceClusterConfig": { + "description": "Common config settings for resources of Google Compute Engine cluster instances, applicable to all instances in the cluster.", + "type": "object", + "properties": { + "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", + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "description": "The Google Compute Engine tags to add to all instances (see Tagging instances).", + "type": "array", + "items": { + "type": "string" + } + }, + "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" + }, + "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" + } + }, + "id": "GceClusterConfig" + }, "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" + "type": "string", + "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" }, "acceleratorCount": { - "format": "int32", "description": "The number of the accelerator cards of this type exposed to this instance.", + "format": "int32", "type": "integer" } }, @@ -759,17 +1189,17 @@ "type": "object", "properties": { "hdfsMetrics": { - "additionalProperties": { - "format": "int64", - "type": "string" - }, "description": "The HDFS metrics.", - "type": "object" + "type": "object", + "additionalProperties": { + "type": "string", + "format": "int64" + } }, "yarnMetrics": { "additionalProperties": { - "format": "int64", - "type": "string" + "type": "string", + "format": "int64" }, "description": "The YARN metrics.", "type": "object" @@ -783,7 +1213,6 @@ "properties": { "driverLogLevels": { "additionalProperties": { - "type": "string", "enum": [ "LEVEL_UNSPECIFIED", "ALL", @@ -794,7 +1223,8 @@ "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" @@ -806,25 +1236,9 @@ "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." + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" }, "metadata": { "additionalProperties": { @@ -833,6 +1247,22 @@ }, "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" + }, + "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" } }, "id": "Operation" @@ -841,18 +1271,19 @@ "description": "Encapsulates the full scoping used to reference a job.", "type": "object", "properties": { + "projectId": { + "type": "string", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to." + }, "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": { + "description": "A request to submit a job.", "type": "object", "properties": { "job": { @@ -860,119 +1291,100 @@ "description": "Required. The job resource." } }, - "id": "SubmitJobRequest", - "description": "A request to submit a job." + "id": "SubmitJobRequest" }, "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.", + "type": "array", "items": { + "type": "object", "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.", + "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" } }, "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" + "$ref": "DiskConfig", + "description": "Optional. Disk option config settings." + }, + "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" + }, + "imageUri": { + "description": "Output-only. The Google Compute Engine image resource used for cluster instances. Inferred from SoftwareConfig.image_version.", + "type": "string" }, "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).", + "type": "array", "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.", + "type": "array", "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.", + "format": "int32", "type": "integer" } - } + }, + "id": "InstanceGroupConfig" }, "JobScheduling": { + "description": "Job scheduling options.", "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.", + "format": "int32", "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" + "id": "JobScheduling" }, "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.", + "format": "google-duration", "type": "string" }, "executableFile": { @@ -982,41 +1394,34 @@ }, "id": "NodeInitializationAction" }, - "CancelJobRequest": { - "properties": {}, - "id": "CancelJobRequest", - "description": "A request to cancel a job.", + "ListJobsResponse": { + "properties": { + "jobs": { + "description": "Output-only. Jobs list.", + "type": "array", + "items": { + "$ref": "Job" + } + }, + "nextPageToken": { + "type": "string", + "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." + } + }, + "id": "ListJobsResponse", + "description": "A list of jobs in a project.", "type": "object" }, + "CancelJobRequest": { + "description": "A request to cancel a job.", + "type": "object", + "properties": {}, + "id": "CancelJobRequest" + }, "SparkSqlJob": { "description": "A Cloud Dataproc job for running Apache Spark SQL (http://spark.apache.org/sql/) queries.", "type": "object", "properties": { - "scriptVariables": { - "additionalProperties": { - "type": "string" - }, - "description": "Optional. Mapping of query variable names to values (equivalent to the Spark SQL command: SET name=\"value\";).", - "type": "object" - }, - "jarFileUris": { - "description": "Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.", - "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 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" @@ -1024,6 +1429,31 @@ "queryList": { "description": "A list of queries.", "$ref": "QueryList" + }, + "scriptVariables": { + "description": "Optional. Mapping of query variable names to values (equivalent to the Spark SQL command: SET name=\"value\";).", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "jarFileUris": { + "description": "Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.", + "type": "array", + "items": { + "type": "string" + } + }, + "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 Spark SQL's SparkConf. Properties that conflict with values set by the Cloud Dataproc API may be overwritten.", + "type": "object", + "additionalProperties": { + "type": "string" + } } }, "id": "SparkSqlJob" @@ -1031,39 +1461,39 @@ "Cluster": { "properties": { "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" - }, - "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" + } }, "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": { - "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" + "$ref": "ClusterStatus", + "description": "Output-only. Cluster status." }, "statusHistory": { "description": "Output-only. The previous cluster status.", + "type": "array", "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" + "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" }, + "clusterUuid": { + "description": "Output-only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc generates this value when it creates the cluster.", + "type": "string" + }, "projectId": { "description": "Required. The Google Cloud Platform project ID that the cluster belongs to.", "type": "string" @@ -1077,16 +1507,16 @@ "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" - }, - "type": "array" + } + }, + "nextPageToken": { + "type": "string", + "description": "The standard List next-page token." } }, "id": "ListOperationsResponse" @@ -1095,13 +1525,13 @@ "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" + "type": "string", + "description": "Required. The name of the cluster where the job will be submitted." + }, + "clusterUuid": { + "type": "string", + "description": "Output-only. A cluster UUID generated by the Cloud Dataproc service when the job is submitted." } }, "id": "JobPlacement" @@ -1110,16 +1540,16 @@ "description": "Specifies the selection and config of software inside the cluster.", "type": "object", "properties": { + "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" + }, "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": { - "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" - } } }, "id": "SoftwareConfig" @@ -1128,19 +1558,30 @@ "description": "The status of a cluster and its instances.", "type": "object", "properties": { + "stateStartTime": { + "description": "Output-only. Time when this state was entered.", + "format": "google-datetime", + "type": "string" + }, + "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" + }, "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", @@ -1150,52 +1591,27 @@ "UPDATING" ], "description": "Output-only. The cluster's state.", - "type": "string" - }, - "substate": { - "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." + "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." ] - }, - "stateStartTime": { - "format": "google-datetime", - "description": "Output-only. Time when this state was entered.", - "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" - }, - "queryList": { - "$ref": "QueryList", - "description": "A list of queries." - }, - "queryFileUri": { - "description": "The HCFS URI of the script that contains the Pig queries.", - "type": "string" - }, "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.", + "type": "array", "items": { "type": "string" }, - "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." }, "scriptVariables": { "additionalProperties": { @@ -1205,150 +1621,116 @@ "type": "object" }, "loggingConfig": { - "$ref": "LoggingConfig", - "description": "Optional. The runtime log config for job execution." + "description": "Optional. The runtime log config for job execution.", + "$ref": "LoggingConfig" }, "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" - } + }, + "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." + }, + "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": { + "description": "A list of queries.", + "$ref": "QueryList" + }, + "queryFileUri": { + "description": "The HCFS URI of the script that contains the Pig queries.", + "type": "string" } }, - "id": "PigJob" + "id": "PigJob", + "description": "A Cloud Dataproc job for running Apache Pig (https://pig.apache.org/) queries on YARN.", + "type": "object" }, "ListClustersResponse": { + "description": "The list of all clusters in a project.", + "type": "object", "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" + "id": "ListClustersResponse" }, "SparkJob": { "description": "A Cloud Dataproc job for running Apache Spark (http://spark.apache.org/) applications on YARN.", "type": "object", "properties": { + "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": { + "type": "array", + "items": { + "type": "string" + }, + "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 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" + }, + "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" + } + }, "mainJarFileUri": { "description": "The HCFS URI of the jar file that contains the main class.", "type": "string" }, "jarFileUris": { "description": "Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks.", + "type": "array", "items": { "type": "string" - }, - "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" + "loggingConfig": { + "description": "Optional. The runtime log config for job execution.", + "$ref": "LoggingConfig" } }, "id": "SparkJob" }, "Job": { + "description": "A Cloud Dataproc job resource.", + "type": "object", "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.", - "items": { - "$ref": "JobStatus" - }, - "type": "array" - }, - "sparkSqlJob": { - "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.", - "items": { - "$ref": "YarnApplication" - }, - "type": "array" - }, - "pysparkJob": { - "description": "Job is a Pyspark job.", - "$ref": "PySparkJob" - }, - "reference": { - "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": { - "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", - "description": "Required. Job information, including how, when, and where to run the job." - }, - "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": { "$ref": "JobScheduling", "description": "Optional. Job scheduling configuration." }, "pigJob": { - "description": "Job is a Pig job.", - "$ref": "PigJob" + "$ref": "PigJob", + "description": "Job is a Pig job." }, "hiveJob": { "description": "Job is a Hive job.", @@ -1360,19 +1742,68 @@ }, "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" + }, + "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": { + "description": "Job is a Spark job.", + "$ref": "SparkJob" + }, + "statusHistory": { + "type": "array", + "items": { + "$ref": "JobStatus" + }, + "description": "Output-only. The previous job status." + }, + "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" + } + }, + "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." + }, + "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." + }, + "placement": { + "$ref": "JobPlacement", + "description": "Required. Job information, including how, when, and where to run the job." + }, + "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", - "description": "A Cloud Dataproc job resource.", - "type": "object" + "id": "Job" }, "JobStatus": { - "description": "Cloud Dataproc job status.", - "type": "object", "properties": { + "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.", @@ -1384,30 +1815,11 @@ "SUBMITTED", "QUEUED", "STALE_STATUS" - ] - }, - "stateStartTime": { - "format": "google-datetime", - "description": "Output-only. The time when this state was entered.", + ], + "description": "Output-only. Additional state information, which includes status reported by the agent.", "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", - "PENDING", - "SETUP_DONE", - "RUNNING", - "CANCEL_PENDING", - "CANCEL_STARTED", - "CANCELLED", - "DONE", - "ERROR", - "ATTEMPT_FAILURE" - ], "description": "Output-only. A state message specifying the overall job state.", "type": "string", "enumDescriptions": [ @@ -1421,10 +1833,28 @@ "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" ] + }, + "details": { + "description": "Output-only. Optional job state details, such as an error description if the state is \u003ccode\u003eERROR\u003c/code\u003e.", + "type": "string" } }, - "id": "JobStatus" + "id": "JobStatus", + "description": "Cloud Dataproc job status.", + "type": "object" }, "ManagedGroupConfig": { "description": "Specifies the resources used to actively manage an instance group.", @@ -1440,427 +1870,6 @@ } }, "id": "ManagedGroupConfig" - }, - "ClusterOperationStatus": { - "description": "The status of the operation.", - "type": "object", - "properties": { - "stateStartTime": { - "format": "google-datetime", - "description": "Output-only. The time this state was entered.", - "type": "string" - }, - "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": { - "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", - "NEW", - "NEW_SAVING", - "SUBMITTED", - "ACCEPTED", - "RUNNING", - "FINISHED", - "FAILED", - "KILLED" - ], - "description": "Required. The application 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." - ] - } - }, - "id": "YarnApplication" - }, - "DiagnoseClusterRequest": { - "description": "A request to collect cluster diagnostic information.", - "type": "object", - "properties": {}, - "id": "DiagnoseClusterRequest" - }, - "DiskConfig": { - "description": "Specifies the config of disk options for a group of VM instances.", - "type": "object", - "properties": { - "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" - }, - "bootDiskSizeGb": { - "format": "int32", - "description": "Optional. Size in GB of the boot disk (default is 500GB).", - "type": "integer" - } - }, - "id": "DiskConfig" - }, - "ClusterOperationMetadata": { - "description": "Metadata describing the operation.", - "type": "object", - "properties": { - "labels": { - "additionalProperties": { - "type": "string" - }, - "description": "Output-only. Labels associated with the operation", - "type": "object" - }, - "status": { - "description": "Output-only. Current operation status.", - "$ref": "ClusterOperationStatus" - }, - "statusHistory": { - "items": { - "$ref": "ClusterOperationStatus" - }, - "type": "array", - "description": "Output-only. The previous operation status." - }, - "clusterUuid": { - "description": "Output-only. Cluster UUID for the operation.", - "type": "string" - }, - "clusterName": { - "type": "string", - "description": "Output-only. Name of the cluster for the operation." - }, - "operationType": { - "description": "Output-only. The operation type.", - "type": "string" - }, - "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" - }, - "HiveJob": { - "description": "A Cloud Dataproc job for running Apache Hive (https://hive.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 Hive queries.", - "type": "string" - }, - "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.", - "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": { - "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" - } - }, - "id": "HiveJob" - }, - "Empty": { - "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", - "properties": {} - }, - "DiagnoseClusterResults": { - "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.", - "type": "object" - }, - "ClusterConfig": { - "description": "The cluster config.", - "type": "object", - "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", - "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.", - "type": "string" - }, - "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." - } - }, - "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": { - "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" - } - }, - "args": { - "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.", - "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" - }, - "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." - } - } - }, - "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" - } - }, - "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": { - "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.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" } }, "icons": { @@ -1879,11 +1888,9 @@ } } }, - "servicePath": "", - "description": "Manages Hadoop-based clusters and jobs on Google Cloud Platform.", "kind": "discovery#restDescription", + "description": "Manages Hadoop-based clusters and jobs on Google Cloud Platform.", + "servicePath": "", "rootUrl": "https://dataproc.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "dataproc" + "basePath": "" } diff --git a/etc/api/dataproc/v1beta2/dataproc-api.json b/etc/api/dataproc/v1beta2/dataproc-api.json index c97418c4b2..628a9fd149 100644 --- a/etc/api/dataproc/v1beta2/dataproc-api.json +++ b/etc/api/dataproc/v1beta2/dataproc-api.json @@ -1,41 +1,29 @@ { + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://dataproc.googleapis.com/", + "ownerDomain": "google.com", + "name": "dataproc", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud Dataproc API", "ownerName": "Google", - "discoveryVersion": "v1", - "version_module": true, "resources": { "projects": { "resources": { - "regions": { + "locations": { "resources": { - "operations": { + "workflowTemplates": { "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.", + "description": "Deletes a workflow template. It does not cancel in-progress workflows.", "response": { "$ref": "Empty" }, @@ -45,11 +33,818 @@ "httpMethod": "DELETE", "parameters": { "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", + "location": "path", + "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}" + }, + "version": { + "location": "query", + "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", + "path": "v1beta2/{+name}", + "id": "dataproc.projects.locations.workflowTemplates.delete" + }, + "list": { + "description": "Lists workflows that match the specified filter in the request.", + "response": { + "$ref": "ListWorkflowTemplatesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "parent": { + "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + }, + "pageToken": { + "description": "Optional. The page token, returned by a previous call, to request the next page of results.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "Optional. The maximum number of results to return in each response.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates", + "path": "v1beta2/{+parent}/workflowTemplates", + "id": "dataproc.projects.locations.workflowTemplates.list" + }, + "create": { + "response": { + "$ref": "WorkflowTemplate" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates", + "path": "v1beta2/{+parent}/workflowTemplates", + "id": "dataproc.projects.locations.workflowTemplates.create", + "description": "Creates new workflow template.", + "request": { + "$ref": "WorkflowTemplate" + } + }, + "instantiate": { + "parameters": { + "name": { + "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:instantiate", + "path": "v1beta2/{+name}:instantiate", + "id": "dataproc.projects.locations.workflowTemplates.instantiate", + "request": { + "$ref": "InstantiateWorkflowTemplateRequest" + }, + "description": "Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling google.cloud.dataproc.v1beta2.OperationService.GetOperation. The Operation will complete when entire workflow is finished.The running workflow can be aborted via google.cloud.dataproc.v1beta2.OperationService.CancelOperation.The google.cloud.dataproc.v1beta2.Operation.metadata will always be google.cloud.dataproc.v1beta2.WorkflowMetadata.The google.cloud.dataproc.v1beta2.Operation.result will always be google.protobuf.Empty.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST" + }, + "get": { + "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.", + "response": { + "$ref": "WorkflowTemplate" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", + "location": "path", + "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}", + "required": true, + "type": "string" + }, + "version": { + "location": "query", + "description": "Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version.", + "format": "int32", + "type": "integer" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", + "path": "v1beta2/{+name}", + "id": "dataproc.projects.locations.workflowTemplates.get" + }, + "update": { + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", + "id": "dataproc.projects.locations.workflowTemplates.update", + "path": "v1beta2/{+name}", + "request": { + "$ref": "WorkflowTemplate" + }, + "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.", + "httpMethod": "PUT", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "WorkflowTemplate" + }, + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", + "location": "path", + "description": "Output only. The \"resource name\" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "regions": { + "resources": { + "clusters": { + "methods": { + "testIamPermissions": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:testIamPermissions", + "id": "dataproc.projects.regions.clusters.testIamPermissions", + "path": "v1beta2/{+resource}:testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "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." + }, + "delete": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "clusterName": { + "location": "path", + "description": "Required. The cluster name.", + "required": true, + "type": "string" + }, + "clusterUuid": { + "description": "Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist.", + "type": "string", + "location": "query" + }, + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that 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" + } + }, + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "path": "v1beta2/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": { + "parameters": { + "region": { + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "required": true, + "type": "string", + "location": "path" + }, + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", + "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", + "id": "dataproc.projects.regions.clusters.diagnose", + "request": { + "$ref": "DiagnoseClusterRequest" + }, + "description": "Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation.", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "region", + "clusterName" + ], + "httpMethod": "POST" + }, + "list": { + "path": "v1beta2/projects/{projectId}/regions/{region}/clusters", + "id": "dataproc.projects.regions.clusters.list", + "description": "Lists all regions/{region}/clusters in a project.", + "response": { + "$ref": "ListClustersResponse" + }, + "parameterOrder": [ + "projectId", + "region" + ], + "httpMethod": "GET", + "parameters": { + "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" + }, + "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": { + "description": "Optional. The standard List page token.", + "type": "string", + "location": "query" + }, + "pageSize": { + "description": "Optional. The standard List page size.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters" + }, + "create": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "projectId", + "region" + ], + "httpMethod": "POST", + "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" + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters", + "path": "v1beta2/projects/{projectId}/regions/{region}/clusters", + "id": "dataproc.projects.regions.clusters.create", + "description": "Creates a cluster in a project.", + "request": { + "$ref": "Cluster" + } + }, + "setIamPolicy": { + "request": { + "$ref": "SetIamPolicyRequest" + }, + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:setIamPolicy", + "path": "v1beta2/{+resource}:setIamPolicy", + "id": "dataproc.projects.regions.clusters.setIamPolicy" + }, + "getIamPolicy": { + "parameters": { + "resource": { + "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:getIamPolicy", + "id": "dataproc.projects.regions.clusters.getIamPolicy", + "path": "v1beta2/{+resource}: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.", + "httpMethod": "GET", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ] + }, + "patch": { + "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" + }, + "gracefulDecommissionTimeout": { + "location": "query", + "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.", + "format": "google-duration", + "type": "string" + }, + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project 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" + }, + "updateMask": { + "location": "query", + "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|", + "format": "google-fieldmask", + "type": "string" + } + }, + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "id": "dataproc.projects.regions.clusters.patch", + "description": "Updates a cluster in a project.", + "request": { + "$ref": "Cluster" + } + }, + "get": { + "response": { + "$ref": "Cluster" + }, + "parameterOrder": [ + "projectId", + "region", + "clusterName" + ], + "httpMethod": "GET", + "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": { + "description": "Required. The Cloud Dataproc region in which to handle the request.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", + "id": "dataproc.projects.regions.clusters.get", + "description": "Gets the resource representation for a cluster in a project." + } + } + }, + "workflowTemplates": { + "methods": { + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "WorkflowTemplate" + }, + "parameters": { + "parent": { + "location": "path", + "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates", + "id": "dataproc.projects.regions.workflowTemplates.create", + "path": "v1beta2/{+parent}/workflowTemplates", + "request": { + "$ref": "WorkflowTemplate" + }, + "description": "Creates new workflow template." + }, + "instantiate": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "name": { + "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:instantiate", + "id": "dataproc.projects.regions.workflowTemplates.instantiate", + "path": "v1beta2/{+name}:instantiate", + "request": { + "$ref": "InstantiateWorkflowTemplateRequest" + }, + "description": "Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling google.cloud.dataproc.v1beta2.OperationService.GetOperation. The Operation will complete when entire workflow is finished.The running workflow can be aborted via google.cloud.dataproc.v1beta2.OperationService.CancelOperation.The google.cloud.dataproc.v1beta2.Operation.metadata will always be google.cloud.dataproc.v1beta2.WorkflowMetadata.The google.cloud.dataproc.v1beta2.Operation.result will always be google.protobuf.Empty." + }, + "get": { + "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.", + "response": { + "$ref": "WorkflowTemplate" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "version": { + "location": "query", + "description": "Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version.", + "format": "int32", + "type": "integer" + }, + "name": { + "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}", + "path": "v1beta2/{+name}", + "id": "dataproc.projects.regions.workflowTemplates.get" + }, + "update": { + "response": { + "$ref": "WorkflowTemplate" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PUT", + "parameters": { + "name": { + "description": "Output only. The \"resource name\" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}", + "path": "v1beta2/{+name}", + "id": "dataproc.projects.regions.workflowTemplates.update", + "request": { + "$ref": "WorkflowTemplate" + }, + "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version." + }, + "delete": { + "id": "dataproc.projects.regions.workflowTemplates.delete", + "path": "v1beta2/{+name}", + "description": "Deletes a workflow template. It does not cancel in-progress workflows.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "version": { + "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "name": { + "location": "path", + "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}" + }, + "list": { + "description": "Lists workflows that match the specified filter in the request.", + "response": { + "$ref": "ListWorkflowTemplatesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+$", + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "Optional. The page token, returned by a previous call, to request the next page of results.", + "type": "string" + }, + "pageSize": { + "location": "query", + "description": "Optional. The maximum number of results to return in each response.", + "format": "int32", + "type": "integer" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates", + "path": "v1beta2/{+parent}/workflowTemplates", + "id": "dataproc.projects.regions.workflowTemplates.list" + } + } + }, + "operations": { + "methods": { + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/regions/[^/]+/operations$", + "location": "path", + "description": "The name of the operation's parent resource.", + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations", + "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." + }, + "get": { + "id": "dataproc.projects.regions.operations.get", + "path": "v1beta2/{+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.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}" + }, + "cancel": { + "path": "v1beta2/{+name}:cancel", + "id": "dataproc.projects.regions.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": { + "pattern": "^projects/[^/]+/regions/[^/]+/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" + ], + "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel" + }, + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", "location": "path", "description": "The name of the operation resource to be deleted.", - "type": "string", "required": true, - "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$" + "type": "string" } }, "scopes": [ @@ -57,83 +852,14 @@ ], "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" + "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": { "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" }, @@ -147,72 +873,72 @@ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { - "jobId": { - "description": "Required. The job ID.", - "type": "string", + "projectId": { + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", "required": true, + "type": "string", "location": "path" }, - "projectId": { + "jobId": { "location": "path", - "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", - "type": "string", - "required": true + "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 + "required": true, + "type": "string" } }, "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", + "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", "id": "dataproc.projects.regions.jobs.cancel", - "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel" + "description": "Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.", + "request": { + "$ref": "CancelJobRequest" + } }, "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", + "response": { + "$ref": "Job" + }, "parameterOrder": [ "projectId", "region", "jobId" ], - "response": { - "$ref": "Job" - }, + "httpMethod": "GET", "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.", + "required": true, + "type": "string" + }, + "projectId": { + "required": true, "type": "string", - "required": true + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to." + }, + "jobId": { + "location": "path", + "description": "Required. The job ID.", + "required": true, + "type": "string" } }, - "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}" + "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", + "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." }, "patch": { - "request": { - "$ref": "Job" - }, - "description": "Updates a job in a project.", "response": { "$ref": "Job" }, @@ -222,64 +948,68 @@ "jobId" ], "httpMethod": "PATCH", + "parameters": { + "projectId": { + "location": "path", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "required": true, + "type": "string" + }, + "jobId": { + "description": "Required. The job ID.", + "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": { + "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" + } + }, "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.patch", + "request": { + "$ref": "Job" + }, + "description": "Updates a job in a project." + }, + "submit": { + "request": { + "$ref": "SubmitJobRequest" + }, + "description": "Submits a job to a cluster.", + "response": { + "$ref": "Job" + }, + "parameterOrder": [ + "projectId", + "region" + ], + "httpMethod": "POST", "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.", + "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "required": true, "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" + "type": "string" } }, "scopes": [ @@ -290,32 +1020,33 @@ "id": "dataproc.projects.regions.jobs.submit" }, "delete": { + "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.", "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, "parameterOrder": [ "projectId", "region", "jobId" ], - "response": { - "$ref": "Empty" - }, "parameters": { "region": { - "location": "path", "description": "Required. The Cloud Dataproc region in which to handle the request.", + "required": true, "type": "string", - "required": true - }, - "jobId": { - "location": "path", - "description": "Required. The job ID.", - "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, + "type": "string", + "location": "path" + }, + "jobId": { + "description": "Required. The job ID.", + "required": true, + "type": "string", "location": "path" } }, @@ -323,11 +1054,11 @@ "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." + "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}" }, "list": { + "httpMethod": "GET", "response": { "$ref": "ListJobsResponse" }, @@ -335,39 +1066,12 @@ "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.", + "required": true, "type": "string", - "required": true + "location": "path" }, "clusterName": { "location": "query", @@ -375,10 +1079,36 @@ "type": "string" }, "projectId": { - "location": "path", "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", + "required": true, "type": "string", - "required": true + "location": "path" + }, + "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 NON_ACTIVE. 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": { + "location": "query", + "enum": [ + "ALL", + "ACTIVE", + "NON_ACTIVE" + ], + "description": "Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "Optional. The page token, returned by a previous call, to request the next page of results.", + "type": "string" + }, + "pageSize": { + "location": "query", + "description": "Optional. The number of results to return in each response.", + "format": "int32", + "type": "integer" } }, "scopes": [ @@ -390,342 +1120,6 @@ "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" - } - } } } } @@ -733,6 +1127,55 @@ } }, "parameters": { + "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": { + "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": { + "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" + ] + }, "alt": { "enum": [ "json", @@ -749,365 +1192,46 @@ "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" + "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" + "type": "string", + "location": "query" }, "pp": { - "location": "query", "description": "Pretty-print response.", + "type": "boolean", "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" } }, + "version": "v1beta2", + "baseUrl": "https://dataproc.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Manages Hadoop-based clusters and jobs on Google Cloud Platform.", + "servicePath": "", + "basePath": "", + "id": "dataproc:v1beta2", + "documentationLink": "https://cloud.google.com/dataproc/", + "revision": "20171207", + "discoveryVersion": "v1", + "version_module": true, "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": { + "type": "object", "additionalProperties": { "enum": [ "LEVEL_UNSPECIFIED", @@ -1122,266 +1246,166 @@ ], "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'", + "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'" + } + }, + "id": "LoggingConfig" + }, + "OrderedJob": { + "id": "OrderedJob", + "type": "object", + "properties": { + "pysparkJob": { + "$ref": "PySparkJob", + "description": "Job is a Pyspark job." + }, + "scheduling": { + "$ref": "JobScheduling", + "description": "Optional. Job scheduling configuration." + }, + "pigJob": { + "$ref": "PigJob", + "description": "Job is a Pig job." + }, + "stepId": { + "description": "Required. The step id. The id must be unique among all jobs within the template.The step id is used as prefix for job id, as job workflow-step-id label, and in prerequisite_step_ids field from other steps.", + "type": "string" + }, + "hadoopJob": { + "description": "Job is a Hadoop job.", + "$ref": "HadoopJob" + }, + "prerequisiteStepIds": { + "description": "Optional. The optional list of prerequisite job step_ids. If not specified, the job will start at the beginning of workflow.", + "type": "array", + "items": { + "type": "string" + } + }, + "hiveJob": { + "$ref": "HiveJob", + "description": "Job is a Hive job." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. The labels to associate with this job.Label keys must be between 1 and 63 characters long, and must conform to the following regular expression: \\p{Ll}\\p{Lo}{0,62}Label values must be between 1 and 63 characters long, and must conform to the following regular expression: \\p{Ll}\\p{Lo}\\p{N}_-{0,63}No more than 64 labels can be associated with a given job.", "type": "object" + }, + "sparkJob": { + "description": "Job is a Spark job.", + "$ref": "SparkJob" + }, + "sparkSqlJob": { + "description": "Job is a SparkSql job.", + "$ref": "SparkSqlJob" } } }, - "Operation": { - "description": "This resource represents a long-running operation that is the result of a network API call.", + "WorkflowNode": { + "description": "The workflow node.", "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" + "prerequisiteStepIds": { + "type": "array", + "items": { + "type": "string" }, - "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" + "description": "Output only. Node's prerequisite nodes." }, - "name": { + "state": { + "description": "Output only. The node state.", "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." + "enumDescriptions": [ + "", + "The node is awaiting prerequisite node to finish.", + "The node is runnable but not running.", + "The node is running.", + "The node completed successfully.", + "The node failed. A node can be marked FAILED because its ancestor or peer failed." + ], + "enum": [ + "NODE_STATUS_UNSPECIFIED", + "BLOCKED", + "RUNNABLE", + "RUNNING", + "COMPLETED", + "FAILED" + ] + }, + "stepId": { + "description": "Output only. The name of the node.", + "type": "string" }, "error": { - "description": "The error result of the operation in case of failure or cancellation.", - "$ref": "Status" + "description": "Output only. The error detail.", + "type": "string" }, - "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.", + "description": "Output only. The job id; populated after the node enters RUNNING state.", "type": "string" } }, - "id": "JobReference" + "id": "WorkflowNode" + }, + "InstantiateWorkflowTemplateRequest": { + "properties": { + "version": { + "description": "Optional. The version of workflow template to instantiate. If specified, the workflow will be instantiated only if the current version of the workflow template has the supplied version.This option cannot be used to instantiate a previous version of workflow template.", + "format": "int32", + "type": "integer" + }, + "instanceId": { + "description": "Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", + "type": "string" + } + }, + "id": "InstantiateWorkflowTemplateRequest", + "description": "A request to instantiate a workflow template.", + "type": "object" }, "SubmitJobRequest": { + "description": "A request to submit a job.", + "type": "object", "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" + "id": "SubmitJobRequest" }, "JobScheduling": { + "description": "Job scheduling options.", + "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.", - "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" + "id": "JobScheduling" }, "Cluster": { "description": "Describes the identifying information, config, and status of a cluster of Google Compute Engine instances.", "type": "object", "properties": { + "labels": { + "additionalProperties": { + "type": "string" + }, + "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" + }, "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." + "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" }, "status": { - "$ref": "ClusterStatus", - "description": "Output-only. Cluster status." + "description": "Output-only. Cluster status.", + "$ref": "ClusterStatus" }, "config": { "$ref": "ClusterConfig", @@ -1389,50 +1413,25 @@ }, "statusHistory": { "description": "Output-only. The previous cluster status.", + "type": "array", "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": { + "clusterUuid": { "type": "string", - "description": "Required. The Google Cloud Platform project ID that the cluster belongs to." + "description": "Output-only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc generates this value when it creates the cluster." }, - "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.", + "projectId": { + "description": "Required. The Google Cloud Platform project ID that the cluster belongs to.", "type": "string" } }, - "id": "ListOperationsResponse" + "id": "Cluster" }, "TestIamPermissionsResponse": { "description": "Response message for TestIamPermissions method.", @@ -1440,299 +1439,211 @@ "properties": { "permissions": { "description": "A subset of TestPermissionsRequest.permissions that the caller is allowed.", + "type": "array", "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.", + "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" } }, - "id": "ClusterStatus" + "id": "SoftwareConfig", + "description": "Specifies the selection and config of software inside the cluster.", + "type": "object" }, - "PigJob": { - "description": "A Cloud Dataproc job for running Apache Pig (https://pig.apache.org/) queries on YARN.", + "ClusterSelector": { + "description": "A selector that chooses target cluster for jobs based on metadata.", "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.", + "zone": { + "description": "Optional. The zone where workflow process executes. This parameter does not affect the selection of the cluster.If unspecified, the zone of the first cluster matching the selector is used.", "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.", + "clusterLabels": { + "description": "Required. The cluster labels. Cluster must have all labels to match.", "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" + "id": "ClusterSelector" + }, + "WorkflowTemplatePlacement": { + "description": "Specifies workflow execution target.Either managed_cluster or cluster_selector is required.", + "type": "object", + "properties": { + "clusterSelector": { + "description": "Optional. A selector that chooses target cluster for jobs based on metadata.The selector is evaluated at the time each job is submitted.", + "$ref": "ClusterSelector" + }, + "managedCluster": { + "$ref": "ManagedCluster", + "description": "Optional. A cluster that is managed by the workflow." + } + }, + "id": "WorkflowTemplatePlacement" + }, + "ClusterOperation": { + "type": "object", + "properties": { + "done": { + "description": "Output only. Indicates the operation is done.", + "type": "boolean" + }, + "operationId": { + "description": "Output only. The id of the cluster operation.", + "type": "string" + }, + "error": { + "description": "Output only. Error, if operation failed.", + "type": "string" + } + }, + "id": "ClusterOperation" + }, + "WorkflowMetadata": { + "description": "A Cloud Dataproc workflow template resource.", + "type": "object", + "properties": { + "createCluster": { + "$ref": "ClusterOperation", + "description": "Output only. The create cluster operation metadata." + }, + "version": { + "type": "integer", + "description": "Output only. The version of template at the time of workflow instantiation.", + "format": "int32" + }, + "graph": { + "description": "Output only. The workflow graph.", + "$ref": "WorkflowGraph" + }, + "template": { + "description": "Output only. The \"resource name\" of the template.", + "type": "string" + }, + "deleteCluster": { + "$ref": "ClusterOperation", + "description": "Output only. The delete cluster operation metadata." + }, + "state": { + "description": "Output only. The workflow 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" + ] + }, + "clusterName": { + "type": "string", + "description": "Output only. The name of the managed cluster." + } + }, + "id": "WorkflowMetadata" + }, + "SparkJob": { + "type": "object", + "properties": { + "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" + } + }, + "mainJarFileUri": { + "description": "The HCFS URI of the jar file that contains the main class.", + "type": "string" + }, + "jarFileUris": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks." + }, + "loggingConfig": { + "$ref": "LoggingConfig", + "description": "Optional. The runtime log config for job execution." + }, + "properties": { + "type": "object", + "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." + }, + "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" + } + }, + "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" + } + }, + "id": "SparkJob", + "description": "A Cloud Dataproc job for running Apache Spark (http://spark.apache.org/) applications on YARN." }, "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.", + "stateStartTime": { + "description": "Output-only. The time when this state was entered.", + "format": "google-datetime", + "type": "string" + }, + "substate": { + "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" + ], + "description": "Output-only. Additional state information, which includes status reported by the agent.", "type": "string" }, "state": { - "type": "string", "enumDescriptions": [ "The job state is unknown.", "The job is pending; it has been submitted, but is not yet running.", @@ -1757,53 +1668,680 @@ "ERROR", "ATTEMPT_FAILURE" ], - "description": "Output-only. A state message specifying the overall job state." + "description": "Output-only. A state message specifying the overall job state.", + "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" - ] - }, - "stateStartTime": { - "format": "google-datetime", - "description": "Output-only. The time when this state was entered.", + "details": { + "description": "Output-only. Optional job state details, such as an error description if the state is \u003ccode\u003eERROR\u003c/code\u003e.", "type": "string" } }, "id": "JobStatus" }, - "LifecycleConfig": { - "description": "Specifies the cluster auto delete related schedule configuration.", + "DiagnoseClusterRequest": { + "description": "A request to collect cluster diagnostic information.", + "type": "object", + "properties": {}, + "id": "DiagnoseClusterRequest" + }, + "DiskConfig": { + "id": "DiskConfig", + "description": "Specifies the config of disk options for a group of VM instances.", "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.", + "bootDiskSizeGb": { + "description": "Optional. Size in GB of the boot disk (default is 500GB).", + "format": "int32", + "type": "integer" + }, + "bootDiskType": { + "description": "Optional. Type of the boot disk (default is 'pd-standard'). Valid values: 'pd-ssd', 'pd-standard'", "type": "string" }, - "autoDeleteTime": { - "format": "google-datetime", - "description": "Optional. The time when cluster will be auto-deleted.", + "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", + "type": "integer" + } + } + }, + "ClusterOperationMetadata": { + "description": "Metadata describing the operation.", + "type": "object", + "properties": { + "clusterUuid": { + "description": "Output-only. Cluster UUID for the operation.", "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.", + "clusterName": { + "description": "Output-only. Name of the cluster for the operation.", + "type": "string" + }, + "operationType": { + "type": "string", + "description": "Output-only. The operation type." + }, + "description": { + "type": "string", + "description": "Output-only. Short description of operation." + }, + "warnings": { + "description": "Output-only. Errors encountered during operation execution.", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "Output-only. Labels associated with the operation", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "status": { + "description": "Output-only. Current operation status.", + "$ref": "ClusterOperationStatus" + }, + "statusHistory": { + "description": "Output-only. The previous operation status.", + "type": "array", + "items": { + "$ref": "ClusterOperationStatus" + } + } + }, + "id": "ClusterOperationMetadata" + }, + "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" + }, + "GceClusterConfig": { + "description": "Common config settings for resources of Google Compute Engine cluster instances, applicable to all instances in the cluster.", + "type": "object", + "properties": { + "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": { + "type": "array", + "items": { + "type": "string" + }, + "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" + }, + "tags": { + "description": "The Google Compute Engine tags to add to all instances (see Tagging instances).", + "type": "array", + "items": { + "type": "string" + } + }, + "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" + }, + "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" } }, - "id": "LifecycleConfig" + "id": "GceClusterConfig" + }, + "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": { + "etag": { + "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.", + "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. bindings with no members will result in an error.", + "type": "array", + "items": { + "$ref": "Binding" + } + } + }, + "id": "Policy" + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a network 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 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": { + "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" + } + }, + "id": "Operation" + }, + "ListWorkflowTemplatesResponse": { + "description": "A response to a request to list workflow templates in a project.", + "type": "object", + "properties": { + "templates": { + "description": "Output only. WorkflowTemplates list.", + "type": "array", + "items": { + "$ref": "WorkflowTemplate" + } + }, + "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\u003eListWorkflowTemplatesRequest\u003c/code\u003e.", + "type": "string" + } + }, + "id": "ListWorkflowTemplatesResponse" + }, + "JobReference": { + "id": "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" + } + } + }, + "Status": { + "id": "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.", + "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 user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", + "type": "string" + } + } + }, + "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.", + "type": "array", + "items": { + "type": "string" + } + }, + "role": { + "description": "Role that is assigned to members. For example, roles/viewer, roles/editor, or roles/owner. Required", + "type": "string" + } + }, + "id": "Binding" + }, + "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": { + "minCpuPlatform": { + "type": "string", + "description": "Optional. Specifies the minimum cpu platform for the Instance Group. Examples: * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform" + }, + "diskConfig": { + "$ref": "DiskConfig", + "description": "Optional. Disk option config settings." + }, + "machineTypeUri": { + "type": "string", + "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" + }, + "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" + }, + "imageUri": { + "description": "Output-only. The Google Compute Engine image resource used for cluster instances. Inferred from SoftwareConfig.image_version.", + "type": "string" + }, + "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": { + "description": "Optional. The number of VM instances in the instance group. For master instance groups, must be set to 1.", + "format": "int32", + "type": "integer" + } + } + }, + "NodeInitializationAction": { + "description": "Specifies an executable to run on a fully configured node and a timeout period for executable completion.", + "type": "object", + "properties": { + "executableFile": { + "description": "Required. Google Cloud Storage URI of executable file.", + "type": "string" + }, + "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" + } + }, + "id": "NodeInitializationAction" + }, + "ListJobsResponse": { + "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" + } + }, + "id": "ListJobsResponse", + "description": "A list of jobs in a project.", + "type": "object" + }, + "CancelJobRequest": { + "description": "A request to cancel a job.", + "type": "object", + "properties": {}, + "id": "CancelJobRequest" + }, + "SparkSqlJob": { + "description": "A Cloud Dataproc job for running Apache Spark SQL (http://spark.apache.org/sql/) queries.", + "type": "object", + "properties": { + "scriptVariables": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. Mapping of query variable names to values (equivalent to the Spark SQL command: SET name=\"value\";).", + "type": "object" + }, + "jarFileUris": { + "description": "Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.", + "type": "array", + "items": { + "type": "string" + } + }, + "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 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": { + "$ref": "QueryList", + "description": "A list of queries." + } + }, + "id": "SparkSqlJob" + }, + "ListOperationsResponse": { + "id": "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" + } + } + }, + "JobPlacement": { + "id": "JobPlacement", + "description": "Cloud Dataproc job config.", + "type": "object", + "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" + } + } + }, + "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" + }, + "queryList": { + "description": "A list of queries.", + "$ref": "QueryList" + }, + "queryFileUri": { + "description": "The HCFS URI of the script that contains the Pig queries.", + "type": "string" + }, + "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.", + "type": "array", + "items": { + "type": "string" + } + }, + "scriptVariables": { + "description": "Optional. Mapping of query variable names to values (equivalent to the Pig command: name=[value]).", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "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" + }, + "ClusterStatus": { + "type": "object", + "properties": { + "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" + }, + "stateStartTime": { + "description": "Output-only. Time when this state was entered.", + "format": "google-datetime", + "type": "string" + }, + "substate": { + "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." + ], + "enum": [ + "UNSPECIFIED", + "UNHEALTHY", + "STALE_STATUS" + ] + }, + "detail": { + "description": "Output-only. Optional details of cluster's state.", + "type": "string" + } + }, + "id": "ClusterStatus", + "description": "The status of a cluster and its instances." + }, + "WorkflowTemplate": { + "type": "object", + "properties": { + "name": { + "description": "Output only. The \"resource name\" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}", + "type": "string" + }, + "id": { + "description": "Required. The template id.", + "type": "string" + }, + "version": { + "description": "Optional. Used to perform a consistent read-modify-write.This field should be left blank for a CreateWorkflowTemplate request. It is required for an UpdateWorkflowTemplate request, and must match the current server version. A typical update template flow would fetch the current template with a GetWorkflowTemplate request, which will return the current template with the version field filled in with the current server version. The user updates other fields in the template, then returns it as part of the UpdateWorkflowTemplate request.", + "format": "int32", + "type": "integer" + }, + "jobs": { + "description": "Required. The Directed Acyclic Graph of Jobs to submit.", + "type": "array", + "items": { + "$ref": "OrderedJob" + } + }, + "createTime": { + "description": "Output only. The time template was created.", + "format": "google-datetime", + "type": "string" + }, + "labels": { + "description": "Optional. The labels to associate with this template. These labels will be propagated to all jobs and clusters created by the workflow instance.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 template.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "placement": { + "$ref": "WorkflowTemplatePlacement", + "description": "Required. WorkflowTemplate scheduling information." + }, + "updateTime": { + "description": "Output only. The time template was last updated.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "WorkflowTemplate", + "description": "A Cloud Dataproc workflow template resource." + }, + "ListClustersResponse": { + "type": "object", + "properties": { + "clusters": { + "description": "Output-only. The clusters in the project.", + "type": "array", + "items": { + "$ref": "Cluster" + } + }, + "nextPageToken": { + "type": "string", + "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." + } + }, + "id": "ListClustersResponse", + "description": "The list of all clusters in a project." + }, + "Job": { + "description": "A Cloud Dataproc job resource.", + "type": "object", + "properties": { + "hadoopJob": { + "$ref": "HadoopJob", + "description": "Job is a Hadoop 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." + }, + "placement": { + "description": "Required. Job information, including how, when, and where to run the job.", + "$ref": "JobPlacement" + }, + "driverControlFilesUri": { + "type": "string", + "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." + }, + "scheduling": { + "$ref": "JobScheduling", + "description": "Optional. Job scheduling configuration." + }, + "pigJob": { + "$ref": "PigJob", + "description": "Job is a Pig job." + }, + "hiveJob": { + "description": "Job is a Hive job.", + "$ref": "HiveJob" + }, + "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" + }, + "sparkJob": { + "description": "Job is a Spark job.", + "$ref": "SparkJob" + }, + "sparkSqlJob": { + "description": "Job is a SparkSql job.", + "$ref": "SparkSqlJob" + }, + "statusHistory": { + "description": "Output-only. The previous job status.", + "type": "array", + "items": { + "$ref": "JobStatus" + } + }, + "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" + } + }, + "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" }, "ManagedGroupConfig": { "properties": { @@ -1812,23 +2350,72 @@ "type": "string" }, "instanceTemplateName": { - "description": "Output-only. The name of the Instance Template used for the Managed Instance Group.", - "type": "string" + "type": "string", + "description": "Output-only. The name of the Instance Template used for the Managed Instance Group." } }, "id": "ManagedGroupConfig", "description": "Specifies the resources used to actively manage an instance group.", "type": "object" }, - "ClusterOperationStatus": { + "LifecycleConfig": { "properties": { - "details": { - "description": "Output-only.A message containing any operation metadata details.", + "autoDeleteTtl": { + "description": "Optional. The life duration of cluster, the cluster will be auto-deleted at the end of this duration.", + "format": "google-duration", + "type": "string" + }, + "autoDeleteTime": { + "description": "Optional. The time when cluster will be auto-deleted.", + "format": "google-datetime", + "type": "string" + }, + "idleDeleteTtl": { + "description": "Optional. The longest duration that cluster would keep alive while staying idle; passing this threshold will cause cluster to be auto-deleted.", + "format": "google-duration", + "type": "string" + } + }, + "id": "LifecycleConfig", + "description": "Specifies the cluster auto delete related schedule configuration.", + "type": "object" + }, + "ManagedCluster": { + "description": "Cluster that is managed by the workflow.", + "type": "object", + "properties": { + "config": { + "description": "Required. The cluster configuration.", + "$ref": "ClusterConfig" + }, + "clusterName": { + "description": "Required. The cluster name. Cluster names within a project must be unique. Names from deleted clusters can be reused.", + "type": "string" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Optional. The labels to associate with this cluster.Label keys must be between 1 and 63 characters long, and must conform to the following PCRE regular expression: \\p{Ll}\\p{Lo}{0,62}Label values must be between 1 and 63 characters long, and must conform to the following PCRE regular expression: \\p{Ll}\\p{Lo}\\p{N}_-{0,63}No more than 64 labels can be associated with a given cluster." + } + }, + "id": "ManagedCluster" + }, + "ClusterOperationStatus": { + "description": "The status of the operation.", + "type": "object", + "properties": { + "innerState": { + "description": "Output-only. A message containing the detailed operation state.", + "type": "string" + }, + "stateStartTime": { + "description": "Output-only. The time this state was entered.", + "format": "google-datetime", "type": "string" }, "state": { - "description": "Output-only. A message containing the operation state.", - "type": "string", "enumDescriptions": [ "Unused.", "The operation has been created.", @@ -1840,27 +2427,92 @@ "PENDING", "RUNNING", "DONE" - ] + ], + "description": "Output-only. A message containing the operation state.", + "type": "string" }, - "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." + "details": { + "description": "Output-only.A message containing any operation metadata details.", + "type": "string" } }, - "id": "ClusterOperationStatus", - "description": "The status of the operation.", - "type": "object" + "id": "ClusterOperationStatus" + }, + "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": { + "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.", + "type": "array", + "items": { + "type": "string" + } + }, + "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 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": { + "type": "array", + "items": { + "type": "string" + }, + "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." + }, + "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" }, "YarnApplication": { + "id": "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": { + "description": "Required. The application state.", "type": "string", "enumDescriptions": [ "Status is unspecified.", @@ -1883,8 +2535,7 @@ "FINISHED", "FAILED", "KILLED" - ], - "description": "Required. The application state." + ] }, "name": { "description": "Required. The application name.", @@ -1895,86 +2546,11 @@ "type": "string" }, "progress": { - "format": "float", "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", - "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.", @@ -1987,98 +2563,227 @@ }, "id": "SetIamPolicyRequest" }, - "DiskConfig": { - "description": "Specifies the config of disk options for a group of VM instances.", + "HiveJob": { + "description": "A Cloud Dataproc job for running Apache Hive (https://hive.apache.org/) queries on YARN.", "type": "object", "properties": { - "bootDiskSizeGb": { - "format": "int32", - "description": "Optional. Size in GB of the boot disk (default is 500GB).", - "type": "integer" + "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" }, - "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.", + "queryFileUri": { + "description": "The HCFS URI of the script that contains Hive queries.", + "type": "string" + }, + "queryList": { + "$ref": "QueryList", + "description": "A list of queries." + }, + "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" + } }, - "labels": { + "scriptVariables": { + "type": "object", "additionalProperties": { "type": "string" }, - "description": "Output-only. Labels associated with the operation", - "type": "object" + "description": "Optional. Mapping of query variable names to values (equivalent to the Hive command: SET name=\"value\";)." }, - "status": { - "$ref": "ClusterOperationStatus", - "description": "Output-only. Current operation status." - }, - "statusHistory": { - "description": "Output-only. The previous operation status.", + "properties": { + "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", + "additionalProperties": { + "type": "string" + } + } + }, + "id": "HiveJob" + }, + "WorkflowGraph": { + "id": "WorkflowGraph", + "description": "The workflow graph.", + "type": "object", + "properties": { + "nodes": { + "description": "Output only. The workflow nodes.", + "type": "array", "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.", + "$ref": "WorkflowNode" + } + } + } + }, + "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": "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" + "id": "DiagnoseClusterResults" + }, + "ClusterConfig": { + "description": "The cluster config.", + "type": "object", + "properties": { + "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." + }, + "lifecycleConfig": { + "description": "Optional. The config setting for auto delete cluster schedule.", + "$ref": "LifecycleConfig" + }, + "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", + "type": "array", + "items": { + "$ref": "NodeInitializationAction" + } + }, + "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" + }, + "workerConfig": { + "description": "Optional. The Google Compute Engine config settings for worker instances in a cluster.", + "$ref": "InstanceGroupConfig" + }, + "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." + } + }, + "id": "ClusterConfig" + }, + "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.", + "type": "array", + "items": { + "type": "string" + } + }, + "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": { + "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." + }, + "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" + } + }, + "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" + } + }, + "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" + } + } + }, + "id": "PySparkJob" + }, + "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" + }, + "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": { + "description": "The number of the accelerator cards of this type exposed to this instance.", + "format": "int32", + "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": { + "id": "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).", + "type": "array", + "items": { + "type": "string" + } } } } }, - "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" + "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" } diff --git a/etc/api/datastore/v1/datastore-api.json b/etc/api/datastore/v1/datastore-api.json index 349a19e7ca..145729ca75 100644 --- a/etc/api/datastore/v1/datastore-api.json +++ b/etc/api/datastore/v1/datastore-api.json @@ -1,1475 +1,9 @@ { - "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": { - "commit": { - "request": { - "$ref": "CommitRequest" - }, - "description": "Commits a transaction, optionally creating, deleting or modifying some\nentities.", - "httpMethod": "POST", - "parameterOrder": [ - "projectId" - ], - "response": { - "$ref": "CommitResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/datastore" - ], - "parameters": { - "projectId": { - "location": "path", - "description": "The ID of the project against which to make the request.", - "type": "string", - "required": true - } - }, - "flatPath": "v1/projects/{projectId}:commit", - "path": "v1/projects/{projectId}:commit", - "id": "datastore.projects.commit" - }, - "beginTransaction": { - "response": { - "$ref": "BeginTransactionResponse" - }, - "parameterOrder": [ - "projectId" - ], - "httpMethod": "POST", - "parameters": { - "projectId": { - "type": "string", - "required": true, - "location": "path", - "description": "The ID of the project against which to make the request." - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/datastore" - ], - "flatPath": "v1/projects/{projectId}:beginTransaction", - "id": "datastore.projects.beginTransaction", - "path": "v1/projects/{projectId}:beginTransaction", - "description": "Begins a new transaction.", - "request": { - "$ref": "BeginTransactionRequest" - } - }, - "runQuery": { - "response": { - "$ref": "RunQueryResponse" - }, - "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" - ], - "flatPath": "v1/projects/{projectId}:runQuery", - "id": "datastore.projects.runQuery", - "path": "v1/projects/{projectId}:runQuery", - "description": "Queries for entities.", - "request": { - "$ref": "RunQueryRequest" - } - }, - "rollback": { - "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" - ], - "flatPath": "v1/projects/{projectId}:rollback", - "id": "datastore.projects.rollback", - "path": "v1/projects/{projectId}:rollback", - "description": "Rolls back a transaction.", - "request": { - "$ref": "RollbackRequest" - } - }, - "lookup": { - "httpMethod": "POST", - "parameterOrder": [ - "projectId" - ], - "response": { - "$ref": "LookupResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/datastore" - ], - "parameters": { - "projectId": { - "location": "path", - "description": "The ID of the project against which to make the request.", - "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" - } - }, - "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.", - "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": { - "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": { - "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": { - "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" - } - }, - "schemas": { - "GoogleDatastoreAdminV1beta1ExportEntitiesResponse": { - "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.", - "type": "object" - }, - "RollbackResponse": { - "description": "The response for Datastore.Rollback.\n(an empty message).", - "type": "object", - "properties": {}, - "id": "RollbackResponse" - }, - "MutationResult": { - "description": "The result of applying a mutation.", - "type": "object", - "properties": { - "conflictDetected": { - "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": { - "$ref": "Key", - "description": "The automatically allocated key.\nSet only when the mutation allocated a 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" - }, - "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" - } - }, - "id": "GqlQuery" - }, - "Filter": { - "properties": { - "compositeFilter": { - "$ref": "CompositeFilter", - "description": "A composite filter." - }, - "propertyFilter": { - "$ref": "PropertyFilter", - "description": "A filter on a property." - } - }, - "id": "Filter", - "description": "A holder for any type of filter.", - "type": "object" - }, - "RollbackRequest": { - "description": "The request for Datastore.Rollback.", - "type": "object", - "properties": { - "transaction": { - "format": "byte", - "description": "The transaction identifier, returned by a call to\nDatastore.BeginTransaction.", - "type": "string" - } - }, - "id": "RollbackRequest" - }, - "RunQueryRequest": { - "description": "The request for Datastore.RunQuery.", - "type": "object", - "properties": { - "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": { - "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": { - "type": "object", - "properties": { - "op": { - "enumDescriptions": [ - "Unspecified. This value must not be used.", - "The results are required to satisfy each of the combined filters." - ], - "enum": [ - "OPERATOR_UNSPECIFIED", - "AND" - ], - "description": "The operator for combining multiple filters.", - "type": "string" - }, - "filters": { - "description": "The list of filters to combine.\nMust contain at least one filter.", - "items": { - "$ref": "Filter" - }, - "type": "array" - } - }, - "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.", - "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.", - "items": { - "$ref": "Key" - }, - "type": "array" - } - }, - "id": "AllocateIdsResponse" - }, - "Query": { - "description": "A query for entities.", - "type": "object", - "properties": { - "projection": { - "description": "The projection to return. Defaults to returning all properties.", - "items": { - "$ref": "Projection" - }, - "type": "array" - }, - "endCursor": { - "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" - }, - "filter": { - "description": "The filter to apply.", - "$ref": "Filter" - }, - "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": { - "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.", - "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).", - "items": { - "$ref": "PropertyReference" - }, - "type": "array" - }, - "order": { - "description": "The order to apply to the query results (if empty, order is unspecified).", - "items": { - "$ref": "PropertyOrder" - }, - "type": "array" - } - }, - "id": "Query" - }, - "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": { - "$ref": "PropertyReference", - "description": "The property to filter by." - }, - "op": { - "enum": [ - "OPERATOR_UNSPECIFIED", - "LESS_THAN", - "LESS_THAN_OR_EQUAL", - "GREATER_THAN", - "GREATER_THAN_OR_EQUAL", - "EQUAL", - "HAS_ANCESTOR" - ], - "description": "The operator to filter by.", - "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", - "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" - } - }, + "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://datastore.googleapis.com/", "auth": { @@ -1484,7 +18,1525 @@ } } }, - "servicePath": "", + "kind": "discovery#restDescription", "description": "Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.\n", - "kind": "discovery#restDescription" + "servicePath": "", + "rootUrl": "https://datastore.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "datastore", + "batchPath": "batch", + "revision": "20171205", + "documentationLink": "https://cloud.google.com/datastore/", + "id": "datastore:v1", + "title": "Google Cloud Datastore API", + "discoveryVersion": "v1", + "ownerName": "Google", + "version_module": true, + "resources": { + "projects": { + "methods": { + "commit": { + "response": { + "$ref": "CommitResponse" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1/projects/{projectId}:commit", + "path": "v1/projects/{projectId}:commit", + "id": "datastore.projects.commit", + "request": { + "$ref": "CommitRequest" + }, + "description": "Commits a transaction, optionally creating, deleting or modifying some\nentities." + }, + "beginTransaction": { + "flatPath": "v1/projects/{projectId}:beginTransaction", + "path": "v1/projects/{projectId}:beginTransaction", + "id": "datastore.projects.beginTransaction", + "request": { + "$ref": "BeginTransactionRequest" + }, + "description": "Begins a new transaction.", + "response": { + "$ref": "BeginTransactionResponse" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ] + }, + "reserveIds": { + "flatPath": "v1/projects/{projectId}:reserveIds", + "id": "datastore.projects.reserveIds", + "path": "v1/projects/{projectId}:reserveIds", + "request": { + "$ref": "ReserveIdsRequest" + }, + "description": "Prevents the supplied keys' IDs from being auto-allocated by Cloud\nDatastore.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ReserveIdsResponse" + }, + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ] + }, + "runQuery": { + "flatPath": "v1/projects/{projectId}:runQuery", + "path": "v1/projects/{projectId}:runQuery", + "id": "datastore.projects.runQuery", + "description": "Queries for entities.", + "request": { + "$ref": "RunQueryRequest" + }, + "response": { + "$ref": "RunQueryResponse" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "required": true, + "type": "string" + } + } + }, + "rollback": { + "httpMethod": "POST", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "RollbackResponse" + }, + "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": "v1/projects/{projectId}:rollback", + "id": "datastore.projects.rollback", + "path": "v1/projects/{projectId}:rollback", + "request": { + "$ref": "RollbackRequest" + }, + "description": "Rolls back a transaction." + }, + "lookup": { + "request": { + "$ref": "LookupRequest" + }, + "description": "Looks up entities by key.", + "httpMethod": "POST", + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "LookupResponse" + }, + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1/projects/{projectId}:lookup", + "id": "datastore.projects.lookup", + "path": "v1/projects/{projectId}:lookup" + }, + "allocateIds": { + "response": { + "$ref": "AllocateIdsResponse" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "required": true, + "type": "string" + } + }, + "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" + }, + "description": "Allocates IDs for the given keys, which is useful for referencing an entity\nbefore it is inserted." + } + }, + "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`.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource to be cancelled." + } + }, + "flatPath": "v1/projects/{projectsId}/operations/{operationsId}:cancel", + "path": "v1/{+name}:cancel", + "id": "datastore.projects.operations.cancel" + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "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", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1/projects/{projectsId}/operations/{operationsId}", + "path": "v1/{+name}", + "id": "datastore.projects.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`." + }, + "list": { + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "name": { + "location": "path", + "description": "The name of the operation's parent resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "The standard list page size.", + "format": "int32", + "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", + "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." + }, + "get": { + "path": "v1/{+name}", + "id": "datastore.projects.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": "GoogleLongrunningOperation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The name of the operation resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/operations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1/projects/{projectsId}/operations/{operationsId}" + } + } + } + } + } + }, + "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": { + "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": { + "type": "boolean", + "default": "true", + "location": "query", + "description": "Pretty-print response." + }, + "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" + }, + "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": { + "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": { + "MutationResult": { + "id": "MutationResult", + "description": "The result of applying a mutation.", + "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" + }, + "key": { + "description": "The automatically allocated key.\nSet only when the mutation allocated a key.", + "$ref": "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", + "type": "string" + } + } + }, + "RollbackRequest": { + "description": "The request for Datastore.Rollback.", + "type": "object", + "properties": { + "transaction": { + "description": "The transaction identifier, returned by a call to\nDatastore.BeginTransaction.", + "format": "byte", + "type": "string" + } + }, + "id": "RollbackRequest" + }, + "GoogleDatastoreAdminV1beta1ExportEntitiesMetadata": { + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesMetadata", + "description": "Metadata for ExportEntities operations.", + "type": "object", + "properties": { + "entityFilter": { + "description": "Description of which entities are being exported.", + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter" + }, + "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" + }, + "progressEntities": { + "$ref": "GoogleDatastoreAdminV1beta1Progress", + "description": "An estimate of the number of entities processed." + }, + "common": { + "$ref": "GoogleDatastoreAdminV1beta1CommonMetadata", + "description": "Metadata common to all Datastore Admin operations." + }, + "progressBytes": { + "$ref": "GoogleDatastoreAdminV1beta1Progress", + "description": "An estimate of the number of bytes processed." + } + } + }, + "CompositeFilter": { + "type": "object", + "properties": { + "filters": { + "description": "The list of filters to combine.\nMust contain at least one filter.", + "type": "array", + "items": { + "$ref": "Filter" + } + }, + "op": { + "description": "The operator for combining multiple filters.", + "type": "string", + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "The results are required to satisfy each of the combined filters." + ], + "enum": [ + "OPERATOR_UNSPECIFIED", + "AND" + ] + } + }, + "id": "CompositeFilter", + "description": "A filter that merges multiple other filters using the given operator." + }, + "AllocateIdsResponse": { + "description": "The response for Datastore.AllocateIds.", + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "$ref": "Key" + }, + "description": "The keys specified in the request (in the same order), each with\nits key path completed with a newly allocated ID." + } + }, + "id": "AllocateIdsResponse" + }, + "GoogleLongrunningOperation": { + "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\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": "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" + }, + "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" + } + }, + "id": "GoogleLongrunningOperation" + }, + "PropertyFilter": { + "description": "A filter on a specific property.", + "type": "object", + "properties": { + "value": { + "description": "The value to compare the property to.", + "$ref": "Value" + }, + "property": { + "$ref": "PropertyReference", + "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.", + "Less than or equal.", + "Greater than.", + "Greater than or equal.", + "Equal.", + "Has ancestor." + ], + "enum": [ + "OPERATOR_UNSPECIFIED", + "LESS_THAN", + "LESS_THAN_OR_EQUAL", + "GREATER_THAN", + "GREATER_THAN_OR_EQUAL", + "EQUAL", + "HAS_ANCESTOR" + ] + } + }, + "id": "PropertyFilter" + }, + "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.", + "type": "string" + } + }, + "id": "PartitionId" + }, + "Entity": { + "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", + "properties": { + "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" + } + }, + "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." + } + } + }, + "QueryResultBatch": { + "description": "A batch of results produced by a query.", + "type": "object", + "properties": { + "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": { + "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" + ], + "description": "The result type for every entity in `entity_results`." + }, + "entityResults": { + "description": "The results for this batch.", + "type": "array", + "items": { + "$ref": "EntityResult" + } + }, + "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 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" + ], + "description": "The state of the query after the current batch.", + "type": "string" + }, + "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" + } + }, + "id": "QueryResultBatch" + }, + "GoogleDatastoreAdminV1beta1Progress": { + "description": "Measures the progress of a particular metric.", + "type": "object", + "properties": { + "workEstimated": { + "description": "An estimate of how much work needs to be performed. May be zero if the\nwork estimate is unavailable.", + "format": "int64", + "type": "string" + }, + "workCompleted": { + "description": "The amount of work that has been completed. Note that this may be greater\nthan work_estimated.", + "format": "int64", + "type": "string" + } + }, + "id": "GoogleDatastoreAdminV1beta1Progress" + }, + "PathElement": { + "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", + "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." + }, + "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" + }, + "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" + }, + "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" + }, + "RunQueryResponse": { + "description": "The response for Datastore.RunQuery.", + "type": "object", + "properties": { + "query": { + "description": "The parsed form of the `GqlQuery` from the request, if it was set.", + "$ref": "Query" + }, + "batch": { + "$ref": "QueryResultBatch", + "description": "A batch of query results (always present)." + } + }, + "id": "RunQueryResponse" + }, + "LookupResponse": { + "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", + "description": "The response for Datastore.Lookup.", + "type": "object" + }, + "CommitRequest": { + "id": "CommitRequest", + "description": "The request for Datastore.Commit.", + "type": "object", + "properties": { + "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." + ] + }, + "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" + } + } + } + }, + "BeginTransactionRequest": { + "properties": { + "transactionOptions": { + "$ref": "TransactionOptions", + "description": "Options for a new transaction." + } + }, + "id": "BeginTransactionRequest", + "description": "The request for Datastore.BeginTransaction.", + "type": "object" + }, + "KindExpression": { + "type": "object", + "properties": { + "name": { + "description": "The name of the kind.", + "type": "string" + } + }, + "id": "KindExpression", + "description": "A representation of a kind." + }, + "Key": { + "type": "object", + "properties": { + "partitionId": { + "$ref": "PartitionId", + "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\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" + } + } + }, + "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." + }, + "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.", + "type": "object", + "properties": { + "longitude": { + "type": "number", + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "format": "double" + }, + "latitude": { + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "format": "double", + "type": "number" + } + }, + "id": "LatLng" + }, + "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": { + "type": "string", + "description": "The time the operation ended, either successfully or otherwise.", + "format": "google-datetime" + }, + "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." + ] + }, + "state": { + "enum": [ + "STATE_UNSPECIFIED", + "INITIALIZING", + "PROCESSING", + "CANCELLING", + "FINALIZING", + "SUCCESSFUL", + "FAILED", + "CANCELLED" + ], + "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." + ] + }, + "startTime": { + "description": "The time that work began on the operation.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "GoogleDatastoreAdminV1beta1CommonMetadata" + }, + "ArrayValue": { + "description": "An array value.", + "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.", + "type": "array", + "items": { + "$ref": "Value" + } + } + }, + "id": "ArrayValue" + }, + "GoogleDatastoreAdminV1beta1ExportEntitiesResponse": { + "description": "The response for\ngoogle.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities.", + "type": "object", + "properties": { + "outputUrl": { + "type": "string", + "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." + } + }, + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesResponse" + }, + "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" + }, + "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" + } + }, + "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" + }, + "Filter": { + "description": "A holder for any type of filter.", + "type": "object", + "properties": { + "propertyFilter": { + "$ref": "PropertyFilter", + "description": "A filter on a property." + }, + "compositeFilter": { + "description": "A composite filter.", + "$ref": "CompositeFilter" + } + }, + "id": "Filter" + }, + "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": { + "$ref": "GqlQuery", + "description": "The GQL query to run." + }, + "readOptions": { + "$ref": "ReadOptions", + "description": "The options for this query." + }, + "query": { + "description": "The query to run.", + "$ref": "Query" + } + }, + "id": "RunQueryRequest" + }, + "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 `{}`." + }, + "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": { + "readWrite": { + "$ref": "ReadWrite", + "description": "The transaction should allow both reads and writes." + }, + "readOnly": { + "description": "The transaction should only allow reads.", + "$ref": "ReadOnly" + } + }, + "id": "TransactionOptions" + }, + "GoogleDatastoreAdminV1beta1ImportEntitiesMetadata": { + "id": "GoogleDatastoreAdminV1beta1ImportEntitiesMetadata", + "description": "Metadata for ImportEntities operations.", + "type": "object", + "properties": { + "progressBytes": { + "$ref": "GoogleDatastoreAdminV1beta1Progress", + "description": "An estimate of the number of bytes processed." + }, + "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" + }, + "entityFilter": { + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter", + "description": "Description of which entities are being imported." + }, + "progressEntities": { + "description": "An estimate of the number of entities processed.", + "$ref": "GoogleDatastoreAdminV1beta1Progress" + }, + "common": { + "description": "Metadata common to all Datastore Admin operations.", + "$ref": "GoogleDatastoreAdminV1beta1CommonMetadata" + } + } + }, + "Query": { + "properties": { + "projection": { + "description": "The projection to return. Defaults to returning all properties.", + "type": "array", + "items": { + "$ref": "Projection" + } + }, + "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" + }, + "filter": { + "$ref": "Filter", + "description": "The filter to apply." + }, + "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" + }, + "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", + "type": "string" + }, + "offset": { + "description": "The number of results to skip. Applies before limit, but after all other\nconstraints. Optional. Must be \u003e= 0 if specified.", + "format": "int32", + "type": "integer" + }, + "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" + } + } + }, + "id": "Query", + "description": "A query for entities.", + "type": "object" + }, + "ReadOnly": { + "properties": {}, + "id": "ReadOnly", + "description": "Options specific to read-only transactions.", + "type": "object" + }, + "EntityResult": { + "description": "The result of fetching an entity from Datastore.", + "type": "object", + "properties": { + "entity": { + "$ref": "Entity", + "description": "The resulting entity." + }, + "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" + } + }, + "id": "EntityResult" + }, + "Value": { + "properties": { + "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`." + }, + "entityValue": { + "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.", + "$ref": "Entity" + }, + "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" + }, + "booleanValue": { + "description": "A boolean value.", + "type": "boolean" + }, + "nullValue": { + "enumDescriptions": [ + "Null value." + ], + "enum": [ + "NULL_VALUE" + ], + "description": "A null value.", + "type": "string" + }, + "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" + } + }, + "id": "Value", + "description": "A message that can hold any of the supported value types and associated\nmetadata.", + "type": "object" + }, + "ReadWrite": { + "properties": { + "previousTransaction": { + "type": "string", + "description": "The transaction identifier of the transaction being retried.", + "format": "byte" + } + }, + "id": "ReadWrite", + "description": "Options specific to read / write transactions.", + "type": "object" + }, + "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" + }, + "ReserveIdsRequest": { + "properties": { + "keys": { + "type": "array", + "items": { + "$ref": "Key" + }, + "description": "A list of keys with complete key paths whose numeric IDs should not be\nauto-allocated." + }, + "databaseId": { + "description": "If not empty, the ID of the database against which to make the request.", + "type": "string" + } + }, + "id": "ReserveIdsRequest", + "description": "The request for Datastore.ReserveIds.", + "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 is a common set of\nmessage 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" + }, + "PropertyOrder": { + "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", + "description": "The desired order for a specific property.", + "type": "object" + }, + "ReserveIdsResponse": { + "id": "ReserveIdsResponse", + "description": "The response for Datastore.ReserveIds.", + "type": "object", + "properties": {} + }, + "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" + }, + "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": { + "type": "array", + "items": { + "type": "string" + }, + "description": "If empty, then this represents all kinds." + }, + "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.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "GoogleDatastoreAdminV1beta1EntityFilter" + }, + "Projection": { + "description": "A representation of a property in a projection.", + "type": "object", + "properties": { + "property": { + "$ref": "PropertyReference", + "description": "The property to project." + } + }, + "id": "Projection" + }, + "Mutation": { + "description": "A mutation to apply to an entity.", + "type": "object", + "properties": { + "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" + }, + "insert": { + "$ref": "Entity", + "description": "The entity to insert. The entity must not already exist.\nThe entity key's final path element may be incomplete." + }, + "baseVersion": { + "type": "string", + "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" + }, + "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" + } + }, + "id": "Mutation" + }, + "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", + "properties": {}, + "id": "RollbackResponse" + } + } } diff --git a/etc/api/datastore/v1beta1/datastore-api.json b/etc/api/datastore/v1beta1/datastore-api.json index 3b00222088..73b8ae971c 100644 --- a/etc/api/datastore/v1beta1/datastore-api.json +++ b/etc/api/datastore/v1beta1/datastore-api.json @@ -1,8 +1,4 @@ { - "batchPath": "batch", - "revision": "20170918", - "documentationLink": "https://cloud.google.com/datastore/", - "id": "datastore:v1beta1", "title": "Google Cloud Datastore API", "discoveryVersion": "v1", "ownerName": "Google", @@ -11,8 +7,6 @@ "projects": { "methods": { "export": { - "id": "datastore.projects.export", - "path": "v1beta1/projects/{projectId}:export", "request": { "$ref": "GoogleDatastoreAdminV1beta1ExportEntitiesRequest" }, @@ -24,72 +18,90 @@ "projectId" ], "httpMethod": "POST", + "parameters": { + "projectId": { + "description": "Project ID 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" ], - "parameters": { - "projectId": { - "location": "path", - "description": "Project ID against which to make the request.", - "type": "string", - "required": true - } - }, - "flatPath": "v1beta1/projects/{projectId}:export" + "flatPath": "v1beta1/projects/{projectId}:export", + "path": "v1beta1/projects/{projectId}:export", + "id": "datastore.projects.export" }, "import": { + "flatPath": "v1beta1/projects/{projectId}: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" - }, + "httpMethod": "POST", "parameterOrder": [ "projectId" ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/datastore" - ], + "response": { + "$ref": "GoogleLongrunningOperation" + }, "parameters": { "projectId": { "description": "Project ID against which to make the request.", - "type": "string", "required": true, + "type": "string", "location": "path" } }, - "flatPath": "v1beta1/projects/{projectId}:import" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ] } } } }, "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.", + "alt": { + "enum": [ + "json", + "media", + "proto" + ], "type": "string", - "location": "query" + "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": { - "type": "string", "location": "query", - "description": "OAuth access token." + "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" + "type": "string", + "location": "query" }, "pp": { "location": "query", "description": "Pretty-print response.", - "default": "true", - "type": "boolean" + "type": "boolean", + "default": "true" }, "bearer_token": { "location": "query", @@ -107,14 +119,9 @@ "type": "string" }, "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": { @@ -122,6 +129,16 @@ "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", @@ -134,100 +151,17 @@ ], "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": { + "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.", @@ -237,58 +171,75 @@ "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" + "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." + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" }, "metadata": { - "type": "object", "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": "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" + "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": "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.", + "type": "array", "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.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } } }, - "id": "GoogleDatastoreAdminV1beta1EntityFilter" + "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']" }, "GoogleDatastoreAdminV1beta1CommonMetadata": { "description": "Metadata common to all Datastore Admin operations.", "type": "object", "properties": { + "labels": { + "description": "The client-assigned labels which were provided when the operation was\ncreated. May also include additional labels.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "endTime": { - "format": "google-datetime", "description": "The time the operation ended, either successfully or otherwise.", + "format": "google-datetime", "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." + ] + }, "state": { "description": "The current state of the Operation.", "type": "string", @@ -313,39 +264,29 @@ "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.", + "format": "google-datetime", "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": { + "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 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.", @@ -353,72 +294,62 @@ }, "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" + "description": "A list of messages that carry the error details. There is a common set of\nmessage 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.", - "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" - } - } + "id": "Status" }, "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" + "common": { + "description": "Metadata common to all Datastore Admin operations.", + "$ref": "GoogleDatastoreAdminV1beta1CommonMetadata" + }, + "progressBytes": { + "description": "An estimate of the number of bytes processed.", + "$ref": "GoogleDatastoreAdminV1beta1Progress" }, "entityFilter": { "$ref": "GoogleDatastoreAdminV1beta1EntityFilter", "description": "Description of which entities are being exported." }, + "outputUrlPrefix": { + "type": "string", + "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." + }, "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" + "$ref": "GoogleDatastoreAdminV1beta1Progress", + "description": "An estimate of the number of entities processed." } }, - "id": "GoogleDatastoreAdminV1beta1ExportEntitiesMetadata" + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesMetadata", + "description": "Metadata for ExportEntities operations.", + "type": "object" + }, + "GoogleDatastoreAdminV1beta1ExportEntitiesRequest": { + "properties": { + "entityFilter": { + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter", + "description": "Description of what data from the project is included in the export." + }, + "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" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Client-assigned labels.", + "type": "object" + } + }, + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesRequest", + "description": "The request for\ngoogle.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities.", + "type": "object" }, "GoogleDatastoreAdminV1beta1ExportEntitiesResponse": { + "description": "The response for\ngoogle.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities.", "type": "object", "properties": { "outputUrl": { @@ -426,8 +357,73 @@ "type": "string" } }, - "id": "GoogleDatastoreAdminV1beta1ExportEntitiesResponse", - "description": "The response for\ngoogle.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities." + "id": "GoogleDatastoreAdminV1beta1ExportEntitiesResponse" + }, + "GoogleDatastoreAdminV1beta1ImportEntitiesMetadata": { + "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." + }, + "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" + }, + "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", + "description": "Metadata for ImportEntities operations." + }, + "GoogleDatastoreAdminV1beta1ImportEntitiesRequest": { + "description": "The request for\ngoogle.datastore.admin.v1beta1.DatastoreAdmin.ImportEntities.", + "type": "object", + "properties": { + "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." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Client-assigned labels.", + "type": "object" + } + }, + "id": "GoogleDatastoreAdminV1beta1ImportEntitiesRequest" + }, + "GoogleDatastoreAdminV1beta1Progress": { + "description": "Measures the progress of a particular metric.", + "type": "object", + "properties": { + "workEstimated": { + "description": "An estimate of how much work needs to be performed. May be zero if the\nwork estimate is unavailable.", + "format": "int64", + "type": "string" + }, + "workCompleted": { + "description": "The amount of work that has been completed. Note that this may be greater\nthan work_estimated.", + "format": "int64", + "type": "string" + } + }, + "id": "GoogleDatastoreAdminV1beta1Progress" } }, "protocol": "rest", @@ -440,20 +436,24 @@ "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" + }, + "https://www.googleapis.com/auth/datastore": { + "description": "View and manage your Google Cloud Datastore data" } } } }, - "servicePath": "", - "description": "Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.\n", "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" + "name": "datastore", + "batchPath": "batch", + "revision": "20171205", + "documentationLink": "https://cloud.google.com/datastore/", + "id": "datastore:v1beta1" } diff --git a/etc/api/datastore/v1beta3/datastore-api.json b/etc/api/datastore/v1beta3/datastore-api.json index e4b6329b53..014b6d763c 100644 --- a/etc/api/datastore/v1beta3/datastore-api.json +++ b/etc/api/datastore/v1beta3/datastore-api.json @@ -3,11 +3,119 @@ "resources": { "projects": { "methods": { - "rollback": { - "description": "Rolls back a transaction.", - "request": { - "$ref": "RollbackRequest" + "commit": { + "response": { + "$ref": "CommitResponse" }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta3/projects/{projectId}:commit", + "path": "v1beta3/projects/{projectId}:commit", + "id": "datastore.projects.commit", + "description": "Commits a transaction, optionally creating, deleting or modifying some\nentities.", + "request": { + "$ref": "CommitRequest" + } + }, + "beginTransaction": { + "request": { + "$ref": "BeginTransactionRequest" + }, + "description": "Begins a new transaction.", + "response": { + "$ref": "BeginTransactionResponse" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1beta3/projects/{projectId}:beginTransaction", + "path": "v1beta3/projects/{projectId}:beginTransaction", + "id": "datastore.projects.beginTransaction" + }, + "reserveIds": { + "path": "v1beta3/projects/{projectId}:reserveIds", + "id": "datastore.projects.reserveIds", + "description": "Prevents the supplied keys' IDs from being auto-allocated by Cloud\nDatastore.", + "request": { + "$ref": "ReserveIdsRequest" + }, + "response": { + "$ref": "ReserveIdsResponse" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta3/projects/{projectId}:reserveIds" + }, + "runQuery": { + "description": "Queries for entities.", + "request": { + "$ref": "RunQueryRequest" + }, + "response": { + "$ref": "RunQueryResponse" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the project against which to make the request.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta3/projects/{projectId}:runQuery", + "path": "v1beta3/projects/{projectId}:runQuery", + "id": "datastore.projects.runQuery" + }, + "rollback": { "response": { "$ref": "RollbackResponse" }, @@ -15,30 +123,6 @@ "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" - ], - "flatPath": "v1beta3/projects/{projectId}:rollback", - "id": "datastore.projects.rollback", - "path": "v1beta3/projects/{projectId}:rollback" - }, - "runQuery": { - "httpMethod": "POST", - "parameterOrder": [ - "projectId" - ], - "response": { - "$ref": "RunQueryResponse" - }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/datastore" @@ -46,52 +130,48 @@ "parameters": { "projectId": { "description": "The ID of the project against which to make the request.", - "type": "string", "required": true, + "type": "string", "location": "path" } }, - "flatPath": "v1beta3/projects/{projectId}:runQuery", - "path": "v1beta3/projects/{projectId}:runQuery", - "id": "datastore.projects.runQuery", + "flatPath": "v1beta3/projects/{projectId}:rollback", + "path": "v1beta3/projects/{projectId}:rollback", + "id": "datastore.projects.rollback", + "description": "Rolls back a transaction.", "request": { - "$ref": "RunQueryRequest" - }, - "description": "Queries for entities." + "$ref": "RollbackRequest" + } }, "lookup": { + "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}:lookup", + "path": "v1beta3/projects/{projectId}:lookup", + "id": "datastore.projects.lookup", + "description": "Looks up entities by key.", + "request": { + "$ref": "LookupRequest" + }, "response": { "$ref": "LookupResponse" }, "parameterOrder": [ "projectId" ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/datastore" - ], - "parameters": { - "projectId": { - "location": "path", - "description": "The ID of the project against which to make the request.", - "type": "string", - "required": true - } - }, - "flatPath": "v1beta3/projects/{projectId}:lookup", - "id": "datastore.projects.lookup", - "path": "v1beta3/projects/{projectId}:lookup", - "request": { - "$ref": "LookupRequest" - }, - "description": "Looks up entities by key." + "httpMethod": "POST" }, "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" }, @@ -101,10 +181,10 @@ "httpMethod": "POST", "parameters": { "projectId": { - "location": "path", "description": "The ID of the project against which to make the request.", + "required": true, "type": "string", - "required": true + "location": "path" } }, "scopes": [ @@ -112,71 +192,23 @@ "https://www.googleapis.com/auth/datastore" ], "flatPath": "v1beta3/projects/{projectId}:allocateIds", + "path": "v1beta3/projects/{projectId}:allocateIds", "id": "datastore.projects.allocateIds", - "path": "v1beta3/projects/{projectId}:allocateIds" - }, - "commit": { - "httpMethod": "POST", - "parameterOrder": [ - "projectId" - ], - "response": { - "$ref": "CommitResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/datastore" - ], - "parameters": { - "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" + "$ref": "AllocateIdsRequest" }, - "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, - "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": "Allocates IDs for the given keys, which is useful for referencing an entity\nbefore it is inserted." } } } }, "parameters": { + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" + }, "$.xgafv": { - "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -186,20 +218,10 @@ "1", "2" ], - "description": "V1 error format." - }, - "callback": { - "location": "query", - "description": "JSONP", + "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", @@ -207,38 +229,44 @@ ], "location": "query", "description": "Data format for response.", - "default": "json" + "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": { "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.", + "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" }, - "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", - "type": "boolean" + "location": "query" }, "bearer_token": { + "type": "string", "location": "query", - "description": "OAuth bearer token.", - "type": "string" + "description": "OAuth bearer token." }, "oauth_token": { + "type": "string", "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" + "description": "OAuth 2.0 token for the current user." }, "upload_protocol": { "location": "query", @@ -248,13 +276,13 @@ "prettyPrint": { "location": "query", "description": "Returns response with indentations and line breaks.", - "default": "true", - "type": "boolean" + "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\")." + "location": "query" }, "fields": { "location": "query", @@ -263,105 +291,41 @@ } }, "schemas": { - "MutationResult": { - "description": "The result of applying a mutation.", + "RunQueryRequest": { + "description": "The request for Datastore.RunQuery.", "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" + "readOptions": { + "$ref": "ReadOptions", + "description": "The options for this query." }, - "key": { - "description": "The automatically allocated key.\nSet only when the mutation allocated a key.", - "$ref": "Key" + "query": { + "description": "The query to run.", + "$ref": "Query" }, - "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" + "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": { + "$ref": "GqlQuery", + "description": "The GQL query to run." } }, - "id": "MutationResult" - }, - "GqlQuery": { - "properties": { - "queryString": { - "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": { - "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" - }, - "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", - "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": { - "$ref": "CompositeFilter", - "description": "A composite filter." - }, - "propertyFilter": { - "description": "A filter on a property.", - "$ref": "PropertyFilter" - } - }, - "id": "Filter" + "id": "RunQueryRequest" }, "RollbackRequest": { "description": "The request for Datastore.Rollback.", "type": "object", "properties": { "transaction": { - "type": "string", + "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" }, - "RunQueryRequest": { - "description": "The request for Datastore.RunQuery.", - "type": "object", - "properties": { - "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": { - "$ref": "ReadOptions", - "description": "The options for this query." - }, - "query": { - "$ref": "Query", - "description": "The query to run." - } - }, - "id": "RunQueryRequest" - }, "GoogleDatastoreAdminV1beta1ExportEntitiesMetadata": { "description": "Metadata for ExportEntities operations.", "type": "object", @@ -374,61 +338,61 @@ "$ref": "GoogleDatastoreAdminV1beta1Progress", "description": "An estimate of the number of bytes processed." }, + "entityFilter": { + "description": "Description of which entities are being exported.", + "$ref": "GoogleDatastoreAdminV1beta1EntityFilter" + }, "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." + "description": "An estimate of the number of entities processed.", + "$ref": "GoogleDatastoreAdminV1beta1Progress" } }, "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": { + "readWrite": { + "description": "The transaction should allow both reads and writes.", + "$ref": "ReadWrite" + }, "readOnly": { "$ref": "ReadOnly", "description": "The transaction should only allow reads." - }, - "readWrite": { - "$ref": "ReadWrite", - "description": "The transaction should allow both reads and writes." } - } + }, + "id": "TransactionOptions" }, "CompositeFilter": { + "type": "object", "properties": { - "filters": { - "items": { - "$ref": "Filter" - }, - "type": "array", - "description": "The list of filters to combine.\nMust contain at least one filter." - }, "op": { + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "The results are required to satisfy each of the combined filters." + ], "enum": [ "OPERATOR_UNSPECIFIED", "AND" ], "description": "The operator for combining multiple filters.", - "type": "string", - "enumDescriptions": [ - "Unspecified. This value must not be used.", - "The results are required to satisfy each of the combined filters." - ] + "type": "string" + }, + "filters": { + "description": "The list of filters to combine.\nMust contain at least one filter.", + "type": "array", + "items": { + "$ref": "Filter" + } } }, "id": "CompositeFilter", - "description": "A filter that merges multiple other filters using the given operator.", - "type": "object" + "description": "A filter that merges multiple other filters using the given operator." }, "GoogleDatastoreAdminV1beta1ImportEntitiesMetadata": { "description": "Metadata for ImportEntities operations.", @@ -438,14 +402,14 @@ "$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" }, + "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" + }, "entityFilter": { "$ref": "GoogleDatastoreAdminV1beta1EntityFilter", "description": "Description of which entities are being imported." @@ -458,98 +422,97 @@ "id": "GoogleDatastoreAdminV1beta1ImportEntitiesMetadata" }, "AllocateIdsResponse": { - "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", - "description": "The response for Datastore.AllocateIds." + "description": "The response for Datastore.AllocateIds.", + "type": "object" }, "Query": { "description": "A query for entities.", "type": "object", "properties": { - "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" - }, - "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.", + "type": "array", "items": { "$ref": "Projection" - }, - "type": "array" + } }, "endCursor": { - "type": "string", + "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": { "$ref": "Filter", "description": "The filter to apply." }, - "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": { - "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).", "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" }, "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.", + "format": "int32", "type": "integer" + }, + "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": { + "type": "array", + "items": { + "$ref": "PropertyReference" + }, + "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).", + "type": "array", + "items": { + "$ref": "PropertyOrder" + } } }, "id": "Query" }, "ReadOnly": { - "properties": {}, - "id": "ReadOnly", "description": "Options specific to read-only transactions.", - "type": "object" + "type": "object", + "properties": {}, + "id": "ReadOnly" }, "PropertyFilter": { - "id": "PropertyFilter", - "description": "A filter on a specific property.", "type": "object", "properties": { - "value": { - "$ref": "Value", - "description": "The value to compare the property to." - }, - "property": { - "$ref": "PropertyReference", - "description": "The property to filter by." - }, "op": { + "enum": [ + "OPERATOR_UNSPECIFIED", + "LESS_THAN", + "LESS_THAN_OR_EQUAL", + "GREATER_THAN", + "GREATER_THAN_OR_EQUAL", + "EQUAL", + "HAS_ANCESTOR" + ], "description": "The operator to filter by.", "type": "string", "enumDescriptions": [ @@ -560,236 +523,208 @@ "Greater than or equal.", "Equal.", "Has ancestor." - ], - "enum": [ - "OPERATOR_UNSPECIFIED", - "LESS_THAN", - "LESS_THAN_OR_EQUAL", - "GREATER_THAN", - "GREATER_THAN_OR_EQUAL", - "EQUAL", - "HAS_ANCESTOR" ] + }, + "value": { + "description": "The value to compare the property to.", + "$ref": "Value" + }, + "property": { + "description": "The property to filter by.", + "$ref": "PropertyReference" } - } + }, + "id": "PropertyFilter", + "description": "A filter on a specific property." }, "EntityResult": { "description": "The result of fetching an entity from Datastore.", "type": "object", "properties": { - "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.", + "format": "byte", "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.", + "format": "int64", "type": "string" + }, + "entity": { + "description": "The resulting entity.", + "$ref": "Entity" } }, "id": "EntityResult" }, - "CommitResponse": { + "Value": { + "description": "A message that can hold any of the supported value types and associated\nmetadata.", + "type": "object", "properties": { - "indexUpdates": { + "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": { + "description": "A geo point value representing a point on the surface of Earth.", + "$ref": "LatLng" + }, + "keyValue": { + "$ref": "Key", + "description": "A key value." + }, + "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" + }, + "booleanValue": { + "description": "A boolean value.", + "type": "boolean" + }, + "nullValue": { + "enum": [ + "NULL_VALUE" + ], + "description": "A null value.", + "type": "string", + "enumDescriptions": [ + "Null value." + ] + }, + "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", - "description": "The number of index entries updated during the commit, or zero if none were\nupdated.", "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" + }, + "CommitResponse": { + "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" - }, - "type": "array" + } + }, + "indexUpdates": { + "description": "The number of index entries updated during the commit, or zero if none were\nupdated.", + "format": "int32", + "type": "integer" } }, "id": "CommitResponse", "description": "The response for Datastore.Commit.", "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." - }, - "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": { - "$ref": "Key", - "description": "A key value." - }, - "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" - } - }, - "id": "Value", - "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.", + "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": { + "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" + } + }, + "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." + } + }, + "id": "Entity" + }, "ReadWrite": { + "id": "ReadWrite", "description": "Options specific to read / write transactions.", "type": "object", "properties": { "previousTransaction": { - "format": "byte", "description": "The transaction identifier of the transaction being retried.", + "format": "byte", "type": "string" } - }, - "id": "ReadWrite" + } }, - "Entity": { + "LookupRequest": { + "description": "The request for Datastore.Lookup.", + "type": "object", "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" + "readOptions": { + "$ref": "ReadOptions", + "description": "The options for this lookup request." }, - "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 `\"\"`." + "keys": { + "description": "Keys of entities to look up.", + "type": "array", + "items": { + "$ref": "Key" + } } }, - "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" - }, - "GoogleDatastoreAdminV1beta1Progress": { - "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", - "description": "Measures the progress of a particular metric.", - "type": "object" + "id": "LookupRequest" }, "QueryResultBatch": { "description": "A batch of results produced by a query.", "type": "object", "properties": { - "endCursor": { - "format": "byte", - "description": "A cursor that points to the position after the last result in the batch.", - "type": "string" - }, - "moreResults": { - "enum": [ - "MORE_RESULTS_TYPE_UNSPECIFIED", - "NOT_FINISHED", - "MORE_RESULTS_AFTER_LIMIT", - "MORE_RESULTS_AFTER_CURSOR", - "NO_MORE_RESULTS" - ], - "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." - ] - }, - "snapshotVersion": { - "type": "string", - "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." - }, "skippedCursor": { - "format": "byte", "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": { - "format": "int32", "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.", @@ -801,64 +736,111 @@ "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." + } + }, + "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 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" + ], + "description": "The state of the query after the current batch.", + "type": "string" + }, + "endCursor": { + "type": "string", + "description": "A cursor that points to the position after the last result in the batch.", + "format": "byte" + }, + "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" } }, "id": "QueryResultBatch" }, - "LookupRequest": { - "description": "The request for Datastore.Lookup.", - "type": "object", + "GoogleDatastoreAdminV1beta1Progress": { "properties": { - "keys": { - "description": "Keys of entities to look up.", - "items": { - "$ref": "Key" - }, - "type": "array" + "workEstimated": { + "description": "An estimate of how much work needs to be performed. May be zero if the\nwork estimate is unavailable.", + "format": "int64", + "type": "string" }, - "readOptions": { - "description": "The options for this lookup request.", - "$ref": "ReadOptions" + "workCompleted": { + "description": "The amount of work that has been completed. Note that this may be greater\nthan work_estimated.", + "format": "int64", + "type": "string" } }, - "id": "LookupRequest" + "id": "GoogleDatastoreAdminV1beta1Progress", + "description": "Measures the progress of a particular metric.", + "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.", + "ReserveIdsRequest": { + "description": "The request for Datastore.ReserveIds.", "type": "object", + "properties": { + "databaseId": { + "description": "If not empty, the ID of the database against which to make the request.", + "type": "string" + }, + "keys": { + "description": "A list of keys with complete key paths whose numeric IDs should not be\nauto-allocated.", + "type": "array", + "items": { + "$ref": "Key" + } + } + }, + "id": "ReserveIdsRequest" + }, + "PathElement": { "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 `\"\"`." + "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", + "type": "string", "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" + "format": "int64" } }, - "id": "PathElement" + "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": { - "type": "string", + "description": "A query cursor. Query cursors are returned in query\nresult batches.", "format": "byte", - "description": "A query cursor. Query cursors are returned in query\nresult batches." + "type": "string" }, "value": { "description": "A value parameter.", @@ -872,26 +854,26 @@ "type": "object", "properties": { "transaction": { - "format": "byte", "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" - }, - "type": "array" + } } }, - "id": "AllocateIdsRequest", - "description": "The request for Datastore.AllocateIds.", - "type": "object" + "id": "AllocateIdsRequest" }, "LookupResponse": { "description": "The response for Datastore.Lookup.", @@ -899,24 +881,24 @@ "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" - }, - "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": { + "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": { + "type": "array", "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." + "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." } }, "id": "LookupResponse" @@ -936,20 +918,14 @@ }, "id": "RunQueryResponse" }, - "BeginTransactionRequest": { - "description": "The request for Datastore.BeginTransaction.", - "type": "object", - "properties": { - "transactionOptions": { - "$ref": "TransactionOptions", - "description": "Options for a new transaction." - } - }, - "id": "BeginTransactionRequest" - }, "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", @@ -963,25 +939,40 @@ "ASCENDING", "DESCENDING" ] - }, - "property": { - "description": "The property to order by.", - "$ref": "PropertyReference" } }, - "id": "PropertyOrder", - "description": "The desired order for a specific property." + "id": "PropertyOrder" + }, + "BeginTransactionRequest": { + "id": "BeginTransactionRequest", + "description": "The request for Datastore.BeginTransaction.", + "type": "object", + "properties": { + "transactionOptions": { + "description": "Options for a new transaction.", + "$ref": "TransactionOptions" + } + } }, "CommitRequest": { "description": "The request for Datastore.Commit.", "type": "object", "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": { - "format": "byte", "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": { + "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).", @@ -991,22 +982,12 @@ "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.", @@ -1014,24 +995,8 @@ } }, "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" + "description": "A representation of a kind.", + "type": "object" }, "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.", @@ -1039,41 +1004,63 @@ "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" - }, - "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" + "$ref": "PartitionId", + "description": "Entities are partitioned into subsets, currently identified by a project\nID and namespace ID.\nQueries are scoped to a single partition." } }, "id": "Key" }, + "LatLng": { + "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", + "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." + }, + "ReserveIdsResponse": { + "properties": {}, + "id": "ReserveIdsResponse", + "description": "The response for Datastore.ReserveIds.", + "type": "object" + }, "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.", + "type": "array", "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.", + "type": "array", "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" + "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": { @@ -1081,24 +1068,42 @@ "type": "string" } }, - "id": "PropertyReference" + "id": "PropertyReference", + "description": "A reference to a property relative to the kind expressions." }, "GoogleDatastoreAdminV1beta1CommonMetadata": { + "description": "Metadata common to all Datastore Admin operations.", "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." + "description": "The client-assigned labels which were provided when the operation was\ncreated. May also include additional labels.", + "type": "object" }, "endTime": { - "format": "google-datetime", + "type": "string", "description": "The time the operation ended, either successfully or otherwise.", - "type": "string" + "format": "google-datetime" + }, + "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." + ] }, "state": { + "description": "The current state of the Operation.", + "type": "string", "enumDescriptions": [ "Unspecified.", "Request is being prepared for processing.", @@ -1118,54 +1123,37 @@ "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.", + "format": "google-datetime", "type": "string" } }, - "id": "GoogleDatastoreAdminV1beta1CommonMetadata", - "description": "Metadata common to all Datastore Admin operations." + "id": "GoogleDatastoreAdminV1beta1CommonMetadata" }, "ArrayValue": { + "description": "An array value.", "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.", + "type": "array", "items": { "$ref": "Value" - }, - "type": "array" + } } }, - "id": "ArrayValue", - "description": "An array value." + "id": "ArrayValue" }, "Projection": { "description": "A representation of a property in a projection.", "type": "object", "properties": { "property": { - "description": "The property to project.", - "$ref": "PropertyReference" + "$ref": "PropertyReference", + "description": "The property to project." } }, "id": "Projection" @@ -1174,6 +1162,19 @@ "description": "A mutation to apply to an entity.", "type": "object", "properties": { + "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" + }, + "insert": { + "$ref": "Entity", + "description": "The entity to insert. The entity must not already exist.\nThe entity key's final path element may be incomplete." + }, + "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." @@ -1181,19 +1182,6 @@ "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" @@ -1202,23 +1190,23 @@ "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", + "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" } }, @@ -1240,13 +1228,77 @@ "type": "object", "properties": {}, "id": "RollbackResponse" + }, + "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." + } + }, + "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" + }, + "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" + }, + "Filter": { + "description": "A holder for any type of filter.", + "type": "object", + "properties": { + "compositeFilter": { + "$ref": "CompositeFilter", + "description": "A composite filter." + }, + "propertyFilter": { + "description": "A filter on a property.", + "$ref": "PropertyFilter" + } + }, + "id": "Filter" } }, - "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": "v1beta3", "baseUrl": "https://datastore.googleapis.com/", "auth": { @@ -1261,17 +1313,17 @@ } } }, - "servicePath": "", - "description": "Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.\n", "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", - "id": "datastore:v1beta3", + "revision": "20171205", "documentationLink": "https://cloud.google.com/datastore/", - "revision": "20170918", + "id": "datastore:v1beta3", "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 index ce7c0fd5c6..669e78161e 100644 --- a/etc/api/deploymentmanager/alpha/deploymentmanager-api.json +++ b/etc/api/deploymentmanager/alpha/deploymentmanager-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/_YIg1ZU-z6xEn8qUWJtIDhiIaWM\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/YBhevoUFAfVyqSyxTJkhAWUX4fg\"", "discoveryVersion": "v1", "id": "deploymentmanager:alpha", "name": "deploymentmanager", "canonicalName": "Deployment Manager Alpha", "version": "alpha", - "revision": "20170925", + "revision": "20171201", "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", @@ -86,6 +86,21 @@ } }, "schemas": { + "AsyncOptions": { + "id": "AsyncOptions", + "type": "object", + "description": "Async options that determine when a resource should finish.", + "properties": { + "methodMatch": { + "type": "string", + "description": "Method regex where this policy will apply." + }, + "pollingOptions": { + "$ref": "PollingOptions", + "description": "Deployment manager will poll instances for this API resource setting a RUNNING state, and blocking until polling conditions tell whether the resource is completed or failed." + } + } + }, "AuditConfig": { "id": "AuditConfig", "type": "object", @@ -217,7 +232,7 @@ }, "name": { "type": "string", - "description": "Name of the composite type." + "description": "Name of the composite type, must follow the expression: [a-z]([-a-z0-9_.]{0,61}[a-z0-9])?." }, "operation": { "$ref": "Operation", @@ -527,6 +542,21 @@ } } }, + "Diagnostic": { + "id": "Diagnostic", + "type": "object", + "description": "", + "properties": { + "field": { + "type": "string", + "description": "JsonPath expression on the resource that if non empty, indicates that this field needs to be extracted as a diagnostic." + }, + "level": { + "type": "string", + "description": "Level to record this diagnostic." + } + } + }, "Expr": { "id": "Expr", "type": "object", @@ -712,7 +742,7 @@ "Operation": { "id": "Operation", "type": "object", - "description": "An Operation resource, used to manage asynchronous API requests.", + "description": "An Operation resource, used to manage asynchronous API requests. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)", "properties": { "clientOperationId": { "type": "string", @@ -889,6 +919,13 @@ "type": "object", "description": "Options allows customized resource handling by Deployment Manager.", "properties": { + "asyncOptions": { + "type": "array", + "description": "Options regarding how to thread async requests.", + "items": { + "$ref": "AsyncOptions" + } + }, "inputMappings": { "type": "array", "description": "The mappings that apply for requests.", @@ -948,6 +985,36 @@ } } }, + "PollingOptions": { + "id": "PollingOptions", + "type": "object", + "description": "", + "properties": { + "diagnostics": { + "type": "array", + "description": "An array of diagnostics to be collected by Deployment Manager, these diagnostics will be displayed to the user.", + "items": { + "$ref": "Diagnostic" + } + }, + "failCondition": { + "type": "string", + "description": "JsonPath expression that determines if the request failed." + }, + "finishCondition": { + "type": "string", + "description": "JsonPath expression that determines if the request is completed." + }, + "pollingLink": { + "type": "string", + "description": "JsonPath expression that evaluates to string, it indicates where to poll." + }, + "targetLink": { + "type": "string", + "description": "JsonPath expression, after polling is completed, indicates where to fetch the resource." + } + } + }, "Resource": { "id": "Resource", "type": "object", @@ -986,6 +1053,13 @@ "type": "string", "description": "Output only. The current properties of the resource before any references have been filled in. Returned as serialized YAML." }, + "runtimePolicies": { + "type": "array", + "description": "Output only. In case this is an action, it will show the runtimePolicies on which this action will run in the deployment", + "items": { + "type": "string" + } + }, "type": { "type": "string", "description": "Output only. The type of the resource, for example compute.v1.instance, or cloudfunctions.v1beta1.function." @@ -1105,6 +1179,13 @@ "type": "string", "description": "Output only. The set of updated properties for this resource, before references are expanded. Returned as serialized YAML." }, + "runtimePolicies": { + "type": "array", + "description": "Output only. In case this is an action, it will show the runtimePolicies that this action will have after updating the deployment.", + "items": { + "type": "string" + } + }, "state": { "type": "string", "description": "Output only. The state of the resource." @@ -1258,6 +1339,10 @@ "type": "string", "description": "Which interpreter (python or jinja) should be used during expansion." }, + "mainTemplate": { + "type": "string", + "description": "The filename of the mainTemplate" + }, "schema": { "type": "string", "description": "The contents of the template schema." @@ -1553,7 +1638,7 @@ "type": "string", "description": "The name of the type for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?", "location": "path" }, "project": { @@ -1586,7 +1671,7 @@ "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])?", + "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?", "location": "path" }, "project": { @@ -1699,7 +1784,7 @@ "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])?", + "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?", "location": "path" }, "project": { @@ -1735,7 +1820,7 @@ "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])?", + "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?", "location": "path" }, "project": { diff --git a/etc/api/deploymentmanager/v2/deploymentmanager-api.json b/etc/api/deploymentmanager/v2/deploymentmanager-api.json index 33589e2174..207dfb296e 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/4coXG-kLdOLe0xqn_lc-mbxcObg\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/GDaMgEo2rpzvf2TXCj_2gpZ3fIE\"", "discoveryVersion": "v1", "id": "deploymentmanager:v2", "name": "deploymentmanager", "canonicalName": "Deployment Manager", "version": "v2", - "revision": "20170925", + "revision": "20171201", "title": "Google Cloud Deployment Manager API", "description": "Declares, configures, and deploys complex solutions on Google Cloud Platform.", "ownerDomain": "google.com", @@ -513,7 +513,7 @@ "Operation": { "id": "Operation", "type": "object", - "description": "An Operation resource, used to manage asynchronous API requests.", + "description": "An Operation resource, used to manage asynchronous API requests. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)", "properties": { "clientOperationId": { "type": "string", diff --git a/etc/api/deploymentmanager/v2beta/deploymentmanager-api.json b/etc/api/deploymentmanager/v2beta/deploymentmanager-api.json index c19a5a38c6..ad0d275105 100644 --- a/etc/api/deploymentmanager/v2beta/deploymentmanager-api.json +++ b/etc/api/deploymentmanager/v2beta/deploymentmanager-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/fjbnlFC4GTEIX5zCJ4_9R1qQWCw\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Os0QttejTkDUy1hcIScN6tyVIbQ\"", "discoveryVersion": "v1", "id": "deploymentmanager:v2beta", "name": "deploymentmanager", "canonicalName": "Deployment Manager V2Beta", "version": "v2beta", - "revision": "20170925", + "revision": "20171201", "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", @@ -243,7 +243,7 @@ }, "name": { "type": "string", - "description": "Name of the composite type." + "description": "Name of the composite type, must follow the expression: [a-z]([-a-z0-9_.]{0,61}[a-z0-9])?." }, "operation": { "$ref": "Operation", @@ -685,7 +685,7 @@ "Operation": { "id": "Operation", "type": "object", - "description": "An Operation resource, used to manage asynchronous API requests.", + "description": "An Operation resource, used to manage asynchronous API requests. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)", "properties": { "clientOperationId": { "type": "string", @@ -1223,6 +1223,10 @@ "type": "string", "description": "Which interpreter (python or jinja) should be used during expansion." }, + "mainTemplate": { + "type": "string", + "description": "The filename of the mainTemplate" + }, "schema": { "type": "string", "description": "The contents of the template schema." @@ -1518,7 +1522,7 @@ "type": "string", "description": "The name of the type for this request.", "required": true, - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?", "location": "path" }, "project": { @@ -1551,7 +1555,7 @@ "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])?", + "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?", "location": "path" }, "project": { @@ -1664,7 +1668,7 @@ "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])?", + "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?", "location": "path" }, "project": { @@ -1700,7 +1704,7 @@ "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])?", + "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?", "location": "path" }, "project": { diff --git a/etc/api/dfareporting/v2.8/dfareporting-api.json b/etc/api/dfareporting/v2.8/dfareporting-api.json index e52586cf07..252e98accb 100644 --- a/etc/api/dfareporting/v2.8/dfareporting-api.json +++ b/etc/api/dfareporting/v2.8/dfareporting-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/emGV_y_FRSYhyMgSPP7gVElVBpw\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/4goAvA_o9T_Nbyckne-XIOvJ_sE\"", "discoveryVersion": "v1", "id": "dfareporting:v2.8", "name": "dfareporting", "version": "v2.8", - "revision": "20170818", + "revision": "20171109", "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.8/", "rootUrl": "https://www.googleapis.com/", "servicePath": "dfareporting/v2.8/", - "batchPath": "batch", + "batchPath": "batch/dfareporting/v2.8", "parameters": { "alt": { "type": "string", @@ -154,7 +154,7 @@ }, "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", + "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 \n- \"50\" for NGN", "format": "int64" }, "defaultCreativeSizeId": { @@ -2061,7 +2061,7 @@ }, "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." + "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", @@ -4426,7 +4426,7 @@ }, "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", + "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 \n- \"50\" for NGN", "format": "int64" }, "description": { @@ -5078,7 +5078,7 @@ "properties": { "floodlightActivityTag": { "type": "string", - "description": "Generated tag for this floodlight activity." + "description": "Generated tag for this Floodlight activity. For global site tags, this is the event snippet." }, "kind": { "type": "string", @@ -5278,7 +5278,7 @@ }, "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." + "description": "Value of the cat= parameter 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", @@ -8671,7 +8671,7 @@ }, "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." + "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 42 days." }, "metricNames": { "type": "array", diff --git a/etc/api/dfareporting/v3.0/dfareporting-api.json b/etc/api/dfareporting/v3.0/dfareporting-api.json new file mode 100644 index 0000000000..48de6518bd --- /dev/null +++ b/etc/api/dfareporting/v3.0/dfareporting-api.json @@ -0,0 +1,19792 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/MD943f1mGqBAwUueANXWEMkM_XU\"", + "discoveryVersion": "v1", + "id": "dfareporting:v3.0", + "name": "dfareporting", + "version": "v3.0", + "revision": "20171109", + "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/v3.0/", + "basePath": "/dfareporting/v3.0/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dfareporting/v3.0/", + "batchPath": "batch/dfareporting/v3.0", + "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 \n- \"50\" for NGN", + "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." + } + } + }, + "AdvertiserLandingPagesListResponse": { + "id": "AdvertiserLandingPagesListResponse", + "type": "object", + "description": "Landing Page List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiserLandingPagesListResponse\".", + "default": "dfareporting#advertiserLandingPagesListResponse" + }, + "landingPages": { + "type": "array", + "description": "Landing page collection", + "items": { + "$ref": "LandingPage" + } + }, + "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." + }, + "defaultLandingPageId": { + "type": "string", + "description": "The default landing page ID for this campaign.", + "format": "int64" + }, + "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": { + "clickThroughUrl": { + "$ref": "CreativeClickThroughUrl", + "description": "Parameter value for the specified click tag. This field contains a click-through url." + }, + "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." + } + } + }, + "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": { + "$ref": "CreativeClickThroughUrl", + "description": "Click-through URL for backup image. Applicable to ENHANCED_BANNER 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." + }, + "politeLoadAssetId": { + "type": "string", + "description": "The asset ID of the polite load image asset. Applicable to the creative type: DISPLAY.", + "format": "int64" + }, + "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." + }, + "orientation": { + "type": "string", + "description": "Orientation of video asset. This is a read-only, auto-generated field.", + "enum": [ + "LANDSCAPE", + "PORTRAIT", + "SQUARE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "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" + } + } + }, + "CreativeClickThroughUrl": { + "id": "CreativeClickThroughUrl", + "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 landingPageId is specified then that landing page's URL is assigned to this field.\n- Otherwise, the customClickThroughUrl is assigned to this field." + }, + "customClickThroughUrl": { + "type": "string", + "description": "Custom click-through URL. Applicable if the landingPageId field is left unset." + }, + "landingPageId": { + "type": "string", + "description": "ID of the landing page for the click-through URL.", + "format": "int64" + } + } + }, + "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": [ + "", + "", + "", + "" + ] + }, + "exitClickThroughUrl": { + "$ref": "CreativeClickThroughUrl", + "description": "Exit click-through URL for 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 \n- \"50\" for NGN", + "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. For global site tags, this is the event snippet." + }, + "globalSiteTagGlobalSnippet": { + "type": "string", + "description": "The global snippet section of a global site tag. The global site tag sets new cookies on your domain, which will store a unique identifier for a user or the ad click that brought the user to your site. Learn more." + }, + "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." + }, + "floodlightTagType": { + "type": "string", + "description": "The type of Floodlight tag this activity will generate. This is a required field.", + "enum": [ + "GLOBAL_SITE_TAG", + "IFRAME", + "IMAGE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "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." + }, + "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= parameter 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": { + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this landing page. This is a required field.", + "format": "int64" + }, + "archived": { + "type": "boolean", + "description": "Whether this landing page has been archived." + }, + "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." + }, + "url": { + "type": "string", + "description": "URL of this landing page. This is a required field." + } + } + }, + "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 42 days." + }, + "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" + }, + "orientation": { + "type": "string", + "description": "Orientation of a video placement. If this value is set, placement will return assets matching the specified orientation.", + "enum": [ + "ANY", + "LANDSCAPE", + "PORTRAIT" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "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" + ] + } + } + }, + "advertiserLandingPages": { + "methods": { + "get": { + "id": "dfareporting.advertiserLandingPages.get", + "path": "userprofiles/{profileId}/advertiserLandingPages/{id}", + "httpMethod": "GET", + "description": "Gets one landing page by ID.", + "parameters": { + "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", + "id" + ], + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.advertiserLandingPages.insert", + "path": "userprofiles/{profileId}/advertiserLandingPages", + "httpMethod": "POST", + "description": "Inserts a new landing page.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.advertiserLandingPages.list", + "path": "userprofiles/{profileId}/advertiserLandingPages", + "httpMethod": "GET", + "description": "Retrieves a list of landing pages.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only landing pages that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only landing pages 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 landing pages by name or ID. Wildcards (*) are allowed. For example, \"landingpage*2017\" will return landing pages with names like \"landingpage July 2017\", \"landingpage March 2017\", or simply \"landingpage 2017\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"landingpage\" will match campaigns with name \"my landingpage\", \"landingpage 2015\", or simply \"landingpage\".", + "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 landing pages that belong to this subaccount.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdvertiserLandingPagesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.advertiserLandingPages.patch", + "path": "userprofiles/{profileId}/advertiserLandingPages", + "httpMethod": "PATCH", + "description": "Updates an existing landing page. This method supports patch semantics.", + "parameters": { + "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", + "id" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.advertiserLandingPages.update", + "path": "userprofiles/{profileId}/advertiserLandingPages", + "httpMethod": "PUT", + "description": "Updates an existing landing page.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "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": { + "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" + ] + }, + "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/v3.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/dfareporting/v3.0/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" + ] + } + } + }, + "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/dialogflow/v2beta1/dialogflow-api.json b/etc/api/dialogflow/v2beta1/dialogflow-api.json new file mode 100644 index 0000000000..453b8d5959 --- /dev/null +++ b/etc/api/dialogflow/v2beta1/dialogflow-api.json @@ -0,0 +1,2905 @@ +{ + "canonicalName": "Dialogflow", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://dialogflow.googleapis.com/", + "ownerDomain": "google.com", + "name": "dialogflow", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Dialogflow API", + "ownerName": "Google", + "resources": { + "projects": { + "methods": { + "getAgent": { + "response": { + "$ref": "Agent" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "parent": { + "location": "path", + "description": "Required. The project that the agent to fetch is associated with.\nFormat: `projects/\u003cProject ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent", + "path": "v2beta1/{+parent}/agent", + "id": "dialogflow.projects.getAgent", + "description": "Retrieves the specified agent." + } + }, + "resources": { + "operations": { + "methods": { + "get": { + "httpMethod": "GET", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/operations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/operations/{operationsId}", + "id": "dialogflow.projects.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." + } + } + }, + "agent": { + "methods": { + "export": { + "flatPath": "v2beta1/projects/{projectsId}/agent:export", + "path": "v2beta1/{+parent}/agent:export", + "id": "dialogflow.projects.agent.export", + "description": "Exports the specified agent to a ZIP file.\n\n\nOperation \u003cresponse: ExportAgentResponse,\n metadata: google.protobuf.Struct\u003e", + "request": { + "$ref": "ExportAgentRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "Required. The project that the agent to export is associated with.\nFormat: `projects/\u003cProject ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + } + }, + "restore": { + "description": "Restores the specified agent from a ZIP file.\n\nReplaces the current agent version with a new one. All the intents and\nentity types in the older version are deleted.\n\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e", + "request": { + "$ref": "RestoreAgentRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "Required. The project that the agent to restore is associated with.\nFormat: `projects/\u003cProject ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/agent:restore", + "path": "v2beta1/{+parent}/agent:restore", + "id": "dialogflow.projects.agent.restore" + }, + "import": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "location": "path", + "description": "Required. The project that the agent to import is associated with.\nFormat: `projects/\u003cProject ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent:import", + "path": "v2beta1/{+parent}/agent:import", + "id": "dialogflow.projects.agent.import", + "request": { + "$ref": "ImportAgentRequest" + }, + "description": "Imports the specified agent from a ZIP file.\n\nUploads new intents and entity types without deleting the existing ones.\nIntents and entity types with the same name are replaced with the new\nversions from ImportAgentRequest.\n\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e" + }, + "search": { + "flatPath": "v2beta1/projects/{projectsId}/agent:search", + "path": "v2beta1/{+parent}/agent:search", + "id": "dialogflow.projects.agent.search", + "description": "Returns the list of agents.\n\nSince there is at most one conversational agent per project, this method is\nuseful primarily for listing all agents across projects the caller has\naccess to. One can achieve that with a wildcard project collection id \"-\".\nRefer to [List\nSub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).", + "response": { + "$ref": "SearchAgentsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. The next_page_token value returned from a previous list request.", + "type": "string" + }, + "pageSize": { + "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "parent": { + "description": "Required. The project to list agents from.\nFormat: `projects/\u003cProject ID or '-'\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + } + }, + "train": { + "description": "Trains the specified agent.\n\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e", + "request": { + "$ref": "TrainAgentRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "Required. The project that the agent to train is associated with.\nFormat: `projects/\u003cProject ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/agent:train", + "path": "v2beta1/{+parent}/agent:train", + "id": "dialogflow.projects.agent.train" + } + }, + "resources": { + "sessions": { + "methods": { + "deleteContexts": { + "description": "Deletes all active contexts in the specified session.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "location": "path", + "description": "Required. The name of the session to delete all contexts from. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+$" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts", + "path": "v2beta1/{+parent}/contexts", + "id": "dialogflow.projects.agent.sessions.deleteContexts" + }, + "detectIntent": { + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}:detectIntent", + "path": "v2beta1/{+session}:detectIntent", + "id": "dialogflow.projects.agent.sessions.detectIntent", + "request": { + "$ref": "DetectIntentRequest" + }, + "description": "Processes a natural language query and returns structured, actionable data\nas a result. This method is not idempotent, because it may cause contexts\nand session entity types to be updated, which in turn might affect\nresults of future queries.", + "response": { + "$ref": "DetectIntentResponse" + }, + "parameterOrder": [ + "session" + ], + "httpMethod": "POST", + "parameters": { + "session": { + "location": "path", + "description": "Required. The name of the session this query is sent to. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.\nIt's up to the API caller to choose an appropriate session ID. It can be\na random number or some type of user identifier (preferably hashed).\nThe length of the session ID must not exceed 36 bytes.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "contexts": { + "methods": { + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "location": "path", + "description": "Required. The name of the context to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}", + "id": "dialogflow.projects.agent.sessions.contexts.delete", + "path": "v2beta1/{+name}", + "description": "Deletes the specified context." + }, + "list": { + "response": { + "$ref": "ListContextsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "location": "query", + "description": "Optional. The next_page_token value returned from a previous list request.", + "type": "string" + }, + "pageSize": { + "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "parent": { + "description": "Required. The session to list all contexts from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts", + "path": "v2beta1/{+parent}/contexts", + "id": "dialogflow.projects.agent.sessions.contexts.list", + "description": "Returns the list of all contexts in the specified session." + }, + "get": { + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}", + "path": "v2beta1/{+name}", + "id": "dialogflow.projects.agent.sessions.contexts.get", + "description": "Retrieves the specified context.", + "response": { + "$ref": "Context" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Required. The name of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$", + "location": "path" + } + } + }, + "patch": { + "request": { + "$ref": "Context" + }, + "description": "Updates the specified context.", + "response": { + "$ref": "Context" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "location": "query", + "description": "Optional. The mask to control which fields get updated.", + "format": "google-fieldmask", + "type": "string" + }, + "name": { + "description": "Required. The unique identifier of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.\nNote: The Context ID is always converted to lowercase.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts/{contextsId}", + "path": "v2beta1/{+name}", + "id": "dialogflow.projects.agent.sessions.contexts.patch" + }, + "create": { + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/contexts", + "id": "dialogflow.projects.agent.sessions.contexts.create", + "path": "v2beta1/{+parent}/contexts", + "request": { + "$ref": "Context" + }, + "description": "Creates a context.", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Context" + }, + "parameters": { + "parent": { + "location": "path", + "description": "Required. The session to create a context for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "entityTypes": { + "methods": { + "list": { + "description": "Returns the list of all session entity types in the specified session.", + "response": { + "$ref": "ListSessionEntityTypesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.", + "format": "int32", + "type": "integer" + }, + "parent": { + "description": "Required. The session to list all session entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+$", + "location": "path" + }, + "pageToken": { + "description": "Optional. The next_page_token value returned from a previous list request.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes", + "path": "v2beta1/{+parent}/entityTypes", + "id": "dialogflow.projects.agent.sessions.entityTypes.list" + }, + "get": { + "description": "Retrieves the specified session entity type.", + "response": { + "$ref": "SessionEntityType" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Required. The name of the session entity type. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}", + "path": "v2beta1/{+name}", + "id": "dialogflow.projects.agent.sessions.entityTypes.get" + }, + "patch": { + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}", + "id": "dialogflow.projects.agent.sessions.entityTypes.patch", + "path": "v2beta1/{+name}", + "request": { + "$ref": "SessionEntityType" + }, + "description": "Updates the specified session entity type.", + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "SessionEntityType" + }, + "parameters": { + "updateMask": { + "description": "Optional. The mask to control which fields get updated.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, + "name": { + "description": "Required. The unique identifier of this session entity type. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "request": { + "$ref": "SessionEntityType" + }, + "description": "Creates a session entity type.", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "SessionEntityType" + }, + "parameters": { + "parent": { + "location": "path", + "description": "Required. The session to create a session entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes", + "id": "dialogflow.projects.agent.sessions.entityTypes.create", + "path": "v2beta1/{+parent}/entityTypes" + }, + "delete": { + "description": "Deletes the specified session entity type.", + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the entity type to delete. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/sessions/{sessionsId}/entityTypes/{entityTypesId}", + "id": "dialogflow.projects.agent.sessions.entityTypes.delete", + "path": "v2beta1/{+name}" + } + } + } + } + }, + "entityTypes": { + "methods": { + "get": { + "description": "Retrieves the specified entity type.", + "response": { + "$ref": "EntityType" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "languageCode": { + "location": "query", + "description": "Optional. The language to retrieve entity synonyms for. If not specified,\nthe agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string" + }, + "name": { + "location": "path", + "description": "Required. The name of the entity type.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}", + "path": "v2beta1/{+name}", + "id": "dialogflow.projects.agent.entityTypes.get" + }, + "patch": { + "response": { + "$ref": "EntityType" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "languageCode": { + "description": "Optional. The language of entity synonyms defined in `entity_type`. If not\nspecified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string", + "location": "query" + }, + "updateMask": { + "location": "query", + "description": "Optional. The mask to control which fields get updated.", + "format": "google-fieldmask", + "type": "string" + }, + "name": { + "description": "Required for all methods except `create` (`create` populates the name\nautomatically.\nThe unique identifier of the entity type. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}", + "path": "v2beta1/{+name}", + "id": "dialogflow.projects.agent.entityTypes.patch", + "request": { + "$ref": "EntityType" + }, + "description": "Updates the specified entity type." + }, + "batchUpdate": { + "request": { + "$ref": "BatchUpdateEntityTypesRequest" + }, + "description": "Updates/Creates multiple entity types in the specified agent.\n\nOperation \u003cresponse: BatchUpdateEntityTypesResponse,\n metadata: google.protobuf.Struct\u003e", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "parent": { + "location": "path", + "description": "Required. The name of the agent to update or create entity types in.\nFormat: `projects/\u003cProject ID\u003e/agent`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes:batchUpdate", + "id": "dialogflow.projects.agent.entityTypes.batchUpdate", + "path": "v2beta1/{+parent}/entityTypes:batchUpdate" + }, + "delete": { + "description": "Deletes the specified entity type.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Required. The name of the entity type to delete.\nFormat: `projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntityType ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}", + "path": "v2beta1/{+name}", + "id": "dialogflow.projects.agent.entityTypes.delete" + }, + "list": { + "description": "Returns the list of all entity types in the specified agent.", + "response": { + "$ref": "ListEntityTypesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "parent": { + "description": "Required. The agent to list all entity types from.\nFormat: `projects/\u003cProject ID\u003e/agent`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent$", + "location": "path" + }, + "languageCode": { + "location": "query", + "description": "Optional. The language to list entity synonyms for. If not specified,\nthe agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string" + }, + "pageToken": { + "description": "Optional. The next_page_token value returned from a previous list request.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes", + "path": "v2beta1/{+parent}/entityTypes", + "id": "dialogflow.projects.agent.entityTypes.list" + }, + "batchDelete": { + "request": { + "$ref": "BatchDeleteEntityTypesRequest" + }, + "description": "Deletes entity types in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "parent": { + "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes:batchDelete", + "id": "dialogflow.projects.agent.entityTypes.batchDelete", + "path": "v2beta1/{+parent}/entityTypes:batchDelete" + }, + "create": { + "request": { + "$ref": "EntityType" + }, + "description": "Creates an entity type in the specified agent.", + "response": { + "$ref": "EntityType" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "location": "path", + "description": "Required. The agent to create a entity type for.\nFormat: `projects/\u003cProject ID\u003e/agent`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent$" + }, + "languageCode": { + "description": "Optional. The language of entity synonyms defined in `entity_type`. If not\nspecified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes", + "path": "v2beta1/{+parent}/entityTypes", + "id": "dialogflow.projects.agent.entityTypes.create" + } + }, + "resources": { + "entities": { + "methods": { + "batchCreate": { + "description": "Creates multiple new entities in the specified entity type (extends the\nexisting collection of entries).\n\nOperation \u003cresponse: google.protobuf.Empty\u003e", + "request": { + "$ref": "BatchCreateEntitiesRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "location": "path", + "description": "Required. The name of the entity type to create entities in. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchCreate", + "path": "v2beta1/{+parent}/entities:batchCreate", + "id": "dialogflow.projects.agent.entityTypes.entities.batchCreate" + }, + "batchUpdate": { + "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchUpdate", + "path": "v2beta1/{+parent}/entities:batchUpdate", + "id": "dialogflow.projects.agent.entityTypes.entities.batchUpdate", + "request": { + "$ref": "BatchUpdateEntitiesRequest" + }, + "description": "Updates entities in the specified entity type (replaces the existing\ncollection of entries).\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "Required. The name of the entity type to update the entities in. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "batchDelete": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "Required. The name of the entity type to delete entries for. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/entityTypes/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/entityTypes/{entityTypesId}/entities:batchDelete", + "path": "v2beta1/{+parent}/entities:batchDelete", + "id": "dialogflow.projects.agent.entityTypes.entities.batchDelete", + "request": { + "$ref": "BatchDeleteEntitiesRequest" + }, + "description": "Deletes entities in the specified entity type.\n\nOperation \u003cresponse: google.protobuf.Empty,\n metadata: google.protobuf.Struct\u003e" + } + } + } + } + }, + "intents": { + "methods": { + "get": { + "flatPath": "v2beta1/projects/{projectsId}/agent/intents/{intentsId}", + "path": "v2beta1/{+name}", + "id": "dialogflow.projects.agent.intents.get", + "description": "Retrieves the specified intent.", + "response": { + "$ref": "Intent" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "intentView": { + "location": "query", + "enum": [ + "INTENT_VIEW_UNSPECIFIED", + "INTENT_VIEW_FULL" + ], + "description": "Optional. The resource view to apply to the returned intent.", + "type": "string" + }, + "languageCode": { + "location": "query", + "description": "Optional. The language to retrieve training phrases, parameters and rich\nmessages for. If not specified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string" + }, + "name": { + "location": "path", + "description": "Required. The name of the intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/intents/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "request": { + "$ref": "Intent" + }, + "description": "Updates the specified intent.", + "response": { + "$ref": "Intent" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "languageCode": { + "description": "Optional. The language of training phrases, parameters and rich messages\ndefined in `intent`. If not specified, the agent's default language is\nused. [More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string", + "location": "query" + }, + "updateMask": { + "description": "Optional. The mask to control which fields get updated.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, + "name": { + "location": "path", + "description": "Required for all methods except `create` (`create` populates the name\nautomatically.\nThe unique identifier of this intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/intents/[^/]+$" + }, + "intentView": { + "location": "query", + "enum": [ + "INTENT_VIEW_UNSPECIFIED", + "INTENT_VIEW_FULL" + ], + "description": "Optional. The resource view to apply to the returned intent.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/intents/{intentsId}", + "path": "v2beta1/{+name}", + "id": "dialogflow.projects.agent.intents.patch" + }, + "batchUpdate": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "parent": { + "description": "Required. The name of the agent to update or create intents in.\nFormat: `projects/\u003cProject ID\u003e/agent`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/intents:batchUpdate", + "id": "dialogflow.projects.agent.intents.batchUpdate", + "path": "v2beta1/{+parent}/intents:batchUpdate", + "request": { + "$ref": "BatchUpdateIntentsRequest" + }, + "description": "Updates/Creates multiple intents in the specified agent.\n\nOperation \u003cresponse: BatchUpdateIntentsResponse\u003e" + }, + "delete": { + "description": "Deletes the specified intent.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Required. The name of the intent to delete.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent/intents/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/agent/intents/{intentsId}", + "path": "v2beta1/{+name}", + "id": "dialogflow.projects.agent.intents.delete" + }, + "list": { + "description": "Returns the list of all intents in the specified agent.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListIntentsResponse" + }, + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of items to return in a single page. By\ndefault 100 and at most 1000.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "intentView": { + "description": "Optional. The resource view to apply to the returned intent.", + "type": "string", + "location": "query", + "enum": [ + "INTENT_VIEW_UNSPECIFIED", + "INTENT_VIEW_FULL" + ] + }, + "parent": { + "description": "Required. The agent to list all intents from.\nFormat: `projects/\u003cProject ID\u003e/agent`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent$", + "location": "path" + }, + "languageCode": { + "location": "query", + "description": "Optional. The language to list training phrases, parameters and rich\nmessages for. If not specified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent before they can be used.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "Optional. The next_page_token value returned from a previous list request.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/intents", + "id": "dialogflow.projects.agent.intents.list", + "path": "v2beta1/{+parent}/intents" + }, + "batchDelete": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "location": "path", + "description": "Required. The name of the agent to delete all entities types for. Format:\n`projects/\u003cProject ID\u003e/agent`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/intents:batchDelete", + "path": "v2beta1/{+parent}/intents:batchDelete", + "id": "dialogflow.projects.agent.intents.batchDelete", + "request": { + "$ref": "BatchDeleteIntentsRequest" + }, + "description": "Deletes intents in the specified agent.\n\nOperation \u003cresponse: google.protobuf.Empty\u003e" + }, + "create": { + "request": { + "$ref": "Intent" + }, + "description": "Creates an intent in the specified agent.", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Intent" + }, + "parameters": { + "languageCode": { + "description": "Optional. The language of training phrases, parameters and rich messages\ndefined in `intent`. If not specified, the agent's default language is\nused. [More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string", + "location": "query" + }, + "intentView": { + "description": "Optional. The resource view to apply to the returned intent.", + "type": "string", + "location": "query", + "enum": [ + "INTENT_VIEW_UNSPECIFIED", + "INTENT_VIEW_FULL" + ] + }, + "parent": { + "location": "path", + "description": "Required. The agent to create a intent for.\nFormat: `projects/\u003cProject ID\u003e/agent`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/agent$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/projects/{projectsId}/agent/intents", + "id": "dialogflow.projects.agent.intents.create", + "path": "v2beta1/{+parent}/intents" + } + } + } + } + } + } + } + }, + "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": { + "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": { + "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" + ] + }, + "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" + } + }, + "version": "v2beta1", + "baseUrl": "https://dialogflow.googleapis.com/", + "kind": "discovery#restDescription", + "description": "An end-to-end development suite for conversational interfaces (e.g., chatbots, voice-powered apps and devices).", + "servicePath": "", + "basePath": "", + "revision": "20171211", + "documentationLink": "https://cloud.google.com/dialogflow-enterprise/", + "id": "dialogflow:v2beta1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "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 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" + } + } + }, + "id": "Status" + }, + "IntentMessage": { + "description": "Corresponds to the `Response` field in API.AI console.", + "type": "object", + "properties": { + "carouselSelect": { + "$ref": "IntentMessageCarouselSelect", + "description": "The carousel card response for Actions on Google." + }, + "linkOutSuggestion": { + "description": "The link out suggestion chip for Actions on Google.", + "$ref": "IntentMessageLinkOutSuggestion" + }, + "simpleResponses": { + "$ref": "IntentMessageSimpleResponses", + "description": "The voice and text-only responses for Actions on Google." + }, + "image": { + "description": "The image response.", + "$ref": "IntentMessageImage" + }, + "payload": { + "description": "The response containing a custom payload.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + }, + "text": { + "$ref": "IntentMessageText", + "description": "The text response." + }, + "platform": { + "enumDescriptions": [ + "Not specified.", + "Facebook.", + "Slack.", + "Telegram.", + "Kik.", + "Skype.", + "Line.", + "Viber.", + "Actions on Google." + ], + "enum": [ + "PLATFORM_UNSPECIFIED", + "FACEBOOK", + "SLACK", + "TELEGRAM", + "KIK", + "SKYPE", + "LINE", + "VIBER", + "ACTIONS_ON_GOOGLE" + ], + "description": "Optional. The platform that this message is intended for.", + "type": "string" + }, + "suggestions": { + "description": "The suggestion chips for Actions on Google.", + "$ref": "IntentMessageSuggestions" + }, + "listSelect": { + "$ref": "IntentMessageListSelect", + "description": "The list card response for Actions on Google." + }, + "quickReplies": { + "$ref": "IntentMessageQuickReplies", + "description": "The quick replies response." + }, + "card": { + "description": "The card response.", + "$ref": "IntentMessageCard" + }, + "basicCard": { + "description": "The basic card response for Actions on Google.", + "$ref": "IntentMessageBasicCard" + } + }, + "id": "IntentMessage" + }, + "ListContextsResponse": { + "description": "The response message for Contexts.ListContexts.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Token to retrieve the next page of results, or empty if there are no\nmore results in the list.", + "type": "string" + }, + "contexts": { + "description": "The list of contexts. There will be a maximum number of items\nreturned based on the page_size field in the request.", + "type": "array", + "items": { + "$ref": "Context" + } + } + }, + "id": "ListContextsResponse" + }, + "Agent": { + "description": "Represents a conversational agent.", + "type": "object", + "properties": { + "matchMode": { + "description": "Optional. Determines how intents are detected from user queries.", + "type": "string", + "enumDescriptions": [ + "Not specified.", + "Best for agents with a small number of examples in intents and/or wide\nuse of templates syntax and composite entities.", + "Can be used for agents with a large number of examples in intents,\nespecially the ones using @sys.any or very large developer entities." + ], + "enum": [ + "MATCH_MODE_UNSPECIFIED", + "MATCH_MODE_HYBRID", + "MATCH_MODE_ML_ONLY" + ] + }, + "supportedLanguageCodes": { + "description": "Optional. The list of all languages supported by this agent (except for the\n`default_language_code`).", + "type": "array", + "items": { + "type": "string" + } + }, + "enableLogging": { + "description": "Optional. Determines whether this agent should log conversation queries.", + "type": "boolean" + }, + "avatarUri": { + "description": "Optional. The URI of the agent's avatar.\nAvatars are used throughout API.AI console and in the self-hosted\n[Web Demo](https://dialogflow.com/docs/integrations/web-demo) integration.", + "type": "string" + }, + "classificationThreshold": { + "description": "Optional. To filter out false positive results and still get variety in\nmatched natural language inputs for your agent, you can tune the machine\nlearning classification threshold. If the returned score value is less than\nthe threshold value, then a fallback intent is be triggered or, if there\nare no fallback intents defined, no intent will be triggered. The score\nvalues range from 0.0 (completely uncertain) to 1.0 (completely certain).\nIf set to 0.0, the default of 0.3 is used.", + "format": "float", + "type": "number" + }, + "defaultLanguageCode": { + "description": "Required. The default language of the agent as a language tag. See\n[Language Support](https://dialogflow.com/docs/reference/language) for a\nlist of the currently supported language codes.\nThis field cannot be set by the `Update` method.", + "type": "string" + }, + "timeZone": { + "description": "Required. The time zone of this agent from the\n[time zone database](https://www.iana.org/time-zones), e.g.,\nAmerica/New_York, Europe/Paris.", + "type": "string" + }, + "description": { + "description": "Optional. The description of this agent.\nThe maximum length is 500 characters. If exceeded, the request is rejected.", + "type": "string" + }, + "displayName": { + "description": "Required. The name of this agent.", + "type": "string" + }, + "parent": { + "description": "Required. The project of this agent.\nFormat: `projects/\u003cProject ID\u003e`.", + "type": "string" + } + }, + "id": "Agent" + }, + "EntityTypeBatch": { + "description": "This message is a wrapper around a collection of entity types.", + "type": "object", + "properties": { + "entityTypes": { + "description": "A collection of entity types.", + "type": "array", + "items": { + "$ref": "EntityType" + } + } + }, + "id": "EntityTypeBatch" + }, + "OriginalDetectIntentRequest": { + "description": "Represents the contents of the original request that was passed to\nthe `[Streaming]DetectIntent` call.", + "type": "object", + "properties": { + "source": { + "description": "The source of this request, e.g., `google`, `facebook`, `slack`. It is set\nby Dialogflow-owned servers. Possible values of this field correspond to\nIntent.Message.Platform.", + "type": "string" + }, + "payload": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Optional. This field is set to the value of `QueryParameters.payload` field\npassed in the request.", + "type": "object" + } + }, + "id": "OriginalDetectIntentRequest" + }, + "IntentMessageBasicCardButton": { + "description": "The button object that appears at the bottom of a card.", + "type": "object", + "properties": { + "openUriAction": { + "description": "Required. Action to take when a user taps on the button.", + "$ref": "IntentMessageBasicCardButtonOpenUriAction" + }, + "title": { + "description": "Required. The title of the button.", + "type": "string" + } + }, + "id": "IntentMessageBasicCardButton" + }, + "IntentMessageSimpleResponse": { + "description": "The simple response message containing speech or text.", + "type": "object", + "properties": { + "displayText": { + "description": "Optional. The text to display.", + "type": "string" + }, + "textToSpeech": { + "description": "One of text_to_speech or ssml must be provided. The plain text of the\nspeech output. Mutually exclusive with ssml.", + "type": "string" + }, + "ssml": { + "description": "One of text_to_speech or ssml must be provided. Structured spoken\nresponse to the user in the SSML format. Mutually exclusive with\ntext_to_speech.", + "type": "string" + } + }, + "id": "IntentMessageSimpleResponse" + }, + "IntentMessageListSelectItem": { + "description": "An item in the list.", + "type": "object", + "properties": { + "title": { + "description": "Required. The title of the list item.", + "type": "string" + }, + "image": { + "$ref": "IntentMessageImage", + "description": "Optional. The image to display." + }, + "description": { + "description": "Optional. The main text describing the item.", + "type": "string" + }, + "info": { + "description": "Required. Additional information about this option.", + "$ref": "IntentMessageSelectItemInfo" + } + }, + "id": "IntentMessageListSelectItem" + }, + "IntentMessageBasicCard": { + "description": "The basic card message. Useful for displaying information.", + "type": "object", + "properties": { + "title": { + "description": "Optional. The title of the card.", + "type": "string" + }, + "image": { + "description": "Optional. The image for the card.", + "$ref": "IntentMessageImage" + }, + "formattedText": { + "description": "Required, unless image is present. The body text of the card.", + "type": "string" + }, + "buttons": { + "description": "Optional. The collection of card buttons.", + "type": "array", + "items": { + "$ref": "IntentMessageBasicCardButton" + } + }, + "subtitle": { + "description": "Optional. The subtitle of the card.", + "type": "string" + } + }, + "id": "IntentMessageBasicCard" + }, + "EntityTypeEntity": { + "description": "Optional. Represents an entity.", + "type": "object", + "properties": { + "synonyms": { + "description": "Required. A collection of synonyms. For `KIND_LIST` entity types this\nmust contain exactly one synonym equal to `value`.", + "type": "array", + "items": { + "type": "string" + } + }, + "value": { + "description": "Required.\nFor `KIND_MAP` entity types:\n A canonical name to be used in place of synonyms.\nFor `KIND_LIST` entity types:\n A string that can contain references to other entity types (with or\n without aliases).", + "type": "string" + } + }, + "id": "EntityTypeEntity" + }, + "InputAudioConfig": { + "description": "Instructs the speech recognizer how to process the audio content.", + "type": "object", + "properties": { + "sampleRateHertz": { + "description": "Required. Sample rate (in Hertz) of the audio content sent in the query.\nRefer to [Cloud Speech API documentation](/speech/docs/basics) for more\ndetails.", + "format": "int32", + "type": "integer" + }, + "languageCode": { + "description": "Required. The language of the supplied audio. Dialogflow does not do\ntranslations. See [Language\nSupport](https://dialogflow.com/docs/languages) for a list of the\ncurrently supported language codes. Note that queries in the same session\ndo not necessarily need to specify the same language.", + "type": "string" + }, + "phraseHints": { + "description": "Optional. The collection of phrase hints which are used to boost accuracy\nof speech recognition.\nRefer to [Cloud Speech API documentation](/speech/docs/basics#phrase-hints)\nfor more details.", + "type": "array", + "items": { + "type": "string" + } + }, + "audioEncoding": { + "enumDescriptions": [ + "Not specified.", + "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 lossless (therefore\nrecognition is not compromised) and requires only about half the\nbandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and\n24-bit samples, however, not 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_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\nDialogflow 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": [ + "AUDIO_ENCODING_UNSPECIFIED", + "AUDIO_ENCODING_LINEAR_16", + "AUDIO_ENCODING_FLAC", + "AUDIO_ENCODING_MULAW", + "AUDIO_ENCODING_AMR", + "AUDIO_ENCODING_AMR_WB", + "AUDIO_ENCODING_OGG_OPUS", + "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" + ], + "description": "Required. Audio encoding of the audio content to process.", + "type": "string" + } + }, + "id": "InputAudioConfig" + }, + "ListSessionEntityTypesResponse": { + "description": "The response message for SessionEntityTypes.ListSessionEntityTypes.", + "type": "object", + "properties": { + "sessionEntityTypes": { + "description": "The list of session entity types. There will be a maximum number of items\nreturned based on the page_size field in the request.", + "type": "array", + "items": { + "$ref": "SessionEntityType" + } + }, + "nextPageToken": { + "description": "Token to retrieve the next page of results, or empty if there are no\nmore results in the list.", + "type": "string" + } + }, + "id": "ListSessionEntityTypesResponse" + }, + "IntentMessageCarouselSelect": { + "description": "The card for presenting a carousel of options to select from.", + "type": "object", + "properties": { + "items": { + "description": "Required. Carousel items.", + "type": "array", + "items": { + "$ref": "IntentMessageCarouselSelectItem" + } + } + }, + "id": "IntentMessageCarouselSelect" + }, + "SearchAgentsResponse": { + "description": "The response message for Agents.SearchAgents.", + "type": "object", + "properties": { + "agents": { + "description": "The list of agents. There will be a maximum number of items returned based\non the page_size field in the request.", + "type": "array", + "items": { + "$ref": "Agent" + } + }, + "nextPageToken": { + "description": "Token to retrieve the next page of results, or empty if there are no\nmore results in the list.", + "type": "string" + } + }, + "id": "SearchAgentsResponse" + }, + "IntentMessageSimpleResponses": { + "description": "The collection of simple response candidates.\nThis message in `QueryResult.fulfillment_messages` and\n`WebhookResponse.fulfillment_messages` should contain only one\n`SimpleResponse`.", + "type": "object", + "properties": { + "simpleResponses": { + "description": "Required. The list of simple responses.", + "type": "array", + "items": { + "$ref": "IntentMessageSimpleResponse" + } + } + }, + "id": "IntentMessageSimpleResponses" + }, + "BatchCreateEntitiesRequest": { + "description": "The request message for EntityTypes.BatchCreateEntities.", + "type": "object", + "properties": { + "languageCode": { + "description": "Optional. The language of entity synonyms defined in `entities`. If not\nspecified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string" + }, + "entities": { + "description": "Required. The collection of entities to create.", + "type": "array", + "items": { + "$ref": "EntityTypeEntity" + } + } + }, + "id": "BatchCreateEntitiesRequest" + }, + "DetectIntentRequest": { + "description": "The request to detect user's intent.", + "type": "object", + "properties": { + "inputAudio": { + "description": "Optional. The natural language speech audio to be processed. This field\nshould be populated iff `query_input` is set to an input audio config.\nA single request can contain up to 1 minute of speech audio data.", + "format": "byte", + "type": "string" + }, + "queryInput": { + "description": "Required. The input specification. It can be set to:\n\n1. an audio config\n which instructs the speech recognizer how to process the speech audio,\n\n2. a conversational query in the form of text, or\n\n3. an event that specifies which intent to trigger.", + "$ref": "QueryInput" + }, + "queryParams": { + "description": "Optional. The parameters of this query.", + "$ref": "QueryParameters" + } + }, + "id": "DetectIntentRequest" + }, + "TextInput": { + "description": "Represents the natural language text to be processed.", + "type": "object", + "properties": { + "text": { + "description": "Required. The UTF-8 encoded natural language text to be processed.\nText length must not exceed 256 bytes.", + "type": "string" + }, + "languageCode": { + "description": "Required. The language of this conversational query. See [Language\nSupport](https://dialogflow.com/docs/languages) for a list of the\ncurrently supported language codes. Note that queries in the same session\ndo not necessarily need to specify the same language.", + "type": "string" + } + }, + "id": "TextInput" + }, + "IntentMessageCardButton": { + "description": "Optional. Contains information about a button.", + "type": "object", + "properties": { + "text": { + "description": "Optional. The text to show on the button.", + "type": "string" + }, + "postback": { + "description": "Optional. The text to send back to the Dialogflow API or a URI to\nopen.", + "type": "string" + } + }, + "id": "IntentMessageCardButton" + }, + "ListEntityTypesResponse": { + "description": "The response message for EntityTypes.ListEntityTypes.", + "type": "object", + "properties": { + "entityTypes": { + "description": "The list of agent entity types. There will be a maximum number of items\nreturned based on the page_size field in the request.", + "type": "array", + "items": { + "$ref": "EntityType" + } + }, + "nextPageToken": { + "description": "Token to retrieve the next page of results, or empty if there are no\nmore results in the list.", + "type": "string" + } + }, + "id": "ListEntityTypesResponse" + }, + "QueryResult": { + "description": "Represents the result of conversational query or event processing.", + "type": "object", + "properties": { + "fulfillmentText": { + "description": "The text to be pronounced to the user or shown on the screen.", + "type": "string" + }, + "parameters": { + "description": "The collection of extracted parameters.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + }, + "intentDetectionConfidence": { + "description": "The intent detection confidence. Values range from 0.0\n(completely uncertain) to 1.0 (completely certain).", + "format": "float", + "type": "number" + }, + "allRequiredParamsPresent": { + "description": "This field is set to:\n- `false` if the matched intent has required parameters and not all of\n the required parameter values have been collected.\n- `true` if all required parameter values have been collected, or if the\n matched intent doesn't contain any required parameters.", + "type": "boolean" + }, + "speechRecognitionConfidence": { + "description": "The confidence estimate between 0.0 and 1.0. A higher number\nindicates an estimated greater likelihood that the recognized words are\ncorrect. The default of 0.0 is a sentinel value indicating that confidence\nwas not set. This field is populated if natural speech audio was provided\nas input.", + "format": "float", + "type": "number" + }, + "queryText": { + "description": "The original conversational query text:\n- If natural language text was provided as input, `query_text` contains\n a copy of the input.\n- If natural language speech audio was provided as input, `query_text`\n contains the speech recognition result. If speech recognizer produced\n multiple alternatives, a particular one is picked.\n- If an event was provided as input, `query_text` is not set.", + "type": "string" + }, + "diagnosticInfo": { + "description": "The free-form diagnostic info. For example, this field\ncould contain webhook call latency.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + }, + "intent": { + "description": "The intent that matched the conversational query. Some, not\nall fields are filled in this message, including but not limited to:\n`name`, `display_name` and `webhook_state`.", + "$ref": "Intent" + }, + "languageCode": { + "description": "The language that was triggered during intent detection.\nSee [Language Support](https://dialogflow.com/docs/reference/language)\nfor a list of the currently supported language codes.", + "type": "string" + }, + "outputContexts": { + "description": "The collection of output contexts. If applicable,\n`output_contexts.parameters` contains entries with name\n`\u003cparameter name\u003e.original` containing the original parameter values\nbefore the query.", + "type": "array", + "items": { + "$ref": "Context" + } + }, + "webhookPayload": { + "description": "If the query was fulfilled by a webhook call, this field is set to the\nvalue of the `payload` field returned in the webhook response.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + }, + "fulfillmentMessages": { + "description": "The collection of rich messages to present to the user.", + "type": "array", + "items": { + "$ref": "IntentMessage" + } + }, + "action": { + "description": "The action name from the matched intent.", + "type": "string" + }, + "webhookSource": { + "description": "If the query was fulfilled by a webhook call, this field is set to the\nvalue of the `source` field returned in the webhook response.", + "type": "string" + } + }, + "id": "QueryResult" + }, + "BatchDeleteEntityTypesRequest": { + "description": "The request message for EntityTypes.BatchDeleteEntityTypes.", + "type": "object", + "properties": { + "entityTypeNames": { + "description": "Required. The names entity types to delete. All names must point to the\nsame agent as `parent`.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "BatchDeleteEntityTypesRequest" + }, + "BatchUpdateEntityTypesResponse": { + "description": "The response message for EntityTypes.BatchUpdateEntityTypes.", + "type": "object", + "properties": { + "entityTypes": { + "description": "The collection of updated or created entity types.", + "type": "array", + "items": { + "$ref": "EntityType" + } + } + }, + "id": "BatchUpdateEntityTypesResponse" + }, + "IntentMessageCard": { + "description": "The card response message.", + "type": "object", + "properties": { + "title": { + "description": "Optional. The title of the card.", + "type": "string" + }, + "buttons": { + "description": "Optional. The collection of card buttons.", + "type": "array", + "items": { + "$ref": "IntentMessageCardButton" + } + }, + "subtitle": { + "description": "Optional. The subtitle of the card.", + "type": "string" + }, + "imageUri": { + "description": "Optional. The public URI to an image file for the card.", + "type": "string" + } + }, + "id": "IntentMessageCard" + }, + "QueryParameters": { + "description": "Represents the parameters of the conversational query.", + "type": "object", + "properties": { + "timeZone": { + "description": "Optional. The time zone of this conversational query from the\n[time zone database](https://www.iana.org/time-zones), e.g.,\nAmerica/New_York, Europe/Paris. If not provided, the time zone specified in\nagent settings is used.", + "type": "string" + }, + "sessionEntityTypes": { + "description": "Optional. The collection of session entity types to replace or extend\ndeveloper entities with for this query only. The entity synonyms apply\nto all languages.", + "type": "array", + "items": { + "$ref": "SessionEntityType" + } + }, + "payload": { + "description": "Optional. This field can be used to pass custom data into the webhook\nassociated with the agent. Arbitrary JSON objects are supported.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + }, + "geoLocation": { + "$ref": "LatLng", + "description": "Optional. The geo location of this conversational query." + }, + "resetContexts": { + "description": "Optional. Specifies whether to delete all contexts in the current session\nbefore the new ones are activated.", + "type": "boolean" + }, + "contexts": { + "description": "Optional. The collection of contexts to be activated before this query is\nexecuted.", + "type": "array", + "items": { + "$ref": "Context" + } + } + }, + "id": "QueryParameters" + }, + "Intent": { + "description": "Represents an intent.\nIntents convert a number of user expressions or patterns into an action. An\naction is an extraction of a user command or sentence semantics.", + "type": "object", + "properties": { + "events": { + "description": "Optional. The collection of event names that trigger the intent.\nIf the collection of input contexts is not empty, all of the contexts must\nbe present in the active user session for an event to trigger this intent.", + "type": "array", + "items": { + "type": "string" + } + }, + "parentFollowupIntentName": { + "description": "The unique identifier of the parent intent in the chain of followup\nintents.\nIt identifies the parent followup intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.", + "type": "string" + }, + "priority": { + "description": "Optional. The priority of this intent. Higher numbers represent higher\npriorities. Zero or negative numbers mean that the intent is disabled.", + "format": "int32", + "type": "integer" + }, + "outputContexts": { + "description": "Optional. The collection of contexts that are activated when the intent\nis matched. Context messages in this collection should not set the\nparameters field. Setting the `lifespan_count` to 0 will reset the context\nwhen the intent is matched.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/-/contexts/\u003cContext ID\u003e`.", + "type": "array", + "items": { + "$ref": "Context" + } + }, + "defaultResponsePlatforms": { + "description": "Optional. The list of platforms for which the first response will be\ntaken from among the messages assigned to the DEFAULT_PLATFORM.", + "type": "array", + "items": { + "enum": [ + "PLATFORM_UNSPECIFIED", + "FACEBOOK", + "SLACK", + "TELEGRAM", + "KIK", + "SKYPE", + "LINE", + "VIBER", + "ACTIONS_ON_GOOGLE" + ], + "type": "string" + }, + "enumDescriptions": [ + "Not specified.", + "Facebook.", + "Slack.", + "Telegram.", + "Kik.", + "Skype.", + "Line.", + "Viber.", + "Actions on Google." + ] + }, + "action": { + "description": "Optional. The name of the action associated with the intent.", + "type": "string" + }, + "name": { + "description": "Required for all methods except `create` (`create` populates the name\nautomatically.\nThe unique identifier of this intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.", + "type": "string" + }, + "messages": { + "description": "Optional. The collection of rich messages corresponding to the\n`Response` field in API.AI console.", + "type": "array", + "items": { + "$ref": "IntentMessage" + } + }, + "webhookState": { + "description": "Required. Indicates whether webhooks are enabled for the intent.", + "type": "string", + "enumDescriptions": [ + "Webhook is disabled in the agent and in the intent.", + "Webhook is enabled in the agent and in the intent.", + "Webhook is enabled in the agent and in the intent. Also, each slot\nfilling prompt is forwarded to the webhook." + ], + "enum": [ + "WEBHOOK_STATE_UNSPECIFIED", + "WEBHOOK_STATE_ENABLED", + "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" + ] + }, + "inputContextNames": { + "description": "Optional. The list of context names required for this intent to be\ntriggered.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/-/contexts/\u003cContext ID\u003e`.", + "type": "array", + "items": { + "type": "string" + } + }, + "followupIntentInfo": { + "description": "Optional. Collection of information about all followup intents that have\nname of this intent as a root_name.", + "type": "array", + "items": { + "$ref": "IntentFollowupIntentInfo" + } + }, + "rootFollowupIntentName": { + "description": "The unique identifier of the root intent in the chain of followup intents.\nIt identifies the correct followup intents chain for this intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.", + "type": "string" + }, + "displayName": { + "description": "Required. The name of this intent.", + "type": "string" + }, + "isFallback": { + "description": "Optional. Indicates whether this is a fallback intent.", + "type": "boolean" + }, + "mlEnabled": { + "description": "Optional. Indicates whether Machine Learning is enabled for the intent.\nNote: If `ml_enabled` setting is set to false, then this intent is not\ntaken into account during inference in `ML ONLY` match mode. Also,\nauto-markup in the UI is turned off.", + "type": "boolean" + }, + "trainingPhrases": { + "description": "Optional. The collection of examples/templates that the agent is\ntrained on.", + "type": "array", + "items": { + "$ref": "IntentTrainingPhrase" + } + }, + "resetContexts": { + "description": "Optional. Indicates whether to delete all contexts in the current\nsession when this intent is matched.", + "type": "boolean" + }, + "parameters": { + "description": "Optional. The collection of parameters associated with the intent.", + "type": "array", + "items": { + "$ref": "IntentParameter" + } + } + }, + "id": "Intent" + }, + "BatchUpdateEntityTypesRequest": { + "description": "The request message for EntityTypes.BatchUpdateEntityTypes.", + "type": "object", + "properties": { + "languageCode": { + "description": "Optional. The language of entity synonyms defined in `entity_types`. If not\nspecified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string" + }, + "updateMask": { + "description": "Optional. The mask to control which fields get updated.", + "format": "google-fieldmask", + "type": "string" + }, + "entityTypeBatchUri": { + "description": "Warning: Importing entity types from a URI is not implemented yet.\nThis feature is coming soon.\nThe URI to a Google Cloud Storage file containing entity types to update\nor create. The file format can either be a serialized proto (of\nEntityBatch type) or a JSON object. Note: The URI must start with\n\"gs://\".", + "type": "string" + }, + "entityTypeBatchInline": { + "$ref": "EntityTypeBatch", + "description": "The collection of entity type to update or create." + } + }, + "id": "BatchUpdateEntityTypesRequest" + }, + "IntentTrainingPhrasePart": { + "description": "Represents a part of a training phrase.", + "type": "object", + "properties": { + "text": { + "description": "Required. The text corresponding to the example or template,\nif there are no annotations. For\nannotated examples, it is the text for one of the example's parts.", + "type": "string" + }, + "entityType": { + "description": "Optional. The entity type name prefixed with `@`. This field is\nrequired for the annotated part of the text and applies only to\nexamples.", + "type": "string" + }, + "alias": { + "description": "Optional. The parameter name for the value extracted from the\nannotated part of the example.", + "type": "string" + }, + "userDefined": { + "description": "Optional. Indicates whether the text was manually annotated by the\ndeveloper.", + "type": "boolean" + } + }, + "id": "IntentTrainingPhrasePart" + }, + "IntentBatch": { + "description": "This message is a wrapper around a collection of intents.", + "type": "object", + "properties": { + "intents": { + "description": "A collection of intents.", + "type": "array", + "items": { + "$ref": "Intent" + } + } + }, + "id": "IntentBatch" + }, + "BatchDeleteEntitiesRequest": { + "description": "The request message for EntityTypes.BatchDeleteEntities.", + "type": "object", + "properties": { + "entityValues": { + "description": "Required. The canonical `values` of the entities to delete. Note that\nthese are not fully-qualified names, i.e. they don't start with\n`projects/\u003cProject ID\u003e`.", + "type": "array", + "items": { + "type": "string" + } + }, + "languageCode": { + "description": "Optional. The language of entity synonyms defined in `entities`. If not\nspecified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string" + } + }, + "id": "BatchDeleteEntitiesRequest" + }, + "IntentMessageListSelect": { + "description": "The card for presenting a list of options to select from.", + "type": "object", + "properties": { + "title": { + "description": "Optional. The overall title of the list.", + "type": "string" + }, + "items": { + "description": "Required. List items.", + "type": "array", + "items": { + "$ref": "IntentMessageListSelectItem" + } + } + }, + "id": "IntentMessageListSelect" + }, + "IntentMessageSuggestion": { + "description": "The suggestion chip message that the user can tap to quickly post a reply\nto the conversation.", + "type": "object", + "properties": { + "title": { + "description": "Required. The text shown the in the suggestion chip.", + "type": "string" + } + }, + "id": "IntentMessageSuggestion" + }, + "IntentMessageCarouselSelectItem": { + "description": "An item in the carousel.", + "type": "object", + "properties": { + "title": { + "description": "Required. Title of the carousel item.", + "type": "string" + }, + "image": { + "$ref": "IntentMessageImage", + "description": "Optional. The image to display." + }, + "description": { + "description": "Optional. The body text of the card.", + "type": "string" + }, + "info": { + "$ref": "IntentMessageSelectItemInfo", + "description": "Required. Additional info about the option item." + } + }, + "id": "IntentMessageCarouselSelectItem" + }, + "IntentMessageQuickReplies": { + "description": "The quick replies response message.", + "type": "object", + "properties": { + "title": { + "description": "Optional. The title of the collection of quick replies.", + "type": "string" + }, + "quickReplies": { + "description": "Optional. The collection of quick replies.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "IntentMessageQuickReplies" + }, + "WebhookRequest": { + "description": "The request message for a webhook call.", + "type": "object", + "properties": { + "queryResult": { + "$ref": "QueryResult", + "description": "The result of the conversational query or event processing. Contains the\nsame value as `[Streaming]DetectIntentResponse.query_result`." + }, + "originalDetectIntentRequest": { + "$ref": "OriginalDetectIntentRequest", + "description": "Optional. The contents of the original request that was passed to\n`[Streaming]DetectIntent` call." + }, + "responseId": { + "description": "The unique identifier of the response. Contains the same value as\n`[Streaming]DetectIntentResponse.response_id`.", + "type": "string" + }, + "session": { + "description": "The unique identifier of detectIntent request session.\nCan be used to identify end-user inside webhook implementation.\nFormat: `projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e`.", + "type": "string" + } + }, + "id": "WebhookRequest" + }, + "RestoreAgentRequest": { + "description": "The request message for Agents.RestoreAgent.", + "type": "object", + "properties": { + "agentUri": { + "description": "Warning: Restoring agents from a URI is not implemented yet.\nThis feature is coming soon.\nThe URI to a Google Cloud Storage file containing the agent to restore.\nNote: The URI must start with \"gs://\".", + "type": "string" + }, + "agentContent": { + "description": "The agent to restore.", + "format": "byte", + "type": "string" + } + }, + "id": "RestoreAgentRequest" + }, + "IntentTrainingPhrase": { + "description": "Represents an example or template that the agent is trained on.", + "type": "object", + "properties": { + "timesAddedCount": { + "description": "Optional. Indicates how many times this example or template was added to\nthe intent. Each time a developer adds an existing sample by editing an\nintent or training, this counter is increased.", + "format": "int32", + "type": "integer" + }, + "type": { + "enumDescriptions": [ + "Not specified. This value should never be used.", + "Examples do not contain @-prefixed entity type names, but example parts\ncan be annotated with entity types.", + "Templates are not annotated with entity types, but they can contain\n@-prefixed entity type names as substrings." + ], + "enum": [ + "TYPE_UNSPECIFIED", + "EXAMPLE", + "TEMPLATE" + ], + "description": "Required. The type of the training phrase.", + "type": "string" + }, + "parts": { + "description": "Required. The collection of training phrase parts (can be annotated).\nFields: `entity_type`, `alias` and `user_defined` should be populated\nonly for the annotated parts of the training phrase.", + "type": "array", + "items": { + "$ref": "IntentTrainingPhrasePart" + } + }, + "name": { + "description": "Required. The unique identifier of this training phrase.", + "type": "string" + } + }, + "id": "IntentTrainingPhrase" + }, + "ListIntentsResponse": { + "description": "The response message for Intents.ListIntents.", + "type": "object", + "properties": { + "intents": { + "description": "The list of agent intents. There will be a maximum number of items\nreturned based on the page_size field in the request.", + "type": "array", + "items": { + "$ref": "Intent" + } + }, + "nextPageToken": { + "description": "Token to retrieve the next page of results, or empty if there are no\nmore results in the list.", + "type": "string" + } + }, + "id": "ListIntentsResponse" + }, + "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.", + "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" + }, + "Context": { + "description": "Represents a context.", + "type": "object", + "properties": { + "lifespanCount": { + "description": "Optional. The number of conversational query requests after which the\ncontext expires. If set to `0` (the default) the context expires\nimmediately. Contexts expire automatically after 10 minutes even if there\nare no matching queries.", + "format": "int32", + "type": "integer" + }, + "name": { + "description": "Required. The unique identifier of the context. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/contexts/\u003cContext ID\u003e`.\nNote: The Context ID is always converted to lowercase.", + "type": "string" + }, + "parameters": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Optional. The collection of parameters associated with this context.\nRefer to [this doc](https://dialogflow.com/docs/actions-and-parameters) for\nsyntax.", + "type": "object" + } + }, + "id": "Context" + }, + "ImportAgentRequest": { + "description": "The request message for Agents.ImportAgent.", + "type": "object", + "properties": { + "agentContent": { + "description": "The agent to import.", + "format": "byte", + "type": "string" + }, + "agentUri": { + "description": "Warning: Importing agents from a URI is not implemented yet.\nThis feature is coming soon.\nThe URI to a Google Cloud Storage file containing the agent to import.\nNote: The URI must start with \"gs://\".", + "type": "string" + } + }, + "id": "ImportAgentRequest" + }, + "BatchUpdateIntentsResponse": { + "description": "The response message for Intents.BatchUpdateIntents.", + "type": "object", + "properties": { + "intents": { + "description": "The collection of updated or created intents.", + "type": "array", + "items": { + "$ref": "Intent" + } + } + }, + "id": "BatchUpdateIntentsResponse" + }, + "IntentParameter": { + "description": "Represents intent parameters.", + "type": "object", + "properties": { + "displayName": { + "description": "Required. The name of the parameter.", + "type": "string" + }, + "entityTypeDisplayName": { + "description": "Optional. The name of the entity type, prefixed with `@`, that\ndescribes values of the parameter. If the parameter is\nrequired, this must be provided.", + "type": "string" + }, + "prompts": { + "description": "Optional. The collection of prompts that the agent can present to the\nuser in order to collect value for the parameter.", + "type": "array", + "items": { + "type": "string" + } + }, + "mandatory": { + "description": "Optional. Indicates whether the parameter is required. That is,\nwhether the intent cannot be completed without collecting the parameter\nvalue.", + "type": "boolean" + }, + "defaultValue": { + "description": "Optional. The default value to use when the `value` yields an empty\nresult.\nDefault values can be extracted from contexts by using the following\nsyntax: `#context_name.parameter_name`.", + "type": "string" + }, + "name": { + "description": "The unique identifier of this parameter.", + "type": "string" + }, + "isList": { + "description": "Optional. Indicates whether the parameter represents a list of values.", + "type": "boolean" + }, + "value": { + "description": "Optional. The definition of the parameter value. It can be:\n- a constant string,\n- a parameter value defined as `$parameter_name`,\n- an original parameter value defined as `$parameter_name.original`,\n- a parameter value from some context defined as\n `#context_name.parameter_name`.", + "type": "string" + } + }, + "id": "IntentParameter" + }, + "ExportAgentResponse": { + "description": "The response message for Agents.ExportAgent.", + "type": "object", + "properties": { + "agentContent": { + "description": "The exported agent.", + "format": "byte", + "type": "string" + }, + "agentUri": { + "description": "The URI to a file containing the exported agent. This field is populated\nonly if `agent_uri` is specified in `ExportAgentRequest`.", + "type": "string" + } + }, + "id": "ExportAgentResponse" + }, + "IntentMessageBasicCardButtonOpenUriAction": { + "description": "Opens the given URI.", + "type": "object", + "properties": { + "uri": { + "description": "Required. The HTTP or HTTPS scheme URI.", + "type": "string" + } + }, + "id": "IntentMessageBasicCardButtonOpenUriAction" + }, + "IntentMessageImage": { + "description": "The image response message.", + "type": "object", + "properties": { + "imageUri": { + "description": "Optional. The public URI to an image file.", + "type": "string" + } + }, + "id": "IntentMessageImage" + }, + "BatchUpdateIntentsRequest": { + "description": "The request message for Intents.BatchUpdateIntents.", + "type": "object", + "properties": { + "intentBatchUri": { + "description": "Warning: Importing intents from a URI is not implemented yet.\nThis feature is coming soon.\nThe URI to a Google Cloud Storage file containing intents to update or\ncreate. The file format can either be a serialized proto (of IntentBatch\ntype) or JSON object. Note: The URI must start with \"gs://\".", + "type": "string" + }, + "intentView": { + "description": "Optional. The resource view to apply to the returned intent.", + "type": "string", + "enumDescriptions": [ + "Training phrases field is not populated in the response.", + "All fields are populated." + ], + "enum": [ + "INTENT_VIEW_UNSPECIFIED", + "INTENT_VIEW_FULL" + ] + }, + "intentBatchInline": { + "$ref": "IntentBatch", + "description": "The collection of intents to update or create." + }, + "languageCode": { + "description": "Optional. The language of training phrases, parameters and rich messages\ndefined in `intents`. If not specified, the agent's default language is\nused. [More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string" + }, + "updateMask": { + "description": "Optional. The mask to control which fields get updated.", + "format": "google-fieldmask", + "type": "string" + } + }, + "id": "BatchUpdateIntentsRequest" + }, + "TrainAgentRequest": { + "description": "The request message for Agents.TrainAgent.", + "type": "object", + "properties": {}, + "id": "TrainAgentRequest" + }, + "SessionEntityType": { + "description": "Represents a session entity type.\n\nExtends or replaces a developer entity type at the user session level (we\nrefer to the entity types defined at the agent level as \"developer entity\ntypes\").\n\nNote: session entity types apply to all queries, regardless of the language.", + "type": "object", + "properties": { + "entityOverrideMode": { + "enumDescriptions": [ + "Not specified. This value should be never used.", + "The collection of session entities overrides the collection of entities\nin the corresponding developer entity type.", + "The collection of session entities extends the collection of entities in\nthe corresponding developer entity type.\nCalls to `ListSessionEntityTypes`, `GetSessionEntityType`,\n`CreateSessionEntityType` and `UpdateSessionEntityType` return the full\ncollection of entities from the developer entity type in the agent's\ndefault language and the session entity type." + ], + "enum": [ + "ENTITY_OVERRIDE_MODE_UNSPECIFIED", + "ENTITY_OVERRIDE_MODE_OVERRIDE", + "ENTITY_OVERRIDE_MODE_SUPPLEMENT" + ], + "description": "Required. Indicates whether the additional data should override or\nsupplement the developer entity type definition.", + "type": "string" + }, + "entities": { + "description": "Required. The collection of entities associated with this session entity\ntype.", + "type": "array", + "items": { + "$ref": "EntityTypeEntity" + } + }, + "name": { + "description": "Required. The unique identifier of this session entity type. Format:\n`projects/\u003cProject ID\u003e/agent/sessions/\u003cSession ID\u003e/entityTypes/\u003cEntity Type\nDisplay Name\u003e`.", + "type": "string" + } + }, + "id": "SessionEntityType" + }, + "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" + }, + "BatchUpdateEntitiesRequest": { + "description": "The response message for EntityTypes.BatchCreateEntities.", + "type": "object", + "properties": { + "entities": { + "description": "Required. The collection of new entities to replace the existing entities.", + "type": "array", + "items": { + "$ref": "EntityTypeEntity" + } + }, + "languageCode": { + "description": "Optional. The language of entity synonyms defined in `entities`. If not\nspecified, the agent's default language is used.\n[More than a dozen\nlanguages](https://dialogflow.com/docs/reference/language) are supported.\nNote: languages must be enabled in the agent, before they can be used.", + "type": "string" + }, + "updateMask": { + "description": "Optional. The mask to control which fields get updated.", + "format": "google-fieldmask", + "type": "string" + } + }, + "id": "BatchUpdateEntitiesRequest" + }, + "IntentMessageText": { + "description": "The text response message.", + "type": "object", + "properties": { + "text": { + "description": "Optional. The collection of the agent's responses.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "IntentMessageText" + }, + "WebhookResponse": { + "description": "The response message for a webhook call.", + "type": "object", + "properties": { + "followupEventInput": { + "$ref": "EventInput", + "description": "Optional. Makes the platform immediately invoke another `DetectIntent` call\ninternally with the specified event as input." + }, + "outputContexts": { + "description": "Optional. The collection of output contexts. This value is passed directly\nto `QueryResult.output_contexts`.", + "type": "array", + "items": { + "$ref": "Context" + } + }, + "fulfillmentText": { + "description": "Optional. The text to be shown on the screen. This value is passed directly\nto `QueryResult.fulfillment_text`.", + "type": "string" + }, + "fulfillmentMessages": { + "description": "Optional. The collection of rich messages to present to the user. This\nvalue is passed directly to `QueryResult.fulfillment_messages`.", + "type": "array", + "items": { + "$ref": "IntentMessage" + } + }, + "payload": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Optional. This value is passed directly to `QueryResult.webhook_payload`.", + "type": "object" + }, + "source": { + "description": "Optional. This value is passed directly to `QueryResult.webhook_source`.", + "type": "string" + } + }, + "id": "WebhookResponse" + }, + "BatchDeleteIntentsRequest": { + "description": "The request message for Intents.BatchDeleteIntents.", + "type": "object", + "properties": { + "intents": { + "description": "Required. The collection of intents to delete. Only intent `name` must be\nfilled in.", + "type": "array", + "items": { + "$ref": "Intent" + } + } + }, + "id": "BatchDeleteIntentsRequest" + }, + "QueryInput": { + "description": "Represents the query input. It can contain either:\n\n1. An audio config which\n instructs the speech recognizer how to process the speech audio.\n\n2. A conversational query in the form of text,.\n\n3. An event that specifies which intent to trigger.", + "type": "object", + "properties": { + "event": { + "$ref": "EventInput", + "description": "The event to be processed." + }, + "text": { + "description": "The natural language text to be processed.", + "$ref": "TextInput" + }, + "audioConfig": { + "description": "Instructs the speech recognizer how to process the speech audio.", + "$ref": "InputAudioConfig" + } + }, + "id": "QueryInput" + }, + "DetectIntentResponse": { + "description": "The message returned from the DetectIntent method.", + "type": "object", + "properties": { + "responseId": { + "description": "The unique identifier of the response. It can be used to\nlocate a response in the training example set or for reporting issues.", + "type": "string" + }, + "queryResult": { + "description": "The results of the conversational query or event processing.", + "$ref": "QueryResult" + }, + "webhookStatus": { + "description": "Specifies the status of the webhook request. `webhook_status`\nis never populated in webhook requests.", + "$ref": "Status" + } + }, + "id": "DetectIntentResponse" + }, + "IntentFollowupIntentInfo": { + "description": "Represents a single followup intent in the chain.", + "type": "object", + "properties": { + "followupIntentName": { + "description": "The unique identifier of the followup intent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.", + "type": "string" + }, + "parentFollowupIntentName": { + "description": "The unique identifier of the followup intent parent.\nFormat: `projects/\u003cProject ID\u003e/agent/intents/\u003cIntent ID\u003e`.", + "type": "string" + } + }, + "id": "IntentFollowupIntentInfo" + }, + "ExportAgentRequest": { + "description": "The request message for Agents.ExportAgent.", + "type": "object", + "properties": { + "agentUri": { + "description": "Warning: Exporting agents to a URI is not implemented yet.\nThis feature is coming soon.\nOptional. The Google Cloud Storage URI to export the agent to.\nNote: The URI must start with\n\"gs://\". If left unspecified, the serialized agent is returned inline.", + "type": "string" + } + }, + "id": "ExportAgentRequest" + }, + "IntentMessageLinkOutSuggestion": { + "description": "The suggestion chip message that allows the user to jump out to the app\nor website associated with this agent.", + "type": "object", + "properties": { + "destinationName": { + "description": "Required. The name of the app or site this chip is linking to.", + "type": "string" + }, + "uri": { + "description": "Required. The URI of the app or site to open when the user taps the\nsuggestion chip.", + "type": "string" + } + }, + "id": "IntentMessageLinkOutSuggestion" + }, + "IntentMessageSelectItemInfo": { + "description": "Additional info about the select item for when it is triggered in a\ndialog.", + "type": "object", + "properties": { + "synonyms": { + "description": "Optional. A list of synonyms that can also be used to trigger this\nitem in dialog.", + "type": "array", + "items": { + "type": "string" + } + }, + "key": { + "description": "Required. A unique key that will be sent back to the agent if this\nresponse is given.", + "type": "string" + } + }, + "id": "IntentMessageSelectItemInfo" + }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "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\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": { + "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" + }, + "EventInput": { + "description": "Events allow for matching intents by event name instead of the natural\nlanguage input. For instance, input `\u003cevent: { name: “welcome_event”,\nparameters: { name: “Sam” } }\u003e` can trigger a personalized welcome response.\nThe parameter `name` may be used by the agent in the response:\n`“Hello #welcome_event.name! What can I do for you today?”`.", + "type": "object", + "properties": { + "languageCode": { + "description": "Required. The language of this query. See [Language\nSupport](https://dialogflow.com/docs/languages) for a list of the\ncurrently supported language codes. Note that queries in the same session\ndo not necessarily need to specify the same language.", + "type": "string" + }, + "name": { + "description": "Required. The unique identifier of the event.", + "type": "string" + }, + "parameters": { + "description": "Optional. The collection of parameters associated with the event.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + } + }, + "id": "EventInput" + }, + "IntentMessageSuggestions": { + "description": "The collection of suggestions.", + "type": "object", + "properties": { + "suggestions": { + "description": "Required. The list of suggested replies.", + "type": "array", + "items": { + "$ref": "IntentMessageSuggestion" + } + } + }, + "id": "IntentMessageSuggestions" + }, + "EntityType": { + "description": "Represents an entity type.\nEntity types serve as a tool for extracting parameter values from natural\nlanguage queries.", + "type": "object", + "properties": { + "name": { + "description": "Required for all methods except `create` (`create` populates the name\nautomatically.\nThe unique identifier of the entity type. Format:\n`projects/\u003cProject ID\u003e/agent/entityTypes/\u003cEntity Type ID\u003e`.", + "type": "string" + }, + "displayName": { + "description": "Required. The name of the entity.", + "type": "string" + }, + "kind": { + "description": "Required. Indicates the kind of entity type.", + "type": "string", + "enumDescriptions": [ + "Not specified. This value should be never used.", + "Map entity types allow mapping of a group of synonyms to a canonical\nvalue.", + "List entity types contain a set of entries that do not map to canonical\nvalues. However, list entity types can contain references to other entity\ntypes (with or without aliases)." + ], + "enum": [ + "KIND_UNSPECIFIED", + "KIND_MAP", + "KIND_LIST" + ] + }, + "autoExpansionMode": { + "enumDescriptions": [ + "Auto expansion disabled for the entity.", + "Allows an agent to recognize values that have not been explicitly\nlisted in the entity." + ], + "enum": [ + "AUTO_EXPANSION_MODE_UNSPECIFIED", + "AUTO_EXPANSION_MODE_DEFAULT" + ], + "description": "Optional. Indicates whether the entity type can be automatically\nexpanded.", + "type": "string" + }, + "entities": { + "description": "Optional. The collection of entities associated with the entity type.", + "type": "array", + "items": { + "$ref": "EntityTypeEntity" + } + } + }, + "id": "EntityType" + } + }, + "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/dlp/v2beta1/dlp-api.json b/etc/api/dlp/v2beta1/dlp-api.json index 5b3b7fcca8..81e3c05656 100644 --- a/etc/api/dlp/v2beta1/dlp-api.json +++ b/etc/api/dlp/v2beta1/dlp-api.json @@ -1,2042 +1,185 @@ { - "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", + "fullyEncodeReservedExpansion": true, "title": "DLP API", "ownerName": "Google", "resources": { + "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.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "GooglePrivacyDlpV2beta1DeidentifyContentResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/content:deidentify", + "id": "dlp.content.deidentify", + "path": "v2beta1/content:deidentify" + }, + "inspect": { + "flatPath": "v2beta1/content:inspect", + "path": "v2beta1/content:inspect", + "id": "dlp.content.inspect", + "description": "Finds potentially sensitive info in a list of strings.\nThis method has limits on input size, processing time, and output size.", + "request": { + "$ref": "GooglePrivacyDlpV2beta1InspectContentRequest" + }, + "response": { + "$ref": "GooglePrivacyDlpV2beta1InspectContentResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {} + }, + "redact": { + "response": { + "$ref": "GooglePrivacyDlpV2beta1RedactContentResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v2beta1/content:redact", + "path": "v2beta1/content:redact", + "id": "dlp.content.redact", + "description": "Redacts potentially sensitive info from a list of strings.\nThis method has limits on input size, processing time, and output size.", + "request": { + "$ref": "GooglePrivacyDlpV2beta1RedactContentRequest" + } + } + } + }, + "rootCategories": { + "methods": { + "list": { + "httpMethod": "GET", + "response": { + "$ref": "GooglePrivacyDlpV2beta1ListRootCategoriesResponse" + }, + "parameterOrder": [], + "parameters": { + "languageCode": { + "location": "query", + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/rootCategories", + "id": "dlp.rootCategories.list", + "path": "v2beta1/rootCategories", + "description": "Returns the list of root categories of sensitive information." + } + }, + "resources": { + "infoTypes": { + "methods": { + "list": { + "description": "Returns sensitive information types for given category.", + "response": { + "$ref": "GooglePrivacyDlpV2beta1ListInfoTypesResponse" + }, + "parameterOrder": [ + "category" + ], + "httpMethod": "GET", + "parameters": { + "category": { + "required": true, + "type": "string", + "pattern": "^[^/]+$", + "location": "path", + "description": "Category name as returned by ListRootCategories." + }, + "languageCode": { + "type": "string", + "location": "query", + "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." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/rootCategories/{rootCategoriesId}/infoTypes", + "path": "v2beta1/rootCategories/{+category}/infoTypes", + "id": "dlp.rootCategories.infoTypes.list" + } + } + } + } + }, "riskAnalysis": { "resources": { "operations": { "methods": { + "cancel": { + "id": "dlp.riskAnalysis.operations.cancel", + "path": "v2beta1/{+name}:cancel", + "request": { + "$ref": "GoogleLongrunningCancelOperationRequest" + }, + "description": "Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation.", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "parameters": { + "name": { + "pattern": "^riskAnalysis/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" + ], + "flatPath": "v2beta1/riskAnalysis/operations/{operationsId}:cancel" + }, + "delete": { + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^riskAnalysis/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource to be deleted." + } + }, + "flatPath": "v2beta1/riskAnalysis/operations/{operationsId}", + "path": "v2beta1/{+name}", + "id": "dlp.riskAnalysis.operations.delete", + "description": "This method is not supported and the server returns `UNIMPLEMENTED`." + }, "list": { "response": { "$ref": "GoogleLongrunningListOperationsResponse" @@ -2047,16 +190,16 @@ "httpMethod": "GET", "parameters": { "name": { + "pattern": "^riskAnalysis/operations$", + "location": "path", "description": "The name of the operation's parent resource.", "required": true, - "type": "string", - "pattern": "^riskAnalysis/operations$", - "location": "path" + "type": "string" }, "pageToken": { - "location": "query", "description": "The standard list page token.", - "type": "string" + "type": "string", + "location": "query" }, "pageSize": { "description": "The list page size. The maximum allowed value is 256 and the default is 100.", @@ -2102,59 +245,6 @@ "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`." } } } @@ -2163,6 +253,10 @@ "dataSource": { "methods": { "analyze": { + "description": "Schedules a job to compute risk analysis metrics over content in a Google\nCloud Platform repository.", + "request": { + "$ref": "GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest" + }, "response": { "$ref": "GoogleLongrunningOperation" }, @@ -2174,88 +268,105 @@ "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" - } + "id": "dlp.dataSource.analyze" } } }, "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": { + "create": { + "request": { + "$ref": "GooglePrivacyDlpV2beta1CreateInspectOperationRequest" + }, + "description": "Schedules a job scanning content in a Google Cloud Platform data\nrepository.", + "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" + }, + "cancel": { + "request": { + "$ref": "GoogleLongrunningCancelOperationRequest" + }, + "description": "Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation.", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^inspect/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource to be cancelled." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/inspect/operations/{operationsId}:cancel", + "path": "v2beta1/{+name}:cancel", + "id": "dlp.inspect.operations.cancel" + }, + "delete": { + "description": "This method is not supported and the server returns `UNIMPLEMENTED`.", + "httpMethod": "DELETE", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "required": true, + "type": "string", + "pattern": "^inspect/operations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v2beta1/inspect/operations/{operationsId}", + "id": "dlp.inspect.operations.delete", + "path": "v2beta1/{+name}" + }, "list": { - "description": "Fetches the list of long running operations.", - "httpMethod": "GET", "response": { "$ref": "GoogleLongrunningListOperationsResponse" }, "parameterOrder": [ "name" ], + "httpMethod": "GET", "parameters": { "filter": { - "location": "query", "description": "Filters by `done`. That is, `done=true` or `done=false`.", - "type": "string" + "type": "string", + "location": "query" }, "name": { - "location": "path", "description": "The name of the operation's parent resource.", "required": true, "type": "string", - "pattern": "^inspect/operations$" + "pattern": "^inspect/operations$", + "location": "path" }, "pageToken": { "location": "query", @@ -2273,11 +384,11 @@ "https://www.googleapis.com/auth/cloud-platform" ], "flatPath": "v2beta1/inspect/operations", + "path": "v2beta1/{+name}", "id": "dlp.inspect.operations.list", - "path": "v2beta1/{+name}" + "description": "Fetches the list of long running 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": "GoogleLongrunningOperation" }, @@ -2287,209 +398,69 @@ "httpMethod": "GET", "parameters": { "name": { + "pattern": "^inspect/operations/[^/]+$", + "location": "path", "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" + "flatPath": "v2beta1/inspect/operations/{operationsId}", + "path": "v2beta1/{+name}", + "id": "dlp.inspect.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." + } + } + }, + "results": { + "resources": { + "findings": { + "methods": { + "list": { + "description": "Returns list of results for given inspect operation result set id.", + "response": { + "$ref": "GooglePrivacyDlpV2beta1ListInspectFindingsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "filter": { + "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", + "location": "query" + }, + "name": { + "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/[^/]+$", + "location": "path" + }, + "pageToken": { + "location": "query", + "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" + }, + "pageSize": { + "location": "query", + "description": "Maximum number of results to return.\nIf 0, the implementation selects a reasonable value.", + "format": "int32", + "type": "integer" + } + }, + "flatPath": "v2beta1/inspect/results/{resultsId}/findings", + "path": "v2beta1/{+name}/findings", + "id": "dlp.inspect.results.findings.list" + } + } } } } @@ -2497,35 +468,38 @@ } }, "parameters": { - "upload_protocol": { + "oauth_token": { "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "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.", "type": "boolean", - "default": "true" - }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" + "default": "true", + "location": "query" }, "uploadType": { - "location": "query", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", - "type": "string" + "type": "string", + "location": "query" }, - "callback": { - "description": "JSONP", + "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" @@ -2534,9 +508,22 @@ "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", @@ -2544,44 +531,28 @@ ], "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" + "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": { - "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.", + "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" }, - "oauth_token": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" + "pp": { + "location": "query", + "description": "Pretty-print response.", + "type": "boolean", + "default": "true" } }, "version": "v2beta1", @@ -2590,7 +561,2249 @@ "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", + "id": "dlp:v2beta1", "documentationLink": "https://cloud.google.com/dlp/docs/", - "id": "dlp:v2beta1" + "revision": "20171205", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "GooglePrivacyDlpV2beta1FieldTransformation": { + "description": "The transformation to apply to the field.", + "type": "object", + "properties": { + "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": { + "$ref": "GooglePrivacyDlpV2beta1InfoTypeTransformations", + "description": "Treat the contents of the field as free text, and selectively\ntransform content that matches an `InfoType`." + }, + "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." + } + }, + "id": "GooglePrivacyDlpV2beta1FieldTransformation" + }, + "GooglePrivacyDlpV2beta1OutputStorageConfig": { + "description": "Cloud repository for storing output.", + "type": "object", + "properties": { + "storagePath": { + "$ref": "GooglePrivacyDlpV2beta1CloudStoragePath", + "description": "The path to a Google Cloud Storage location to store output.\nThe 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" + }, + "table": { + "description": "Store findings in a new table in the dataset.", + "$ref": "GooglePrivacyDlpV2beta1BigQueryTable" + } + }, + "id": "GooglePrivacyDlpV2beta1OutputStorageConfig" + }, + "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": { + "description": "The set of columns' values that share the same k-anonymity value.", + "type": "object", + "properties": { + "equivalenceClassSize": { + "type": "string", + "description": "Size of the equivalence class, for example number of rows with the\nabove set of values.", + "format": "int64" + }, + "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" + }, + "GoogleLongrunningOperation": { + "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": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "This field will contain an InspectOperationResult object for `inspect.operations.create` or a RiskAnalysisOperationResult object for `dataSource.analyze`.", + "type": "object" + }, + "name": { + "description": "The server-assigned name. The `name` should have the format of `inspect/operations/\u003cidentifier\u003e`.", + "type": "string" + }, + "error": { + "$ref": "GoogleRpcStatus", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "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", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + } + }, + "id": "GoogleLongrunningOperation" + }, + "GooglePrivacyDlpV2beta1InspectOperationMetadata": { + "description": "Metadata returned within GetOperation for an inspect request.", + "type": "object", + "properties": { + "totalEstimatedBytes": { + "type": "string", + "description": "Estimate of the number of bytes to process.", + "format": "int64" + }, + "infoTypeStats": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1InfoTypeStatistics" + } + }, + "requestInspectConfig": { + "description": "The inspect config used to create the Operation.", + "$ref": "GooglePrivacyDlpV2beta1InspectConfig" + }, + "requestOutputConfig": { + "description": "Optional location to store findings.", + "$ref": "GooglePrivacyDlpV2beta1OutputStorageConfig" + }, + "createTime": { + "description": "The time which this request was started.", + "format": "google-datetime", + "type": "string" + }, + "processedBytes": { + "description": "Total size in bytes that were processed.", + "format": "int64", + "type": "string" + }, + "requestStorageConfig": { + "description": "The storage config used to create the Operation.", + "$ref": "GooglePrivacyDlpV2beta1StorageConfig" + } + }, + "id": "GooglePrivacyDlpV2beta1InspectOperationMetadata" + }, + "GooglePrivacyDlpV2beta1KmsWrappedCryptoKey": { + "id": "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" + } + } + }, + "GooglePrivacyDlpV2beta1InfoType": { + "description": "Type of information detected by the API.", + "type": "object", + "properties": { + "name": { + "description": "Name of the information type.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1InfoType" + }, + "GooglePrivacyDlpV2beta1CharsToIgnore": { + "type": "object", + "properties": { + "charactersToSkip": { + "type": "string" + }, + "commonCharactersToIgnore": { + "type": "string", + "enumDescriptions": [ + "", + "0-9", + "A-Z", + "a-z", + "US Punctuation, one of !\"#$%&'()*+,-./:;\u003c=\u003e?@[\\]^_`{|}~", + "Whitespace character, one of [ \\t\\n\\x0B\\f\\r]" + ], + "enum": [ + "CHARACTER_GROUP_UNSPECIFIED", + "NUMERIC", + "ALPHA_UPPER_CASE", + "ALPHA_LOWER_CASE", + "PUNCTUATION", + "WHITESPACE" + ] + } + }, + "id": "GooglePrivacyDlpV2beta1CharsToIgnore", + "description": "Characters to skip when doing deidentification of a value. These will be left\nalone and skipped." + }, + "GooglePrivacyDlpV2beta1FixedSizeBucketingConfig": { + "type": "object", + "properties": { + "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]." + }, + "lowerBound": { + "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].", + "$ref": "GooglePrivacyDlpV2beta1Value" + }, + "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" + } + }, + "id": "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." + }, + "GooglePrivacyDlpV2beta1RiskAnalysisOperationResult": { + "description": "Result of a risk analysis\n[`Operation`](/dlp/docs/reference/rest/v2beta1/inspect.operations)\nrequest.", + "type": "object", + "properties": { + "categoricalStatsResult": { + "$ref": "GooglePrivacyDlpV2beta1CategoricalStatsResult" + }, + "numericalStatsResult": { + "$ref": "GooglePrivacyDlpV2beta1NumericalStatsResult" + }, + "kMapEstimationResult": { + "$ref": "GooglePrivacyDlpV2beta1KMapEstimationResult" + }, + "kAnonymityResult": { + "$ref": "GooglePrivacyDlpV2beta1KAnonymityResult" + }, + "lDiversityResult": { + "$ref": "GooglePrivacyDlpV2beta1LDiversityResult" + } + }, + "id": "GooglePrivacyDlpV2beta1RiskAnalysisOperationResult" + }, + "GooglePrivacyDlpV2beta1CategoryDescription": { + "type": "object", + "properties": { + "name": { + "description": "Internal name of the category.", + "type": "string" + }, + "displayName": { + "description": "Human readable form of the category name.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1CategoryDescription", + "description": "Info Type Category description." + }, + "GooglePrivacyDlpV2beta1Conditions": { + "type": "object", + "properties": { + "conditions": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1Condition" + } + } + }, + "id": "GooglePrivacyDlpV2beta1Conditions" + }, + "GooglePrivacyDlpV2beta1PrimitiveTransformation": { + "description": "A rule for transforming a value.", + "type": "object", + "properties": { + "replaceWithInfoTypeConfig": { + "$ref": "GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig" + }, + "cryptoHashConfig": { + "$ref": "GooglePrivacyDlpV2beta1CryptoHashConfig" + }, + "cryptoReplaceFfxFpeConfig": { + "$ref": "GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig" + }, + "replaceConfig": { + "$ref": "GooglePrivacyDlpV2beta1ReplaceValueConfig" + }, + "timePartConfig": { + "$ref": "GooglePrivacyDlpV2beta1TimePartConfig" + }, + "fixedSizeBucketingConfig": { + "$ref": "GooglePrivacyDlpV2beta1FixedSizeBucketingConfig" + }, + "characterMaskConfig": { + "$ref": "GooglePrivacyDlpV2beta1CharacterMaskConfig" + }, + "bucketingConfig": { + "$ref": "GooglePrivacyDlpV2beta1BucketingConfig" + }, + "redactConfig": { + "$ref": "GooglePrivacyDlpV2beta1RedactConfig" + } + }, + "id": "GooglePrivacyDlpV2beta1PrimitiveTransformation" + }, + "GooglePrivacyDlpV2beta1CategoricalStatsConfig": { + "id": "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." + } + } + }, + "GooglePrivacyDlpV2beta1Finding": { + "properties": { + "quote": { + "description": "The specific string that may be potentially sensitive info.", + "type": "string" + }, + "location": { + "description": "Location of the info found.", + "$ref": "GooglePrivacyDlpV2beta1Location" + }, + "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" + }, + "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" + } + }, + "id": "GooglePrivacyDlpV2beta1Finding", + "description": "Container structure describing a single finding within a string or image.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1KMapEstimationConfig": { + "description": "Reidentifiability metric. This corresponds to a risk model similar to what\nis called \"journalist risk\" in the literature, except the attack dataset is\nstatistically modeled instead of being perfectly known. This can be done\nusing publicly available data (like the US Census), or using a custom\nstatistical model (indicated as one or several BigQuery tables), or by\nextrapolating from the distribution of values in the input dataset.", + "type": "object", + "properties": { + "auxiliaryTables": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1AuxiliaryTable" + }, + "description": "Several auxiliary tables can be used in the analysis. Each custom_tag\nused to tag a quasi-identifiers column must appear in exactly one column\nof one auxiliary table." + }, + "quasiIds": { + "description": "Fields considered to be quasi-identifiers. No two columns can have the\nsame tag. [required]", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1TaggedField" + } + }, + "regionCode": { + "description": "ISO 3166-1 alpha-2 region code to use in the statistical modeling.\nRequired if no column is tagged with a region-specific InfoType (like\nUS_ZIP_5) or a region code.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1KMapEstimationConfig" + }, + "GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata": { + "description": "Metadata returned within the\n[`riskAnalysis.operations.get`](/dlp/docs/reference/rest/v2beta1/riskAnalysis.operations/get)\nfor risk analysis.", + "type": "object", + "properties": { + "createTime": { + "type": "string", + "description": "The time which this request was started.", + "format": "google-datetime" + }, + "requestedSourceTable": { + "$ref": "GooglePrivacyDlpV2beta1BigQueryTable", + "description": "Input dataset to compute metrics over." + }, + "requestedPrivacyMetric": { + "$ref": "GooglePrivacyDlpV2beta1PrivacyMetric", + "description": "Privacy metric to compute." + } + }, + "id": "GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata" + }, + "GoogleLongrunningListOperationsResponse": { + "id": "GoogleLongrunningListOperationsResponse", + "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": "GoogleLongrunningOperation" + } + }, + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + } + } + }, + "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": { + "result": { + "description": "The results.", + "$ref": "GooglePrivacyDlpV2beta1InspectResult" + }, + "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" + } + }, + "id": "GooglePrivacyDlpV2beta1ListInspectFindingsResponse" + }, + "GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket": { + "description": "A KMapEstimationHistogramBucket message with the following values:\n min_anonymity: 3\n max_anonymity: 5\n frequency: 42\nmeans that there are 42 records whose quasi-identifier values correspond\nto 3, 4 or 5 people in the overlying population. An important particular\ncase is when min_anonymity = max_anonymity = 1: the frequency field then\ncorresponds to the number of uniquely identifiable records.", + "type": "object", + "properties": { + "bucketValues": { + "description": "Sample of quasi-identifier tuple values in this bucket. The total\nnumber of classes returned per bucket is capped at 20.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues" + } + }, + "minAnonymity": { + "type": "string", + "description": "Always positive.", + "format": "int64" + }, + "maxAnonymity": { + "description": "Always greater than or equal to min_anonymity.", + "format": "int64", + "type": "string" + }, + "bucketSize": { + "description": "Number of records within these anonymity bounds.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket" + }, + "GooglePrivacyDlpV2beta1Expressions": { + "id": "GooglePrivacyDlpV2beta1Expressions", + "description": "A collection of expressions", + "type": "object", + "properties": { + "logicalOperator": { + "description": "The operator to apply to the result of conditions. Default and currently\nonly supported value is `AND`.", + "type": "string", + "enumDescriptions": [ + "", + "" + ], + "enum": [ + "LOGICAL_OPERATOR_UNSPECIFIED", + "AND" + ] + }, + "conditions": { + "$ref": "GooglePrivacyDlpV2beta1Conditions" + } + } + }, + "GooglePrivacyDlpV2beta1CloudStorageOptions": { + "type": "object", + "properties": { + "fileSet": { + "$ref": "GooglePrivacyDlpV2beta1FileSet" + } + }, + "id": "GooglePrivacyDlpV2beta1CloudStorageOptions", + "description": "Options defining a file or a set of files (path ending with *) within\na Google Cloud Storage bucket." + }, + "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": { + "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" + }, + "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" + } + } + }, + "id": "GooglePrivacyDlpV2beta1KAnonymityHistogramBucket" + }, + "GooglePrivacyDlpV2beta1InspectOperationResult": { + "id": "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" + } + } + }, + "GooglePrivacyDlpV2beta1LDiversityResult": { + "description": "Result of the l-diversity computation.", + "type": "object", + "properties": { + "sensitiveValueFrequencyHistogramBuckets": { + "description": "Histogram of l-diversity equivalence class sensitive value frequencies.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1LDiversityHistogramBucket" + } + } + }, + "id": "GooglePrivacyDlpV2beta1LDiversityResult" + }, + "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": { + "id": "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" + } + } + }, + "GooglePrivacyDlpV2beta1DeidentifyConfig": { + "description": "The configuration that controls how the data will change.", + "type": "object", + "properties": { + "recordTransformations": { + "description": "Treat the dataset as structured. Transformations can be applied to\nspecific locations within structured datasets, such as transforming\na column within a table.", + "$ref": "GooglePrivacyDlpV2beta1RecordTransformations" + }, + "infoTypeTransformations": { + "$ref": "GooglePrivacyDlpV2beta1InfoTypeTransformations", + "description": "Treat the dataset as free-form text and apply the same free text\ntransformation everywhere." + } + }, + "id": "GooglePrivacyDlpV2beta1DeidentifyConfig" + }, + "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": { + "type": "object", + "properties": { + "bigQueryOptions": { + "$ref": "GooglePrivacyDlpV2beta1BigQueryOptions", + "description": "BigQuery options specification." + }, + "cloudStorageOptions": { + "$ref": "GooglePrivacyDlpV2beta1CloudStorageOptions", + "description": "Google Cloud Storage options specification." + }, + "datastoreOptions": { + "$ref": "GooglePrivacyDlpV2beta1DatastoreOptions", + "description": "Google Cloud Datastore options specification." + } + }, + "id": "GooglePrivacyDlpV2beta1StorageConfig", + "description": "Shared message indicating Cloud storage type." + }, + "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" + }, + "GooglePrivacyDlpV2beta1BigQueryOptions": { + "description": "Options defining BigQuery table and row identifiers.", + "type": "object", + "properties": { + "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" + } + }, + "tableReference": { + "$ref": "GooglePrivacyDlpV2beta1BigQueryTable", + "description": "Complete BigQuery table reference." + } + }, + "id": "GooglePrivacyDlpV2beta1BigQueryOptions" + }, + "GooglePrivacyDlpV2beta1PrivacyMetric": { + "description": "Privacy metric to compute for reidentification risk analysis.", + "type": "object", + "properties": { + "kMapEstimationConfig": { + "$ref": "GooglePrivacyDlpV2beta1KMapEstimationConfig" + }, + "lDiversityConfig": { + "$ref": "GooglePrivacyDlpV2beta1LDiversityConfig" + }, + "numericalStatsConfig": { + "$ref": "GooglePrivacyDlpV2beta1NumericalStatsConfig" + }, + "kAnonymityConfig": { + "$ref": "GooglePrivacyDlpV2beta1KAnonymityConfig" + }, + "categoricalStatsConfig": { + "$ref": "GooglePrivacyDlpV2beta1CategoricalStatsConfig" + } + }, + "id": "GooglePrivacyDlpV2beta1PrivacyMetric" + }, + "GooglePrivacyDlpV2beta1ReplaceConfig": { + "type": "object", + "properties": { + "replaceWith": { + "description": "Content replacing sensitive information of given type. Max 256 chars.", + "type": "string" + }, + "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" + } + }, + "id": "GooglePrivacyDlpV2beta1ReplaceConfig" + }, + "GooglePrivacyDlpV2beta1NumericalStatsConfig": { + "properties": { + "field": { + "description": "Field to compute numerical stats on. Supported types are\ninteger, float, date, datetime, timestamp, time.", + "$ref": "GooglePrivacyDlpV2beta1FieldId" + } + }, + "id": "GooglePrivacyDlpV2beta1NumericalStatsConfig", + "description": "Compute numerical stats over an individual column, including\nmin, max, and quantiles.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1LDiversityEquivalenceClass": { + "description": "The set of columns' values that share the same l-diversity value.", + "type": "object", + "properties": { + "equivalenceClassSize": { + "description": "Size of the k-anonymity equivalence class.", + "format": "int64", + "type": "string" + }, + "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" + } + } + }, + "id": "GooglePrivacyDlpV2beta1LDiversityEquivalenceClass" + }, + "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" + }, + "GooglePrivacyDlpV2beta1RecordCondition": { + "description": "A condition for determining whether a transformation should be applied to\na field.", + "type": "object", + "properties": { + "expressions": { + "$ref": "GooglePrivacyDlpV2beta1Expressions" + } + }, + "id": "GooglePrivacyDlpV2beta1RecordCondition" + }, + "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" + }, + "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": { + "description": "Result of the numerical stats computation.", + "type": "object", + "properties": { + "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" + } + }, + "minValue": { + "$ref": "GooglePrivacyDlpV2beta1Value", + "description": "Minimum value appearing in the column." + } + }, + "id": "GooglePrivacyDlpV2beta1NumericalStatsResult" + }, + "GooglePrivacyDlpV2beta1Dictionary": { + "properties": { + "wordList": { + "$ref": "GooglePrivacyDlpV2beta1WordList", + "description": "List of words or phrases to search for." + } + }, + "id": "GooglePrivacyDlpV2beta1Dictionary", + "description": "Custom information type based on a dictionary of words or phrases. This can\nbe used to match sensitive information specific to the data, such as a list\nof employee IDs or job titles.\n\nDictionary words are case-insensitive and all characters other than letters\nand digits in the unicode [Basic Multilingual\nPlane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane)\nwill be replaced with whitespace when scanning for matches, so the\ndictionary phrase \"Sam Johnson\" will match all three phrases \"sam johnson\",\n\"Sam, Johnson\", and \"Sam (Johnson)\". Additionally, the characters\nsurrounding any match must be of a different type than the adjacent\ncharacters within the word, so letters must be next to non-letters and\ndigits next to non-digits. For example, the dictionary word \"jen\" will\nmatch the first three letters of the text \"jen123\" but will return no\nmatches for \"jennifer\".\n\nDictionary words containing a large number of characters that are not\nletters or digits may result in unexpected findings because such characters\nare treated as whitespace.", + "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": { + "fieldTransformations": { + "description": "Transform the record by applying various field transformations.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1FieldTransformation" + } + }, + "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" + } + } + }, + "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": { + "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": { + "type": "boolean", + "description": "When true, a contextual quote from the data that triggered a finding is\nincluded in the response; see Finding.quote." + }, + "customInfoTypes": { + "description": "Custom info types provided by the user.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1CustomInfoType" + } + }, + "excludeTypes": { + "description": "When true, excludes type information of the findings.", + "type": "boolean" + }, + "minLikelihood": { + "type": "string", + "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." + } + }, + "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": { + "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", + "properties": {}, + "id": "GooglePrivacyDlpV2beta1RedactConfig" + }, + "GooglePrivacyDlpV2beta1CryptoHashConfig": { + "id": "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": { + "$ref": "GooglePrivacyDlpV2beta1CryptoKey", + "description": "The key used by the hash function." + } + } + }, + "GooglePrivacyDlpV2beta1Key": { + "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\nA path can never be empty, and a path can have at most 100 elements.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1PathElement" + } + }, + "partitionId": { + "description": "Entities are partitioned into subsets, currently identified by a project\nID and namespace ID.\nQueries are scoped to a single partition.", + "$ref": "GooglePrivacyDlpV2beta1PartitionId" + } + }, + "id": "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." + }, + "GooglePrivacyDlpV2beta1InspectContentRequest": { + "description": "Request to search for potentially sensitive info in a list of items.", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ContentItem" + }, + "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." + }, + "inspectConfig": { + "description": "Configuration for the inspector.", + "$ref": "GooglePrivacyDlpV2beta1InspectConfig" + } + }, + "id": "GooglePrivacyDlpV2beta1InspectContentRequest" + }, + "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": { + "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": { + "type": "integer", + "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" + } + }, + "id": "GoogleTypeDate" + }, + "GooglePrivacyDlpV2beta1ImageRedactionConfig": { + "description": "Configuration for determining how redaction of images should occur.", + "type": "object", + "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" + }, + "GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig": { + "properties": {}, + "id": "GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig", + "description": "Replace each matching finding with the name of the info_type.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1Location": { + "description": "Specifies the location of a finding within its source item.", + "type": "object", + "properties": { + "recordKey": { + "description": "Key of the finding.", + "$ref": "GooglePrivacyDlpV2beta1RecordKey" + }, + "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": { + "$ref": "GooglePrivacyDlpV2beta1Range", + "description": "Zero-based byte offsets within a content item." + } + }, + "id": "GooglePrivacyDlpV2beta1Location" + }, + "GooglePrivacyDlpV2beta1RecordSuppression": { + "description": "Configuration to suppress records whose suppression conditions evaluate to\ntrue.", + "type": "object", + "properties": { + "condition": { + "$ref": "GooglePrivacyDlpV2beta1RecordCondition" + } + }, + "id": "GooglePrivacyDlpV2beta1RecordSuppression" + }, + "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": { + "properties": { + "key": { + "type": "string", + "description": "The AES 128/192/256 bit key. [required]", + "format": "byte" + } + }, + "id": "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" + }, + "GooglePrivacyDlpV2beta1CustomInfoType": { + "properties": { + "infoType": { + "$ref": "GooglePrivacyDlpV2beta1InfoType", + "description": "Info type configuration. All custom info types must have configurations\nthat do not conflict with built-in info types or other custom info types." + }, + "dictionary": { + "$ref": "GooglePrivacyDlpV2beta1Dictionary", + "description": "Dictionary-based custom info type." + }, + "surrogateType": { + "$ref": "GooglePrivacyDlpV2beta1SurrogateType", + "description": "Surrogate info type." + } + }, + "id": "GooglePrivacyDlpV2beta1CustomInfoType", + "description": "Custom information type provided by the user. Used to find domain-specific\nsensitive information configurable to the data in question.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1InfoTypeDescription": { + "id": "GooglePrivacyDlpV2beta1InfoTypeDescription", + "description": "Description of the information type (infoType).", + "type": "object", + "properties": { + "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" + } + }, + "name": { + "description": "Internal name of the infoType.", + "type": "string" + } + } + }, + "GooglePrivacyDlpV2beta1AuxiliaryTable": { + "description": "An auxiliary table contains statistical information on the relative\nfrequency of different quasi-identifiers values. It has one or several\nquasi-identifiers columns, and one column that indicates the relative\nfrequency of each quasi-identifier tuple.\nIf a tuple is present in the data but not in the auxiliary table, the\ncorresponding relative frequency is assumed to be zero (and thus, the\ntuple is highly reidentifiable).", + "type": "object", + "properties": { + "table": { + "description": "Auxiliary table location. [required]", + "$ref": "GooglePrivacyDlpV2beta1BigQueryTable" + }, + "quasiIds": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1QuasiIdField" + }, + "description": "Quasi-identifier columns. [required]" + }, + "relativeFrequency": { + "$ref": "GooglePrivacyDlpV2beta1FieldId", + "description": "The relative frequency column must contain a floating-point number\nbetween 0 and 1 (inclusive). Null values are assumed to be zero.\n[required]" + } + }, + "id": "GooglePrivacyDlpV2beta1AuxiliaryTable" + }, + "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": { + "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 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" + } + } + }, + "id": "GoogleRpcStatus" + }, + "GooglePrivacyDlpV2beta1KMapEstimationResult": { + "description": "Result of the reidentifiability analysis. Note that these results are an\nestimation, not exact values.", + "type": "object", + "properties": { + "kMapEstimationHistogram": { + "description": "The intervals [min_anonymity, max_anonymity] do not overlap. If a value\ndoesn't correspond to any such interval, the associated frequency is\nzero. For example, the following records:\n {min_anonymity: 1, max_anonymity: 1, frequency: 17}\n {min_anonymity: 2, max_anonymity: 3, frequency: 42}\n {min_anonymity: 5, max_anonymity: 10, frequency: 99}\nmean that there are no record with an estimated anonymity of 4, 5, or\nlarger than 10.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket" + } + } + }, + "id": "GooglePrivacyDlpV2beta1KMapEstimationResult" + }, + "GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues": { + "type": "object", + "properties": { + "quasiIdsValues": { + "description": "The quasi-identifier values.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1Value" + } + }, + "estimatedAnonymity": { + "type": "string", + "description": "The estimated anonymity for these quasi-identifier values.", + "format": "int64" + } + }, + "id": "GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues", + "description": "A tuple of values for the quasi-identifier columns." + }, + "GooglePrivacyDlpV2beta1PathElement": { + "id": "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": { + "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" + }, + "kind": { + "type": "string", + "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 `\"\"`." + } + } + }, + "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": { + "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" + }, + "datasetId": { + "description": "Dataset ID of the table.", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1BigQueryTable" + }, + "GooglePrivacyDlpV2beta1ListRootCategoriesResponse": { + "type": "object", + "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." + }, + "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" + }, + "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" + }, + "GooglePrivacyDlpV2beta1InfoTypeTransformation": { + "description": "A transformation to apply to text that is identified as a specific\ninfo_type.", + "type": "object", + "properties": { + "primitiveTransformation": { + "$ref": "GooglePrivacyDlpV2beta1PrimitiveTransformation", + "description": "Primitive transformation to apply to the info type. [required]" + }, + "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" + } + } + }, + "id": "GooglePrivacyDlpV2beta1InfoTypeTransformation" + }, + "GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest": { + "description": "Request for creating a risk analysis operation.", + "type": "object", + "properties": { + "sourceTable": { + "$ref": "GooglePrivacyDlpV2beta1BigQueryTable", + "description": "Input dataset to compute metrics over." + }, + "privacyMetric": { + "description": "Privacy metric to compute.", + "$ref": "GooglePrivacyDlpV2beta1PrivacyMetric" + } + }, + "id": "GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest" + }, + "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" + }, + "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": { + "$ref": "GooglePrivacyDlpV2beta1Value", + "description": "Replacement value for this bucket. If not provided\nthe default behavior will be to hyphenate the min-max range." + }, + "min": { + "description": "Lower bound of the range, inclusive. Type should be the same as max if\nused.", + "$ref": "GooglePrivacyDlpV2beta1Value" + } + }, + "id": "GooglePrivacyDlpV2beta1Bucket" + }, + "GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket": { + "description": "Histogram bucket of value frequencies in the column.", + "type": "object", + "properties": { + "valueFrequencyLowerBound": { + "type": "string", + "description": "Lower bound on the value frequency of the values in this bucket.", + "format": "int64" + }, + "bucketValues": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ValueFrequency" + }, + "description": "Sample of value frequencies in this bucket. The total number of\nvalues returned per bucket is capped at 20." + }, + "bucketSize": { + "type": "string", + "description": "Total number of records in this bucket.", + "format": "int64" + }, + "valueFrequencyUpperBound": { + "description": "Upper bound on the value frequency of the values in this bucket.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket" + }, + "GooglePrivacyDlpV2beta1TableLocation": { + "description": "Location of a finding within a `ContentItem.Table`.", + "type": "object", + "properties": { + "rowIndex": { + "description": "The zero-based index of the row where the finding is located.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1TableLocation" + }, + "GooglePrivacyDlpV2beta1KAnonymityConfig": { + "description": "k-anonymity metric, used for analysis of reidentification risk.", + "type": "object", + "properties": { + "entityId": { + "$ref": "GooglePrivacyDlpV2beta1EntityId", + "description": "Optional message indicating that each distinct entity_id should not\ncontribute to the k-anonymity count more than once per equivalence class.\nIf an entity_id appears on several rows with different quasi-identifier\ntuples, it will contribute to each count exactly once.\n\nThis can lead to unexpected results. Consider a table where ID 1 is\nassociated to quasi-identifier \"foo\", ID 2 to \"bar\", and ID 3 to *both*\nquasi-identifiers \"foo\" and \"bar\" (on separate rows), and where this ID\nis used as entity_id. Then, the anonymity value associated to ID 3 will\nbe 2, even if it is the only ID to be associated to both values \"foo\" and\n\"bar\"." + }, + "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" + }, + "GooglePrivacyDlpV2beta1DatastoreKey": { + "description": "Record key for a finding in Cloud Datastore.", + "type": "object", + "properties": { + "entityKey": { + "description": "Datastore entity key.", + "$ref": "GooglePrivacyDlpV2beta1Key" + } + }, + "id": "GooglePrivacyDlpV2beta1DatastoreKey" + }, + "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": { + "id": "GooglePrivacyDlpV2beta1DeidentifyContentRequest", + "description": "Request to de-identify a list of items.", + "type": "object", + "properties": { + "inspectConfig": { + "$ref": "GooglePrivacyDlpV2beta1InspectConfig", + "description": "Configuration for the inspector." + }, + "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." + } + } + }, + "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" + }, + "GooglePrivacyDlpV2beta1QuasiIdField": { + "properties": { + "field": { + "$ref": "GooglePrivacyDlpV2beta1FieldId" + }, + "customTag": { + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1QuasiIdField", + "description": "A quasi-identifier column has a custom_tag, used to know which column\nin the data corresponds to which column in the statistical model.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1ImageLocation": { + "description": "Bounding box encompassing detected text within an image.", + "type": "object", + "properties": { + "height": { + "type": "integer", + "description": "Height of the bounding box in pixels.", + "format": "int32" + }, + "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": { + "id": "GooglePrivacyDlpV2beta1ContentItem", + "description": "Container structure for the content to inspect.", + "type": "object", + "properties": { + "table": { + "description": "Structured content for inspection.", + "$ref": "GooglePrivacyDlpV2beta1Table" + }, + "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" + } + } + }, + "GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig": { + "id": "GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig", + "description": "Replaces an identifier with a surrogate using FPE with the FFX\nmode of operation.\nThe identifier must be representable by the US-ASCII character set.\nFor a given crypto key and context, the same identifier will be\nreplaced with the same surrogate.\nIdentifiers must be at least two characters long.\nIn the case that the identifier is the empty string, it will be skipped.", + "type": "object", + "properties": { + "cryptoKey": { + "$ref": "GooglePrivacyDlpV2beta1CryptoKey", + "description": "The key used by the encryption algorithm. [required]" + }, + "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." + }, + "surrogateInfoType": { + "$ref": "GooglePrivacyDlpV2beta1InfoType", + "description": "The custom info type to annotate the surrogate with.\nThis annotation will be applied to the surrogate by prefixing it with\nthe name of the custom info type followed by the number of\ncharacters comprising the surrogate. The following scheme defines the\nformat: info_type_name(surrogate_character_count):surrogate\n\nFor example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and\nthe surrogate is 'abc', the full replacement value\nwill be: 'MY_TOKEN_INFO_TYPE(3):abc'\n\nThis annotation identifies the surrogate when inspecting content using the\ncustom info type\n[`SurrogateType`](/dlp/docs/reference/rest/v2beta1/InspectConfig#surrogatetype).\nThis facilitates reversal of the surrogate when it occurs in free text.\n\nIn order for inspection to work properly, the name of this info type must\nnot occur naturally anywhere in your data; otherwise, inspection may\nfind a surrogate that does not correspond to an actual identifier.\nTherefore, choose your custom info type name carefully after considering\nwhat your data looks like. One way to select a name that has a high chance\nof yielding reliable detection is to include one or more unicode characters\nthat are highly improbable to exist in your data.\nFor example, assuming your data is entered from a regular ASCII keyboard,\nthe symbol with the hex code point 29DD might be used like so:\n⧝MY_TOKEN_TYPE" + }, + "commonAlphabet": { + "type": "string", + "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" + ] + }, + "radix": { + "description": "The native way to select the alphabet. Must be in the range [2, 62].", + "format": "int32", + "type": "integer" + }, + "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" + } + } + }, + "GooglePrivacyDlpV2beta1Color": { + "description": "Represents a color in the RGB color space.", + "type": "object", + "properties": { + "red": { + "type": "number", + "description": "The amount of red in the color as a value in the interval [0, 1].", + "format": "float" + }, + "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" + }, + "GooglePrivacyDlpV2beta1Table": { + "type": "object", + "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." + }, + "GooglePrivacyDlpV2beta1SurrogateType": { + "description": "Message for detecting output from deidentification transformations\nsuch as\n[`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2beta1/content/deidentify#CryptoReplaceFfxFpeConfig).\nThese types of transformations are\nthose that perform pseudonymization, thereby producing a \"surrogate\" as\noutput. This should be used in conjunction with a field on the\ntransformation such as `surrogate_info_type`.", + "type": "object", + "properties": {}, + "id": "GooglePrivacyDlpV2beta1SurrogateType" + }, + "GooglePrivacyDlpV2beta1ValueFrequency": { + "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", + "description": "A value of a field, including its frequency.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1CryptoKey": { + "type": "object", + "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." + }, + "GooglePrivacyDlpV2beta1InfoTypeLimit": { + "description": "Max findings configuration per info type, per content item or long running\noperation.", + "type": "object", + "properties": { + "infoType": { + "$ref": "GooglePrivacyDlpV2beta1InfoType", + "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." + }, + "maxFindings": { + "description": "Max findings limit for the given infoType.", + "format": "int32", + "type": "integer" + } + }, + "id": "GooglePrivacyDlpV2beta1InfoTypeLimit" + }, + "GooglePrivacyDlpV2beta1LDiversityHistogramBucket": { + "description": "Histogram bucket of sensitive value frequencies in the table.", + "type": "object", + "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" + }, + "GooglePrivacyDlpV2beta1Value": { + "properties": { + "floatValue": { + "format": "double", + "type": "number" + }, + "timeValue": { + "$ref": "GoogleTypeTimeOfDay" + }, + "integerValue": { + "format": "int64", + "type": "string" + }, + "stringValue": { + "type": "string" + }, + "dateValue": { + "$ref": "GoogleTypeDate" + }, + "timestampValue": { + "format": "google-datetime", + "type": "string" + }, + "booleanValue": { + "type": "boolean" + } + }, + "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": { + "description": "Value to compare against. [Required, except for `EXISTS` tests.]", + "$ref": "GooglePrivacyDlpV2beta1Value" + } + }, + "id": "GooglePrivacyDlpV2beta1Condition" + }, + "GooglePrivacyDlpV2beta1PartitionId": { + "type": "object", + "properties": { + "namespaceId": { + "description": "If not empty, the ID of the namespace to which the entities belong.", + "type": "string" + }, + "projectId": { + "type": "string", + "description": "The ID of the project to which the entities belong." + } + }, + "id": "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." + }, + "GooglePrivacyDlpV2beta1InspectContentResponse": { + "description": "Results of inspecting a list of items.", + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1InspectResult" + }, + "description": "Each content_item from the request has a result in this list, in the\nsame order as the request." + } + }, + "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" + }, + "GooglePrivacyDlpV2beta1WordList": { + "description": "Message defining a list of words or phrases to search for in the data.", + "type": "object", + "properties": { + "words": { + "description": "Words or phrases defining the dictionary. The dictionary must contain\nat least one phrase and every phrase must contain at least 2 characters\nthat are letters or digits. [required]", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "GooglePrivacyDlpV2beta1WordList" + }, + "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": { + "description": "Summary of a single tranformation.", + "type": "object", + "properties": { + "fieldTransformations": { + "description": "The field transformation that was applied. This list will contain\nmultiple only in the case of errors.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1FieldTransformation" + } + }, + "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": { + "$ref": "GooglePrivacyDlpV2beta1PrimitiveTransformation", + "description": "The specific transformation these stats apply to." + }, + "results": { + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1SummaryResult" + } + }, + "field": { + "description": "Set if the transformation was limited to a specific FieldId.", + "$ref": "GooglePrivacyDlpV2beta1FieldId" + } + }, + "id": "GooglePrivacyDlpV2beta1TransformationSummary" + }, + "GoogleLongrunningCancelOperationRequest": { + "description": "The request message for Operations.CancelOperation.", + "type": "object", + "properties": {}, + "id": "GoogleLongrunningCancelOperationRequest" + }, + "GooglePrivacyDlpV2beta1CharacterMaskConfig": { + "type": "object", + "properties": { + "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" + } + }, + "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" + } + }, + "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." + }, + "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": { + "type": "string", + "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)." + } + }, + "id": "GooglePrivacyDlpV2beta1TransientCryptoKey" + }, + "GooglePrivacyDlpV2beta1CreateInspectOperationRequest": { + "description": "Request for scheduling a scan of a data subset from a Google Platform data\nrepository.", + "type": "object", + "properties": { + "storageConfig": { + "$ref": "GooglePrivacyDlpV2beta1StorageConfig", + "description": "Specification of the data set to process." + }, + "outputConfig": { + "$ref": "GooglePrivacyDlpV2beta1OutputStorageConfig", + "description": "Optional location to store findings." + }, + "operationConfig": { + "description": "Additional configuration settings for long running operations.", + "$ref": "GooglePrivacyDlpV2beta1OperationConfig" + }, + "inspectConfig": { + "$ref": "GooglePrivacyDlpV2beta1InspectConfig", + "description": "Configuration for the inspector." + } + }, + "id": "GooglePrivacyDlpV2beta1CreateInspectOperationRequest" + }, + "GooglePrivacyDlpV2beta1TaggedField": { + "description": "A column with a semantic tag attached.", + "type": "object", + "properties": { + "customTag": { + "description": "A column can be tagged with a custom tag. In this case, the user must\nindicate an auxiliary table that contains statistical information on\nthe possible values of this column (below).", + "type": "string" + }, + "infoType": { + "description": "A column can be tagged with a InfoType to use the relevant public\ndataset as a statistical model of population, if available. We\ncurrently support US ZIP codes, region codes, ages and genders.", + "$ref": "GooglePrivacyDlpV2beta1InfoType" + }, + "inferred": { + "description": "If no semantic tag is indicated, we infer the statistical model from\nthe distribution of values in the input data", + "$ref": "GoogleProtobufEmpty" + }, + "field": { + "description": "Identifies the column. [required]", + "$ref": "GooglePrivacyDlpV2beta1FieldId" + } + }, + "id": "GooglePrivacyDlpV2beta1TaggedField" + }, + "GooglePrivacyDlpV2beta1InfoTypeStatistics": { + "properties": { + "infoType": { + "$ref": "GooglePrivacyDlpV2beta1InfoType", + "description": "The type of finding this stat is for." + }, + "count": { + "description": "Number of findings for this info type.", + "format": "int64", + "type": "string" + } + }, + "id": "GooglePrivacyDlpV2beta1InfoTypeStatistics", + "description": "Statistics regarding a specific InfoType.", + "type": "object" + }, + "GooglePrivacyDlpV2beta1RedactContentResponse": { + "type": "object", + "properties": { + "items": { + "description": "The redacted content.", + "type": "array", + "items": { + "$ref": "GooglePrivacyDlpV2beta1ContentItem" + } + } + }, + "id": "GooglePrivacyDlpV2beta1RedactContentResponse", + "description": "Results of redacting a list of items." + }, + "GooglePrivacyDlpV2beta1PropertyReference": { + "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", + "description": "A reference to a property relative to the Datastore kind expressions.", + "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" + }, + "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" } diff --git a/etc/api/dns/v1/dns-api.json b/etc/api/dns/v1/dns-api.json index 597a87cf71..53b5cdc318 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/Qqhck8TylpPy6aQ1JM2ZkAgjJKg\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/kYaEhhTBm7CVpFDEtOaBWuwXKdQ\"", "discoveryVersion": "v1", "id": "dns:v1", "name": "dns", "version": "v1", - "revision": "20170921", + "revision": "20171204", "title": "Google Cloud DNS API", "description": "Configures and serves authoritative DNS records.", "ownerDomain": "google.com", diff --git a/etc/api/dns/v1beta2/dns-api.json b/etc/api/dns/v1beta2/dns-api.json new file mode 100644 index 0000000000..f9646965fa --- /dev/null +++ b/etc/api/dns/v1beta2/dns-api.json @@ -0,0 +1,1406 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Wmm2Vo9PjskhCswlTPYrBhP5H3I\"", + "discoveryVersion": "v1", + "id": "dns:v1beta2", + "name": "dns", + "version": "v1beta2", + "revision": "20171204", + "title": "Google Cloud DNS API", + "description": "Configures and serves authoritative DNS records.", + "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/cloud-dns", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/dns/v1beta2/projects/", + "basePath": "/dns/v1beta2/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dns/v1beta2/projects/", + "batchPath": "batch/dns/v1beta2", + "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.clouddns.readonly": { + "description": "View your DNS records hosted by Google Cloud DNS" + }, + "https://www.googleapis.com/auth/ndev.clouddns.readwrite": { + "description": "View and manage your DNS records hosted by Google Cloud DNS" + } + } + } + }, + "schemas": { + "Change": { + "id": "Change", + "type": "object", + "description": "An atomic update to a collection of ResourceRecordSets.", + "properties": { + "additions": { + "type": "array", + "description": "Which ResourceRecordSets to add?", + "items": { + "$ref": "ResourceRecordSet" + } + }, + "deletions": { + "type": "array", + "description": "Which ResourceRecordSets to remove? Must match existing data exactly.", + "items": { + "$ref": "ResourceRecordSet" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "isServing": { + "type": "boolean", + "description": "If the DNS queries for the zone will be served." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#change\".", + "default": "dns#change" + }, + "startTime": { + "type": "string", + "description": "The time that this operation was started by the server (output only). This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "Status of the operation (output only).", + "enum": [ + "done", + "pending" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "ChangesListResponse": { + "id": "ChangesListResponse", + "type": "object", + "description": "The response to a request to enumerate Changes to a ResourceRecordSets collection.", + "properties": { + "changes": { + "type": "array", + "description": "The requested changes.", + "items": { + "$ref": "Change" + } + }, + "header": { + "$ref": "ResponseHeader" + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "dns#changesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another list request using this value as your pagination token.\n\nIn this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to retrieve a \"snapshot\" of collections larger than the maximum page size." + } + } + }, + "DnsKey": { + "id": "DnsKey", + "type": "object", + "description": "A DNSSEC key pair.", + "properties": { + "algorithm": { + "type": "string", + "description": "String mnemonic specifying the DNSSEC algorithm of this key. Immutable after creation time.", + "enum": [ + "ecdsap256sha256", + "ecdsap384sha384", + "rsasha1", + "rsasha256", + "rsasha512" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "creationTime": { + "type": "string", + "description": "The time that this resource was created in the control plane. This is in RFC3339 text format. Output only." + }, + "description": { + "type": "string", + "description": "A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the resource's function." + }, + "digests": { + "type": "array", + "description": "Cryptographic hashes of the DNSKEY resource record associated with this DnsKey. These digests are needed to construct a DS record that points at this DNS key. Output only.", + "items": { + "$ref": "DnsKeyDigest" + } + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)." + }, + "isActive": { + "type": "boolean", + "description": "Active keys will be used to sign subsequent changes to the ManagedZone. Inactive keys will still be present as DNSKEY Resource Records for the use of resolvers validating existing signatures." + }, + "keyLength": { + "type": "integer", + "description": "Length of the key in bits. Specified at creation time then immutable.", + "format": "uint32" + }, + "keyTag": { + "type": "integer", + "description": "The key tag is a non-cryptographic hash of the a DNSKEY resource record associated with this DnsKey. The key tag can be used to identify a DNSKEY more quickly (but it is not a unique identifier). In particular, the key tag is used in a parent zone's DS record to point at the DNSKEY in this child ManagedZone. The key tag is a number in the range [0, 65535] and the algorithm to calculate it is specified in RFC4034 Appendix B. Output only.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#dnsKey\".", + "default": "dns#dnsKey" + }, + "publicKey": { + "type": "string", + "description": "Base64 encoded public half of this key. Output only." + }, + "type": { + "type": "string", + "description": "One of \"KEY_SIGNING\" or \"ZONE_SIGNING\". Keys of type KEY_SIGNING have the Secure Entry Point flag set and, when active, will be used to sign only resource record sets of type DNSKEY. Otherwise, the Secure Entry Point flag will be cleared and this key will be used to sign only resource record sets of other types. Immutable after creation time.", + "enum": [ + "keySigning", + "zoneSigning" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "DnsKeyDigest": { + "id": "DnsKeyDigest", + "type": "object", + "properties": { + "digest": { + "type": "string", + "description": "The base-16 encoded bytes of this digest. Suitable for use in a DS resource record." + }, + "type": { + "type": "string", + "description": "Specifies the algorithm used to calculate this digest.", + "enum": [ + "sha1", + "sha256", + "sha384" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "DnsKeySpec": { + "id": "DnsKeySpec", + "type": "object", + "description": "Parameters for DnsKey key generation. Used for generating initial keys for a new ManagedZone and as default when adding a new DnsKey.", + "properties": { + "algorithm": { + "type": "string", + "description": "String mnemonic specifying the DNSSEC algorithm of this key.", + "enum": [ + "ecdsap256sha256", + "ecdsap384sha384", + "rsasha1", + "rsasha256", + "rsasha512" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "keyLength": { + "type": "integer", + "description": "Length of the keys in bits.", + "format": "uint32" + }, + "keyType": { + "type": "string", + "description": "One of \"KEY_SIGNING\" or \"ZONE_SIGNING\". Keys of type KEY_SIGNING have the Secure Entry Point flag set and, when active, will be used to sign only resource record sets of type DNSKEY. Otherwise, the Secure Entry Point flag will be cleared and this key will be used to sign only resource record sets of other types.", + "enum": [ + "keySigning", + "zoneSigning" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#dnsKeySpec\".", + "default": "dns#dnsKeySpec" + } + } + }, + "DnsKeysListResponse": { + "id": "DnsKeysListResponse", + "type": "object", + "description": "The response to a request to enumerate DnsKeys in a ManagedZone.", + "properties": { + "dnsKeys": { + "type": "array", + "description": "The requested resources.", + "items": { + "$ref": "DnsKey" + } + }, + "header": { + "$ref": "ResponseHeader" + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "dns#dnsKeysListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another list request using this value as your pagination token.\n\nIn this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to retrieve a \"snapshot\" of collections larger than the maximum page size." + } + } + }, + "ManagedZone": { + "id": "ManagedZone", + "type": "object", + "description": "A zone is a subtree of the DNS namespace under one administrative responsibility. A ManagedZone is a resource that represents a DNS zone hosted by the Cloud DNS service.", + "properties": { + "creationTime": { + "type": "string", + "description": "The time that this resource was created on the server. This is in RFC3339 text format. Output only." + }, + "description": { + "type": "string", + "description": "A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the managed zone's function." + }, + "dnsName": { + "type": "string", + "description": "The DNS name of this managed zone, for instance \"example.com.\"." + }, + "dnssecConfig": { + "$ref": "ManagedZoneDnsSecConfig", + "description": "DNSSEC configuration." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource; defined by the server (output only)", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#managedZone\".", + "default": "dns#managedZone" + }, + "name": { + "type": "string", + "description": "User assigned name for this resource. Must be unique within the project. The name must be 1-63 characters long, must begin with a letter, end with a letter or digit, and only contain lowercase letters, digits or dashes." + }, + "nameServerSet": { + "type": "string", + "description": "Optionally specifies the NameServerSet for this ManagedZone. A NameServerSet is a set of DNS name servers that all host the same ManagedZones. Most users will leave this field unset." + }, + "nameServers": { + "type": "array", + "description": "Delegate your managed_zone to these virtual name servers; defined by the server (output only)", + "items": { + "type": "string" + } + } + } + }, + "ManagedZoneDnsSecConfig": { + "id": "ManagedZoneDnsSecConfig", + "type": "object", + "properties": { + "defaultKeySpecs": { + "type": "array", + "description": "Specifies parameters that will be used for generating initial DnsKeys for this ManagedZone. Output only while state is not OFF.", + "items": { + "$ref": "DnsKeySpec" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#managedZoneDnsSecConfig\".", + "default": "dns#managedZoneDnsSecConfig" + }, + "nonExistence": { + "type": "string", + "description": "Specifies the mechanism used to provide authenticated denial-of-existence responses. Output only while state is not OFF.", + "enum": [ + "nsec", + "nsec3" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "state": { + "type": "string", + "description": "Specifies whether DNSSEC is enabled, and what mode it is in.", + "enum": [ + "off", + "on", + "transfer" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "ManagedZoneOperationsListResponse": { + "id": "ManagedZoneOperationsListResponse", + "type": "object", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "dns#managedZoneOperationsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another list request using this value as your page token.\n\nIn this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to retrieve a consistent snapshot of a collection larger than the maximum page size." + }, + "operations": { + "type": "array", + "description": "The operation resources.", + "items": { + "$ref": "Operation" + } + } + } + }, + "ManagedZonesDeleteResponse": { + "id": "ManagedZonesDeleteResponse", + "type": "object", + "properties": { + "header": { + "$ref": "ResponseHeader" + } + } + }, + "ManagedZonesListResponse": { + "id": "ManagedZonesListResponse", + "type": "object", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "dns#managedZonesListResponse" + }, + "managedZones": { + "type": "array", + "description": "The managed zone resources.", + "items": { + "$ref": "ManagedZone" + } + }, + "nextPageToken": { + "type": "string", + "description": "The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another list request using this value as your page token.\n\nIn this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to retrieve a consistent snapshot of a collection larger than the maximum page size." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An operation represents a successful mutation performed on a Cloud DNS resource. Operations provide: - An audit log of server resource mutations. - A way to recover/retry API calls in the case where the response is never received by the caller. Use the caller specified client_operation_id.", + "properties": { + "dnsKeyContext": { + "$ref": "OperationDnsKeyContext", + "description": "Only populated if the operation targeted a DnsKey (output only)." + }, + "id": { + "type": "string", + "description": "Unique identifier for the resource. This is the client_operation_id if the client specified it when the mutation was initiated, otherwise, it is generated by the server. The name must be 1-63 characters long and match the regular expression [-a-z0-9]? (output only)" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#operation\".", + "default": "dns#operation" + }, + "startTime": { + "type": "string", + "description": "The time that this operation was started by the server. This is in RFC3339 text format (output only)." + }, + "status": { + "type": "string", + "description": "Status of the operation. Can be one of the following: \"PENDING\" or \"DONE\" (output only).", + "enum": [ + "done", + "pending" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "type": { + "type": "string", + "description": "Type of the operation. Operations include insert, update, and delete (output only)." + }, + "user": { + "type": "string", + "description": "User who requested the operation, for example: user@example.com. cloud-dns-system for operations automatically done by the system. (output only)" + }, + "zoneContext": { + "$ref": "OperationManagedZoneContext", + "description": "Only populated if the operation targeted a ManagedZone (output only)." + } + } + }, + "OperationDnsKeyContext": { + "id": "OperationDnsKeyContext", + "type": "object", + "properties": { + "newValue": { + "$ref": "DnsKey", + "description": "The post-operation DnsKey resource." + }, + "oldValue": { + "$ref": "DnsKey", + "description": "The pre-operation DnsKey resource." + } + } + }, + "OperationManagedZoneContext": { + "id": "OperationManagedZoneContext", + "type": "object", + "properties": { + "newValue": { + "$ref": "ManagedZone", + "description": "The post-operation ManagedZone resource." + }, + "oldValue": { + "$ref": "ManagedZone", + "description": "The pre-operation ManagedZone resource." + } + } + }, + "Project": { + "id": "Project", + "type": "object", + "description": "A project resource. The project is a top level container for resources including Cloud DNS ManagedZones. Projects can be created only in the APIs console.", + "properties": { + "id": { + "type": "string", + "description": "User assigned unique identifier for the resource (output only)." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#project\".", + "default": "dns#project" + }, + "number": { + "type": "string", + "description": "Unique numeric identifier for the resource; defined by the server (output only).", + "format": "uint64" + }, + "quota": { + "$ref": "Quota", + "description": "Quotas assigned to this project (output only)." + } + } + }, + "Quota": { + "id": "Quota", + "type": "object", + "description": "Limits associated with a Project.", + "properties": { + "dnsKeysPerManagedZone": { + "type": "integer", + "description": "Maximum allowed number of DnsKeys per ManagedZone.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#quota\".", + "default": "dns#quota" + }, + "managedZones": { + "type": "integer", + "description": "Maximum allowed number of managed zones in the project.", + "format": "int32" + }, + "resourceRecordsPerRrset": { + "type": "integer", + "description": "Maximum allowed number of ResourceRecords per ResourceRecordSet.", + "format": "int32" + }, + "rrsetAdditionsPerChange": { + "type": "integer", + "description": "Maximum allowed number of ResourceRecordSets to add per ChangesCreateRequest.", + "format": "int32" + }, + "rrsetDeletionsPerChange": { + "type": "integer", + "description": "Maximum allowed number of ResourceRecordSets to delete per ChangesCreateRequest.", + "format": "int32" + }, + "rrsetsPerManagedZone": { + "type": "integer", + "description": "Maximum allowed number of ResourceRecordSets per zone in the project.", + "format": "int32" + }, + "totalRrdataSizePerChange": { + "type": "integer", + "description": "Maximum allowed size for total rrdata in one ChangesCreateRequest in bytes.", + "format": "int32" + }, + "whitelistedKeySpecs": { + "type": "array", + "description": "DNSSEC algorithm and key length types that can be used for DnsKeys.", + "items": { + "$ref": "DnsKeySpec" + } + } + } + }, + "ResourceRecordSet": { + "id": "ResourceRecordSet", + "type": "object", + "description": "A unit of data that will be returned by the DNS servers.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dns#resourceRecordSet\".", + "default": "dns#resourceRecordSet" + }, + "name": { + "type": "string", + "description": "For example, www.example.com." + }, + "rrdatas": { + "type": "array", + "description": "As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1).", + "items": { + "type": "string" + } + }, + "signatureRrdatas": { + "type": "array", + "description": "As defined in RFC 4034 (section 3.2).", + "items": { + "type": "string" + } + }, + "ttl": { + "type": "integer", + "description": "Number of seconds that this ResourceRecordSet can be cached by resolvers.", + "format": "int32" + }, + "type": { + "type": "string", + "description": "The identifier of a supported record type, for example, A, AAAA, MX, TXT, and so on." + } + } + }, + "ResourceRecordSetsListResponse": { + "id": "ResourceRecordSetsListResponse", + "type": "object", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "dns#resourceRecordSetsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another list request using this value as your pagination token.\n\nIn this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to retrieve a consistent snapshot of a collection larger than the maximum page size." + }, + "rrsets": { + "type": "array", + "description": "The resource record set resources.", + "items": { + "$ref": "ResourceRecordSet" + } + } + } + }, + "ResponseHeader": { + "id": "ResponseHeader", + "type": "object", + "description": "Elements common to every response.", + "properties": { + "operationId": { + "type": "string", + "description": "For mutating operation requests that completed successfully. This is the client_operation_id if the client specified it, otherwise it is generated by the server (output only)." + } + } + } + }, + "resources": { + "changes": { + "methods": { + "create": { + "id": "dns.changes.create", + "path": "{project}/managedZones/{managedZone}/changes", + "httpMethod": "POST", + "description": "Atomically update the ResourceRecordSet collection.", + "parameters": { + "clientOperationId": { + "type": "string", + "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", + "location": "query" + }, + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "request": { + "$ref": "Change" + }, + "response": { + "$ref": "Change" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "get": { + "id": "dns.changes.get", + "path": "{project}/managedZones/{managedZone}/changes/{changeId}", + "httpMethod": "GET", + "description": "Fetch the representation of an existing Change.", + "parameters": { + "changeId": { + "type": "string", + "description": "The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.", + "required": true, + "location": "path" + }, + "clientOperationId": { + "type": "string", + "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", + "location": "query" + }, + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone", + "changeId" + ], + "response": { + "$ref": "Change" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "list": { + "id": "dns.changes.list", + "path": "{project}/managedZones/{managedZone}/changes", + "httpMethod": "GET", + "description": "Enumerate Changes to a ResourceRecordSet collection.", + "parameters": { + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + }, + "sortBy": { + "type": "string", + "description": "Sorting criterion. The only supported value is change sequence.", + "default": "changeSequence", + "enum": [ + "changeSequence" + ], + "enumDescriptions": [ + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Sorting order direction: 'ascending' or 'descending'.", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "response": { + "$ref": "ChangesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + }, + "dnsKeys": { + "methods": { + "get": { + "id": "dns.dnsKeys.get", + "path": "{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}", + "httpMethod": "GET", + "description": "Fetch the representation of an existing DnsKey.", + "parameters": { + "clientOperationId": { + "type": "string", + "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", + "location": "query" + }, + "digestType": { + "type": "string", + "description": "An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed.", + "location": "query" + }, + "dnsKeyId": { + "type": "string", + "description": "The identifier of the requested DnsKey.", + "required": true, + "location": "path" + }, + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone", + "dnsKeyId" + ], + "response": { + "$ref": "DnsKey" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "list": { + "id": "dns.dnsKeys.list", + "path": "{project}/managedZones/{managedZone}/dnsKeys", + "httpMethod": "GET", + "description": "Enumerate DnsKeys to a ResourceRecordSet collection.", + "parameters": { + "digestType": { + "type": "string", + "description": "An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed.", + "location": "query" + }, + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "response": { + "$ref": "DnsKeysListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + }, + "managedZoneOperations": { + "methods": { + "get": { + "id": "dns.managedZoneOperations.get", + "path": "{project}/managedZones/{managedZone}/operations/{operation}", + "httpMethod": "GET", + "description": "Fetch the representation of an existing Operation.", + "parameters": { + "clientOperationId": { + "type": "string", + "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", + "location": "query" + }, + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request.", + "required": true, + "location": "path" + }, + "operation": { + "type": "string", + "description": "Identifies the operation addressed by this request.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone", + "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.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "list": { + "id": "dns.managedZoneOperations.list", + "path": "{project}/managedZones/{managedZone}/operations", + "httpMethod": "GET", + "description": "Enumerate Operations for the given ManagedZone.", + "parameters": { + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + }, + "sortBy": { + "type": "string", + "description": "Sorting criterion. The only supported values are START_TIME and ID.", + "default": "startTime", + "enum": [ + "id", + "startTime" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "response": { + "$ref": "ManagedZoneOperationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + }, + "managedZones": { + "methods": { + "create": { + "id": "dns.managedZones.create", + "path": "{project}/managedZones", + "httpMethod": "POST", + "description": "Create a new ManagedZone.", + "parameters": { + "clientOperationId": { + "type": "string", + "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "ManagedZone" + }, + "response": { + "$ref": "ManagedZone" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "delete": { + "id": "dns.managedZones.delete", + "path": "{project}/managedZones/{managedZone}", + "httpMethod": "DELETE", + "description": "Delete a previously created ManagedZone.", + "parameters": { + "clientOperationId": { + "type": "string", + "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", + "location": "query" + }, + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "response": { + "$ref": "ManagedZonesDeleteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "get": { + "id": "dns.managedZones.get", + "path": "{project}/managedZones/{managedZone}", + "httpMethod": "GET", + "description": "Fetch the representation of an existing ManagedZone.", + "parameters": { + "clientOperationId": { + "type": "string", + "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", + "location": "query" + }, + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "response": { + "$ref": "ManagedZone" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "list": { + "id": "dns.managedZones.list", + "path": "{project}/managedZones", + "httpMethod": "GET", + "description": "Enumerate ManagedZones that have been created but not yet deleted.", + "parameters": { + "dnsName": { + "type": "string", + "description": "Restricts the list to return only zones with this domain name.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ManagedZonesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "patch": { + "id": "dns.managedZones.patch", + "path": "{project}/managedZones/{managedZone}", + "httpMethod": "PATCH", + "description": "Update an existing ManagedZone. This method supports patch semantics.", + "parameters": { + "clientOperationId": { + "type": "string", + "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", + "location": "query" + }, + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "request": { + "$ref": "ManagedZone" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + }, + "update": { + "id": "dns.managedZones.update", + "path": "{project}/managedZones/{managedZone}", + "httpMethod": "PUT", + "description": "Update an existing ManagedZone.", + "parameters": { + "clientOperationId": { + "type": "string", + "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", + "location": "query" + }, + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "request": { + "$ref": "ManagedZone" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + }, + "projects": { + "methods": { + "get": { + "id": "dns.projects.get", + "path": "{project}", + "httpMethod": "GET", + "description": "Fetch the representation of an existing Project.", + "parameters": { + "clientOperationId": { + "type": "string", + "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + }, + "resourceRecordSets": { + "methods": { + "list": { + "id": "dns.resourceRecordSets.list", + "path": "{project}/managedZones/{managedZone}/rrsets", + "httpMethod": "GET", + "description": "Enumerate ResourceRecordSets that have been created but not yet deleted.", + "parameters": { + "managedZone": { + "type": "string", + "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", + "format": "int32", + "location": "query" + }, + "name": { + "type": "string", + "description": "Restricts the list to return only records with this fully qualified domain name.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Identifies the project addressed by this request.", + "required": true, + "location": "path" + }, + "type": { + "type": "string", + "description": "Restricts the list to return only records of this type. If present, the \"name\" parameter must also be present.", + "location": "query" + } + }, + "parameterOrder": [ + "project", + "managedZone" + ], + "response": { + "$ref": "ResourceRecordSetsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + } + } +} diff --git a/etc/api/dns/v2beta1/dns-api.json b/etc/api/dns/v2beta1/dns-api.json index 152661aea2..8372fc4662 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/hpi36R8_AoZ-cwi75LboIgnLTZI\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/STXKkP7EeWGaQrB4Hta20Be1jDE\"", "discoveryVersion": "v1", "id": "dns:v2beta1", "name": "dns", "version": "v2beta1", - "revision": "20170921", + "revision": "20171204", "title": "Google Cloud DNS API", "description": "Configures and serves authoritative DNS records.", "ownerDomain": "google.com", diff --git a/etc/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json b/etc/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json index 53611dd396..2bd0dcba40 100644 --- a/etc/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json +++ b/etc/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json @@ -24,7 +24,7 @@ "basePath": "/doubleclickbidmanager/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "doubleclickbidmanager/v1/", - "batchPath": "batch", + "batchPath": "batch/doubleclickbidmanager/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/doubleclicksearch/v2/doubleclicksearch-api.json b/etc/api/doubleclicksearch/v2/doubleclicksearch-api.json index 2ed4998f37..5ae9718929 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/hR70UblNHyBCC4lBQCtqgaZ_GJ8\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/T2vdXek6tIY1HgjGsdCsPe9_CT0\"", "discoveryVersion": "v1", "id": "doubleclicksearch:v2", "name": "doubleclicksearch", "version": "v2", - "revision": "20170919", + "revision": "20171116", "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", diff --git a/etc/api/drive/v2/drive-api.json b/etc/api/drive/v2/drive-api.json index b8e6716d5c..633433b49f 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/iFxqLENsSLiJs1Br4TNBOHg98fQ\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/3l4zAM4QjtKUvpGW4oeKgzw0f5o\"", "discoveryVersion": "v1", "id": "drive:v2", "name": "drive", "version": "v2", - "revision": "20170915", + "revision": "20171201", "title": "Drive API", "description": "Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.", "ownerDomain": "google.com", @@ -2049,6 +2049,11 @@ "type": "string", "description": "The color of this Team Drive as an RGB hex string. It can only be set on a drive.teamdrives.update request that does not set themeId." }, + "createdDate": { + "type": "string", + "description": "The time at which the Team Drive was created (RFC 3339 date-time).", + "format": "date-time" + }, "id": { "type": "string", "description": "The ID of this Team Drive which is also the ID of the top level folder for this Team Drive." @@ -3913,6 +3918,12 @@ "description": "Whether the requesting application supports Team Drives.", "default": "false", "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -3947,6 +3958,12 @@ "description": "Whether the requesting application supports Team Drives.", "default": "false", "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -4023,6 +4040,12 @@ "description": "Whether the requesting application supports Team Drives.", "default": "false", "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -4069,6 +4092,12 @@ "description": "Whether the requesting application supports Team Drives.", "default": "false", "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -4121,6 +4150,12 @@ "description": "Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.", "default": "false", "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -4173,6 +4208,12 @@ "description": "Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.", "default": "false", "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -4960,6 +5001,12 @@ "description": "The ID of the Team Drive", "required": true, "location": "path" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -5018,6 +5065,17 @@ "type": "string", "description": "Page token for Team Drives.", "location": "query" + }, + "q": { + "type": "string", + "description": "Query string for searching Team Drives.", + "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned.", + "default": "false", + "location": "query" } }, "response": { diff --git a/etc/api/drive/v3/drive-api.json b/etc/api/drive/v3/drive-api.json index e49520e13a..bbf7c05304 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/IQ6IlDF_Rs6vMZyFSA6V8uvh46Q\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/dokL7JnoHyUOqrzu7Ur837tSd0s\"", "discoveryVersion": "v1", "id": "drive:v3", "name": "drive", "version": "v3", - "revision": "20170915", + "revision": "20171201", "title": "Drive API", "description": "Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.", "ownerDomain": "google.com", @@ -1324,6 +1324,11 @@ "type": "string", "description": "The color of this Team Drive as an RGB hex string. It can only be set on a drive.teamdrives.update request that does not set themeId." }, + "createdTime": { + "type": "string", + "description": "The time at which the Team Drive was created (RFC 3339 date-time).", + "format": "date-time" + }, "id": { "type": "string", "description": "The ID of this Team Drive which is also the ID of the top level folder for this Team Drive." @@ -2337,6 +2342,12 @@ "description": "Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.", "default": "false", "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -2376,6 +2387,12 @@ "description": "Whether the requesting application supports Team Drives.", "default": "false", "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -2410,6 +2427,12 @@ "description": "Whether the requesting application supports Team Drives.", "default": "false", "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -2458,6 +2481,12 @@ "description": "Whether the requesting application supports Team Drives.", "default": "false", "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -2510,6 +2539,12 @@ "description": "Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.", "default": "false", "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -2954,6 +2989,12 @@ "description": "The ID of the Team Drive", "required": true, "location": "path" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs.", + "default": "false", + "location": "query" } }, "parameterOrder": [ @@ -2986,6 +3027,17 @@ "type": "string", "description": "Page token for Team Drives.", "location": "query" + }, + "q": { + "type": "string", + "description": "Query string for searching Team Drives.", + "location": "query" + }, + "useDomainAdminAccess": { + "type": "boolean", + "description": "Whether the request should be treated as if it was issued by a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned.", + "default": "false", + "location": "query" } }, "response": { diff --git a/etc/api/firebasedynamiclinks/v1/firebasedynamiclinks-api.json b/etc/api/firebasedynamiclinks/v1/firebasedynamiclinks-api.json index c872bb289c..a41ed63055 100644 --- a/etc/api/firebasedynamiclinks/v1/firebasedynamiclinks-api.json +++ b/etc/api/firebasedynamiclinks/v1/firebasedynamiclinks-api.json @@ -1,14 +1,393 @@ { - "revision": "20170926", + "ownerDomain": "google.com", + "name": "firebasedynamiclinks", + "batchPath": "batch", + "title": "Firebase Dynamic Links API", + "ownerName": "Google", + "resources": { + "shortLinks": { + "methods": { + "create": { + "scopes": [ + "https://www.googleapis.com/auth/firebase" + ], + "parameters": {}, + "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" + } + } + }, + "v1": { + "methods": { + "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.", + "httpMethod": "GET", + "parameterOrder": [ + "dynamicLink" + ], + "response": { + "$ref": "DynamicLinkStats" + }, + "scopes": [ + "https://www.googleapis.com/auth/firebase" + ], + "parameters": { + "durationDays": { + "description": "The span of time requested in days.", + "format": "int64", + "type": "string", + "location": "query" + }, + "dynamicLink": { + "required": true, + "type": "string", + "location": "path", + "description": "Dynamic Link URL. e.g. https://abcd.app.goo.gl/wxyz" + } + }, + "flatPath": "v1/{dynamicLink}/linkStats", + "id": "firebasedynamiclinks.getLinkStats", + "path": "v1/{dynamicLink}/linkStats" + }, + "installAttribution": { + "description": "Get iOS strong/weak-match info for post-install attribution.", + "request": { + "$ref": "GetIosPostInstallAttributionRequest" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "GetIosPostInstallAttributionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/firebase" + ], + "parameters": {}, + "flatPath": "v1/installAttribution", + "id": "firebasedynamiclinks.installAttribution", + "path": "v1/installAttribution" + } + } + } + }, + "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": { + "location": "query", + "description": "OAuth access 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": { + "type": "boolean", + "default": "true", + "location": "query", + "description": "Pretty-print response." + }, + "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" + }, + "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": { + "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": { + "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" + } + }, + "version": "v1", + "baseUrl": "https://firebasedynamiclinks-ipv6.googleapis.com/", + "description": "Programmatically creates and manages Firebase Dynamic Links.", + "kind": "discovery#restDescription", + "servicePath": "", + "basePath": "", + "revision": "20171205", "documentationLink": "https://firebase.google.com/docs/dynamic-links/", "id": "firebasedynamiclinks:v1", "discoveryVersion": "v1", "version_module": true, "schemas": { + "NavigationInfo": { + "description": "Information of navigation behavior.", + "type": "object", + "properties": { + "enableForcedRedirect": { + "type": "boolean", + "description": "If this option is on, FDL click will be forced to redirect rather than\nshow an interstitial page." + } + }, + "id": "NavigationInfo" + }, + "IosInfo": { + "description": "iOS related attributes to the Dynamic Link..", + "type": "object", + "properties": { + "iosFallbackLink": { + "type": "string", + "description": "Link to open on iOS if the app is not installed." + }, + "iosAppStoreId": { + "type": "string", + "description": "iOS App Store ID." + }, + "iosIpadFallbackLink": { + "description": "If specified, this overrides the ios_fallback_link value on iPads.", + "type": "string" + }, + "iosIpadBundleId": { + "description": "iPad bundle ID of the app.", + "type": "string" + }, + "iosCustomScheme": { + "description": "Custom (destination) scheme to use for iOS. By default, we’ll use the\nbundle ID as the custom scheme. Developer can override this behavior using\nthis param.", + "type": "string" + }, + "iosBundleId": { + "description": "iOS bundle ID of the app.", + "type": "string" + } + }, + "id": "IosInfo" + }, + "AnalyticsInfo": { + "type": "object", + "properties": { + "itunesConnectAnalytics": { + "$ref": "ITunesConnectAnalytics", + "description": "iTunes Connect App Analytics." + }, + "googlePlayAnalytics": { + "description": "Google Play Campaign Measurements.", + "$ref": "GooglePlayAnalytics" + } + }, + "id": "AnalyticsInfo", + "description": "Tracking parameters supported by Dynamic Link." + }, + "CreateShortDynamicLinkRequest": { + "description": "Request to create a short Dynamic Link.", + "type": "object", + "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).", + "$ref": "DynamicLinkInfo" + }, + "longDynamicLink": { + "description": "Full long Dynamic Link URL with desired query parameters specified.\nFor example,\n\"https://sample.app.goo.gl/?link=http://www.google.com&apn=com.sample\",\n[Learn more](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically).", + "type": "string" + }, + "suffix": { + "description": "Short Dynamic Link suffix. Optional.", + "$ref": "Suffix" + } + }, + "id": "CreateShortDynamicLinkRequest" + }, + "DesktopInfo": { + "id": "DesktopInfo", + "description": "Desktop related attributes to the Dynamic Link.", + "type": "object", + "properties": { + "desktopFallbackLink": { + "type": "string", + "description": "Link to open on desktop." + } + } + }, + "DynamicLinkEventStat": { + "description": "Dynamic Link event stat.", + "type": "object", + "properties": { + "count": { + "description": "The number of times this event occurred.", + "format": "int64", + "type": "string" + }, + "event": { + "type": "string", + "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." + }, + "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" + } + }, + "id": "DynamicLinkEventStat" + }, + "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": { + "uniqueMatchLinkToCheck": { + "type": "string", + "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." + }, + "appInstallationTime": { + "type": "string", + "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" + }, + "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": { + "type": "string", + "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." + }, + "sdkVersion": { + "description": "Google SDK version.", + "type": "string" + }, + "bundleId": { + "type": "string", + "description": "APP bundle ID." + }, + "device": { + "description": "Device information.", + "$ref": "DeviceInfo" + } + }, + "id": "GetIosPostInstallAttributionRequest" + }, "CreateShortDynamicLinkResponse": { "description": "Response to create a short Dynamic Link.", "type": "object", "properties": { + "warning": { + "description": "Information about potential warnings on link creation.", + "type": "array", + "items": { + "$ref": "DynamicLinkWarning" + } + }, "shortLink": { "description": "Short Dynamic Link value. e.g. https://abcd.app.goo.gl/wxyz", "type": "string" @@ -16,42 +395,39 @@ "previewLink": { "description": "Preivew link to show the link flow chart.", "type": "string" - }, - "warning": { - "description": "Information about potential warnings on link creation.", - "type": "array", - "items": { - "$ref": "DynamicLinkWarning" - } } }, "id": "CreateShortDynamicLinkResponse" }, "Suffix": { + "description": "Short Dynamic Link suffix.", + "type": "object", "properties": { "option": { - "enumDescriptions": [ - "The suffix option is not specified, performs as NOT_GUESSABLE .", - "Short Dynamic Link suffix is a base62 [0-9A-Za-z] encoded string of\na random generated 96 bit random number, which has a length of 17 chars.\nFor example, \"nlAR8U4SlKRZw1cb2\".\nIt prevents other people from guessing and crawling short Dynamic Links\nthat contain personal identifiable information.", - "Short Dynamic Link suffix is a base62 [0-9A-Za-z] string starting with a\nlength of 4 chars. the length will increase when all the space is\noccupied." - ], "enum": [ "OPTION_UNSPECIFIED", "UNGUESSABLE", "SHORT" ], "description": "Suffix option.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "The suffix option is not specified, performs as NOT_GUESSABLE .", + "Short Dynamic Link suffix is a base62 [0-9A-Za-z] encoded string of\na random generated 96 bit random number, which has a length of 17 chars.\nFor example, \"nlAR8U4SlKRZw1cb2\".\nIt prevents other people from guessing and crawling short Dynamic Links\nthat contain personal identifiable information.", + "Short Dynamic Link suffix is a base62 [0-9A-Za-z] string starting with a\nlength of 4 chars. the length will increase when all the space is\noccupied." + ] } }, - "id": "Suffix", - "description": "Short Dynamic Link suffix.", - "type": "object" + "id": "Suffix" }, "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": { + "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" @@ -60,27 +436,32 @@ "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" - }, "utmCampaign": { "description": "Campaign name; used for keyword analysis to identify a specific product\npromotion or strategic campaign.", "type": "string" }, - "utmContent": { - "description": "Campaign content; used for A/B testing and content-targeted ads to\ndifferentiate ads or links that point to the same URL.", + "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" }, - "utmMedium": { - "description": "Campaign medium; used to identify a medium such as email or cost-per-click.", - "type": "string" + "utmContent": { + "type": "string", + "description": "Campaign content; used for A/B testing and content-targeted ads to\ndifferentiate ads or links that point to the same URL." } }, "id": "GooglePlayAnalytics" }, "DynamicLinkInfo": { + "type": "object", "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" + }, + "desktopInfo": { + "$ref": "DesktopInfo", + "description": "Desktop related information. See desktop related parameters in the\n[documentation](https://firebase.google.com/docs/dynamic-links/create-manually)." + }, "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" @@ -90,39 +471,69 @@ "$ref": "IosInfo" }, "socialMetaTagInfo": { - "$ref": "SocialMetaTagInfo", - "description": "Parameters for social meta tag params.\nUsed to set meta tag data for link previews on social sites." + "description": "Parameters for social meta tag params.\nUsed to set meta tag data for link previews on social sites.", + "$ref": "SocialMetaTagInfo" }, "androidInfo": { - "description": "Android related information. See Android related parameters in the\n[documentation](https://firebase.google.com/docs/dynamic-links/create-manually).", - "$ref": "AndroidInfo" + "$ref": "AndroidInfo", + "description": "Android related information. See Android related parameters in the\n[documentation](https://firebase.google.com/docs/dynamic-links/create-manually)." }, "navigationInfo": { - "description": "Information of navigation behavior of a Firebase Dynamic Links.", - "$ref": "NavigationInfo" + "$ref": "NavigationInfo", + "description": "Information of navigation behavior of a Firebase Dynamic Links." }, "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", - "description": "Information about a Dynamic Link.", - "type": "object" + "description": "Information about a Dynamic Link." }, - "ITunesConnectAnalytics": { + "DeviceInfo": { + "type": "object", "properties": { - "at": { - "description": "Affiliate token used to create affiliate-coded links.", + "languageCodeRaw": { + "type": "string", + "description": "Device language code raw setting.\niOS does returns language code in different format than iOS WebView.\nFor example WebView returns en_US, but iOS returns en-US.\nField below will return raw value returned by iOS." + }, + "screenResolutionWidth": { + "type": "string", + "description": "Device display resolution width.", + "format": "int64" + }, + "screenResolutionHeight": { + "description": "Device display resolution height.", + "format": "int64", "type": "string" }, + "languageCode": { + "type": "string", + "description": "Device language code setting." + }, + "timezone": { + "type": "string", + "description": "Device timezone setting." + }, + "deviceModelName": { + "type": "string", + "description": "Device model name." + } + }, + "id": "DeviceInfo", + "description": "Signals associated with the device making the request." + }, + "ITunesConnectAnalytics": { + "description": "Parameters for iTunes Connect App Analytics.", + "type": "object", + "properties": { + "at": { + "type": "string", + "description": "Affiliate token used to create affiliate-coded links." + }, "ct": { - "description": "Campaign text that developers can optionally add to any link in order to\ntrack sales from a specific marketing campaign.", - "type": "string" + "type": "string", + "description": "Campaign text that developers can optionally add to any link in order to\ntrack sales from a specific marketing campaign." }, "mt": { "description": "iTune media types, including music, podcasts, audiobooks and so on.", @@ -133,54 +544,15 @@ "type": "string" } }, - "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" + "id": "ITunesConnectAnalytics" }, "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" + "type": "string", + "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." }, "deepLink": { "description": "The deep-link attributed post-install via one of several techniques\n(fingerprint, copy unique).", @@ -190,7 +562,13 @@ "description": "Invitation ID attributed post-install via one of several techniques\n(fingerprint, copy unique).", "type": "string" }, + "externalBrowserDestinationLink": { + "type": "string", + "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" + }, "attributionConfidence": { + "description": "The confidence of the returned attribution.", + "type": "string", "enumDescriptions": [ "Unset.", "Weak confidence, more than one matching link found or link suspected to\nbe false positive", @@ -202,13 +580,7 @@ "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.", @@ -233,14 +605,27 @@ "utmMedium": { "description": "Scion medium value to be propagated by iSDK to Scion at post-install.", "type": "string" + }, + "utmSource": { + "type": "string", + "description": "Scion source value to be propagated by iSDK to Scion at post-install." + }, + "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" } }, "id": "GetIosPostInstallAttributionResponse" }, "SocialMetaTagInfo": { + "id": "SocialMetaTagInfo", "description": "Parameters for social meta tag params.\nUsed to set meta tag data for link previews on social sites.", "type": "object", "properties": { + "socialDescription": { + "description": "A short description of the link. Optional.", + "type": "string" + }, "socialTitle": { "description": "Title to be displayed. Optional.", "type": "string" @@ -248,21 +633,16 @@ "socialImageLink": { "description": "An image url string. Optional.", "type": "string" - }, - "socialDescription": { - "description": "A short description of the link. Optional.", - "type": "string" } - }, - "id": "SocialMetaTagInfo" + } }, "AndroidInfo": { "description": "Android related attributes to the Dynamic Link.", "type": "object", "properties": { "androidPackageName": { - "description": "Android package name of the app.", - "type": "string" + "type": "string", + "description": "Android package name of the app." }, "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.", @@ -279,14 +659,24 @@ }, "id": "AndroidInfo" }, + "DynamicLinkStats": { + "description": "Analytics stats of a Dynamic Link for a given timeframe.", + "type": "object", + "properties": { + "linkEventStats": { + "description": "Dynamic Link event stats.", + "type": "array", + "items": { + "$ref": "DynamicLinkEventStat" + } + } + }, + "id": "DynamicLinkStats" + }, "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.", @@ -356,209 +746,13 @@ "warningMessage": { "description": "The warning message to help developers improve their requests.", "type": "string" + }, + "warningDocumentLink": { + "description": "The document describing the warning, and helps resolve.", + "type": "string" } }, "id": "DynamicLinkWarning" - }, - "DynamicLinkStats": { - "description": "Analytics stats of a Dynamic Link for a given timeframe.", - "type": "object", - "properties": { - "linkEventStats": { - "description": "Dynamic Link event stats.", - "type": "array", - "items": { - "$ref": "DynamicLinkEventStat" - } - } - }, - "id": "DynamicLinkStats" - }, - "NavigationInfo": { - "description": "Information of navigation behavior.", - "type": "object", - "properties": { - "enableForcedRedirect": { - "description": "If this option is on, FDL click will be forced to redirect rather than\nshow an interstitial page.", - "type": "boolean" - } - }, - "id": "NavigationInfo" - }, - "IosInfo": { - "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" - }, - "iosIpadBundleId": { - "description": "iPad bundle ID of the app.", - "type": "string" - }, - "iosCustomScheme": { - "description": "Custom (destination) scheme to use for iOS. By default, we’ll use the\nbundle ID as the custom scheme. Developer can override this behavior using\nthis param.", - "type": "string" - }, - "iosBundleId": { - "description": "iOS bundle ID of the app.", - "type": "string" - } - }, - "id": "IosInfo", - "description": "iOS related attributes to the Dynamic Link..", - "type": "object" - }, - "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).", - "$ref": "DynamicLinkInfo" - }, - "longDynamicLink": { - "description": "Full long Dynamic Link URL with desired query parameters specified.\nFor example,\n\"https://sample.app.goo.gl/?link=http://www.google.com&apn=com.sample\",\n[Learn more](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically).", - "type": "string" - }, - "suffix": { - "description": "Short Dynamic Link suffix. Optional.", - "$ref": "Suffix" - } - }, - "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": { @@ -576,180 +770,5 @@ } } }, - "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": "" + "rootUrl": "https://firebasedynamiclinks-ipv6.googleapis.com/" } diff --git a/etc/api/firebaseremoteconfig/v1/firebaseremoteconfig-api.json b/etc/api/firebaseremoteconfig/v1/firebaseremoteconfig-api.json index d0706998d7..507a8a2157 100644 --- a/etc/api/firebaseremoteconfig/v1/firebaseremoteconfig-api.json +++ b/etc/api/firebaseremoteconfig/v1/firebaseremoteconfig-api.json @@ -1,19 +1,204 @@ { + "ownerName": "Google", + "resources": { + "projects": { + "methods": { + "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.", + "response": { + "$ref": "RemoteConfig" + }, + "parameterOrder": [ + "project" + ], + "httpMethod": "GET", + "parameters": { + "project": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The GMP project identifier. Required.\nSee note at the beginning of this file regarding project ids.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/projects/{projectsId}/remoteConfig", + "path": "v1/{+project}/remoteConfig", + "id": "firebaseremoteconfig.projects.getRemoteConfig" + }, + "updateRemoteConfig": { + "httpMethod": "PUT", + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "RemoteConfig" + }, + "parameters": { + "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" + }, + "project": { + "description": "The GMP project identifier. Required.\nSee note at the beginning of this file regarding project ids.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/remoteConfig", + "id": "firebaseremoteconfig.projects.updateRemoteConfig", + "path": "v1/{+project}/remoteConfig", + "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." + } + } + } + }, + "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\").", + "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" + }, + "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": { + "location": "query", + "description": "Pretty-print response.", + "type": "boolean", + "default": "true" + }, + "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.", + "type": "boolean", + "default": "true", + "location": "query" + } + }, + "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": "", "documentationLink": "https://firebase.google.com/docs/remote-config/", - "revision": "20170912", + "revision": "20171129", "id": "firebaseremoteconfig:v1", "discoveryVersion": "v1", "version_module": true, "schemas": { + "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", + "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" + }, + "description": { + "description": "Optional.\nA description for this Parameter. Length must be less than or equal to\n100 characters (or more precisely, unicode code points, which is defined in\njava/com/google/wireless/android/config/ConstsExporter.java).\nA description may contain any Unicode characters", + "type": "string" + }, + "conditionalValues": { + "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.", + "type": "object" + } + }, + "id": "RemoteConfigParameter" + }, "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": { + "enum": [ + "CONDITION_DISPLAY_COLOR_UNSPECIFIED", + "BLUE", + "BROWN", + "CYAN", + "DEEP_ORANGE", + "GREEN", + "INDIGO", + "LIME", + "ORANGE", + "PINK", + "PURPLE", + "TEAL" + ], "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": [ @@ -29,25 +214,19 @@ "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" + }, + "description": { + "description": "Optional.\nA description for this Condition. Length must be less than or equal to\n100 characters (or more precisely, unicode code points, which is defined in\njava/com/google/wireless/android/config/ConstsExporter.java).\nA description may contain any Unicode characters", + "type": "string" + }, + "expression": { + "description": "Required.", + "type": "string" } }, "id": "RemoteConfigCondition" @@ -56,60 +235,42 @@ "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" + }, + "useInAppDefault": { + "description": "if true, omit the parameter from the map of fetched parameter values", + "type": "boolean" } }, "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).", + "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 structure 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." + "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.", + "type": "object" + }, + "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.", + "type": "array", + "items": { + "$ref": "RemoteConfigCondition" + } } }, "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" + "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 Remote Config", @@ -118,158 +279,5 @@ "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": "" + "title": "Firebase Remote Config API" } diff --git a/etc/api/firebaserules/v1/firebaserules-api.json b/etc/api/firebaserules/v1/firebaserules-api.json index 402166f4a7..825d913993 100644 --- a/etc/api/firebaserules/v1/firebaserules-api.json +++ b/etc/api/firebaserules/v1/firebaserules-api.json @@ -1,469 +1,20 @@ { - "resources": { - "projects": { - "methods": { - "test": { - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "TestRulesetResponse" - }, - "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", - "path": "v1/{+name}:test", - "id": "firebaserules.projects.test", - "request": { - "$ref": "TestRulesetRequest" - }, - "description": "Test `Source` for syntactic and semantic correctness. Issues present, if\nany, will be returned to the caller with a description, severity, and\nsource location.\n\nThe test method may be executed with `Source` or a `Ruleset` name.\nPassing `Source` is useful for unit testing new rules. Passing a `Ruleset`\nname is useful for regression testing an existing rule.\n\nThe following is an example of `Source` that permits users to upload images\nto a bucket bearing their user id and matching the correct metadata:\n\n_*Example*_\n\n // Users are allowed to subscribe and unsubscribe to the blog.\n service firebase.storage {\n match /users/{userId}/images/{imageName} {\n allow write: if userId == request.auth.uid\n && (imageName.matches('*.png$')\n || imageName.matches('*.jpg$'))\n && resource.mimeType.matches('^image/')\n }\n }" - } - }, - "resources": { - "rulesets": { - "methods": { - "list": { - "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": [ - "name" - ], - "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", - "https://www.googleapis.com/auth/firebase.readonly" - ], - "parameters": { - "name": { - "location": "path", - "description": "Resource name for the ruleset to get.\n\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`", - "type": "string", - "required": true, - "pattern": "^projects/[^/]+/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": { - "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" - }, - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Ruleset" - }, - "parameters": { - "name": { - "location": "path", - "description": "Resource name for Project which owns this `Ruleset`.\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" - ] - }, - "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" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "DELETE", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/firebase" - ], - "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": { - "list": { - "httpMethod": "GET", - "parameterOrder": [ - "name" - ], - "response": { - "$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" - ], - "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" - }, - "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": { - "name": { - "type": "string", - "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}", - "id": "firebaserules.projects.releases.get", - "path": "v1/{+name}" - }, - "update": { - "response": { - "$ref": "Release" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "PUT", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/firebase" - ], - "parameters": { - "name": { - "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": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/firebase" - ], - "flatPath": "v1/projects/{projectsId}/releases/{releasesId}", - "path": "v1/{+name}", - "id": "firebaserules.projects.releases.delete", - "description": "Delete a `Release` by resource name." - } - } - } - } - } - }, - "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": { - "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": { - "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" - }, - "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/", - "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", "id": "firebaserules:v1", - "revision": "20170925", + "documentationLink": "https://firebase.google.com/docs/storage/security", + "revision": "20171108", "discoveryVersion": "v1", "version_module": true, "schemas": { "FunctionMock": { - "type": "object", "properties": { + "args": { + "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.", + "type": "array", + "items": { + "$ref": "Arg" + } + }, "function": { "description": "The name of the function.\n\nThe function name must match one provided by a service declaration.", "type": "string" @@ -471,132 +22,126 @@ "result": { "$ref": "Result", "description": "The mock result of the function call." - }, - "args": { - "items": { - "$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": "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`." + "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`.", + "type": "object" }, "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." + "description": "The Rules runtime version of the executable.", + "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." + ] }, "executable": { - "type": "string", + "description": "Executable view of the `Ruleset` referenced by the `Release`.", "format": "byte", - "description": "Executable view of the `Ruleset` referenced by the `Release`." + "type": "string" }, "updateTime": { - "type": "string", + "description": "Timestamp for the most recent `Release.update_time`.", "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." + "description": "`Language` used to generate the executable bytes.", + "type": "string", + "enumDescriptions": [ + "Language unspecified. Defaults to FIREBASE_RULES.", + "Firebase Rules language.", + "Event Flow triggers." + ] + }, + "rulesetName": { + "description": "`Ruleset` name associated with the `Release` executable.", + "type": "string" } }, "id": "GetReleaseExecutableResponse", - "description": "The response for FirebaseRulesService.GetReleaseExecutable" + "description": "The response for FirebaseRulesService.GetReleaseExecutable", + "type": "object" }, "Source": { - "description": "`Source` is one or more `File` messages comprising a logical set of rules.", - "type": "object", "properties": { "files": { + "description": "`File` set constituting the `Source` bundle.", + "type": "array", "items": { "$ref": "File" - }, - "type": "array", - "description": "`File` set constituting the `Source` bundle." + } } }, - "id": "Source" + "id": "Source", + "description": "`Source` is one or more `File` messages comprising a logical set of rules.", + "type": "object" }, "Result": { - "type": "object", "properties": { + "value": { + "description": "The result is an actual value. The type of the value must match that\nof the type declared by the service.", + "type": "any" + }, "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." + "description": "Possible result values from the function mock invocation.", + "type": "object" }, "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": { - "type": "integer", - "format": "int32", - "description": "Line number of the source fragment. 1-based." - }, "column": { - "format": "int32", "description": "First column on the source line associated with the source fragment.", + "format": "int32", "type": "integer" }, "fileName": { - "type": "string", - "description": "Name of the `File`." + "description": "Name of the `File`.", + "type": "string" + }, + "line": { + "description": "Line number of the source fragment. 1-based.", + "format": "int32", + "type": "integer" } }, - "id": "SourcePosition" + "id": "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" }, "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" }, + "functionMocks": { + "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.", + "type": "array", + "items": { + "$ref": "FunctionMock" + } + }, "expectation": { "enum": [ "EXPECTATION_UNSPECIFIED", @@ -612,179 +157,179 @@ ] }, "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." + "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.", + "type": "any" } }, "id": "TestCase" }, "Ruleset": { + "description": "`Ruleset` is an immutable copy of `Source` with a globally unique identifier\nand a creation time.", "type": "object", "properties": { + "createTime": { + "description": "Time the `Ruleset` was created.\nOutput only.", + "format": "google-datetime", + "type": "string" + }, "name": { - "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." + "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" }, "source": { "$ref": "Source", "description": "`Source` for the `Ruleset`." - }, - "createTime": { - "type": "string", - "format": "google-datetime", - "description": "Time the `Ruleset` was created.\nOutput only." } }, - "id": "Ruleset", - "description": "`Ruleset` is an immutable copy of `Source` with a globally unique identifier\nand a creation time." + "id": "Ruleset" }, - "Issue": { - "description": "Issues include warnings, errors, and deprecation notices.", + "TestRulesetRequest": { + "description": "The request for FirebaseRulesService.TestRuleset.", "type": "object", + "properties": { + "source": { + "description": "Optional `Source` to be checked for correctness.\n\nThis field must not be set when the resource name refers to a `Ruleset`.", + "$ref": "Source" + }, + "testSuite": { + "$ref": "TestSuite", + "description": "Inline `TestSuite` to run." + } + }, + "id": "TestRulesetRequest" + }, + "Issue": { "properties": { "sourcePosition": { - "$ref": "SourcePosition", - "description": "Position of the issue in the `Source`." + "description": "Position of the issue in the `Source`.", + "$ref": "SourcePosition" }, "severity": { - "type": "string", - "enumDescriptions": [ - "An unspecified severity.", - "Deprecation issue for statements and method that may no longer be\nsupported or maintained.", - "Warnings such as: unused variables.", - "Errors such as: unmatched curly braces or variable redefinition." - ], "enum": [ "SEVERITY_UNSPECIFIED", "DEPRECATION", "WARNING", "ERROR" ], - "description": "The severity of the issue." + "description": "The severity of the issue.", + "type": "string", + "enumDescriptions": [ + "An unspecified severity.", + "Deprecation issue for statements and method that may no longer be\nsupported or maintained.", + "Warnings such as: unused variables.", + "Errors such as: unmatched curly braces or variable redefinition." + ] }, "description": { "description": "Short error description.", "type": "string" } }, - "id": "Issue" - }, - "TestRulesetRequest": { - "type": "object", - "properties": { - "testSuite": { - "$ref": "TestSuite", - "description": "Inline `TestSuite` to run." - }, - "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", - "description": "The request for FirebaseRulesService.TestRuleset." - }, - "ListReleasesResponse": { - "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." - } - }, - "id": "ListReleasesResponse", - "description": "The response for FirebaseRulesService.ListReleases." - }, - "FunctionCall": { - "type": "object", - "properties": { - "function": { - "type": "string", - "description": "Name of the function invoked." - }, - "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." + "id": "Issue", + "description": "Issues include warnings, errors, and deprecation notices.", + "type": "object" }, "File": { - "type": "object", "properties": { - "content": { - "type": "string", - "description": "Textual Content." - }, "fingerprint": { - "format": "byte", "description": "Fingerprint (e.g. github sha) associated with the `File`.", + "format": "byte", "type": "string" }, "name": { - "type": "string", - "description": "File name." + "description": "File name.", + "type": "string" + }, + "content": { + "description": "Textual Content.", + "type": "string" } }, "id": "File", - "description": "`File` containing source content." + "description": "`File` containing source content.", + "type": "object" }, - "Release": { + "ListReleasesResponse": { + "description": "The response for FirebaseRulesService.ListReleases.", "type": "object", "properties": { - "updateTime": { - "type": "string", - "format": "google-datetime", - "description": "Time the release was updated.\nOutput only." + "releases": { + "description": "List of `Release` instances.", + "type": "array", + "items": { + "$ref": "Release" + } }, - "rulesetName": { - "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.", + "nextPageToken": { + "description": "The pagination token to retrieve the next page of results. If the value is\nempty, no further results remain.", "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`." + "id": "ListReleasesResponse" }, - "TestRulesetResponse": { + "FunctionCall": { + "properties": { + "args": { + "description": "The arguments that were provided to the function.", + "type": "array", + "items": { + "type": "any" + } + }, + "function": { + "description": "Name of the function invoked.", + "type": "string" + } + }, + "id": "FunctionCall", + "description": "Represents a service-defined function call that was invoked during test\nexecution.", + "type": "object" + }, + "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", "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`.", - "items": { - "$ref": "TestResult" - }, - "type": "array" + "createTime": { + "description": "Time the release was created.\nOutput only.", + "format": "google-datetime", + "type": "string" }, + "updateTime": { + "description": "Time the release was updated.\nOutput only.", + "format": "google-datetime", + "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" + }, + "rulesetName": { + "description": "Name of the `Ruleset` referred to by this `Release`. The `Ruleset` must\nexist the `Release` to be created.", + "type": "string" + } + }, + "id": "Release" + }, + "TestRulesetResponse": { + "properties": { "issues": { "description": "Syntactic and semantic `Source` issues of varying severity. Issues of\n`ERROR` severity will prevent tests from executing.", + "type": "array", "items": { "$ref": "Issue" - }, - "type": "array" + } + }, + "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" + } } }, "id": "TestRulesetResponse", - "description": "The response for FirebaseRulesService.TestRuleset." + "description": "The response for FirebaseRulesService.TestRuleset.", + "type": "object" }, "TestResult": { "description": "Test result message containing the state of the test as well as a\ndescription and source position for test failures.", @@ -792,17 +337,10 @@ "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": [ @@ -818,6 +356,13 @@ "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 }`" @@ -826,62 +371,78 @@ "id": "TestResult" }, "ListRulesetsResponse": { + "description": "The response for FirebaseRulesService.ListRulesets.", "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.", "type": "string" } }, - "id": "ListRulesetsResponse", - "description": "The response for FirebaseRulesService.ListRulesets." + "id": "ListRulesetsResponse" }, "Arg": { - "type": "object", "properties": { - "anyValue": { - "$ref": "Empty", - "description": "Argument matches any value provided." - }, "exactValue": { - "type": "any", - "description": "Argument exactly matches value provided." + "description": "Argument exactly matches value provided.", + "type": "any" + }, + "anyValue": { + "description": "Argument matches any value provided.", + "$ref": "Empty" } }, "id": "Arg", - "description": "Arg matchers for the mock function." + "description": "Arg matchers for the mock function.", + "type": "object" }, "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": { + "description": "Collection of test cases associated with the `TestSuite`.", + "type": "array", "items": { "$ref": "TestCase" - }, - "type": "array", - "description": "Collection of test cases associated with the `TestSuite`." + } } }, - "id": "TestSuite" + "id": "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" + }, + "UpdateReleaseRequest": { + "description": "The request for FirebaseRulesService.UpdateReleasePatch.", + "type": "object", + "properties": { + "updateMask": { + "description": "Specifies which fields to update.", + "format": "google-fieldmask", + "type": "string" + }, + "release": { + "description": "`Release` to update.", + "$ref": "Release" + } + }, + "id": "UpdateReleaseRequest" }, "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" } }, "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 Rules", @@ -891,11 +452,11 @@ "https://www.googleapis.com/auth/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" }, - "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" + }, + "https://www.googleapis.com/auth/firebase.readonly": { + "description": "View all your Firebase data and settings" } } } @@ -905,5 +466,489 @@ "name": "firebaserules", "batchPath": "batch", "title": "Firebase Rules API", - "ownerName": "Google" + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "rulesets": { + "methods": { + "delete": { + "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.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/firebase" + ], + "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" + } + }, + "flatPath": "v1/projects/{projectsId}/rulesets/{rulesetsId}" + }, + "get": { + "response": { + "$ref": "Ruleset" + }, + "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": { + "name": { + "pattern": "^projects/[^/]+/rulesets/[^/]+$", + "location": "path", + "description": "Resource name for the ruleset to get.\n\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`", + "required": true, + "type": "string" + } + }, + "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." + }, + "list": { + "response": { + "$ref": "ListRulesetsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Resource name for the project.\n\nFormat: `projects/{project_id}`", + "required": true, + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "Next page token for loading the next batch of `Ruleset` instances.", + "type": "string" + }, + "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 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", + "location": "query" + }, + "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" + } + }, + "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", + "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." + }, + "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" + }, + "response": { + "$ref": "Ruleset" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/firebase" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Resource name for Project which owns this `Ruleset`.\n\nFormat: `projects/{project_id}`", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/projects/{projectsId}/rulesets", + "path": "v1/{+name}/rulesets", + "id": "firebaserules.projects.rulesets.create" + } + } + }, + "releases": { + "methods": { + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Release" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/releases/.+$", + "location": "path", + "description": "Resource name for the project which owns this `Release`.\n\nFormat: `projects/{project_id}`", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/firebase" + ], + "flatPath": "v1/projects/{projectsId}/releases/{releasesId}", + "id": "firebaserules.projects.releases.patch", + "path": "v1/{+name}", + "request": { + "$ref": "UpdateReleaseRequest" + }, + "description": "Update a `Release` via PATCH.\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." + }, + "get": { + "response": { + "$ref": "Release" + }, + "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": { + "name": { + "description": "Resource name of the `Release`.\n\nFormat: `projects/{project_id}/releases/{release_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/releases/.+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/releases/{releasesId}", + "path": "v1/{+name}", + "id": "firebaserules.projects.releases.get", + "description": "Get a `Release` by name." + }, + "update": { + "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.", + "httpMethod": "PUT", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Release" + }, + "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}`", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/firebase" + ], + "flatPath": "v1/projects/{projectsId}/releases/{releasesId}" + }, + "getExecutable": { + "description": "Get the `Release` executable to use when enforcing rules.", + "response": { + "$ref": "GetReleaseExecutableResponse" + }, + "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": { + "name": { + "description": "Resource name of the `Release`.\n\nFormat: `projects/{project_id}/releases/{release_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/releases/.+$", + "location": "path" + }, + "executableVersion": { + "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", + "location": "query" + } + }, + "flatPath": "v1/projects/{projectsId}/releases/{releasesId}:getExecutable", + "path": "v1/{+name}:getExecutable", + "id": "firebaserules.projects.releases.getExecutable" + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/firebase" + ], + "flatPath": "v1/projects/{projectsId}/releases/{releasesId}", + "id": "firebaserules.projects.releases.delete", + "path": "v1/{+name}", + "description": "Delete a `Release` by resource name." + }, + "list": { + "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": { + "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" + }, + "name": { + "description": "Resource name for the project.\n\nFormat: `projects/{project_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "pageToken": { + "location": "query", + "description": "Next page token for the next batch of `Release` instances.", + "type": "string" + }, + "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 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" + } + }, + "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": { + "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": { + "description": "Resource name for the project which owns this `Release`.\n\nFormat: `projects/{project_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/releases", + "path": "v1/{+name}/releases", + "id": "firebaserules.projects.releases.create" + } + } + } + }, + "methods": { + "test": { + "response": { + "$ref": "TestRulesetResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/firebase", + "https://www.googleapis.com/auth/firebase.readonly" + ], + "parameters": { + "name": { + "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}`", + "required": true, + "type": "string", + "pattern": "^projects/.+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}:test", + "path": "v1/{+name}:test", + "id": "firebaserules.projects.test", + "description": "Test `Source` for syntactic and semantic correctness. Issues present, if\nany, will be returned to the caller with a description, severity, and\nsource location.\n\nThe test method may be executed with `Source` or a `Ruleset` name.\nPassing `Source` is useful for unit testing new rules. Passing a `Ruleset`\nname is useful for regression testing an existing rule.\n\nThe following is an example of `Source` that permits users to upload images\nto a bucket bearing their user id and matching the correct metadata:\n\n_*Example*_\n\n // Users are allowed to subscribe and unsubscribe to the blog.\n service firebase.storage {\n match /users/{userId}/images/{imageName} {\n allow write: if userId == request.auth.uid\n && (imageName.matches('*.png$')\n || imageName.matches('*.jpg$'))\n && resource.mimeType.matches('^image/')\n }\n }", + "request": { + "$ref": "TestRulesetRequest" + } + } + } + } + }, + "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.", + "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": { + "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": { + "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" + }, + "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://firebaserules.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Creates and manages rules that determine when a Firebase Rules-enabled service should permit a request.\n", + "servicePath": "" } diff --git a/etc/api/firestore/v1beta1/firestore-api.json b/etc/api/firestore/v1beta1/firestore-api.json new file mode 100644 index 0000000000..04d8508343 --- /dev/null +++ b/etc/api/firestore/v1beta1/firestore-api.json @@ -0,0 +1,1968 @@ +{ + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "Document": { + "description": "A Firestore document.\n\nMust not exceed 1 MiB - 4 bytes.", + "type": "object", + "properties": { + "createTime": { + "description": "Output only. The time at which the document was created.\n\nThis value increases monotonically when a document is deleted then\nrecreated. It can also be compared to values from other documents and\nthe `read_time` of a query.", + "format": "google-datetime", + "type": "string" + }, + "fields": { + "additionalProperties": { + "$ref": "Value" + }, + "description": "The document's fields.\n\nThe map keys represent field names.\n\nA simple field name contains only characters `a` to `z`, `A` to `Z`,\n`0` to `9`, or `_`, and must not start with `0` to `9`. For example,\n`foo_bar_17`.\n\nField names matching the regular expression `__.*__` are reserved. Reserved\nfield names are forbidden except in certain documented contexts. The map\nkeys, represented as UTF-8, must not exceed 1,500 bytes and cannot be\nempty.\n\nField paths may be used in other contexts to refer to structured fields\ndefined here. For `map_value`, the field path is represented by the simple\nor quoted field names of the containing fields, delimited by `.`. For\nexample, the structured field\n`\"foo\" : { map_value: { \"x&y\" : { string_value: \"hello\" }}}` would be\nrepresented by the field path `foo.x&y`.\n\nWithin a field path, a quoted field name starts and ends with `` ` `` and\nmay contain any character. Some characters, including `` ` ``, must be\nescaped using a `\\`. For example, `` `x&y` `` represents `x&y` and\n`` `bak\\`tik` `` represents `` bak`tik ``.", + "type": "object" + }, + "updateTime": { + "description": "Output only. The time at which the document was last changed.\n\nThis value is initally set to the `create_time` then increases\nmonotonically with each change to the document. It can also be\ncompared to values from other documents and the `read_time` of a query.", + "format": "google-datetime", + "type": "string" + }, + "name": { + "description": "The resource name of the document, for example\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.", + "type": "string" + } + }, + "id": "Document" + }, + "Projection": { + "id": "Projection", + "description": "The projection of document's fields to return.", + "type": "object", + "properties": { + "fields": { + "description": "The fields to return.\n\nIf empty, all fields are returned. To only return the name\nof the document, use `['__name__']`.", + "type": "array", + "items": { + "$ref": "FieldReference" + } + } + } + }, + "DocumentRemove": { + "description": "A Document has been removed from the view of the targets.\n\nSent if the document is no longer relevant to a target and is out of view.\nCan be sent instead of a DocumentDelete or a DocumentChange if the server\ncan not send the new value of the document.\n\nMultiple DocumentRemove messages may be returned for the same logical\nwrite or delete, if multiple targets are affected.", + "type": "object", + "properties": { + "document": { + "description": "The resource name of the Document that has gone out of view.", + "type": "string" + }, + "readTime": { + "description": "The read timestamp at which the remove was observed.\n\nGreater or equal to the `commit_time` of the change/delete/remove.", + "format": "google-datetime", + "type": "string" + }, + "removedTargetIds": { + "description": "A set of target IDs for targets that previously matched this document.", + "type": "array", + "items": { + "format": "int32", + "type": "integer" + } + } + }, + "id": "DocumentRemove" + }, + "ListDocumentsResponse": { + "description": "The response for Firestore.ListDocuments.", + "type": "object", + "properties": { + "documents": { + "description": "The Documents found.", + "type": "array", + "items": { + "$ref": "Document" + } + }, + "nextPageToken": { + "description": "The next page token.", + "type": "string" + } + }, + "id": "ListDocumentsResponse" + }, + "RollbackRequest": { + "type": "object", + "properties": { + "transaction": { + "description": "The transaction to roll back.", + "format": "byte", + "type": "string" + } + }, + "id": "RollbackRequest", + "description": "The request for Firestore.Rollback." + }, + "CompositeFilter": { + "type": "object", + "properties": { + "op": { + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "The results are required to satisfy each of the combined filters." + ], + "enum": [ + "OPERATOR_UNSPECIFIED", + "AND" + ], + "description": "The operator for combining multiple filters.", + "type": "string" + }, + "filters": { + "description": "The list of filters to combine.\nMust contain at least one filter.", + "type": "array", + "items": { + "$ref": "Filter" + } + } + }, + "id": "CompositeFilter", + "description": "A filter that merges multiple other filters using the given operator." + }, + "DocumentsTarget": { + "description": "A target specified by a set of documents names.", + "type": "object", + "properties": { + "documents": { + "description": "The names of the documents to retrieve. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nThe request will fail if any of the document is not a child resource of\nthe given `database`. Duplicate names will be elided.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "DocumentsTarget" + }, + "DocumentMask": { + "description": "A set of field paths on a document.\nUsed to restrict a get or update operation on a document to a subset of its\nfields.\nThis is different from standard field masks, as this is always scoped to a\nDocument, and takes in account the dynamic nature of Value.", + "type": "object", + "properties": { + "fieldPaths": { + "description": "The list of field paths in the mask. See Document.fields for a field\npath syntax reference.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "DocumentMask" + }, + "DocumentTransform": { + "description": "A transformation of a document.", + "type": "object", + "properties": { + "document": { + "description": "The name of the document to transform.", + "type": "string" + }, + "fieldTransforms": { + "description": "The list of transformations to apply to the fields of the document, in\norder.\nThis must not be empty.", + "type": "array", + "items": { + "$ref": "FieldTransform" + } + } + }, + "id": "DocumentTransform" + }, + "FieldTransform": { + "description": "A transformation of a field of the document.", + "type": "object", + "properties": { + "fieldPath": { + "description": "The path of the field. See Document.fields for the field path syntax\nreference.", + "type": "string" + }, + "setToServerValue": { + "description": "Sets the field to the given server value.", + "type": "string", + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "The time at which the server processed the request, with millisecond\nprecision." + ], + "enum": [ + "SERVER_VALUE_UNSPECIFIED", + "REQUEST_TIME" + ] + } + }, + "id": "FieldTransform" + }, + "ListCollectionIdsResponse": { + "description": "The response from Firestore.ListCollectionIds.", + "type": "object", + "properties": { + "collectionIds": { + "description": "The collection ids.", + "type": "array", + "items": { + "type": "string" + } + }, + "nextPageToken": { + "description": "A page token that may be used to continue the list.", + "type": "string" + } + }, + "id": "ListCollectionIdsResponse" + }, + "CommitResponse": { + "id": "CommitResponse", + "description": "The response for Firestore.Commit.", + "type": "object", + "properties": { + "writeResults": { + "description": "The result of applying the writes.\n\nThis i-th write result corresponds to the i-th write in the\nrequest.", + "type": "array", + "items": { + "$ref": "WriteResult" + } + }, + "commitTime": { + "description": "The time at which the commit occurred.", + "format": "google-datetime", + "type": "string" + } + } + }, + "Order": { + "description": "An order on a field.", + "type": "object", + "properties": { + "direction": { + "enumDescriptions": [ + "Unspecified.", + "Ascending.", + "Descending." + ], + "enum": [ + "DIRECTION_UNSPECIFIED", + "ASCENDING", + "DESCENDING" + ], + "description": "The direction to order by. Defaults to `ASCENDING`.", + "type": "string" + }, + "field": { + "$ref": "FieldReference", + "description": "The field to order by." + } + }, + "id": "Order" + }, + "WriteResponse": { + "description": "The response for Firestore.Write.", + "type": "object", + "properties": { + "streamToken": { + "description": "A token that represents the position of this response in the stream.\nThis can be used by a client to resume the stream at this point.\n\nThis field is always set.", + "format": "byte", + "type": "string" + }, + "writeResults": { + "description": "The result of applying the writes.\n\nThis i-th write result corresponds to the i-th write in the\nrequest.", + "type": "array", + "items": { + "$ref": "WriteResult" + } + }, + "streamId": { + "type": "string", + "description": "The ID of the stream.\nOnly set on the first message, when a new stream was created." + }, + "commitTime": { + "description": "The time at which the commit occurred.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "WriteResponse" + }, + "FieldFilter": { + "id": "FieldFilter", + "description": "A filter on a specific field.", + "type": "object", + "properties": { + "field": { + "$ref": "FieldReference", + "description": "The field to filter by." + }, + "value": { + "description": "The value to compare to.", + "$ref": "Value" + }, + "op": { + "description": "The operator to filter by.", + "type": "string", + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "Less than. Requires that the field come first in `order_by`.", + "Less than or equal. Requires that the field come first in `order_by`.", + "Greater than. Requires that the field come first in `order_by`.", + "Greater than or equal. Requires that the field come first in\n`order_by`.", + "Equal." + ], + "enum": [ + "OPERATOR_UNSPECIFIED", + "LESS_THAN", + "LESS_THAN_OR_EQUAL", + "GREATER_THAN", + "GREATER_THAN_OR_EQUAL", + "EQUAL" + ] + } + } + }, + "TargetChange": { + "description": "Targets being watched have changed.", + "type": "object", + "properties": { + "resumeToken": { + "description": "A token that can be used to resume the stream for the given `target_ids`,\nor all targets if `target_ids` is empty.\n\nNot set on every target change.", + "format": "byte", + "type": "string" + }, + "targetIds": { + "type": "array", + "items": { + "format": "int32", + "type": "integer" + }, + "description": "The target IDs of targets that have changed.\n\nIf empty, the change applies to all targets.\n\nFor `target_change_type=ADD`, the order of the target IDs matches the order\nof the requests to add the targets. This allows clients to unambiguously\nassociate server-assigned target IDs with added targets.\n\nFor other states, the order of the target IDs is not defined." + }, + "cause": { + "$ref": "Status", + "description": "The error that resulted in this change, if applicable." + }, + "readTime": { + "description": "The consistent `read_time` for the given `target_ids` (omitted when the\ntarget_ids are not at a consistent snapshot).\n\nThe stream is guaranteed to send a `read_time` with `target_ids` empty\nwhenever the entire stream reaches a new consistent snapshot. ADD,\nCURRENT, and RESET messages are guaranteed to (eventually) result in a\nnew consistent snapshot (while NO_CHANGE and REMOVE messages are not).\n\nFor a given stream, `read_time` is guaranteed to be monotonically\nincreasing.", + "format": "google-datetime", + "type": "string" + }, + "targetChangeType": { + "enumDescriptions": [ + "No change has occurred. Used only to send an updated `resume_token`.", + "The targets have been added.", + "The targets have been removed.", + "The targets reflect all changes committed before the targets were added\nto the stream.\n\nThis will be sent after or with a `read_time` that is greater than or\nequal to the time at which the targets were added.\n\nListeners can wait for this change if read-after-write semantics\nare desired.", + "The targets have been reset, and a new initial state for the targets\nwill be returned in subsequent changes.\n\nAfter the initial state is complete, `CURRENT` will be returned even\nif the target was previously indicated to be `CURRENT`." + ], + "enum": [ + "NO_CHANGE", + "ADD", + "REMOVE", + "CURRENT", + "RESET" + ], + "description": "The type of change that occurred.", + "type": "string" + } + }, + "id": "TargetChange" + }, + "MapValue": { + "description": "A map value.", + "type": "object", + "properties": { + "fields": { + "additionalProperties": { + "$ref": "Value" + }, + "description": "The map's fields.\n\nThe map keys represent field names. Field names matching the regular\nexpression `__.*__` are reserved. Reserved field names are forbidden except\nin certain documented contexts. The map keys, represented as UTF-8, must\nnot exceed 1,500 bytes and cannot be empty.", + "type": "object" + } + }, + "id": "MapValue" + }, + "DocumentDelete": { + "id": "DocumentDelete", + "description": "A Document has been deleted.\n\nMay be the result of multiple writes, including updates, the\nlast of which deleted the Document.\n\nMultiple DocumentDelete messages may be returned for the same logical\ndelete, if multiple targets are affected.", + "type": "object", + "properties": { + "removedTargetIds": { + "description": "A set of target IDs for targets that previously matched this entity.", + "type": "array", + "items": { + "format": "int32", + "type": "integer" + } + }, + "document": { + "description": "The resource name of the Document that was deleted.", + "type": "string" + }, + "readTime": { + "description": "The read timestamp at which the delete was observed.\n\nGreater or equal to the `commit_time` of the delete.", + "format": "google-datetime", + "type": "string" + } + } + }, + "BeginTransactionResponse": { + "properties": { + "transaction": { + "description": "The transaction that was started.", + "format": "byte", + "type": "string" + } + }, + "id": "BeginTransactionResponse", + "description": "The response for Firestore.BeginTransaction.", + "type": "object" + }, + "IndexField": { + "description": "A field of an index.", + "type": "object", + "properties": { + "fieldPath": { + "type": "string", + "description": "The path of the field. Must match the field path specification described\nby google.firestore.v1beta1.Document.fields.\nSpecial field path `__name__` may be used by itself or at the end of a\npath. `__type__` may be used only at the end of path." + }, + "mode": { + "description": "The field's mode.", + "type": "string", + "enumDescriptions": [ + "The mode is unspecified.", + "The field's values are indexed so as to support sequencing in\nascending order and also query by \u003c, \u003e, \u003c=, \u003e=, and =.", + "The field's values are indexed so as to support sequencing in\ndescending order and also query by \u003c, \u003e, \u003c=, \u003e=, and =." + ], + "enum": [ + "MODE_UNSPECIFIED", + "ASCENDING", + "DESCENDING" + ] + } + }, + "id": "IndexField" + }, + "RunQueryResponse": { + "description": "The response for Firestore.RunQuery.", + "type": "object", + "properties": { + "skippedResults": { + "description": "The number of results that have been skipped due to an offset between\nthe last response and the current response.", + "format": "int32", + "type": "integer" + }, + "transaction": { + "description": "The transaction that was started as part of this request.\nCan only be set in the first response, and only if\nRunQueryRequest.new_transaction was set in the request.\nIf set, no other fields will be set in this response.", + "format": "byte", + "type": "string" + }, + "document": { + "$ref": "Document", + "description": "A query result.\nNot set when reporting partial progress." + }, + "readTime": { + "type": "string", + "description": "The time at which the document was read. This may be monotonically\nincreasing; in this case, the previous documents in the result stream are\nguaranteed not to have changed between their `read_time` and this one.\n\nIf the query returns no results, a response with `read_time` and no\n`document` will be sent, and this represents the time at which the query\nwas run.", + "format": "google-datetime" + } + }, + "id": "RunQueryResponse" + }, + "CommitRequest": { + "id": "CommitRequest", + "description": "The request for Firestore.Commit.", + "type": "object", + "properties": { + "transaction": { + "description": "If set, applies all writes in this transaction, and commits it.", + "format": "byte", + "type": "string" + }, + "writes": { + "description": "The writes to apply.\n\nAlways executed atomically and in order.", + "type": "array", + "items": { + "$ref": "Write" + } + } + } + }, + "BeginTransactionRequest": { + "description": "The request for Firestore.BeginTransaction.", + "type": "object", + "properties": { + "options": { + "$ref": "TransactionOptions", + "description": "The options for the transaction.\nDefaults to a read-write transaction." + } + }, + "id": "BeginTransactionRequest" + }, + "ListenRequest": { + "description": "A request for Firestore.Listen", + "type": "object", + "properties": { + "addTarget": { + "$ref": "Target", + "description": "A target to add to this stream." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Labels associated with this target change.", + "type": "object" + }, + "removeTarget": { + "description": "The ID of a target to remove from this stream.", + "format": "int32", + "type": "integer" + } + }, + "id": "ListenRequest" + }, + "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.", + "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" + }, + "CollectionSelector": { + "description": "A selection of a collection, such as `messages as m1`.", + "type": "object", + "properties": { + "allDescendants": { + "description": "When false, selects only collections that are immediate children of\nthe `parent` specified in the containing `RunQueryRequest`.\nWhen true, selects all descendant collections.", + "type": "boolean" + }, + "collectionId": { + "description": "The collection ID.\nWhen set, selects only collections with this ID.", + "type": "string" + } + }, + "id": "CollectionSelector" + }, + "ArrayValue": { + "description": "An array value.", + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "$ref": "Value" + }, + "description": "Values in the array." + } + }, + "id": "ArrayValue" + }, + "Index": { + "description": "An index definition.", + "type": "object", + "properties": { + "name": { + "description": "The resource name of the index.\nOutput only.", + "type": "string" + }, + "collectionId": { + "description": "The collection ID to which this index applies. Required.", + "type": "string" + }, + "fields": { + "description": "The fields to index.", + "type": "array", + "items": { + "$ref": "IndexField" + } + }, + "state": { + "enumDescriptions": [ + "The state is unspecified.", + "The index is being created.\nThere is an active long-running operation for the index.\nThe index is updated when writing a document.\nSome index data may exist.", + "The index is ready to be used.\nThe index is updated when writing a document.\nThe index is fully populated from all stored documents it applies to.", + "The index was being created, but something went wrong.\nThere is no active long-running operation for the index,\nand the most recently finished long-running operation failed.\nThe index is not updated when writing a document.\nSome index data may exist." + ], + "enum": [ + "STATE_UNSPECIFIED", + "CREATING", + "READY", + "ERROR" + ], + "description": "The state of the index.\nOutput only.", + "type": "string" + } + }, + "id": "Index" + }, + "StructuredQuery": { + "id": "StructuredQuery", + "description": "A Firestore query.", + "type": "object", + "properties": { + "orderBy": { + "description": "The order to apply to the query results.\n\nFirestore guarantees a stable ordering through the following rules:\n\n * Any field required to appear in `order_by`, that is not already\n specified in `order_by`, is appended to the order in field name order\n by default.\n * If an order on `__name__` is not specified, it is appended by default.\n\nFields are appended with the same sort direction as the last order\nspecified, or 'ASCENDING' if no order was specified. For example:\n\n * `SELECT * FROM Foo ORDER BY A` becomes\n `SELECT * FROM Foo ORDER BY A, __name__`\n * `SELECT * FROM Foo ORDER BY A DESC` becomes\n `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`\n * `SELECT * FROM Foo WHERE A \u003e 1` becomes\n `SELECT * FROM Foo WHERE A \u003e 1 ORDER BY A, __name__`", + "type": "array", + "items": { + "$ref": "Order" + } + }, + "select": { + "description": "The projection to return.", + "$ref": "Projection" + }, + "limit": { + "description": "The maximum number of results to return.\n\nApplies after all other constraints.\nMust be \u003e= 0 if specified.", + "format": "int32", + "type": "integer" + }, + "from": { + "type": "array", + "items": { + "$ref": "CollectionSelector" + }, + "description": "The collections to query." + }, + "offset": { + "description": "The number of results to skip.\n\nApplies before limit, but after all other constraints. Must be \u003e= 0 if\nspecified.", + "format": "int32", + "type": "integer" + }, + "endAt": { + "description": "A end point for the query results.", + "$ref": "Cursor" + }, + "startAt": { + "$ref": "Cursor", + "description": "A starting point for the query results." + }, + "where": { + "description": "The filter to apply.", + "$ref": "Filter" + } + } + }, + "UnaryFilter": { + "description": "A filter with a single operand.", + "type": "object", + "properties": { + "op": { + "enum": [ + "OPERATOR_UNSPECIFIED", + "IS_NAN", + "IS_NULL" + ], + "description": "The unary operator to apply.", + "type": "string", + "enumDescriptions": [ + "Unspecified. This value must not be used.", + "Test if a field is equal to NaN.", + "Test if an exprestion evaluates to Null." + ] + }, + "field": { + "$ref": "FieldReference", + "description": "The field to which to apply the operator." + } + }, + "id": "UnaryFilter" + }, + "Filter": { + "description": "A filter.", + "type": "object", + "properties": { + "fieldFilter": { + "description": "A filter on a document field.", + "$ref": "FieldFilter" + }, + "unaryFilter": { + "description": "A filter that takes exactly one argument.", + "$ref": "UnaryFilter" + }, + "compositeFilter": { + "description": "A composite filter.", + "$ref": "CompositeFilter" + } + }, + "id": "Filter" + }, + "WriteRequest": { + "description": "The request for Firestore.Write.\n\nThe first request creates a stream, or resumes an existing one from a token.\n\nWhen creating a new stream, the server replies with a response containing\nonly an ID and a token, to use in the next request.\n\nWhen resuming a stream, the server first streams any responses later than the\ngiven token, then a response containing only an up-to-date token, to use in\nthe next request.", + "type": "object", + "properties": { + "streamId": { + "description": "The ID of the write stream to resume.\nThis may only be set in the first message. When left empty, a new write\nstream will be created.", + "type": "string" + }, + "streamToken": { + "description": "A stream token that was previously sent by the server.\n\nThe client should set this field to the token from the most recent\nWriteResponse it has received. This acknowledges that the client has\nreceived responses up to this token. After sending this token, earlier\ntokens may not be used anymore.\n\nThe server may close the stream if there are too many unacknowledged\nresponses.\n\nLeave this field unset when creating a new stream. To resume a stream at\na specific point, set this field and the `stream_id` field.\n\nLeave this field unset when creating a new stream.", + "format": "byte", + "type": "string" + }, + "writes": { + "type": "array", + "items": { + "$ref": "Write" + }, + "description": "The writes to apply.\n\nAlways executed atomically and in order.\nThis must be empty on the first request.\nThis may be empty on the last request.\nThis must not be empty on all other requests." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Labels associated with this write request.", + "type": "object" + } + }, + "id": "WriteRequest" + }, + "BatchGetDocumentsResponse": { + "description": "The streamed response for Firestore.BatchGetDocuments.", + "type": "object", + "properties": { + "readTime": { + "description": "The time at which the document was read.\nThis may be monotically increasing, in this case the previous documents in\nthe result stream are guaranteed not to have changed between their\nread_time and this one.", + "format": "google-datetime", + "type": "string" + }, + "found": { + "$ref": "Document", + "description": "A document that was requested." + }, + "missing": { + "description": "A document name that was requested but does not exist. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.", + "type": "string" + }, + "transaction": { + "description": "The transaction that was started as part of this request.\nWill only be set in the first response, and only if\nBatchGetDocumentsRequest.new_transaction was set in the request.", + "format": "byte", + "type": "string" + } + }, + "id": "BatchGetDocumentsResponse" + }, + "Target": { + "id": "Target", + "description": "A specification of a set of documents to listen to.", + "type": "object", + "properties": { + "readTime": { + "description": "Start listening after a specific `read_time`.\n\nThe client must know the state of matching documents at this time.", + "format": "google-datetime", + "type": "string" + }, + "targetId": { + "description": "A client provided target ID.\n\nIf not set, the server will assign an ID for the target.\n\nUsed for resuming a target without changing IDs. The IDs can either be\nclient-assigned or be server-assigned in a previous stream. All targets\nwith client provided IDs must be added before adding a target that needs\na server-assigned id.", + "format": "int32", + "type": "integer" + }, + "documents": { + "$ref": "DocumentsTarget", + "description": "A target specified by a set of document names." + }, + "query": { + "description": "A target specified by a query.", + "$ref": "QueryTarget" + }, + "resumeToken": { + "type": "string", + "description": "A resume token from a prior TargetChange for an identical target.\n\nUsing a resume token with a different target is unsupported and may fail.", + "format": "byte" + }, + "once": { + "description": "If the target should be removed once it is current and consistent.", + "type": "boolean" + } + } + }, + "RunQueryRequest": { + "description": "The request for Firestore.RunQuery.", + "type": "object", + "properties": { + "transaction": { + "description": "Reads documents in a transaction.", + "format": "byte", + "type": "string" + }, + "structuredQuery": { + "description": "A structured query.", + "$ref": "StructuredQuery" + }, + "readTime": { + "description": "Reads documents as they were at the given time.\nThis may not be older than 60 seconds.", + "format": "google-datetime", + "type": "string" + }, + "newTransaction": { + "description": "Starts a new transaction and reads the documents.\nDefaults to a read-only transaction.\nThe new transaction ID will be returned as the first response in the\nstream.", + "$ref": "TransactionOptions" + } + }, + "id": "RunQueryRequest" + }, + "Precondition": { + "type": "object", + "properties": { + "exists": { + "description": "When set to `true`, the target document must exist.\nWhen set to `false`, the target document must not exist.", + "type": "boolean" + }, + "updateTime": { + "description": "When set, the target document must exist and have been last updated at\nthat time.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "Precondition", + "description": "A precondition on a document, used for conditional operations." + }, + "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 `{}`." + }, + "ListIndexesResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + }, + "indexes": { + "description": "The indexes.", + "type": "array", + "items": { + "$ref": "Index" + } + } + }, + "id": "ListIndexesResponse", + "description": "The response for FirestoreAdmin.ListIndexes." + }, + "TransactionOptions": { + "description": "Options for creating a new transaction.", + "type": "object", + "properties": { + "readOnly": { + "$ref": "ReadOnly", + "description": "The transaction can only be used for read operations." + }, + "readWrite": { + "$ref": "ReadWrite", + "description": "The transaction can be used for both read and write operations." + } + }, + "id": "TransactionOptions" + }, + "FieldReference": { + "id": "FieldReference", + "description": "A reference to a field, such as `max(messages.time) as max_time`.", + "type": "object", + "properties": { + "fieldPath": { + "type": "string" + } + } + }, + "ListenResponse": { + "id": "ListenResponse", + "description": "The response for Firestore.Listen.", + "type": "object", + "properties": { + "filter": { + "$ref": "ExistenceFilter", + "description": "A filter to apply to the set of documents previously returned for the\ngiven target.\n\nReturned when documents may have been removed from the given target, but\nthe exact documents are unknown." + }, + "documentChange": { + "description": "A Document has changed.", + "$ref": "DocumentChange" + }, + "targetChange": { + "$ref": "TargetChange", + "description": "Targets have changed." + }, + "documentRemove": { + "$ref": "DocumentRemove", + "description": "A Document has been removed from a target (because it is no longer\nrelevant to that target)." + }, + "documentDelete": { + "$ref": "DocumentDelete", + "description": "A Document has been deleted." + } + } + }, + "ListCollectionIdsRequest": { + "description": "The request for Firestore.ListCollectionIds.", + "type": "object", + "properties": { + "pageToken": { + "description": "A page token. Must be a value from\nListCollectionIdsResponse.", + "type": "string" + }, + "pageSize": { + "description": "The maximum number of results to return.", + "format": "int32", + "type": "integer" + } + }, + "id": "ListCollectionIdsRequest" + }, + "ExistenceFilter": { + "type": "object", + "properties": { + "targetId": { + "description": "The target ID to which this filter applies.", + "format": "int32", + "type": "integer" + }, + "count": { + "description": "The total count of documents that match target_id.\n\nIf different from the count of documents in the client that match, the\nclient must manually determine which documents no longer match the target.", + "format": "int32", + "type": "integer" + } + }, + "id": "ExistenceFilter", + "description": "A digest of all the documents that match a given target." + }, + "ReadOnly": { + "description": "Options for a transaction that can only be used to read documents.", + "type": "object", + "properties": { + "readTime": { + "type": "string", + "description": "Reads documents at the given time.\nThis may not be older than 60 seconds.", + "format": "google-datetime" + } + }, + "id": "ReadOnly" + }, + "WriteResult": { + "description": "The result of applying a write.", + "type": "object", + "properties": { + "updateTime": { + "description": "The last update time of the document after applying the write. Not set\nafter a `delete`.\n\nIf the write did not actually change the document, this will be the\nprevious update_time.", + "format": "google-datetime", + "type": "string" + }, + "transformResults": { + "description": "The results of applying each DocumentTransform.FieldTransform, in the\nsame order.", + "type": "array", + "items": { + "$ref": "Value" + } + } + }, + "id": "WriteResult" + }, + "Value": { + "description": "A message that can hold any of the supported value types.", + "type": "object", + "properties": { + "doubleValue": { + "description": "A double value.", + "format": "double", + "type": "number" + }, + "timestampValue": { + "description": "A timestamp value.\n\nPrecise only to microseconds. When stored, any additional precision is\nrounded down.", + "format": "google-datetime", + "type": "string" + }, + "nullValue": { + "enum": [ + "NULL_VALUE" + ], + "description": "A null value.", + "type": "string", + "enumDescriptions": [ + "Null value." + ] + }, + "booleanValue": { + "description": "A boolean value.", + "type": "boolean" + }, + "mapValue": { + "description": "A map value.", + "$ref": "MapValue" + }, + "bytesValue": { + "description": "A bytes value.\n\nMust not exceed 1 MiB - 89 bytes.\nOnly the first 1,500 bytes are considered by queries.", + "format": "byte", + "type": "string" + }, + "geoPointValue": { + "$ref": "LatLng", + "description": "A geo point value representing a point on the surface of Earth." + }, + "integerValue": { + "type": "string", + "description": "An integer value.", + "format": "int64" + }, + "stringValue": { + "description": "A string value.\n\nThe string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.\nOnly the first 1,500 bytes of the UTF-8 representation are considered by\nqueries.", + "type": "string" + }, + "referenceValue": { + "description": "A reference to a document. For example:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.", + "type": "string" + }, + "arrayValue": { + "$ref": "ArrayValue", + "description": "An array value.\n\nCannot contain another array value." + } + }, + "id": "Value" + }, + "Write": { + "description": "A write on a document.", + "type": "object", + "properties": { + "transform": { + "$ref": "DocumentTransform", + "description": "Applies a tranformation to a document.\nAt most one `transform` per document is allowed in a given request.\nAn `update` cannot follow a `transform` on the same document in a given\nrequest." + }, + "delete": { + "description": "A document name to delete. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.", + "type": "string" + }, + "updateMask": { + "$ref": "DocumentMask", + "description": "The fields to update in this write.\n\nThis field can be set only when the operation is `update`.\nNone of the field paths in the mask may contain a reserved name.\nIf the document exists on the server and has fields not referenced in the\nmask, they are left unchanged.\nFields referenced in the mask, but not present in the input document, are\ndeleted from the document on the server.\nThe field paths in this mask must not contain a reserved field name." + }, + "currentDocument": { + "$ref": "Precondition", + "description": "An optional precondition on the document.\n\nThe write will fail if this is set and not met by the target document." + }, + "update": { + "description": "A document to write.", + "$ref": "Document" + } + }, + "id": "Write" + }, + "Cursor": { + "id": "Cursor", + "description": "A position in a query result set.", + "type": "object", + "properties": { + "values": { + "description": "The values that represent a position, in the order they appear in\nthe order by clause of a query.\n\nCan contain fewer values than specified in the order by clause.", + "type": "array", + "items": { + "$ref": "Value" + } + }, + "before": { + "description": "If the position is just before or just after the given values, relative\nto the sort order defined by the query.", + "type": "boolean" + } + } + }, + "ReadWrite": { + "description": "Options for a transaction that can be used to read and write documents.", + "type": "object", + "properties": { + "retryTransaction": { + "description": "An optional transaction to retry.", + "format": "byte", + "type": "string" + } + }, + "id": "ReadWrite" + }, + "BatchGetDocumentsRequest": { + "properties": { + "documents": { + "description": "The names of the documents to retrieve. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nThe request will fail if any of the document is not a child resource of the\ngiven `database`. Duplicate names will be elided.", + "type": "array", + "items": { + "type": "string" + } + }, + "readTime": { + "description": "Reads documents as they were at the given time.\nThis may not be older than 60 seconds.", + "format": "google-datetime", + "type": "string" + }, + "newTransaction": { + "description": "Starts a new transaction and reads the documents.\nDefaults to a read-only transaction.\nThe new transaction ID will be returned as the first response in the\nstream.", + "$ref": "TransactionOptions" + }, + "mask": { + "$ref": "DocumentMask", + "description": "The fields to return. If not set, returns all fields.\n\nIf a document has a field that is not present in this mask, that field will\nnot be returned in the response." + }, + "transaction": { + "description": "Reads documents in a transaction.", + "format": "byte", + "type": "string" + } + }, + "id": "BatchGetDocumentsRequest", + "description": "The request for Firestore.BatchGetDocuments.", + "type": "object" + }, + "QueryTarget": { + "type": "object", + "properties": { + "parent": { + "description": "The parent resource name. In the format:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nFor example:\n`projects/my-project/databases/my-database/documents` or\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`", + "type": "string" + }, + "structuredQuery": { + "$ref": "StructuredQuery", + "description": "A structured query." + } + }, + "id": "QueryTarget", + "description": "A target specified by a query." + }, + "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": { + "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": { + "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": "Operation" + }, + "DocumentChange": { + "description": "A Document has changed.\n\nMay be the result of multiple writes, including deletes, that\nultimately resulted in a new value for the Document.\n\nMultiple DocumentChange messages may be returned for the same logical\nchange, if multiple targets are affected.", + "type": "object", + "properties": { + "document": { + "description": "The new state of the Document.\n\nIf `mask` is set, contains only fields that were updated or added.", + "$ref": "Document" + }, + "targetIds": { + "description": "A set of target IDs of targets that match this document.", + "type": "array", + "items": { + "format": "int32", + "type": "integer" + } + }, + "removedTargetIds": { + "description": "A set of target IDs for targets that no longer match this document.", + "type": "array", + "items": { + "format": "int32", + "type": "integer" + } + } + }, + "id": "DocumentChange" + }, + "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.", + "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" + } + }, + "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": "Firestore", + "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" + } + } + } + }, + "rootUrl": "https://firestore.googleapis.com/", + "ownerDomain": "google.com", + "name": "firestore", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud Firestore API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "databases": { + "resources": { + "documents": { + "methods": { + "createDocument": { + "response": { + "$ref": "Document" + }, + "parameterOrder": [ + "parent", + "collectionId" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "The parent resource. For example:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/databases/[^/]+/documents/.+$", + "location": "path" + }, + "documentId": { + "description": "The client-assigned document ID to use for this document.\n\nOptional. If not specified, an ID will be assigned by the service.", + "type": "string", + "location": "query" + }, + "mask.fieldPaths": { + "description": "The list of field paths in the mask. See Document.fields for a field\npath syntax reference.", + "type": "string", + "repeated": true, + "location": "query" + }, + "collectionId": { + "description": "The collection ID, relative to `parent`, to list. For example: `chatrooms`.", + "required": true, + "type": "string", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{collectionId}", + "path": "v1beta1/{+parent}/{collectionId}", + "id": "firestore.projects.databases.documents.createDocument", + "request": { + "$ref": "Document" + }, + "description": "Creates a new document." + }, + "get": { + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}", + "path": "v1beta1/{+name}", + "id": "firestore.projects.databases.documents.get", + "description": "Gets a single document.", + "response": { + "$ref": "Document" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$", + "location": "path", + "description": "The resource name of the Document to get. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`." + }, + "mask.fieldPaths": { + "type": "string", + "repeated": true, + "location": "query", + "description": "The list of field paths in the mask. See Document.fields for a field\npath syntax reference." + }, + "readTime": { + "location": "query", + "description": "Reads the version of the document at the given time.\nThis may not be older than 60 seconds.", + "format": "google-datetime", + "type": "string" + }, + "transaction": { + "location": "query", + "description": "Reads the document in a transaction.", + "format": "byte", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ] + }, + "patch": { + "response": { + "$ref": "Document" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "currentDocument.exists": { + "location": "query", + "description": "When set to `true`, the target document must exist.\nWhen set to `false`, the target document must not exist.", + "type": "boolean" + }, + "name": { + "description": "The resource name of the document, for example\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$", + "location": "path" + }, + "updateMask.fieldPaths": { + "type": "string", + "repeated": true, + "location": "query", + "description": "The list of field paths in the mask. See Document.fields for a field\npath syntax reference." + }, + "mask.fieldPaths": { + "description": "The list of field paths in the mask. See Document.fields for a field\npath syntax reference.", + "type": "string", + "repeated": true, + "location": "query" + }, + "currentDocument.updateTime": { + "location": "query", + "description": "When set, the target document must exist and have been last updated at\nthat time.", + "format": "google-datetime", + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}", + "path": "v1beta1/{+name}", + "id": "firestore.projects.databases.documents.patch", + "description": "Updates or inserts a document.", + "request": { + "$ref": "Document" + } + }, + "listen": { + "response": { + "$ref": "ListenResponse" + }, + "parameterOrder": [ + "database" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "database": { + "pattern": "^projects/[^/]+/databases/[^/]+$", + "location": "path", + "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents:listen", + "path": "v1beta1/{+database}/documents:listen", + "id": "firestore.projects.databases.documents.listen", + "description": "Listens to changes.", + "request": { + "$ref": "ListenRequest" + } + }, + "delete": { + "description": "Deletes a document.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "currentDocument.exists": { + "description": "When set to `true`, the target document must exist.\nWhen set to `false`, the target document must not exist.", + "type": "boolean", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$", + "location": "path", + "description": "The resource name of the Document to delete. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.", + "required": true, + "type": "string" + }, + "currentDocument.updateTime": { + "type": "string", + "location": "query", + "description": "When set, the target document must exist and have been last updated at\nthat time.", + "format": "google-datetime" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}", + "path": "v1beta1/{+name}", + "id": "firestore.projects.databases.documents.delete" + }, + "listCollectionIds": { + "response": { + "$ref": "ListCollectionIdsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$", + "location": "path", + "description": "The parent document. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nFor example:\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}:listCollectionIds", + "path": "v1beta1/{+parent}:listCollectionIds", + "id": "firestore.projects.databases.documents.listCollectionIds", + "request": { + "$ref": "ListCollectionIdsRequest" + }, + "description": "Lists all the collection IDs underneath a document." + }, + "commit": { + "id": "firestore.projects.databases.documents.commit", + "path": "v1beta1/{+database}/documents:commit", + "request": { + "$ref": "CommitRequest" + }, + "description": "Commits a transaction, while optionally updating documents.", + "httpMethod": "POST", + "parameterOrder": [ + "database" + ], + "response": { + "$ref": "CommitResponse" + }, + "parameters": { + "database": { + "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/databases/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents:commit" + }, + "rollback": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "database": { + "location": "path", + "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/databases/[^/]+$" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents:rollback", + "path": "v1beta1/{+database}/documents:rollback", + "id": "firestore.projects.databases.documents.rollback", + "description": "Rolls back a transaction.", + "request": { + "$ref": "RollbackRequest" + }, + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "database" + ], + "httpMethod": "POST" + }, + "write": { + "path": "v1beta1/{+database}/documents:write", + "id": "firestore.projects.databases.documents.write", + "request": { + "$ref": "WriteRequest" + }, + "description": "Streams batches of document updates and deletes, in order.", + "response": { + "$ref": "WriteResponse" + }, + "parameterOrder": [ + "database" + ], + "httpMethod": "POST", + "parameters": { + "database": { + "pattern": "^projects/[^/]+/databases/[^/]+$", + "location": "path", + "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.\nThis is only required in the first message.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents:write" + }, + "batchGet": { + "response": { + "$ref": "BatchGetDocumentsResponse" + }, + "parameterOrder": [ + "database" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "database": { + "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/databases/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents:batchGet", + "path": "v1beta1/{+database}/documents:batchGet", + "id": "firestore.projects.databases.documents.batchGet", + "description": "Gets multiple documents.\n\nDocuments returned by this method are not guaranteed to be returned in the\nsame order that they were requested.", + "request": { + "$ref": "BatchGetDocumentsRequest" + } + }, + "beginTransaction": { + "request": { + "$ref": "BeginTransactionRequest" + }, + "description": "Starts a new transaction.", + "httpMethod": "POST", + "parameterOrder": [ + "database" + ], + "response": { + "$ref": "BeginTransactionResponse" + }, + "parameters": { + "database": { + "pattern": "^projects/[^/]+/databases/[^/]+$", + "location": "path", + "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents:beginTransaction", + "id": "firestore.projects.databases.documents.beginTransaction", + "path": "v1beta1/{+database}/documents:beginTransaction" + }, + "list": { + "parameters": { + "showMissing": { + "location": "query", + "description": "If the list should show missing documents. A missing document is a\ndocument that does not exist but has sub-documents. These documents will\nbe returned with a key but will not have fields, Document.create_time,\nor Document.update_time set.\n\nRequests with `show_missing` may not specify `where` or\n`order_by`.", + "type": "boolean" + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "The `next_page_token` value returned from a previous List request, if any." + }, + "mask.fieldPaths": { + "location": "query", + "description": "The list of field paths in the mask. See Document.fields for a field\npath syntax reference.", + "type": "string", + "repeated": true + }, + "pageSize": { + "description": "The maximum number of documents to return.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "collectionId": { + "location": "path", + "description": "The collection ID, relative to `parent`, to list. For example: `chatrooms`\nor `messages`.", + "required": true, + "type": "string" + }, + "transaction": { + "location": "query", + "description": "Reads documents in a transaction.", + "format": "byte", + "type": "string" + }, + "parent": { + "location": "path", + "description": "The parent resource name. In the format:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nFor example:\n`projects/my-project/databases/my-database/documents` or\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$" + }, + "readTime": { + "location": "query", + "description": "Reads documents as they were at the given time.\nThis may not be older than 60 seconds.", + "format": "google-datetime", + "type": "string" + }, + "orderBy": { + "location": "query", + "description": "The order to sort results by. For example: `priority desc, name`.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}/{collectionId}", + "path": "v1beta1/{+parent}/{collectionId}", + "id": "firestore.projects.databases.documents.list", + "description": "Lists documents.", + "response": { + "$ref": "ListDocumentsResponse" + }, + "parameterOrder": [ + "parent", + "collectionId" + ], + "httpMethod": "GET" + }, + "runQuery": { + "response": { + "$ref": "RunQueryResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "parent": { + "description": "The parent resource name. In the format:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nFor example:\n`projects/my-project/databases/my-database/documents` or\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}:runQuery", + "path": "v1beta1/{+parent}:runQuery", + "id": "firestore.projects.databases.documents.runQuery", + "description": "Runs a query.", + "request": { + "$ref": "RunQueryRequest" + } + } + } + }, + "indexes": { + "methods": { + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The index name. For example:\n`projects/{project_id}/databases/{database_id}/indexes/{index_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/databases/[^/]+/indexes/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/indexes/{indexesId}", + "id": "firestore.projects.databases.indexes.delete", + "path": "v1beta1/{+name}", + "description": "Deletes an index." + }, + "list": { + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/indexes", + "path": "v1beta1/{+parent}/indexes", + "id": "firestore.projects.databases.indexes.list", + "description": "Lists the indexes that match the specified filters.", + "response": { + "$ref": "ListIndexesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "The standard List page token.", + "type": "string" + }, + "pageSize": { + "description": "The standard List page size.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "parent": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/databases/[^/]+$", + "location": "path", + "description": "The database name. For example:\n`projects/{project_id}/databases/{database_id}`" + }, + "filter": { + "location": "query", + "type": "string" + } + } + }, + "get": { + "description": "Gets an index.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Index" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/databases/[^/]+/indexes/[^/]+$", + "location": "path", + "description": "The name of the index. For example:\n`projects/{project_id}/databases/{database_id}/indexes/{index_id}`", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/indexes/{indexesId}", + "id": "firestore.projects.databases.indexes.get", + "path": "v1beta1/{+name}" + }, + "create": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ], + "parameters": { + "parent": { + "description": "The name of the database this index will apply to. For example:\n`projects/{project_id}/databases/{database_id}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/databases/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1beta1/projects/{projectsId}/databases/{databasesId}/indexes", + "path": "v1beta1/{+parent}/indexes", + "id": "firestore.projects.databases.indexes.create", + "description": "Creates the specified index.\nA newly created index's initial state is `CREATING`. On completion of the\nreturned google.longrunning.Operation, the state will be `READY`.\nIf the index already exists, the call will return an `ALREADY_EXISTS`\nstatus.\n\nDuring creation, the process could result in an error, in which case the\nindex will move to the `ERROR` state. The process can be recovered by\nfixing the data that caused the error, removing the index with\ndelete, then re-creating the index with\ncreate.\n\nIndexes with a single field cannot be created.", + "request": { + "$ref": "Index" + } + } + } + } + } + } + } + } + }, + "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" + }, + "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": { + "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.", + "type": "boolean", + "default": "true" + }, + "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" + }, + "callback": { + "type": "string", + "location": "query", + "description": "JSONP" + }, + "$.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" + } + }, + "version": "v1beta1", + "baseUrl": "https://firestore.googleapis.com/", + "kind": "discovery#restDescription", + "description": "", + "servicePath": "", + "basePath": "", + "revision": "20171205", + "documentationLink": "https://cloud.google.com/firestore", + "id": "firestore:v1beta1" +} diff --git a/etc/api/fitness/v1/fitness-api.json b/etc/api/fitness/v1/fitness-api.json index abafde0461..55a163a1f0 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/Iezg2N-GRRgP6nxERqABDosZ2Tk\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/K1BxZmhfi_H1WlvW1SDsecgXAnE\"", "discoveryVersion": "v1", "id": "fitness:v1", "name": "fitness", "version": "v1", - "revision": "20170830", + "revision": "20170922", "title": "Fitness", "description": "Stores and accesses user data in the fitness store from apps on any platform.", "ownerDomain": "google.com", @@ -773,14 +773,14 @@ }, "deletedDataPoint": { "type": "array", - "description": "Data points that have been removed and will not be included in any other request for dataset contents.", + "description": "Deleted data points for the user. Note, for modifications this should be parsed before handling insertions.", "items": { "$ref": "DataPoint" } }, "insertedDataPoint": { "type": "array", - "description": "Data points listed.", + "description": "Inserted data points for the user.", "items": { "$ref": "DataPoint" } @@ -1223,7 +1223,7 @@ "id": "fitness.users.dataSources.dataPointChanges.list", "path": "{userId}/dataSources/{dataSourceId}/dataPointChanges", "httpMethod": "GET", - "description": "results ordered by descending end_time", + "description": "Queries for user's data point changes for a particular data source.", "parameters": { "dataSourceId": { "type": "string", @@ -1233,7 +1233,7 @@ }, "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.", + "description": "If specified, no more than this many data point changes will be included in the response.", "format": "int32", "location": "query" }, @@ -1244,7 +1244,7 @@ }, "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.", + "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" } diff --git a/etc/api/fusiontables/v1/fusiontables-api.json b/etc/api/fusiontables/v1/fusiontables-api.json index 51fc523e20..567fd7045b 100644 --- a/etc/api/fusiontables/v1/fusiontables-api.json +++ b/etc/api/fusiontables/v1/fusiontables-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/hYetPnobfGbbTDN2IyE3ld5RWXw\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/3n2JbinzwstAjIIKWdbUBbIIhU4\"", "discoveryVersion": "v1", "id": "fusiontables:v1", "name": "fusiontables", "version": "v1", - "revision": "20170413", + "revision": "20171117", "title": "Fusion Tables API", "description": "API for working with Fusion Tables data.", "ownerDomain": "google.com", diff --git a/etc/api/fusiontables/v2/fusiontables-api.json b/etc/api/fusiontables/v2/fusiontables-api.json index 5af149f15b..dfda240de4 100644 --- a/etc/api/fusiontables/v2/fusiontables-api.json +++ b/etc/api/fusiontables/v2/fusiontables-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/p_O8VQ1GgwnmLUmXhlZf5JsJdkk\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/_bC0Z0nYODnrZBcW4xrPKn1ZzhA\"", "discoveryVersion": "v1", "id": "fusiontables:v2", "name": "fusiontables", "version": "v2", - "revision": "20170413", + "revision": "20171117", "title": "Fusion Tables API", "description": "API for working with Fusion Tables data.", "ownerDomain": "google.com", @@ -1530,6 +1530,29 @@ "https://www.googleapis.com/auth/fusiontables" ] }, + "refetchSheet": { + "id": "fusiontables.table.refetchSheet", + "path": "tables/{tableId}/refetch", + "httpMethod": "POST", + "description": "Replaces rows of the table with the rows of the spreadsheet that is first imported from. Current rows remain visible until all replacement rows are ready.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table whose rows will be replaced from the spreadsheet.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, "replaceRows": { "id": "fusiontables.table.replaceRows", "path": "tables/{tableId}/replace", diff --git a/etc/api/games/v1/games-api.json b/etc/api/games/v1/games-api.json index 1f08d5d01f..1b755cd789 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/sGiRc3q5mYn-fpaf2dI4we-YLzY\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/VIpOSOSZ-zOkpd4WqabbGm_2r4U\"", "discoveryVersion": "v1", "id": "games:v1", "name": "games", "canonicalName": "Games", "version": "v1", - "revision": "20170925", + "revision": "20171207", "title": "Google Play Game Services API", "description": "The API for Google Play Game Services.", "ownerDomain": "google.com", diff --git a/etc/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json b/etc/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json index 0ac3b0faf1..a37050bf67 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/XlOtxoGRhUhIN8Wi-yr0KBHSEJA\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/3ak9sapH7H4IuKpkj-CidpvNYC0\"", "discoveryVersion": "v1", "id": "gamesConfiguration:v1configuration", "name": "gamesConfiguration", "canonicalName": "Games Configuration", "version": "v1configuration", - "revision": "20170925", + "revision": "20171207", "title": "Google Play Game Services Publishing API", "description": "The Publishing API for Google Play Game Services.", "ownerDomain": "google.com", diff --git a/etc/api/gamesmanagement/v1management/gamesmanagement-api.json b/etc/api/gamesmanagement/v1management/gamesmanagement-api.json index 1aa0322caf..9cb7f0000c 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/x6d9KrKEkZj5LYDdLx1wDF-XPvE\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/im3JBEgetvXOsiwP9uK_fBMdxGE\"", "discoveryVersion": "v1", "id": "gamesManagement:v1management", "name": "gamesManagement", "canonicalName": "Games Management", "version": "v1management", - "revision": "20170925", + "revision": "20171207", "title": "Google Play Game Services Management API", "description": "The Management API for Google Play Game Services.", "ownerDomain": "google.com", diff --git a/etc/api/genomics/v1/genomics-api.json b/etc/api/genomics/v1/genomics-api.json index 370061b329..affa214c93 100644 --- a/etc/api/genomics/v1/genomics-api.json +++ b/etc/api/genomics/v1/genomics-api.json @@ -1,14 +1,409 @@ { - "discoveryVersion": "v1", + "batchPath": "batch", + "id": "genomics:v1", + "documentationLink": "https://cloud.google.com/genomics", + "revision": "20171207", + "title": "Genomics API", "ownerName": "Google", + "discoveryVersion": "v1", "resources": { + "references": { + "methods": { + "get": { + "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", + "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}", + "path": "v1/references/{referenceId}", + "id": "genomics.references.get" + }, + "search": { + "response": { + "$ref": "SearchReferencesResponse" + }, + "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/references/search", + "path": "v1/references/search", + "id": "genomics.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)." + } + }, + "resources": { + "bases": { + "methods": { + "list": { + "response": { + "$ref": "ListBasesResponse" + }, + "parameterOrder": [ + "referenceId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "parameters": { + "pageToken": { + "type": "string", + "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." + }, + "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" + }, + "end": { + "type": "string", + "location": "query", + "description": "The end position (0-based, exclusive) of this query. Defaults to the length\nof this reference.", + "format": "int64" + } + }, + "flatPath": "v1/references/{referenceId}/bases", + "path": "v1/references/{referenceId}/bases", + "id": "genomics.references.bases.list", + "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": { + "list": { + "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)", + "response": { + "$ref": "ListDatasetsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "parameters": { + "pageToken": { + "type": "string", + "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." + }, + "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" + } + } + }, + "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": { + "required": true, + "type": "string", + "pattern": "^datasets/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which policy is being specified. Format is\n`datasets/\u003cdataset ID\u003e`." + } + }, + "flatPath": "v1/datasets/{datasetsId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "genomics.datasets.setIamPolicy" + }, + "create": { + "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" + }, + "response": { + "$ref": "Dataset" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": {}, + "flatPath": "v1/datasets", + "path": "v1/datasets", + "id": "genomics.datasets.create" + }, + "getIamPolicy": { + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "parameters": { + "resource": { + "required": true, + "type": "string", + "pattern": "^datasets/[^/]+$", + "location": "path", + "description": "REQUIRED: The resource for which policy is being specified. Format is\n`datasets/\u003cdataset ID\u003e`." + } + }, + "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)" + }, + "patch": { + "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.", + "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": { + "type": "string", + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "undelete": { + "httpMethod": "POST", + "parameterOrder": [ + "datasetId" + ], + "response": { + "$ref": "Dataset" + }, + "parameters": { + "datasetId": { + "required": true, + "type": "string", + "location": "path", + "description": "The ID of the dataset to be undeleted." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1/datasets/{datasetId}:undelete", + "id": "genomics.datasets.undelete", + "path": "v1/datasets/{datasetId}:undelete", + "request": { + "$ref": "UndeleteDatasetRequest" + }, + "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." + }, + "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)", + "response": { + "$ref": "Dataset" + }, + "parameterOrder": [ + "datasetId" + ], + "httpMethod": "GET", + "parameters": { + "datasetId": { + "required": true, + "type": "string", + "location": "path", + "description": "The ID of the dataset." + } + }, + "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}", + "path": "v1/datasets/{datasetId}", + "id": "genomics.datasets.get" + }, + "testIamPermissions": { + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "location": "path", + "description": "REQUIRED: The resource for which policy is being specified. Format is\n`datasets/\u003cdataset ID\u003e`.", + "required": true, + "type": "string", + "pattern": "^datasets/[^/]+$" + } + }, + "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", + "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": { + "flatPath": "v1/datasets/{datasetId}", + "path": "v1/datasets/{datasetId}", + "id": "genomics.datasets.delete", + "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)", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "datasetId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "datasetId": { + "required": true, + "type": "string", + "location": "path", + "description": "The ID of the dataset to be deleted." + } + } + } + } + }, "annotations": { "methods": { + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "annotationId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "annotationId": { + "required": true, + "type": "string", + "location": "path", + "description": "The ID of the annotation to be deleted." + } + }, + "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." + }, "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.", + "flatPath": "v1/annotations", + "id": "genomics.annotations.create", + "path": "v1/annotations", "request": { "$ref": "Annotation" }, + "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.", "httpMethod": "POST", "parameterOrder": [], "response": { @@ -18,31 +413,33 @@ "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": { + "flatPath": "v1/annotations:batchCreate", + "id": "genomics.annotations.batchCreate", + "path": "v1/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.", + "httpMethod": "POST", + "parameterOrder": [], "response": { "$ref": "BatchCreateAnnotationsResponse" }, - "parameterOrder": [], - "httpMethod": "POST", + "parameters": {}, "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": { + "response": { + "$ref": "SearchAnnotationsResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", @@ -52,18 +449,12 @@ "flatPath": "v1/annotations/search", "path": "v1/annotations/search", "id": "genomics.annotations.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" - }, - "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" }, @@ -73,10 +464,10 @@ "httpMethod": "GET", "parameters": { "annotationId": { - "location": "path", - "description": "The ID of the annotation to be retrieved.", + "required": true, "type": "string", - "required": true + "location": "path", + "description": "The ID of the annotation to be retrieved." } }, "scopes": [ @@ -85,22 +476,30 @@ "https://www.googleapis.com/auth/genomics.readonly" ], "flatPath": "v1/annotations/{annotationId}", + "path": "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." }, "update": { + "response": { + "$ref": "Annotation" + }, + "parameterOrder": [ + "annotationId" + ], + "httpMethod": "PUT", "parameters": { "updateMask": { - "format": "google-fieldmask", + "location": "query", "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" + "format": "google-fieldmask", + "type": "string" }, "annotationId": { - "description": "The ID of the annotation to be updated.", - "type": "string", "required": true, - "location": "path" + "type": "string", + "location": "path", + "description": "The ID of the annotation to be updated." } }, "scopes": [ @@ -110,47 +509,88 @@ "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", - "parameterOrder": [ - "annotationId" - ], - "response": { - "$ref": "Annotation" - } - }, - "delete": { - "httpMethod": "DELETE", - "parameterOrder": [ - "annotationId" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": { - "annotationId": { - "location": "path", - "description": "The ID of the annotation to be deleted.", - "type": "string", - "required": true - } - }, - "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." + "description": "Updates an annotation. Caller must have\nWRITE permission for the associated dataset." } } }, "variantsets": { "methods": { + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "variantSetId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "variantSetId": { + "required": true, + "type": "string", + "location": "path", + "description": "The ID of the variant set to be deleted." + } + }, + "flatPath": "v1/variantsets/{variantSetId}", + "path": "v1/variantsets/{variantSetId}", + "id": "genomics.variantsets.delete", + "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": { + "response": { + "$ref": "VariantSet" + }, + "parameterOrder": [], + "httpMethod": "POST", + "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", + "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.", + "request": { + "$ref": "VariantSet" + } + }, + "export": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "variantSetId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "variantSetId": { + "required": true, + "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." + } + }, + "flatPath": "v1/variantsets/{variantSetId}:export", + "path": "v1/variantsets/{variantSetId}:export", + "id": "genomics.variantsets.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)", + "request": { + "$ref": "ExportVariantSetRequest" + } + }, "search": { "response": { "$ref": "SearchVariantSetsResponse" @@ -164,25 +604,25 @@ ], "parameters": {}, "flatPath": "v1/variantsets/search", - "id": "genomics.variantsets.search", "path": "v1/variantsets/search", + "id": "genomics.variantsets.search", + "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).", "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": { + "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)", "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" }, + "parameterOrder": [ + "variantSetId" + ], + "httpMethod": "PATCH", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" @@ -190,15 +630,15 @@ "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.", + "format": "google-fieldmask", "type": "string" }, "variantSetId": { "location": "path", "description": "The ID of the variant to be updated (must already exist).", - "type": "string", - "required": true + "required": true, + "type": "string" } }, "flatPath": "v1/variantsets/{variantSetId}", @@ -206,6 +646,17 @@ "id": "genomics.variantsets.patch" }, "get": { + "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)", + "response": { + "$ref": "VariantSet" + }, + "parameterOrder": [ + "variantSetId" + ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", @@ -213,101 +664,59 @@ ], "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": { + "type": "string", "location": "path", - "description": "The ID of the variant set to be deleted.", - "type": "string", - "required": true + "description": "Required. The ID of the variant set." } - }, - "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": { - "path": "v1/variantsets/{variantSetId}:export", - "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" - ], - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/bigquery", - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": { - "variantSetId": { - "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", - "required": true, - "location": "path" - } - }, - "flatPath": "v1/variantsets/{variantSetId}:export" } } }, "operations": { "methods": { + "list": { + "flatPath": "v1/operations", + "path": "v1/{+name}", + "id": "genomics.operations.list", + "description": "Lists operations that match the specified filter in the request.", + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation's parent resource.", + "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": { + "type": "string", + "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`" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, "get": { "response": { "$ref": "Operation" @@ -322,99 +731,83 @@ ], "parameters": { "name": { + "required": true, + "type": "string", "pattern": "^operations/.+$", "location": "path", - "description": "The name of the operation resource.", - "type": "string", - "required": true + "description": "The name of the operation resource." } }, "flatPath": "v1/operations/{operationsId}", - "id": "genomics.operations.get", "path": "v1/{+name}", + "id": "genomics.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": { - "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" + "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." + } + }, + "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" + } } } }, "referencesets": { "methods": { + "get": { + "response": { + "$ref": "ReferenceSet" + }, + "parameterOrder": [ + "referenceSetId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ], + "parameters": { + "referenceSetId": { + "required": true, + "type": "string", + "location": "path", + "description": "The ID of the reference set." + } + }, + "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)." + }, "search": { - "httpMethod": "POST", - "parameterOrder": [], "response": { "$ref": "SearchReferenceSetsResponse" }, + "parameterOrder": [], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", @@ -424,48 +817,175 @@ "flatPath": "v1/referencesets/search", "path": "v1/referencesets/search", "id": "genomics.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" + } + } + } + }, + "callsets": { + "methods": { + "patch": { + "request": { + "$ref": "CallSet" }, - "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", + "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.", "response": { - "$ref": "ReferenceSet" + "$ref": "CallSet" }, "parameterOrder": [ - "referenceSetId" + "callSetId" ], + "httpMethod": "PATCH", "parameters": { - "referenceSetId": { - "description": "The ID of the reference set.", + "updateMask": { "type": "string", + "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" + }, + "callSetId": { "required": true, - "location": "path" + "type": "string", + "location": "path", + "description": "The ID of the call set to be updated." } }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1/callsets/{callSetId}", + "path": "v1/callsets/{callSetId}", + "id": "genomics.callsets.patch" + }, + "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)", + "response": { + "$ref": "CallSet" + }, + "parameterOrder": [ + "callSetId" + ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics", "https://www.googleapis.com/auth/genomics.readonly" ], - "flatPath": "v1/referencesets/{referenceSetId}" + "parameters": { + "callSetId": { + "location": "path", + "description": "The ID of the call set.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/callsets/{callSetId}", + "path": "v1/callsets/{callSetId}", + "id": "genomics.callsets.get" + }, + "create": { + "response": { + "$ref": "CallSet" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": {}, + "flatPath": "v1/callsets", + "path": "v1/callsets", + "id": "genomics.callsets.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" + } + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "callSetId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "callSetId": { + "location": "path", + "description": "The ID of the call set to be deleted.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/callsets/{callSetId}", + "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)" + }, + "search": { + "response": { + "$ref": "SearchCallSetsResponse" + }, + "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/callsets/search", + "path": "v1/callsets/search", + "id": "genomics.callsets.search", + "request": { + "$ref": "SearchCallSetsRequest" + }, + "description": "Gets a list of call sets matching the criteria.\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\nImplements\n[GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178)." + } + } + }, + "reads": { + "methods": { + "search": { + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "SearchReadsResponse" + }, + "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", + "id": "genomics.reads.search", + "path": "v1/reads/search", + "request": { + "$ref": "SearchReadsRequest" + }, + "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)." } } }, "readgroupsets": { "methods": { "export": { - "path": "v1/readgroupsets/{readGroupSetId}:export", + "flatPath": "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.", + "path": "v1/readgroupsets/{readGroupSetId}: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.", "httpMethod": "POST", "parameterOrder": [ "readGroupSetId" @@ -477,18 +997,21 @@ "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 + "required": true, + "type": "string" } }, "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": { + "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).", + "request": { + "$ref": "SearchReadGroupSetsRequest" + }, "response": { "$ref": "SearchReadGroupSetsResponse" }, @@ -501,80 +1024,70 @@ ], "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}" + "id": "genomics.readgroupsets.search" }, "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.", + "flatPath": "v1/readgroupsets/{readGroupSetId}", + "id": "genomics.readgroupsets.patch", + "path": "v1/readgroupsets/{readGroupSetId}", "request": { "$ref": "ReadGroupSet" }, - "response": { - "$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.", + "httpMethod": "PATCH", "parameterOrder": [ "readGroupSetId" ], - "httpMethod": "PATCH", + "response": { + "$ref": "ReadGroupSet" + }, "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 + "required": true, + "type": "string" }, "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.", + "format": "google-fieldmask", "type": "string" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" + ] + }, + "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)", + "response": { + "$ref": "ReadGroupSet" + }, + "parameterOrder": [ + "readGroupSetId" ], + "httpMethod": "GET", + "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, + "type": "string", + "location": "path", + "description": "The ID of the read group set." + } + }, "flatPath": "v1/readgroupsets/{readGroupSetId}", - "id": "genomics.readgroupsets.patch", - "path": "v1/readgroupsets/{readGroupSetId}" + "path": "v1/readgroupsets/{readGroupSetId}", + "id": "genomics.readgroupsets.get" }, "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" }, @@ -586,28 +1099,34 @@ "https://www.googleapis.com/auth/genomics" ], "parameters": {}, - "flatPath": "v1/readgroupsets:import" + "flatPath": "v1/readgroupsets:import", + "path": "v1/readgroupsets:import", + "id": "genomics.readgroupsets.import", + "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)", + "request": { + "$ref": "ImportReadGroupSetsRequest" + } }, "delete": { + "httpMethod": "DELETE", "response": { "$ref": "Empty" }, - "httpMethod": "DELETE", "parameterOrder": [ "readGroupSetId" ], + "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" ], - "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}", @@ -618,369 +1137,153 @@ "coveragebuckets": { "methods": { "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.", + "response": { + "$ref": "ListCoverageBucketsResponse" + }, + "parameterOrder": [ + "readGroupSetId" + ], + "httpMethod": "GET", "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": { + "type": "string", "location": "query", - "description": "The name of the reference to query, within the reference set associated\nwith this query. Optional.", - "type": "string" + "description": "The name of the reference to query, within the reference set associated\nwith this query. Optional." }, "end": { + "type": "string", "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.", + "format": "int64" + }, + "pageToken": { + "type": "string", + "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." + }, + "pageSize": { + "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" + }, + "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", "type": "string" + }, + "targetBucketWidth": { + "type": "string", + "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" + }, + "readGroupSetId": { + "required": true, + "type": "string", + "location": "path", + "description": "Required. The ID of the read group set over which coverage is requested." } }, "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" - ] + "id": "genomics.readgroupsets.coveragebuckets.list" } } } } }, - "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": { - "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" - ], - "response": { - "$ref": "Empty" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": { - "callSetId": { - "location": "path", - "description": "The ID of the call set to be deleted.", - "type": "string", - "required": true - } - }, - "flatPath": "v1/callsets/{callSetId}" - }, - "search": { - "request": { - "$ref": "SearchCallSetsRequest" - }, - "description": "Gets a list of call sets matching the criteria.\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\nImplements\n[GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178).", - "response": { - "$ref": "SearchCallSetsResponse" - }, - "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/callsets/search", - "id": "genomics.callsets.search", - "path": "v1/callsets/search" - }, - "get": { - "httpMethod": "GET", - "parameterOrder": [ - "callSetId" - ], - "response": { - "$ref": "CallSet" - }, - "parameters": { - "callSetId": { - "location": "path", - "description": "The ID of the call 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/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", - "request": { - "$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": "AnnotationSet" - }, - "parameterOrder": [ - "annotationSetId" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics", - "https://www.googleapis.com/auth/genomics.readonly" - ], - "parameters": { - "annotationSetId": { - "description": "The ID of the annotation set to be retrieved.", - "type": "string", - "required": true, - "location": "path" - } - }, - "flatPath": "v1/annotationsets/{annotationSetId}" - }, - "update": { - "response": { - "$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" - ], - "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": "AnnotationSet" - } - } - } - }, "variants": { "methods": { - "create": { + "merge": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ], "parameters": {}, - "flatPath": "v1/variants", - "id": "genomics.variants.create", - "path": "v1/variants", + "flatPath": "v1/variants:merge", + "path": "v1/variants:merge", + "id": "genomics.variants.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" + } + }, + "import": { + "flatPath": "v1/variants:import", + "path": "v1/variants:import", + "id": "genomics.variants.import", + "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.", + "request": { + "$ref": "ImportVariantsRequest" + }, + "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": {} + }, + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "variantId" + ], + "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}", + "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)" + }, + "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)", + "httpMethod": "POST", + "parameterOrder": [], "response": { "$ref": "Variant" }, - "parameterOrder": [], - "httpMethod": "POST" + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1/variants", + "id": "genomics.variants.create", + "path": "v1/variants" }, "search": { "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).", @@ -992,510 +1295,212 @@ }, "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/variants/search", - "id": "genomics.variants.search", - "path": "v1/variants/search" + "path": "v1/variants/search", + "id": "genomics.variants.search" }, "patch": { + "flatPath": "v1/variants/{variantId}", + "path": "v1/variants/{variantId}", + "id": "genomics.variants.patch", + "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" }, - "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": [ - "variantId" - ], "response": { "$ref": "Variant" }, + "parameterOrder": [ + "variantId" + ], + "httpMethod": "PATCH", "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.", + "required": true, + "type": "string" + }, + "updateMask": { "type": "string", - "required": true + "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" } - }, - "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" - ], + "httpMethod": "GET", "parameters": { "variantId": { + "location": "path", "description": "The ID of the variant.", - "type": "string", "required": true, - "location": "path" - } - }, - "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" - ], - "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": { - "bases": { - "methods": { - "list": { - "response": { - "$ref": "ListBasesResponse" - }, - "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": { - "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" - }, - "start": { - "location": "query", - "format": "int64", - "description": "The start position (0-based) of this query. Defaults to 0.", - "type": "string" - }, - "referenceId": { - "description": "The ID of the reference.", - "type": "string", - "required": true, - "location": "path" - }, - "end": { - "location": "query", - "format": "int64", - "description": "The end position (0-based, exclusive) of this query. Defaults to the length\nof this reference.", - "type": "string" - } - }, - "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" - ], + "flatPath": "v1/variants/{variantId}", + "path": "v1/variants/{variantId}", + "id": "genomics.variants.get" + } + } + }, + "annotationsets": { + "methods": { + "delete": { "response": { - "$ref": "Dataset" - }, - "parameters": { - "datasetId": { - "description": "The ID of the dataset to be undeleted.", - "type": "string", - "required": true, - "location": "path" - } + "$ref": "Empty" }, + "parameterOrder": [ + "annotationSetId" + ], + "httpMethod": "DELETE", "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.", + "parameters": { + "annotationSetId": { + "location": "path", + "description": "The ID of the annotation set to be deleted.", + "required": true, + "type": "string" + } + }, + "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": { + "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": "UndeleteDatasetRequest" + "$ref": "SearchAnnotationSetsRequest" + }, + "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" + }, + "get": { + "response": { + "$ref": "AnnotationSet" + }, + "parameterOrder": [ + "annotationSetId" + ], + "httpMethod": "GET", + "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}", + "path": "v1/annotationsets/{annotationSetId}", + "id": "genomics.annotationsets.get", + "description": "Gets an annotation set. Caller must have READ permission for\nthe associated dataset." + }, + "update": { + "response": { + "$ref": "AnnotationSet" + }, + "parameterOrder": [ + "annotationSetId" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "parameters": { + "updateMask": { + "type": "string", + "location": "query", + "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" + }, + "annotationSetId": { + "required": true, + "type": "string", + "location": "path", + "description": "The ID of the annotation set to be updated." + } + }, + "flatPath": "v1/annotationsets/{annotationSetId}", + "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" } + }, + "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)." } } } }, "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.", - "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." }, "access_token": { "location": "query", @@ -1503,46 +1508,46 @@ "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" + "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": { - "description": "OAuth 2.0 token for the current user.", - "type": "string", - "location": "query" + "type": "boolean", + "default": "true" }, "bearer_token": { + "type": "string", "location": "query", - "description": "OAuth bearer token.", + "description": "OAuth bearer token." + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", "type": "string" }, "upload_protocol": { + "type": "string", "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." }, "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" + "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", - "location": "query" + "type": "string" + }, + "fields": { + "location": "query", + "description": "Selector specifying which fields to include in a partial response.", + "type": "string" }, "callback": { "location": "query", @@ -1550,19 +1555,20 @@ "type": "string" }, "$.xgafv": { + "location": "query", + "enum": [ + "1", + "2" + ], "description": "V1 error format.", "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" ] }, "alt": { + "location": "query", "description": "Data format for response.", "default": "json", "enum": [ @@ -1575,119 +1581,53 @@ "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": { - "Program": { - "type": "object", - "properties": { - "version": { - "description": "The version of the program run.", - "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" - }, - "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": "Program" - }, - "ComputeEngine": { - "id": "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" - }, - "instanceName": { - "description": "The instance on which the operation is running.", - "type": "string" - }, - "zone": { - "description": "The availability zone in which the instance resides.", - "type": "string" - } - } - }, - "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": { - "meanCoverage": { - "format": "float", - "description": "The average number of reads which are aligned to each individual\nreference base in this bucket.", - "type": "number" - }, - "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 id used by the source of this data.", "type": "string" + }, + "sourceName": { + "description": "The name of the source of this data.", + "type": "string" } - } + }, + "id": "ExternalId" + }, + "SearchVariantSetsRequest": { + "description": "The search variant sets request.", + "type": "object", + "properties": { + "pageToken": { + "type": "string", + "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." + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024.", + "format": "int32" + }, + "datasetIds": { + "description": "Exactly one dataset ID must be provided here. Only variant sets which\nbelong to this dataset will be returned.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "SearchVariantSetsRequest" }, "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" - }, - "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": { + "type": "string", "enumDescriptions": [ "", "", @@ -1704,45 +1644,48 @@ "CHARACTER", "STRING" ], - "description": "The type of data. Possible types include: Integer, Float,\nFlag, Character, and String.", - "type": "string" + "description": "The type of data. Possible types include: Integer, Float,\nFlag, Character, and String." }, "info": { + "type": "object", "additionalProperties": { + "type": "array", "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" + "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)." + }, + "value": { + "type": "string", + "description": "The value field for simple metadata" + }, + "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": { + "type": "string", + "description": "The number of values that can be included in a field described by this\nmetadata." + }, + "key": { + "description": "The top-level key.", + "type": "string" + }, + "description": { + "type": "string", + "description": "A textual description of this metadata." } - } + }, + "id": "VariantSetMetadata" }, "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" - }, - "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.", + "format": "int32", "type": "integer" }, "sourceUri": { @@ -1750,95 +1693,87 @@ "type": "string" }, "name": { - "description": "The name of this reference, for example `22`.", - "type": "string" + "type": "string", + "description": "The name of this reference, for example `22`." }, "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", + "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." + }, + "id": { + "type": "string", + "description": "The server-generated reference ID, unique across all references." + }, + "length": { + "description": "The length of this reference's sequence.", + "format": "int64", "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.", + }, + "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" - }, - "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" + "id": "Reference" }, "SearchReferenceSetsRequest": { "type": "object", "properties": { - "md5checksums": { - "description": "If present, return reference sets for which the\nmd5checksum matches exactly.", + "accessions": { + "type": "array", "items": { "type": "string" }, - "type": "array" + "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`." }, "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`.", + "pageSize": { + "type": "integer", + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024. The maximum value is 4096.", + "format": "int32" + }, + "assemblyId": { + "type": "string", + "description": "If present, return reference sets for which a substring of their\n`assemblyId` matches this string (case insensitive)." + }, + "md5checksums": { + "type": "array", "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" + "description": "If present, return reference sets for which the\nmd5checksum matches exactly." } }, "id": "SearchReferenceSetsRequest" }, "SetIamPolicyRequest": { - "id": "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", + "description": "Request message for `SetIamPolicy` method." }, "MergeVariantsRequest": { "type": "object", "properties": { "variants": { "description": "The variants to be merged with existing variants.", + "type": "array", "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", @@ -1846,7 +1781,9 @@ "MOVE_TO_CALLS" ], "type": "string" - } + }, + "description": "A mapping between info field keys and the InfoMergeOperations to\nbe performed on them.", + "type": "object" }, "variantSetId": { "description": "The destination variant set.", @@ -1855,77 +1792,97 @@ }, "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", + "BatchCreateAnnotationsRequest": { "type": "object", "properties": { + "requestId": { + "type": "string", + "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." + }, + "annotations": { + "type": "array", + "items": { + "$ref": "Annotation" + }, + "description": "The annotations to be created. At most 4096 can be specified in a single\nrequest." + } + }, + "id": "BatchCreateAnnotationsRequest" + }, + "Read": { + "type": "object", + "properties": { + "fragmentName": { + "type": "string", + "description": "The fragment name. Equivalent to QNAME (query template name) in SAM." + }, "readGroupSetId": { - "description": "The ID of the read group set this read belongs to. A read belongs to\nexactly one read group set.", - "type": "string" + "type": "string", + "description": "The ID of the read group set this read belongs to. A read belongs to\nexactly one read group set." }, "duplicateFragment": { "description": "The fragment is a PCR or optical duplicate (SAM flag 0x400).", "type": "boolean" }, "readNumber": { - "format": "int32", + "type": "integer", "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" + "format": "int32" }, "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" + "type": "string", + "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)." + }, + "alignedSequence": { + "type": "string", + "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." + }, + "info": { + "type": "object", + "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)." }, "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" - } + "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" }, - "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", + "type": "integer", "description": "The observed length of the fragment, equivalent to TLEN in SAM.", - "type": "integer" + "format": "int32" }, "failedVendorQualityChecks": { - "description": "Whether this read did not pass filters, such as platform or vendor quality\ncontrols (SAM flag 0x200).", - "type": "boolean" + "type": "boolean", + "description": "Whether this read did not pass filters, such as platform or vendor quality\ncontrols (SAM flag 0x200)." }, "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" - }, - "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).", + "format": "int32", "type": "integer" }, "id": { @@ -1935,37 +1892,74 @@ "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" + "id": "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" }, - "BatchCreateAnnotationsRequest": { - "id": "BatchCreateAnnotationsRequest", + "ReferenceSet": { "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" + "md5checksum": { + "type": "string", + "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." }, - "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.", + "assemblyId": { + "description": "Public id of this reference set, such as `GRCh37`.", "type": "string" + }, + "id": { + "type": "string", + "description": "The server-generated reference set ID, unique across all reference sets." + }, + "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": { + "type": "string", + "description": "Free text description of this reference set." + }, + "sourceUri": { + "description": "The URI from which the references were obtained.", + "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" + }, + "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": { - "id": "CigarUnit", "description": "A single CIGAR operation.", "type": "object", "properties": { "operation": { + "enum": [ + "OPERATION_UNSPECIFIED", + "ALIGNMENT_MATCH", + "INSERT", + "DELETE", + "SKIP", + "CLIP_SOFT", + "CLIP_HARD", + "PAD", + "SEQUENCE_MATCH", + "SEQUENCE_MISMATCH" + ], "type": "string", "enumDescriptions": [ "", @@ -1978,18 +1972,6 @@ "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": { @@ -1997,82 +1979,14 @@ "type": "string" }, "operationLength": { - "format": "int64", + "type": "string", "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" + "format": "int64" } }, - "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" + "id": "CigarUnit" }, "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": { @@ -2080,21 +1994,10 @@ "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": "string", + "description": "The ID of the reference set that defines the coordinate space for this\nset's annotations." }, "type": { - "description": "The type of annotations contained within this set.", "type": "string", "enumDescriptions": [ "", @@ -2109,11 +2012,22 @@ "VARIANT", "GENE", "TRANSCRIPT" - ] + ], + "description": "The type of annotations contained within this set." + }, + "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" }, "id": { - "description": "The server-generated annotation set ID, unique across all annotation sets.", - "type": "string" + "type": "string", + "description": "The server-generated annotation set ID, unique across all annotation sets." }, "datasetId": { "description": "The dataset to which this annotation set belongs.", @@ -2124,217 +2038,267 @@ "type": "string" } }, - "id": "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'." + }, + "Transcript": { + "type": "object", + "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": { + "type": "string", + "description": "The annotation ID of the gene from which this transcript is transcribed." + } + }, + "id": "Transcript", + "description": "A transcript represents the assertion that a particular region of the\nreference genome may be transcribed as RNA." }, "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", + "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." + }, + "instrumentModel": { + "type": "string", + "description": "The instrument model used as part of this experiment. This maps to\nsequencing technology in the SAM spec." + }, + "sequencingCenter": { + "description": "The sequencing center used as part of this experiment.", "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.", + "type": "array", "items": { "$ref": "Dataset" }, - "type": "array" + "description": "The list of matching Datasets." + }, + "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": { "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", "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" + "id": "TestIamPermissionsRequest", + "description": "Request message for `TestIamPermissions` method." }, "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.", + "format": "int64", + "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", "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.", + "format": "int32", "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)", + "ExportReadGroupSetRequest": { + "description": "The read group set export request.", "type": "object", "properties": { + "projectId": { + "description": "Required. The Google Cloud project ID that owns this\nexport. The caller must have WRITE access to this project.", + "type": "string" + }, + "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", + "items": { + "type": "string" + } + } + }, + "id": "ExportReadGroupSetRequest" + }, + "CallSet": { + "type": "object", + "properties": { + "sampleId": { + "type": "string", + "description": "The sample ID this call set corresponds to." + }, "name": { "description": "The call set name.", "type": "string" }, "info": { + "type": "object", "additionalProperties": { + "type": "array", "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" + "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)." }, "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" }, - "type": "array" + "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)." }, "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.", + "format": "int64", "type": "string" } }, - "id": "CallSet" + "id": "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)" }, "SearchAnnotationSetsResponse": { - "id": "SearchAnnotationSetsResponse", "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" - }, - "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": "SearchAnnotationSetsResponse" }, "ImportVariantsRequest": { - "description": "The variant data import request.", "type": "object", "properties": { + "infoMergeConfig": { + "type": "object", + "additionalProperties": { + "enum": [ + "INFO_MERGE_OPERATION_UNSPECIFIED", + "IGNORE_NEW", + "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." + }, + "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\".", + "type": "boolean" + }, "format": { + "enum": [ + "FORMAT_UNSPECIFIED", + "FORMAT_VCF", + "FORMAT_COMPLETE_GENOMICS" + ], "description": "The format of the variant data being imported. If unspecified, defaults to\nto `VCF`.", "type": "string", "enumDescriptions": [ "", "VCF (Variant Call Format). The VCF files may be gzip compressed. gVCF is\nalso supported. Disclaimer: gzip VCF imports are currently much slower\nthan equivalent uncompressed VCF imports. For this reason, uncompressed\nVCF is currently recommended for imports with more than 1GB combined\nuncompressed size, or for time sensitive imports.", "Complete Genomics masterVarBeta format. The masterVarBeta files may\nbe bzip2 compressed." - ], - "enum": [ - "FORMAT_UNSPECIFIED", - "FORMAT_VCF", - "FORMAT_COMPLETE_GENOMICS" ] + } + }, + "id": "ImportVariantsRequest", + "description": "The variant data import request." + }, + "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" }, - "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" + "bucketWidth": { + "type": "string", + "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" }, - "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.", + "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" + } + } + }, + "id": "ListCoverageBucketsResponse" + }, + "VariantAnnotation": { + "type": "object", + "properties": { + "transcriptIds": { + "type": "array", "items": { "type": "string" }, - "type": "array" + "description": "Google annotation IDs of the transcripts affected by this variant. These\nshould be provided when the variant is created." }, - "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": [ "", @@ -2355,17 +2319,34 @@ "SNP", "STRUCTURAL", "CNV" - ] + ], + "description": "Type has been adapted from ClinVar's list of variant types." }, "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" + "type": "string", + "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." }, "geneId": { - "description": "Google annotation ID of the gene affected by this variant. This should\nbe provided when the variant is created.", - "type": "string" + "type": "string", + "description": "Google annotation ID of the gene affected by this variant. This should\nbe provided when the variant is created." }, "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": [ @@ -2383,32 +2364,27 @@ "", "", "`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": { "description": "The set of conditions associated with this variant.\nA condition describes the way a variant influences human health.", + "type": "array", "items": { "$ref": "ClinicalCondition" - }, - "type": "array" + } }, "effect": { + "enum": [ + "EFFECT_UNSPECIFIED", + "EFFECT_OTHER", + "FRAMESHIFT", + "FRAME_PRESERVING_INDEL", + "SYNONYMOUS_SNP", + "NONSYNONYMOUS_SNP", + "STOP_GAIN", + "STOP_LOSS", + "SPLICE_SITE_DISRUPTION" + ], "description": "Effect of the variant on the coding sequence.", "type": "string", "enumDescriptions": [ @@ -2421,187 +2397,125 @@ "`STOP_GAIN` indicates a mutation that leads to the creation\nof a stop codon at the variant site. Frameshift mutations creating\ndownstream stop codons do not count as `STOP_GAIN`.", "`STOP_LOSS` indicates a mutation that eliminates a\nstop codon at the variant site.", "`SPLICE_SITE_DISRUPTION` indicates that this variant is\nfound in a splice site for the associated transcript, and alters the\nnormal splicing pattern." - ], - "enum": [ - "EFFECT_UNSPECIFIED", - "EFFECT_OTHER", - "FRAMESHIFT", - "FRAME_PRESERVING_INDEL", - "SYNONYMOUS_SNP", - "NONSYNONYMOUS_SNP", - "STOP_GAIN", - "STOP_LOSS", - "SPLICE_SITE_DISRUPTION" ] - }, - "transcriptIds": { - "description": "Google annotation IDs of the transcripts affected by this variant. These\nshould be provided when the variant is created.", - "items": { - "type": "string" - }, - "type": "array" - } - } - }, - "ListCoverageBucketsResponse": { - "type": "object", - "properties": { - "bucketWidth": { - "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`).", - "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.", - "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" + "id": "VariantAnnotation" }, "ExportVariantSetRequest": { "description": "The variant data export request.", "type": "object", "properties": { - "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" - }, "format": { + "enum": [ + "FORMAT_UNSPECIFIED", + "FORMAT_BIGQUERY" + ], "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.", + "bigqueryDataset": { + "type": "string", + "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\"." + }, + "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" - }, - "type": "array" + } + }, + "projectId": { + "type": "string", + "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." } }, "id": "ExportVariantSetRequest" }, "SearchAnnotationsRequest": { - "id": "SearchAnnotationsRequest", "type": "object", "properties": { - "referenceId": { - "description": "The ID of the reference to query.", - "type": "string" - }, - "end": { - "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": { - "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 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.", + "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" - }, - "type": "array" + } }, "referenceName": { - "description": "The name of the reference to query, within the reference set associated\nwith this query.", - "type": "string" + "type": "string", + "description": "The name of the reference to query, within the reference set associated\nwith this query." + }, + "referenceId": { + "type": "string", + "description": "The ID of the reference to query." + }, + "end": { + "type": "string", + "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" + }, + "pageToken": { + "type": "string", + "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." + }, + "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", + "type": "integer" } - } + }, + "id": "SearchAnnotationsRequest" }, "OperationEvent": { "description": "An event that occurred during an Operation.", "type": "object", "properties": { - "startTime": { + "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" - }, - "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": { - "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" - }, "start": { - "format": "int64", + "type": "string", "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" - } - } - }, - "SearchReferencesResponse": { - "id": "SearchReferencesResponse", - "type": "object", - "properties": { - "references": { - "description": "The matching references.", - "items": { - "$ref": "Reference" - }, - "type": "array" + "format": "int64" }, - "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.", + "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.", + "format": "int64", "type": "string" } - } - }, - "GetIamPolicyRequest": { - "id": "GetIamPolicyRequest", - "description": "Request message for `GetIamPolicy` method.", - "type": "object", - "properties": {} + }, + "id": "CodingSequence" }, "TestIamPermissionsResponse": { "description": "Response message for `TestIamPermissions` method.", @@ -2609,35 +2523,66 @@ "properties": { "permissions": { "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } } }, "id": "TestIamPermissionsResponse" }, + "GetIamPolicyRequest": { + "type": "object", + "properties": {}, + "id": "GetIamPolicyRequest", + "description": "Request message for `GetIamPolicy` method." + }, + "SearchReferencesResponse": { + "type": "object", + "properties": { + "references": { + "type": "array", + "items": { + "$ref": "Reference" + }, + "description": "The matching references." + }, + "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." + } + }, + "id": "SearchReferencesResponse" + }, "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": { + "description": "If specified, only annotation sets associated with the given reference set\nare returned.", + "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": { - "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" + "description": "Required. The dataset IDs to search within. Caller must have `READ` access\nto these datasets." }, "types": { - "description": "If specified, only annotation sets that have any of these types are\nreturned.", + "type": "array", "items": { "type": "string", "enum": [ @@ -2648,102 +2593,93 @@ "TRANSCRIPT" ] }, - "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.", "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." - ] - }, - "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" + ], + "description": "If specified, only annotation sets that have any of these types are\nreturned." } }, "id": "SearchAnnotationSetsRequest" }, "SearchReadGroupSetsResponse": { - "description": "The read group set search response.", "type": "object", "properties": { - "readGroupSets": { - "description": "The list of matching read group sets.", - "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.", "type": "string" + }, + "readGroupSets": { + "description": "The list of matching read group sets.", + "type": "array", + "items": { + "$ref": "ReadGroupSet" + } } }, - "id": "SearchReadGroupSetsResponse" + "id": "SearchReadGroupSetsResponse", + "description": "The read group set search response." }, - "SearchReferencesRequest": { - "id": "SearchReferencesRequest", + "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": { - "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" + "position": { + "$ref": "Position", + "description": "The position of this alignment." }, - "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`.", + "cigar": { + "type": "array", + "items": { + "$ref": "CigarUnit" + }, + "description": "Represents the local alignment of this sequence (alignment matches, indels,\netc) against the reference." + }, + "mappingQuality": { + "type": "integer", + "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" + } + }, + "id": "LinearAlignment" + }, + "SearchReferencesRequest": { + "type": "object", + "properties": { + "md5checksums": { + "type": "array", "items": { "type": "string" }, - "type": "array" + "description": "If present, return references for which the\nmd5checksum matches exactly." }, - "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" + "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`.", + "type": "array", + "items": { + "type": "string" + } + }, + "pageToken": { + "type": "string", + "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." }, "referenceSetId": { "description": "If present, return only references which belong to this reference set.", "type": "string" }, - "md5checksums": { - "description": "If present, return references for which the\nmd5checksum matches exactly.", - "items": { - "type": "string" - }, - "type": "array" - } - } - }, - "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": { + "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", - "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" } - } + }, + "id": "SearchReferencesRequest" }, "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": { @@ -2755,75 +2691,60 @@ "type": "string" }, "id": { - "description": "The server-generated dataset ID, unique across all datasets.", - "type": "string" + "type": "string", + "description": "The server-generated dataset ID, unique across all datasets." }, "createTime": { - "format": "google-datetime", "description": "The time this dataset was created, in seconds from the epoch.", + "format": "google-datetime", "type": "string" } }, - "id": "Dataset" + "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)" }, "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" + "description": "IDs of the call sets created during the import." } - } + }, + "id": "ImportVariantsResponse" }, "ReadGroup": { "description": "A read group is all the data that's processed the same way by the sequencer.", "type": "object", "properties": { - "datasetId": { - "description": "The dataset to which this read group belongs.", - "type": "string" - }, - "experiment": { - "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.", - "type": "string" - }, - "referenceSetId": { - "description": "The reference set the reads in this read group are aligned to.", - "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" - }, - "type": "array" - } + } + }, + "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)." }, "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" + "type": "string", + "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." }, "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.", + "format": "int32", "type": "integer" }, "description": { @@ -2831,39 +2752,46 @@ "type": "string" }, "sampleId": { - "description": "A client-supplied sample identifier for the reads in this read group.", + "type": "string", + "description": "A client-supplied sample identifier for the reads in this read group." + }, + "datasetId": { + "type": "string", + "description": "The dataset to which this read group belongs." + }, + "experiment": { + "$ref": "Experiment", + "description": "The experiment used to generate this read group." + }, + "name": { + "description": "The read group name. This corresponds to the @RG ID field in the SAM spec.", "type": "string" + }, + "referenceSetId": { + "type": "string", + "description": "The reference set the reads in this read group are aligned to." } }, "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": { - "id": { - "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": { - "description": "The read groups in this set. There are typically 1-10 read groups in a read\ngroup set.", + "type": "array", "items": { "$ref": "ReadGroup" }, - "type": "array" + "description": "The read groups in this set. There are typically 1-10 read groups in a read\ngroup set." }, "filename": { "description": "The filename of the original source file for this read group set, if any.", "type": "string" }, "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" + "type": "string", + "description": "The read group set name. By default this will be initialized to the sample\nname of the sequenced data contained in this set." }, "referenceSetId": { "description": "The reference set to which the reads in this read group set are aligned.", @@ -2871,83 +2799,92 @@ }, "info": { "additionalProperties": { + "type": "array", "items": { "type": "any" - }, - "type": "array" + } }, "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." + }, + "datasetId": { + "type": "string", + "description": "The dataset to which this read group set belongs." } - } + }, + "id": "ReadGroupSet" }, "SearchVariantSetsResponse": { - "description": "The search variant sets response.", "type": "object", "properties": { - "variantSets": { - "description": "The variant sets belonging to the requested dataset.", - "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" + }, + "variantSets": { + "type": "array", + "items": { + "$ref": "VariantSet" + }, + "description": "The variant sets belonging to the requested dataset." } }, - "id": "SearchVariantSetsResponse" + "id": "SearchVariantSetsResponse", + "description": "The search variant sets response." }, "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": {} + "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 `{}`." }, "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": { "position": { - "format": "int64", "description": "The 0-based offset from the start of the forward strand for that reference.", + "format": "int64", "type": "string" }, "referenceName": { - "description": "The name of the reference in whatever reference set is being used.", - "type": "string" + "type": "string", + "description": "The name of the reference in whatever reference set is being used." }, "reverseStrand": { - "description": "Whether this position is on the reverse strand, as opposed to the forward\nstrand.", - "type": "boolean" + "type": "boolean", + "description": "Whether this position is on the reverse strand, as opposed to the forward\nstrand." } - } + }, + "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." }, "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.", @@ -2957,53 +2894,47 @@ "id": "SearchReferenceSetsResponse" }, "SearchCallSetsRequest": { - "id": "SearchCallSetsRequest", - "description": "The call set search request.", "type": "object", "properties": { - "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" + "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" + } }, "name": { "description": "Only return call sets for which a substring of the name matches this\nstring.", "type": "string" }, - "pageSize": { - "format": "int32", - "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024.", - "type": "integer" + "pageToken": { + "type": "string", + "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." }, - "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" + "pageSize": { + "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 1024.", + "format": "int32", + "type": "integer" } - } + }, + "id": "SearchCallSetsRequest", + "description": "The call set search request." }, "ImportReadGroupSetsRequest": { - "id": "ImportReadGroupSetsRequest", - "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": { + "enum": [ + "PARTITION_STRATEGY_UNSPECIFIED", + "PER_FILE_PER_SAMPLE", + "MERGE_ALL" + ], "description": "The partition strategy describes how read groups are partitioned into read\ngroup sets.", "type": "string", "enumDescriptions": [ "", "In most cases, this strategy yields one read group set per file. This is\nthe default behavior.\n\nAllocate one read group set per file per sample. For BAM files, read\ngroups are considered to share a sample if they have identical sample\nnames. Furthermore, all reads for each file which do not belong to a read\ngroup, if any, will be grouped into a single read group set per-file.", "Includes all read groups in all imported files into a single read group\nset. Requires that the headers for all imported files are equivalent. All\nreads which do not belong to a read group, if any, will be grouped into a\nseparate read group set." - ], - "enum": [ - "PARTITION_STRATEGY_UNSPECIFIED", - "PER_FILE_PER_SAMPLE", - "MERGE_ALL" ] }, "datasetId": { @@ -3012,144 +2943,136 @@ }, "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" - }, - "type": "array" + } + }, + "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" } - } + }, + "id": "ImportReadGroupSetsRequest", + "description": "The read group set import request." }, "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": { - "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.", + "type": "array", "items": { "$ref": "Binding" }, - "type": "array" + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error." + }, + "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": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" } - } + }, + "id": "Policy" }, "SearchReadsRequest": { - "description": "The read search request.", "type": "object", "properties": { + "readGroupIds": { + "type": "array", + "items": { + "type": "string" + }, + "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`." + }, + "end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive. If\nspecified, `referenceName` must also be specified.", + "format": "int64" + }, + "pageToken": { + "type": "string", + "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." + }, + "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", + "type": "integer" + }, + "start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive. If\nspecified, `referenceName` must also be specified.", + "format": "int64" + }, "referenceName": { "description": "The reference sequence name, for example `chr1`, `1`, or `chrX`. If set to\n`*`, only unmapped reads are returned. If unspecified, all reads (mapped\nand unmapped) are returned.", "type": "string" }, "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`.", - "items": { - "type": "string" - }, - "type": "array" - }, - "end": { - "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": { - "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 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, `referenceName` must also be specified.", - "type": "string" + "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`." } }, - "id": "SearchReadsRequest" + "id": "SearchReadsRequest", + "description": "The read search request." }, "CancelOperationRequest": { - "id": "CancelOperationRequest", "description": "The request message for Operations.CancelOperation.", "type": "object", - "properties": {} + "properties": {}, + "id": "CancelOperationRequest" }, "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" + "type": "string", + "description": "The annotation set to which this annotation belongs." }, "name": { - "description": "The display name of this annotation.", - "type": "string" + "type": "string", + "description": "The display name of this annotation." }, "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" + "$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": { + "type": "string", + "description": "The ID of the Google Genomics reference associated with this range." + }, "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" + "type": "boolean", + "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." }, "referenceName": { - "description": "The display name corresponding to the reference specified by\n`referenceId`, for example `chr1`, `1`, or `chrX`.", - "type": "string" + "type": "string", + "description": "The display name corresponding to the reference specified by\n`referenceId`, for example `chr1`, `1`, or `chrX`." }, "info": { + "type": "object", "additionalProperties": { + "type": "array", "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" + "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": { + "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.", @@ -3164,98 +3087,102 @@ "GENE", "TRANSCRIPT" ], - "description": "The data type for this annotation. Must match the containing annotation\nset's type.", - "type": "string" + "description": "The data type for this annotation. Must match the containing annotation\nset's type." + }, + "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": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive.", + "format": "int64" } }, - "id": "Annotation" + "id": "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`." }, "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": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + }, + "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": { "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" + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." }, "metadata": { - "description": "An OperationMetadata object. This will always be returned with the Operation.", "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": { "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": "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" } }, "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" + "$ref": "ComputeEngine", + "description": "Execution information specific to Google Compute Engine." } - } + }, + "id": "RuntimeMetadata", + "description": "Runtime metadata that will be populated in the\nruntimeMetadata\nfield of the Operation associated with a RunPipeline execution." }, "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" + "description": "IDs of the read group sets that were created." } }, - "id": "ImportReadGroupSetsResponse" + "id": "ImportReadGroupSetsResponse", + "description": "The read group set import response." }, "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" - }, - "type": "array" - } + } + }, + "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" }, "callSetName": { "description": "The name of the call set this variant call belongs to.", @@ -3263,479 +3190,511 @@ }, "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" + "type": "number", + "format": "double" + } }, "callSetId": { - "description": "The ID of the call set this variant call belongs to.", - "type": "string" + "type": "string", + "description": "The ID of the call set this variant call belongs to." + }, + "genotype": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "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." } - } + }, + "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." }, "SearchVariantsResponse": { - "id": "SearchVariantsResponse", "description": "The variant search 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." + }, "variants": { "description": "The list of matching Variants.", + "type": "array", "items": { "$ref": "Variant" - }, - "type": "array" + } + } + }, + "id": "SearchVariantsResponse" + }, + "ListBasesResponse": { + "type": "object", + "properties": { + "offset": { + "type": "string", + "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" }, "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": { "description": "A substring of the bases that make up this reference.", "type": "string" - }, - "offset": { - "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": { - "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.", + "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" } - }, - "type": "array" + } + }, + "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" - }, - "UndeleteDatasetRequest": { - "id": "UndeleteDatasetRequest", - "type": "object", - "properties": {} + "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." }, "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": { - "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", - "type": "string" + "type": "string", + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired" } - } + }, + "id": "Binding" + }, + "UndeleteDatasetRequest": { + "type": "object", + "properties": {}, + "id": "UndeleteDatasetRequest" }, "Range": { - "description": "A 0-based half-open genomic coordinate range for search requests.", "type": "object", "properties": { - "end": { - "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" + "type": "string", + "description": "The reference sequence name, for example `chr1`,\n`1`, or `chrX`." }, "start": { - "format": "int64", "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", "type": "string" } }, - "id": "Range" + "id": "Range", + "description": "A 0-based half-open genomic coordinate range for search requests." }, "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": { + "datasetId": { + "type": "string", + "description": "The dataset to which this variant set belongs." + }, "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" + "type": "string", + "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." }, "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.", "type": "string" }, "description": { - "description": "A textual description of this variant set.", - "type": "string" - }, - "datasetId": { - "description": "The dataset to which this variant set belongs.", - "type": "string" + "type": "string", + "description": "A textual description of this variant set." } - } + }, + "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)" }, "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", - "description": "ReferenceBound records an upper bound for the starting coordinate of\nvariants in a particular reference.", "type": "object", "properties": { - "upperBound": { - "format": "int64", - "description": "An upper bound (inclusive) on the starting coordinate of any\nvariant in the reference sequence.", - "type": "string" - }, "referenceName": { "description": "The name of the reference associated with this reference bound.", "type": "string" + }, + "upperBound": { + "description": "An upper bound (inclusive) on the starting coordinate of any\nvariant in the reference sequence.", + "format": "int64", + "type": "string" } - } + }, + "id": "ReferenceBound", + "description": "ReferenceBound records an upper bound for the starting coordinate of\nvariants in a particular reference." }, "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" + "description": "A list of operations that matches the specified filter in the request." }, "nextPageToken": { - "description": "The standard List next-page token.", - "type": "string" + "type": "string", + "description": "The standard List next-page token." } }, "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": { + "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": { + "type": "string", + "description": "The date this variant was created, in milliseconds from the epoch.", + "format": "int64" + }, + "start": { + "type": "string", + "description": "The position at which this variant occurs (0-based).\nThis corresponds to the first base of the string of reference bases.", + "format": "int64" + }, + "quality": { + "type": "number", + "description": "A measure of how likely this variant is to be real.\nA higher value is better.", + "format": "double" + }, + "id": { + "type": "string", + "description": "The server-generated variant ID, unique across all variants." + }, "variantSetId": { - "description": "The ID of the variant set this variant belongs to.", - "type": "string" + "type": "string", + "description": "The ID of the variant set this variant belongs to." }, "referenceName": { - "description": "The reference on which this variant occurs.\n(such as `chr20` or `X`)", - "type": "string" + "type": "string", + "description": "The reference on which this variant occurs.\n(such as `chr20` or `X`)" }, "info": { + "type": "object", "additionalProperties": { + "type": "array", "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" + "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": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The bases that appear instead of the reference bases." + }, "names": { "description": "Names for the variant, for example a RefSNP ID.", + "type": "array", "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.", + "type": "array", "items": { "type": "string" }, - "type": "array" + "description": "A list of filters (normally quality filters) this variant has failed.\n`PASS` indicates this variant has passed all filters." }, - "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" + "end": { + "type": "string", + "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" } - } + }, + "id": "Variant" }, "SearchCallSetsResponse": { "description": "The call set search 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." + }, "callSets": { - "description": "The list of matching call sets.", + "type": "array", "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" + "description": "The list of matching call sets." } }, "id": "SearchCallSetsResponse" }, + "SearchVariantsRequest": { + "type": "object", + "properties": { + "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": { + "type": "string", + "description": "The end of the window, 0-based exclusive. If unspecified or 0, defaults to\nthe length of the reference.", + "format": "int64" + }, + "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" + }, + "pageToken": { + "type": "string", + "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." + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of variants to return in a single page. If unspecified,\ndefaults to 5000. The maximum value is 10000.", + "format": "int32" + }, + "callSetIds": { + "type": "array", + "items": { + "type": "string" + }, + "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." + }, + "start": { + "description": "The beginning of the window (0-based, inclusive) for which\noverlapping variants should be returned. If unspecified, defaults to 0.", + "format": "int64", + "type": "string" + }, + "variantName": { + "type": "string", + "description": "Only return variants which have exactly this name." + }, + "referenceName": { + "description": "Required. Only return variants in this reference sequence.", + "type": "string" + } + }, + "id": "SearchVariantsRequest", + "description": "The variant search request." + }, "OperationMetadata": { "description": "Metadata describing an Operation.", "type": "object", "properties": { - "createTime": { - "format": "google-datetime", - "description": "The time at which the job was submitted to the Genomics service.", - "type": "string" - }, - "labels": { - "description": "Optionally provided by the caller when submitting the request that creates\nthe operation.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "projectId": { - "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": { - "format": "google-datetime", + "type": "string", "description": "The time at which the job stopped running.", - "type": "string" + "format": "google-datetime" }, "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" + } }, "startTime": { - "format": "google-datetime", + "type": "string", "description": "The time at which the job began to run.", - "type": "string" + "format": "google-datetime" }, "request": { + "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": "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" + "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." }, "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" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Optionally provided by the caller when submitting the request that creates\nthe operation." + }, + "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." + }, + "clientId": { + "type": "string", + "description": "This field is deprecated. Use `labels` instead. Optionally provided by the\ncaller when submitting the request that creates the operation." } }, "id": "OperationMetadata" }, - "SearchVariantsRequest": { - "description": "The variant search request.", - "type": "object", - "properties": { - "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" - }, - "pageSize": { - "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.", - "items": { - "type": "string" - }, - "type": "array" - }, - "variantName": { - "description": "Only return variants which have exactly this name.", - "type": "string" - }, - "start": { - "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" - } - }, - "id": "SearchVariantsRequest" - }, "SearchReadGroupSetsRequest": { - "id": "SearchReadGroupSetsRequest", "description": "The read group set search request.", "type": "object", "properties": { - "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" + "type": "string", + "description": "Only return read group sets for which a substring of the name matches this\nstring." + }, + "pageToken": { + "type": "string", + "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." }, "pageSize": { - "format": "int32", + "type": "integer", "description": "The maximum number of results to return in a single page. If unspecified,\ndefaults to 256. The maximum value is 1024.", - "type": "integer" + "format": "int32" }, "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" + } } - } + }, + "id": "SearchReadGroupSetsRequest" }, "SearchAnnotationsResponse": { - "id": "SearchAnnotationsResponse", "type": "object", "properties": { - "annotations": { - "description": "The matching annotations.", - "items": { - "$ref": "Annotation" - }, - "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" + }, + "annotations": { + "description": "The matching annotations.", + "type": "array", + "items": { + "$ref": "Annotation" + } } - } + }, + "id": "SearchAnnotationsResponse" + }, + "SearchReadsResponse": { + "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" + } + }, + "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." + } + }, + "id": "SearchReadsResponse", + "description": "The read search response." }, "ClinicalCondition": { "type": "object", "properties": { + "conceptId": { + "type": "string", + "description": "The MedGen concept id associated with this gene.\nSearch for these IDs at http://www.ncbi.nlm.nih.gov/medgen/" + }, "names": { "description": "A set of names for the condition.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "omimId": { "description": "The OMIM id for this condition.\nSearch for these IDs at http://omim.org/", @@ -3743,75 +3702,116 @@ }, "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" + } } }, "id": "ClinicalCondition" }, - "SearchReadsResponse": { - "description": "The read search response.", + "Program": { "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.", + "name": { + "type": "string", + "description": "The display name of the program. This is typically the colloquial name of\nthe tool used, for example 'bwa' or 'picard'." + }, + "commandLine": { + "description": "The command line used to run this program.", "type": "string" }, - "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": { - "$ref": "Read" - }, - "type": "array" + "prevProgramId": { + "description": "The ID of the program run before this one.", + "type": "string" + }, + "id": { + "type": "string", + "description": "The user specified locally unique ID of the program. Used along with\n`prevProgramId` to define an ordering between programs." + }, + "version": { + "description": "The version of the program run.", + "type": "string" } }, - "id": "SearchReadsResponse" + "id": "Program" + }, + "ComputeEngine": { + "type": "object", + "properties": { + "zone": { + "description": "The availability zone in which the instance resides.", + "type": "string" + }, + "machineType": { + "type": "string", + "description": "The machine type of the instance." + }, + "diskNames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The names of the disks that were created for this pipeline." + }, + "instanceName": { + "description": "The instance on which the operation is running.", + "type": "string" + } + }, + "id": "ComputeEngine", + "description": "Describes a Compute Engine resource that is being managed by a running\npipeline." + }, + "CoverageBucket": { + "type": "object", + "properties": { + "meanCoverage": { + "type": "number", + "description": "The average number of reads which are aligned to each individual\nreference base in this bucket.", + "format": "float" + }, + "range": { + "$ref": "Range", + "description": "The genomic coordinate range spanned by this bucket." + } + }, + "id": "CoverageBucket", + "description": "A bucket over which read coverage has been precomputed. A bucket corresponds\nto a specific range of the reference sequence." } }, - "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://genomics.googleapis.com/", "auth": { "oauth2": { "scopes": { - "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/genomics.readonly": { - "description": "View Genomics data" + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" }, "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" } } } }, - "description": "Upload, process, query, and search Genomics data in the cloud.", "kind": "discovery#restDescription", + "description": "Upload, process, query, and search Genomics data in the cloud.", "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", - "title": "Genomics API" + "name": "genomics" } diff --git a/etc/api/genomics/v1alpha2/genomics-api.json b/etc/api/genomics/v1alpha2/genomics-api.json index 55d6926d98..1f7d0fdf7c 100644 --- a/etc/api/genomics/v1alpha2/genomics-api.json +++ b/etc/api/genomics/v1alpha2/genomics-api.json @@ -1,12 +1,4 @@ { - "rootUrl": "https://genomics.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "genomics", - "batchPath": "batch", - "revision": "20170925", - "documentationLink": "https://cloud.google.com/genomics", - "id": "genomics:v1alpha2", "title": "Genomics API", "ownerName": "Google", "discoveryVersion": "v1", @@ -14,13 +6,6 @@ "operations": { "methods": { "cancel": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" @@ -29,46 +14,28 @@ "name": { "location": "path", "description": "The name of the operation resource to be cancelled.", - "type": "string", "required": true, + "type": "string", "pattern": "^operations/.+$" } }, "flatPath": "v1alpha2/operations/{operationsId}:cancel", - "id": "genomics.operations.cancel", "path": "v1alpha2/{+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" }, - "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." - }, - "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": "Empty" + }, "parameterOrder": [ "name" ], - "response": { - "$ref": "Operation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/genomics" - ], - "parameters": { - "name": { - "type": "string", - "required": true, - "pattern": "^operations/.+$", - "location": "path", - "description": "The name of the operation resource." - } - }, - "flatPath": "v1alpha2/operations/{operationsId}", - "path": "v1alpha2/{+name}", - "id": "genomics.operations.get" + "httpMethod": "POST" }, "list": { + "description": "Lists operations that match the specified filter in the request.", "response": { "$ref": "ListOperationsResponse" }, @@ -82,23 +49,23 @@ "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, + "type": "string", "pattern": "^operations$", "location": "path", "description": "The name of the operation's parent resource." }, - "pageSize": { - "type": "integer", + "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", - "description": "The maximum number of results to return. If unspecified, defaults to\n256. The maximum value is 2048." + "type": "integer" } }, "scopes": [ @@ -106,9 +73,34 @@ "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." + "id": "genomics.operations.list" + }, + "get": { + "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.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "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" + ] } } }, @@ -126,43 +118,14 @@ ], "parameters": {}, "flatPath": "v1alpha2/pipelines:setOperationStatus", - "id": "genomics.pipelines.setOperationStatus", "path": "v1alpha2/pipelines:setOperationStatus", + "id": "genomics.pipelines.setOperationStatus", + "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.", "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" }, @@ -170,9 +133,9 @@ "httpMethod": "GET", "parameters": { "operationId": { - "type": "string", "location": "query", - "description": "The operation to retrieve controller configuration for." + "description": "The operation to retrieve controller configuration for.", + "type": "string" }, "validationToken": { "location": "query", @@ -183,7 +146,36 @@ "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." + }, + "delete": { + "description": "Deletes a pipeline based on ID.\n\nCaller must have WRITE permission to the project.", + "httpMethod": "DELETE", + "parameterOrder": [ + "pipelineId" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "pipelineId": { + "location": "path", + "description": "Caller must have WRITE access to the project in which this pipeline\nis defined.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ], + "flatPath": "v1alpha2/pipelines/{pipelineId}", + "id": "genomics.pipelines.delete", + "path": "v1alpha2/pipelines/{pipelineId}" }, "list": { "response": { @@ -191,39 +183,41 @@ }, "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": { + "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": { + "location": "query", + "description": "Number of pipelines to return at once. Defaults to 256, and max\nis 2048.", + "format": "int32", + "type": "integer" + }, + "projectId": { + "description": "Required. The name of the project to search for pipelines. Caller\nmust have READ access to this project.", + "type": "string", + "location": "query" + }, + "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" + } + }, "flatPath": "v1alpha2/pipelines", - "id": "genomics.pipelines.list", "path": "v1alpha2/pipelines", + "id": "genomics.pipelines.list", "description": "Lists pipelines.\n\nCaller must have READ permission to the project." }, "create": { + "path": "v1alpha2/pipelines", + "id": "genomics.pipelines.create", "description": "Creates a pipeline that can be run later. Create takes a Pipeline that\nhas all fields other than `pipelineId` populated, and then returns\nthe same pipeline with `pipelineId` populated. This id can be used\nto run the pipeline.\n\nCaller must have WRITE permission to the project.", "request": { "$ref": "Pipeline" @@ -233,34 +227,32 @@ }, "parameterOrder": [], "httpMethod": "POST", - "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/genomics" ], - "flatPath": "v1alpha2/pipelines", - "id": "genomics.pipelines.create", - "path": "v1alpha2/pipelines" + "parameters": {}, + "flatPath": "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" - }, "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", + "path": "v1alpha2/pipelines:run", "id": "genomics.pipelines.run", - "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" + } }, "get": { "response": { @@ -270,31 +262,63 @@ "pipelineId" ], "httpMethod": "GET", + "parameters": { + "pipelineId": { + "location": "path", + "description": "Caller must have READ access to the project in which this pipeline\nis defined.", + "required": true, + "type": "string" + } + }, "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 READ access to the project in which this pipeline\nis defined." - } - }, "flatPath": "v1alpha2/pipelines/{pipelineId}", - "id": "genomics.pipelines.get", "path": "v1alpha2/pipelines/{pipelineId}", + "id": "genomics.pipelines.get", "description": "Retrieves a pipeline based on ID.\n\nCaller must have READ permission to the project." } } } }, "parameters": { - "uploadType": { + "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": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." + "description": "Pretty-print response.", + "type": "boolean", + "default": "true" + }, + "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.", + "type": "boolean", + "default": "true", + "location": "query" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "type": "string", + "location": "query" }, "fields": { "type": "string", @@ -302,24 +326,29 @@ "description": "Selector specifying which fields to include in a partial response." }, "callback": { + "description": "JSONP", "type": "string", - "location": "query", - "description": "JSONP" + "location": "query" }, "$.xgafv": { - "location": "query", - "enum": [ - "1", - "2" - ], "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", @@ -328,57 +357,173 @@ ], "location": "query", "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ] + "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" - }, - "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": { + "TimestampEvent": { + "description": "Stores the list of events and times they occured for major events in job\nexecution.", + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "description": "The time this event occured.", + "format": "google-datetime" + }, + "description": { + "description": "String indicating the type of event", + "type": "string" + } + }, + "id": "TimestampEvent" + }, + "LocalCopy": { + "description": "LocalCopy defines how a remote file should be copied to and from the VM.", + "type": "object", + "properties": { + "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" + }, + "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" + } + }, + "id": "LocalCopy" + }, + "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" + }, + "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" + } + }, + "id": "DockerExecutor" + }, + "Disk": { + "description": "A Google Compute Engine disk resource specification.", + "type": "object", + "properties": { + "autoDelete": { + "description": "Deprecated. Disks created by the Pipelines API will be deleted at the end\nof the pipeline run, regardless of what this field is set to.", + "type": "boolean" + }, + "sizeGb": { + "description": "The size of the disk. Defaults to 500 (GB).\nThis field is not applicable for local SSD.", + "format": "int32", + "type": "integer" + }, + "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" + }, + "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": { + "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", + "PERSISTENT_SSD", + "LOCAL_SSD" + ], + "description": "Required. The type of the disk to create.", + "type": "string" + } + }, + "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" + }, + "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": { + "defaultValue": { + "type": "string", + "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://`." + }, + "name": { + "description": "Required. Name of the parameter - the pipeline runner uses this string\nas the key to the input and output maps in RunPipeline.", + "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." + } + }, + "id": "PipelineParameter" + }, + "LoggingOptions": { + "description": "The logging options for the pipeline run.", + "type": "object", + "properties": { + "gcsPath": { + "type": "string", + "description": "The location in Google Cloud Storage to which the pipeline logs\nwill be copied. Can be specified as a fully qualified directory\npath, in which case logs will be output with a unique identifier\nas the filename in that directory, or as a fully specified path,\nwhich must end in `.log`, in which case that path will be\nused, and the user must ensure that logs are not\noverwritten. Stdout and stderr logs from the run are also\ngenerated and output as `-stdout.log` and `-stderr.log`." + } + }, + "id": "LoggingOptions" + }, + "RunPipelineRequest": { + "type": "object", + "properties": { + "pipelineId": { + "description": "The already created pipeline to run.", + "type": "string" + }, + "ephemeralPipeline": { + "description": "A new pipeline object to run once and then delete.", + "$ref": "Pipeline" + }, + "pipelineArgs": { + "description": "The arguments to use when running this pipeline.", + "$ref": "RunPipelineArgs" + } + }, + "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." + }, "CancelOperationRequest": { "description": "The request message for Operations.CancelOperation.", "type": "object", @@ -390,38 +535,37 @@ "type": "object", "properties": { "response": { - "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": "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": { - "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`" + "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." + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "Status" }, "metadata": { + "description": "An OperationMetadata object. This will always be returned with the Operation.", "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." + "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" }, "RuntimeMetadata": { - "description": "Runtime metadata that will be populated in the\nruntimeMetadata\nfield of the Operation associated with a RunPipeline execution.", "type": "object", "properties": { "computeEngine": { @@ -429,27 +573,38 @@ "description": "Execution information specific to Google Compute Engine." } }, - "id": "RuntimeMetadata" + "id": "RuntimeMetadata", + "description": "Runtime metadata that will be populated in the\nruntimeMetadata\nfield of the Operation associated with a RunPipeline execution." }, "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", - "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": { + "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 is a common set of\nmessage types for APIs to use.", + "type": "array", "items": { "type": "object", "additionalProperties": { @@ -457,35 +612,25 @@ "type": "any" } }, - "type": "array" - }, - "code": { - "type": "integer", - "format": "int32", - "description": "The status code, which should be an enum value of google.rpc.Code." - }, - "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 list of messages that carry the error details. There is a common set of\nmessage 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." + "id": "Status" }, "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" @@ -495,41 +640,50 @@ "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": { - "format": "int32", "description": "The minimum number of cores to use. Defaults to 1.", + "format": "int32", "type": "integer" }, + "acceleratorType": { + "description": "Optional. The Compute Engine defined accelerator type.\nBy specifying this parameter, you will download and install the following\nthird-party software onto your managed Compute Engine instances: NVIDIA®\nTesla® drivers and NVIDIA® CUDA toolkit.\nPlease see https://cloud.google.com/compute/docs/gpus/ for a list of\navailable accelerator types.", + "type": "string" + }, + "acceleratorCount": { + "description": "Optional. The number of accelerators of the specified type to attach.\nBy specifying this parameter, you will download and install the following\nthird-party software onto your managed Compute Engine instances:\nNVIDIA® Tesla® drivers and NVIDIA® CUDA toolkit.", + "format": "int64", + "type": "string" + }, "noAddress": { - "description": "Whether to assign an external IP to the instance. This is an experimental\nfeature that may go away. Defaults to false.\nCorresponds to `--no_address` flag for [gcloud compute instances create]\n(https://cloud.google.com/sdk/gcloud/reference/compute/instances/create).\nIn order to use this, must be true for both create time and run time.\nCannot be true at run time if false at create time. If you need to ssh into\na private IP VM for debugging, you can ssh to a public VM and then ssh into\nthe private VM's Internal IP. If noAddress is set, this pipeline run may\nonly load docker images from Google Container Registry and not Docker Hub.\nBefore using this, you must\n[configure access to Google services from internal IPs](https://cloud.google.com/compute/docs/configure-private-google-access#configuring_access_to_google_services_from_internal_ips).", - "type": "boolean" + "type": "boolean", + "description": "Whether to assign an external IP to the instance. This is an experimental\nfeature that may go away. Defaults to false.\nCorresponds to `--no_address` flag for [gcloud compute instances create]\n(https://cloud.google.com/sdk/gcloud/reference/compute/instances/create).\nIn order to use this, must be true for both create time and run time.\nCannot be true at run time if false at create time. If you need to ssh into\na private IP VM for debugging, you can ssh to a public VM and then ssh into\nthe private VM's Internal IP. If noAddress is set, this pipeline run may\nonly load docker images from Google Container Registry and not Docker Hub.\nBefore using this, you must\n[configure access to Google services from internal IPs](https://cloud.google.com/compute/docs/configure-private-google-access#configuring_access_to_google_services_from_internal_ips)." }, "disks": { "description": "Disks to attach.", + "type": "array", "items": { "$ref": "Disk" - }, - "type": "array" + } }, "bootDiskSizeGb": { - "type": "integer", + "description": "The size of the boot disk. Defaults to 10 (GB).", "format": "int32", - "description": "The size of the boot disk. Defaults to 10 (GB)." + "type": "integer" }, "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": { - "type": "number", + "description": "The minimum amount of RAM to use. Defaults to 3.75 (GB)", "format": "double", - "description": "The minimum amount of RAM to use. Defaults to 3.75 (GB)" + "type": "number" } }, "id": "PipelineResources" @@ -538,28 +692,12 @@ "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": { - "$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" - }, - "pipelineId": { - "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.", @@ -571,10 +709,26 @@ }, "inputParameters": { "description": "Input parameters of the pipeline.", + "type": "array", "items": { "$ref": "PipelineParameter" - }, - "type": "array" + } + }, + "resources": { + "description": "Required. Specifies resource requirements for the pipeline run.\nRequired fields:\n\n*\nminimumCpuCores\n\n*\nminimumRamGb", + "$ref": "PipelineResources" + }, + "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" + }, + "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" + }, + "projectId": { + "description": "Required. The project in which to create the pipeline. The caller must have\nWRITE access.", + "type": "string" } }, "id": "Pipeline" @@ -583,24 +737,25 @@ "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", + "description": "Optional time of when event started.", "format": "google-datetime", - "description": "Optional time of when event started." + "type": "string" }, "description": { - "type": "string", - "description": "Required description of event." + "description": "Required description of event.", + "type": "string" + }, + "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" } }, "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": { @@ -640,62 +795,42 @@ "type": "string" } }, - "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": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "id": "RepeatedString" + "id": "ControllerConfig" }, "ListOperationsResponse": { + "id": "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." + } }, - "OperationMetadata": { + "RepeatedString": { "type": "object", "properties": { - "runtimeMetadata": { - "additionalProperties": { - "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": { + "values": { + "type": "array", + "items": { "type": "string" - }, - "description": "Optionally provided by the caller when submitting the request that creates\nthe operation.", - "type": "object" - }, + } + } + }, + "id": "RepeatedString" + }, + "OperationMetadata": { + "description": "Metadata describing an Operation.", + "type": "object", + "properties": { "projectId": { "description": "The Google Cloud Project in which the job is scoped.", "type": "string" @@ -705,88 +840,108 @@ "type": "string" }, "endTime": { - "type": "string", + "description": "The time at which the job stopped running.", "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" + "description": "Optional event messages that were generated during the job's execution.\nThis also contains any warnings that were generated during import\nor export." }, "startTime": { - "type": "string", + "description": "The time at which the job began to run.", "format": "google-datetime", - "description": "The time at which the job began to run." + "type": "string" }, "request": { "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 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", - "description": "Metadata describing an Operation." - }, - "RunPipelineArgs": { - "description": "The pipeline run arguments.", - "type": "object", - "properties": { + }, + "runtimeMetadata": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "Runtime metadata on this Operation." + }, "labels": { + "description": "Optionally provided by the caller when submitting the request that creates\nthe operation.", "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." + } }, + "createTime": { + "description": "The time at which the job was submitted to the Genomics service.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "OperationMetadata" + }, + "RunPipelineArgs": { + "properties": { "logging": { - "$ref": "LoggingOptions", - "description": "Required. Logging options. Used by the service to communicate results\nto the user." + "description": "Required. Logging options. Used by the service to communicate results\nto the user.", + "$ref": "LoggingOptions" + }, + "labels": { + "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.", + "type": "object" }, "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.", + "format": "google-duration", "type": "string" }, "resources": { - "$ref": "PipelineResources", - "description": "Specifies resource requirements/overrides for the pipeline run." + "description": "Specifies resource requirements/overrides for the pipeline run.", + "$ref": "PipelineResources" }, "outputs": { + "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", "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." + "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" }, "clientId": { "description": "This field is deprecated. Use `labels` instead. Client-specified pipeline\noperation identifier.", "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." + }, "inputs": { "additionalProperties": { "type": "string" }, "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" - }, - "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" + "id": "RunPipelineArgs", + "description": "The pipeline run arguments.", + "type": "object" }, "ListPipelinesResponse": { + "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.", "type": "object", "properties": { @@ -795,26 +950,19 @@ "type": "string" }, "pipelines": { + "description": "The matched pipelines.", + "type": "array", "items": { "$ref": "Pipeline" - }, - "type": "array", - "description": "The matched pipelines." + } } - }, - "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": { - "validationToken": { - "type": "string", - "format": "uint64" - }, - "errorMessage": { - "type": "string" - }, "errorCode": { "enum": [ "OK", @@ -857,32 +1005,51 @@ ] }, "timestampEvents": { + "type": "array", "items": { "$ref": "TimestampEvent" - }, - "type": "array" + } }, "operationId": { "type": "string" + }, + "errorMessage": { + "type": "string" + }, + "validationToken": { + "format": "uint64", + "type": "string" } - }, - "id": "SetOperationStatusRequest" + } }, - "ComputeEngine": { - "description": "Describes a Compute Engine resource that is being managed by a running\npipeline.", + "ImportVariantsResponse": { + "description": "The variant data import response.", "type": "object", "properties": { - "diskNames": { - "description": "The names of the disks that were created for this pipeline.", + "callSetIds": { + "description": "IDs of the call sets created during the import.", + "type": "array", "items": { "type": "string" - }, - "type": "array" - }, + } + } + }, + "id": "ImportVariantsResponse" + }, + "ComputeEngine": { + "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" @@ -892,199 +1059,41 @@ "type": "string" } }, - "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": { - "timestamp": { - "format": "google-datetime", - "description": "The time this event occured.", - "type": "string" - }, - "description": { - "description": "String indicating the type of event", - "type": "string" - } - }, - "id": "TimestampEvent", - "description": "Stores the list of events and times they occured for major events in job\nexecution." - }, - "LocalCopy": { - "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" - } - }, - "id": "LocalCopy", - "description": "LocalCopy defines how a remote file should be copied to and from the VM." - }, - "DockerExecutor": { - "description": "The Docker execuctor specification.", - "type": "object", - "properties": { - "cmd": { - "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": { - "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": { - "type": "object", - "properties": { - "autoDelete": { - "description": "Deprecated. Disks created by the Pipelines API will be deleted at the end\nof the pipeline run, regardless of what this field is set to.", - "type": "boolean" - }, - "sizeGb": { - "type": "integer", - "format": "int32", - "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": { - "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": { - "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": { - "enum": [ - "TYPE_UNSPECIFIED", - "PERSISTENT_HDD", - "PERSISTENT_SSD", - "LOCAL_SSD" - ], - "description": "Required. The type of the disk to create.", - "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", - "description": "A Google Compute Engine disk resource specification." - }, - "PipelineParameter": { - "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" - }, - "name": { - "description": "Required. Name of the parameter - the pipeline runner uses this string\nas the key to the input and output maps in RunPipeline.", - "type": "string" - }, - "description": { - "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.", - "type": "object", - "properties": { - "gcsPath": { - "type": "string", - "description": "The location in Google Cloud Storage to which the pipeline logs\nwill be copied. Can be specified as a fully qualified directory\npath, in which case logs will be output with a unique identifier\nas the filename in that directory, or as a fully specified path,\nwhich must end in `.log`, in which case that path will be\nused, and the user must ensure that logs are not\noverwritten. Stdout and stderr logs from the run are also\ngenerated and output as `-stdout.log` and `-stderr.log`." - } - }, - "id": "LoggingOptions" - }, - "RunPipelineRequest": { - "type": "object", - "properties": { - "pipelineArgs": { - "$ref": "RunPipelineArgs", - "description": "The arguments to use when running this pipeline." - }, - "pipelineId": { - "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", - "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." + "id": "ComputeEngine", + "description": "Describes a Compute Engine resource that is being managed by a running\npipeline." } }, - "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": "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": "", + "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", + "id": "genomics:v1alpha2", + "documentationLink": "https://cloud.google.com/genomics", + "revision": "20171207" } diff --git a/etc/api/gmail/v1/gmail-api.json b/etc/api/gmail/v1/gmail-api.json index d6bafaf71f..dd63c755fb 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/yLmXjwrCZrd7tYs9N17TGZKIRRE\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/KN8GrB2y-CsV6bxSvl7bWp7E8GE\"", "discoveryVersion": "v1", "id": "gmail:v1", "name": "gmail", "version": "v1", - "revision": "20170913", + "revision": "20171128", "title": "Gmail API", "description": "Access Gmail mailboxes including sending user email.", "ownerDomain": "google.com", diff --git a/etc/api/iam/v1/iam-api.json b/etc/api/iam/v1/iam-api.json index 16877035f7..1636a31d92 100644 --- a/etc/api/iam/v1/iam-api.json +++ b/etc/api/iam/v1/iam-api.json @@ -1,41 +1,1276 @@ { + "ownerDomain": "google.com", + "name": "iam", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Identity and Access Management (IAM) API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "serviceAccounts": { + "methods": { + "getIamPolicy": { + "description": "Returns the IAM access control policy for a\nServiceAccount.", + "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 requested.\nSee the operation documentation for the appropriate value for this field.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "id": "iam.projects.serviceAccounts.getIamPolicy" + }, + "get": { + "path": "v1/{+name}", + "id": "iam.projects.serviceAccounts.get", + "description": "Gets a ServiceAccount.", + "response": { + "$ref": "ServiceAccount" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "location": "path", + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.\nUsing `-` as a wildcard for the `PROJECT_ID` 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}" + }, + "update": { + "response": { + "$ref": "ServiceAccount" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "location": "path", + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.\n\nRequests using `-` as a wildcard for the `PROJECT_ID` will infer the\nproject from the `account` and the `ACCOUNT` value can be the `email`\naddress or the `unique_id` of the service account.\n\nIn responses the resource name will always be in the format\n`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.", + "required": true, + "type": "string" + } + }, + "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" + } + }, + "testIamPermissions": { + "path": "v1/{+resource}:testIamPermissions", + "id": "iam.projects.serviceAccounts.testIamPermissions", + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "description": "Tests the specified permissions against the IAM access control policy\nfor a ServiceAccount.", + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:testIamPermissions" + }, + "delete": { + "description": "Deletes a ServiceAccount.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "location": "path", + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.\nUsing `-` as a wildcard for the `PROJECT_ID` 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" + } + }, + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}", + "path": "v1/{+name}", + "id": "iam.projects.serviceAccounts.delete" + }, + "list": { + "id": "iam.projects.serviceAccounts.list", + "path": "v1/{+name}/serviceAccounts", + "description": "Lists ServiceAccounts for a project.", + "httpMethod": "GET", + "response": { + "$ref": "ListServiceAccountsResponse" + }, + "parameterOrder": [ + "name" + ], + "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" + }, + "pageToken": { + "location": "query", + "description": "Optional pagination token returned in an earlier\nListServiceAccountsResponse.next_page_token.", + "type": "string" + }, + "pageSize": { + "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", + "type": "integer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/serviceAccounts" + }, + "signBlob": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "SignBlobResponse" + }, + "parameters": { + "name": { + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.\nUsing `-` as a wildcard for the `PROJECT_ID` 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}:signBlob", + "id": "iam.projects.serviceAccounts.signBlob", + "path": "v1/{+name}:signBlob", + "request": { + "$ref": "SignBlobRequest" + }, + "description": "Signs a blob using a service account's system-managed private key." + }, + "create": { + "description": "Creates a ServiceAccount\nand returns it.", + "request": { + "$ref": "CreateServiceAccountRequest" + }, + "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`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/serviceAccounts", + "id": "iam.projects.serviceAccounts.create", + "path": "v1/{+name}/serviceAccounts" + }, + "signJwt": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "SignJwtResponse" + }, + "parameters": { + "name": { + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.\nUsing `-` as a wildcard for the `PROJECT_ID` 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}: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": { + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "resource": { + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "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" + } + }, + "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" + } + } + }, + "resources": { + "keys": { + "methods": { + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ServiceAccountKey" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "location": "path", + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.\nUsing `-` as a wildcard for the `PROJECT_ID` 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}/keys", + "id": "iam.projects.serviceAccounts.keys.create", + "path": "v1/{+name}/keys", + "request": { + "$ref": "CreateServiceAccountKeyRequest" + }, + "description": "Creates a ServiceAccountKey\nand returns it." + }, + "delete": { + "description": "Deletes a ServiceAccountKey.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+/keys/[^/]+$", + "location": "path", + "description": "The resource name of the service account key in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.\nUsing `-` as a wildcard for the `PROJECT_ID` 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}/keys/{keysId}", + "path": "v1/{+name}", + "id": "iam.projects.serviceAccounts.keys.delete" + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListServiceAccountKeysResponse" + }, + "parameters": { + "keyTypes": { + "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, + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "location": "path", + "description": "The resource name of the service account in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.\n\nUsing `-` as a wildcard for the `PROJECT_ID`, 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}/keys", + "id": "iam.projects.serviceAccounts.keys.list", + "path": "v1/{+name}/keys", + "description": "Lists ServiceAccountKeys." + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "ServiceAccountKey" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "publicKeyType": { + "enum": [ + "TYPE_NONE", + "TYPE_X509_PEM_FILE", + "TYPE_RAW_PUBLIC_KEY" + ], + "description": "The output format of the public key requested.\nX509_PEM is the default output format.", + "type": "string", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+/keys/[^/]+$", + "location": "path", + "description": "The resource name of the service account key in the following format:\n`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.\n\nUsing `-` as a wildcard for the `PROJECT_ID` 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}/keys/{keysId}", + "id": "iam.projects.serviceAccounts.keys.get", + "path": "v1/{+name}", + "description": "Gets the ServiceAccountKey\nby key id." + } + } + } + } + }, + "roles": { + "methods": { + "delete": { + "path": "v1/{+name}", + "id": "iam.projects.roles.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", + "parameters": { + "etag": { + "description": "Used to perform a consistent read-modify-write.", + "format": "byte", + "type": "string", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/roles/[^/]+$", + "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}`", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/roles/{rolesId}" + }, + "list": { + "id": "iam.projects.roles.list", + "path": "v1/{+parent}/roles", + "description": "Lists the Roles defined on a resource.", + "httpMethod": "GET", + "response": { + "$ref": "ListRolesResponse" + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageToken": { + "description": "Optional pagination token returned in an earlier ListRolesResponse.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "Optional limit on the number of roles to include in the response.", + "format": "int32", + "type": "integer" + }, + "view": { + "enum": [ + "BASIC", + "FULL" + ], + "description": "Optional view for the returned Role objects.", + "type": "string", + "location": "query" + }, + "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}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "showDeleted": { + "description": "Include Roles that have been deleted.", + "type": "boolean", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/roles" + }, + "create": { + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The resource name of the parent resource in one of the following formats:\n`organizations/{ORGANIZATION_ID}`\n`projects/{PROJECT_ID}`", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/projects/{projectsId}/roles", + "path": "v1/{+parent}/roles", + "id": "iam.projects.roles.create", + "description": "Creates a new Role.", + "request": { + "$ref": "CreateRoleRequest" + } + }, + "patch": { + "httpMethod": "PATCH", + "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}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/roles/[^/]+$", + "location": "path" + }, + "updateMask": { + "location": "query", + "description": "A mask describing which fields in the Role have changed.", + "format": "google-fieldmask", + "type": "string" + } + }, + "flatPath": "v1/projects/{projectsId}/roles/{rolesId}", + "id": "iam.projects.roles.patch", + "path": "v1/{+name}", + "description": "Updates a Role definition.", + "request": { + "$ref": "Role" + } + }, + "undelete": { + "path": "v1/{+name}:undelete", + "id": "iam.projects.roles.undelete", + "description": "Undelete a Role, bringing it back in its previous state.", + "request": { + "$ref": "UndeleteRoleRequest" + }, + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "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}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/roles/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/roles/{rolesId}:undelete" + }, + "get": { + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "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}`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/roles/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/roles/{rolesId}", + "path": "v1/{+name}", + "id": "iam.projects.roles.get", + "description": "Gets a Role definition." + } + } + } + } + }, + "roles": { + "methods": { + "queryGrantableRoles": { + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "QueryGrantableRolesResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/roles:queryGrantableRoles", + "id": "iam.roles.queryGrantableRoles", + "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." + }, + "list": { + "path": "v1/roles", + "id": "iam.roles.list", + "description": "Lists the Roles defined on a resource.", + "response": { + "$ref": "ListRolesResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "pageToken": { + "description": "Optional pagination token returned in an earlier ListRolesResponse.", + "type": "string", + "location": "query" + }, + "pageSize": { + "description": "Optional limit on the number of roles to include in the response.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "view": { + "location": "query", + "enum": [ + "BASIC", + "FULL" + ], + "description": "Optional view for the returned Role objects.", + "type": "string" + }, + "parent": { + "location": "query", + "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" + }, + "showDeleted": { + "description": "Include Roles that have been deleted.", + "type": "boolean", + "location": "query" + } + }, + "flatPath": "v1/roles" + }, + "get": { + "description": "Gets a Role definition.", + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^roles/[^/]+$", + "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}`", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/roles/{rolesId}", + "path": "v1/{+name}", + "id": "iam.roles.get" + } + } + }, + "permissions": { + "methods": { + "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" + }, + "response": { + "$ref": "QueryTestablePermissionsResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1/permissions:queryTestablePermissions", + "path": "v1/permissions:queryTestablePermissions", + "id": "iam.permissions.queryTestablePermissions" + } + } + }, + "organizations": { + "resources": { + "roles": { + "methods": { + "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": { + "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}`", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+/roles/[^/]+$", + "location": "path" + }, + "etag": { + "location": "query", + "description": "Used to perform a consistent read-modify-write.", + "format": "byte", + "type": "string" + } + }, + "flatPath": "v1/organizations/{organizationsId}/roles/{rolesId}", + "path": "v1/{+name}", + "id": "iam.organizations.roles.delete" + }, + "list": { + "description": "Lists the Roles defined on a resource.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListRolesResponse" + }, + "parameters": { + "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}`", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+$", + "location": "path" + }, + "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" + }, + "pageSize": { + "location": "query", + "description": "Optional limit on the number of roles to include in the response.", + "format": "int32", + "type": "integer" + }, + "view": { + "enum": [ + "BASIC", + "FULL" + ], + "description": "Optional view for the returned Role objects.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/organizations/{organizationsId}/roles", + "id": "iam.organizations.roles.list", + "path": "v1/{+parent}/roles" + }, + "create": { + "description": "Creates a new Role.", + "request": { + "$ref": "CreateRoleRequest" + }, + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "pattern": "^organizations/[^/]+$", + "location": "path", + "description": "The resource name of the parent resource in one of the following formats:\n`organizations/{ORGANIZATION_ID}`\n`projects/{PROJECT_ID}`", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/organizations/{organizationsId}/roles", + "path": "v1/{+parent}/roles", + "id": "iam.organizations.roles.create" + }, + "undelete": { + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^organizations/[^/]+/roles/[^/]+$", + "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}`", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/organizations/{organizationsId}/roles/{rolesId}:undelete", + "path": "v1/{+name}:undelete", + "id": "iam.organizations.roles.undelete", + "description": "Undelete a Role, bringing it back in its previous state.", + "request": { + "$ref": "UndeleteRoleRequest" + } + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "pattern": "^organizations/[^/]+/roles/[^/]+$", + "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}`", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/organizations/{organizationsId}/roles/{rolesId}", + "id": "iam.organizations.roles.get", + "path": "v1/{+name}", + "description": "Gets a Role definition." + }, + "patch": { + "response": { + "$ref": "Role" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "location": "query", + "description": "A mask describing which fields in the Role have changed.", + "format": "google-fieldmask", + "type": "string" + }, + "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}`", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+/roles/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/organizations/{organizationsId}/roles/{rolesId}", + "path": "v1/{+name}", + "id": "iam.organizations.roles.patch", + "request": { + "$ref": "Role" + }, + "description": "Updates a Role definition." + } + } + } + } + } + }, + "parameters": { + "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": { + "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": { + "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": { + "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": { + "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" + } + }, "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", + "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": "", - "revision": "20170919", - "documentationLink": "https://cloud.google.com/iam/", "id": "iam:v1", + "documentationLink": "https://cloud.google.com/iam/", + "revision": "20171130", "discoveryVersion": "v1", "version_module": true, "schemas": { - "SetIamPolicyRequest": { - "description": "Request message for `SetIamPolicy` method.", + "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": { - "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." + "privateKeyType": { + "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" + ], + "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", + "type": "string" + }, + "privateKeyData": { + "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.", + "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/{ACCOUNT}/keys/{key}`.", + "type": "string" + }, + "validBeforeTime": { + "description": "The key can be used before this timestamp.", + "format": "google-datetime", + "type": "string" + }, + "keyAlgorithm": { + "enum": [ + "KEY_ALG_UNSPECIFIED", + "KEY_ALG_RSA_1024", + "KEY_ALG_RSA_2048", + "KEY_ALG_GCS_SYMMETRIC_HMAC" + ], + "description": "Specifies the algorithm (and possibly key size) for the key.", + "type": "string", + "enumDescriptions": [ + "An unspecified key algorithm.", + "1k RSA Key.", + "2k RSA Key.", + "HMAC." + ] } }, - "id": "SetIamPolicyRequest" + "id": "ServiceAccountKey" + }, + "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" + }, + "Permission": { + "description": "A permission which can be included by a role.", + "type": "object", + "properties": { + "description": { + "description": "A brief description of what this Permission is used for.", + "type": "string" + }, + "customRolesSupportLevel": { + "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" + ], + "description": "The current custom role support level.", + "type": "string" + }, + "stage": { + "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" + ], + "description": "The current launch stage of the permission.", + "type": "string" + }, + "name": { + "description": "The name of this Permission.", + "type": "string" + }, + "onlyInPredefinedRoles": { + "description": "This permission can ONLY be used in predefined roles.", + "type": "boolean" + }, + "title": { + "description": "The title of this Permission.", + "type": "string" + } + }, + "id": "Permission" + }, + "SignJwtRequest": { + "properties": { + "payload": { + "description": "The JWT payload to sign, a JSON JWT Claim set.", + "type": "string" + } + }, + "id": "SignJwtRequest", + "description": "The service account sign JWT request.", + "type": "object" + }, + "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" + } + } + }, + "id": "PolicyDelta" + }, + "ListServiceAccountsResponse": { + "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.", + "type": "array", + "items": { + "$ref": "ServiceAccount" + } + } + }, + "id": "ListServiceAccountsResponse", + "description": "The service account list response.", + "type": "object" + }, + "QueryGrantableRolesResponse": { + "properties": { + "roles": { + "description": "The list of matching roles.", + "type": "array", + "items": { + "$ref": "Role" + } + }, + "nextPageToken": { + "description": "To retrieve the next page of results, set\n`QueryGrantableRolesRequest.page_token` to this value.", + "type": "string" + } + }, + "id": "QueryGrantableRolesResponse", + "description": "The grantable role query response.", + "type": "object" + }, + "SignBlobRequest": { + "description": "The service account sign blob request.", + "type": "object", + "properties": { + "bytesToSign": { + "description": "The bytes to sign.", + "format": "byte", + "type": "string" + } + }, + "id": "SignBlobRequest" + }, + "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" }, "QueryTestablePermissionsResponse": { "description": "The response containing permissions which can be tested on a resource.", "type": "object", "properties": { + "permissions": { + "description": "The Permissions testable on the requested resource.", + "type": "array", + "items": { + "$ref": "Permission" + } + }, "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": { - "$ref": "Permission" - }, - "type": "array" } }, "id": "QueryTestablePermissionsResponse" @@ -51,22 +1286,22 @@ "type": "object", "properties": { "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." + "2k RSA Key.", + "HMAC." ], "enum": [ "KEY_ALG_UNSPECIFIED", "KEY_ALG_RSA_1024", - "KEY_ALG_RSA_2048" - ] + "KEY_ALG_RSA_2048", + "KEY_ALG_GCS_SYMMETRIC_HMAC" + ], + "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" }, "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.", @@ -76,7 +1311,9 @@ "TYPE_UNSPECIFIED", "TYPE_PKCS12_FILE", "TYPE_GOOGLE_CREDENTIALS_FILE" - ] + ], + "description": "The output format of the private key. `GOOGLE_CREDENTIALS_FILE` is the\ndefault output format.", + "type": "string" } }, "id": "CreateServiceAccountKeyRequest" @@ -85,166 +1322,152 @@ "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" + }, + "signedJwt": { + "description": "The signed 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).", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } } }, - "id": "TestIamPermissionsRequest" + "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.", + "format": "byte", "type": "string" }, "version": { - "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`.\n`bindings` with no members will result in an error.", + "type": "array", "items": { "$ref": "Binding" - }, - "type": "array" + } } }, - "id": "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" }, "ListRolesResponse": { - "description": "The response containing the roles defined under a resource.", - "type": "object", "properties": { + "roles": { + "description": "The Roles defined on this resource.", + "type": "array", + "items": { + "$ref": "Role" + } + }, "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" + "id": "ListRolesResponse", + "description": "The response containing the roles defined under a resource.", + "type": "object" }, "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" + "id": "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" }, "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" }, + "condition": { + "$ref": "Expr", + "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" + }, "role": { "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", "type": "string" }, "action": { + "enum": [ + "ACTION_UNSPECIFIED", + "ADD", + "REMOVE" + ], "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" + "id": "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" }, "UndeleteRoleRequest": { - "description": "The request to undelete an existing role.", - "type": "object", "properties": { "etag": { - "format": "byte", "description": "Used to perform a consistent read-modify-write.", + "format": "byte", "type": "string" } }, - "id": "UndeleteRoleRequest" + "id": "UndeleteRoleRequest", + "description": "The request to undelete an existing role.", + "type": "object" }, "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" + }, + "serviceAccount": { + "description": "The ServiceAccount resource to create.\nCurrently, only the following values are user assignable:\n`display_name` .", + "$ref": "ServiceAccount" } }, "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.", + "format": "byte", "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", @@ -254,7 +1477,15 @@ "EAP" ], "description": "The current launch stage of the role.", - "type": "string" + "type": "string", + "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." + ] }, "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.", @@ -270,13 +1501,19 @@ }, "includedPermissions": { "description": "The names of the permissions this role grants when bound in an IAM policy.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } + }, + "description": { + "description": "Optional. A human-readable description for the role.", + "type": "string" } }, - "id": "Role" + "id": "Role", + "description": "A role in the Identity and Access Management API.", + "type": "object" }, "Binding": { "description": "Associates `members` with a `role`.", @@ -284,10 +1521,10 @@ "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", @@ -296,85 +1533,8 @@ }, "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" @@ -382,52 +1542,101 @@ "pageToken": { "description": "Optional pagination token returned in an earlier\nQueryGrantableRolesResponse.", "type": "string" + }, + "pageSize": { + "description": "Optional limit on the number of roles to include in the response.", + "format": "int32", + "type": "integer" + }, + "view": { + "enum": [ + "BASIC", + "FULL" + ], + "type": "string", + "enumDescriptions": [ + "Omits the `included_permissions` field.\nThis is the default value.", + "Returns all fields." + ] } }, - "id": "QueryGrantableRolesRequest" + "id": "QueryGrantableRolesRequest", + "description": "The grantable role query request.", + "type": "object" + }, + "ServiceAccount": { + "properties": { + "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/{ACCOUNT}`.\n\nRequests using `-` as a wildcard for the `PROJECT_ID` will infer the\nproject from the `account` and the `ACCOUNT` value can be the `email`\naddress or the `unique_id` of the service account.\n\nIn responses the resource name will always be in the format\n`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.", + "type": "string" + }, + "email": { + "description": "@OutputOnly The email address of the service account.", + "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" + }, + "displayName": { + "description": "Optional. A user-specified description of the service account. Must be\nfewer than 100 UTF-8 bytes.", + "type": "string" + } + }, + "id": "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 the format of projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}. The caller\ncan use 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/{ACCOUNT}`.\nUsing `-` as a wildcard for the `PROJECT_ID` 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" + }, + "Expr": { + "properties": { + "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" + }, + "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" + }, + "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" + } + }, + "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\"", + "type": "object" }, "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" + "$ref": "Role", + "description": "The Role resource to create." } }, - "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" + "id": "CreateRoleRequest", + "description": "The request to create a new role.", + "type": "object" }, "QueryTestablePermissionsRequest": { "description": "A request to get permissions which can be tested on a resource.", @@ -442,220 +1651,47 @@ "type": "string" }, "pageSize": { - "format": "int32", "description": "Optional limit on the number of permissions to include in the response.", + "format": "int32", "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", + "TestIamPermissionsResponse": { "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": [ - "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" - ], - "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" - }, - "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" - }, - "SignBlobResponse": { - "description": "The service account sign blob response.", - "type": "object", - "properties": { - "signature": { - "format": "byte", - "description": "The signed blob.", - "type": "string" - }, - "keyId": { - "description": "The id of the key used to sign the blob.", - "type": "string" - } - }, - "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.", + "permissions": { + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.", + "type": "array", "items": { - "$ref": "BindingDelta" - }, - "type": "array" + "type": "string" + } } }, - "id": "PolicyDelta" + "id": "TestIamPermissionsResponse", + "description": "Response message for `TestIamPermissions` method.", + "type": "object" }, - "ListServiceAccountsResponse": { - "description": "The service account list response.", + "ListServiceAccountKeysResponse": { + "description": "The service account keys 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.", + "keys": { + "description": "The public keys for the service account.", + "type": "array", "items": { - "$ref": "ServiceAccount" - }, - "type": "array" + "$ref": "ServiceAccountKey" + } } }, - "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" + "id": "ListServiceAccountKeysResponse" } }, + "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": "iam", "auth": { "oauth2": { @@ -666,1037 +1702,5 @@ } } }, - "rootUrl": "https://iam.googleapis.com/", - "ownerDomain": "google.com", - "name": "iam", - "batchPath": "batch", - "fullyEncodeReservedExpansion": true, - "title": "Google Identity and Access Management (IAM) API", - "ownerName": "Google", - "resources": { - "projects": { - "resources": { - "roles": { - "methods": { - "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": "Role" - }, - "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": "^projects/[^/]+/roles/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectsId}/roles/{rolesId}:undelete", - "path": "v1/{+name}:undelete", - "id": "iam.projects.roles.undelete" - }, - "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": "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": "^projects/[^/]+/roles/[^/]+$" - }, - "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", - "format": "int32", - "description": "Optional limit on the number of roles to include in the response.", - "type": "integer" - }, - "view": { - "description": "Optional view for the returned Role objects.", - "type": "string", - "location": "query", - "enum": [ - "BASIC", - "FULL" - ] - }, - "parent": { - "location": "path", - "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}/roles", - "path": "v1/{+parent}/roles", - "id": "iam.projects.roles.list" - }, - "create": { - "description": "Creates a new Role.", - "request": { - "$ref": "CreateRoleRequest" - }, - "httpMethod": "POST", - "parameterOrder": [ - "parent" - ], - "response": { - "$ref": "Role" - }, - "parameters": { - "parent": { - "location": "path", - "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": "^projects/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "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" - }, - "parameterOrder": [ - "name" - ], - "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}", - "path": "v1/{+name}", - "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" - }, - "httpMethod": "PUT", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "ServiceAccount" - }, - "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\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, - "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "testIamPermissions": { - "request": { - "$ref": "TestIamPermissionsRequest" - }, - "description": "Tests the specified permissions against the IAM access control policy\nfor a ServiceAccount.", - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "parameterOrder": [ - "resource" - ], - "httpMethod": "POST", - "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", - "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", - "parameterOrder": [ - "name" - ], - "response": { - "$ref": "Empty" - }, - "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.", - "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}: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": { - "delete": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "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.", - "type": "string", - "required": true, - "pattern": "^projects/[^/]+/serviceAccounts/[^/]+/keys/[^/]+$" - } - }, - "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys/{keysId}", - "id": "iam.projects.serviceAccounts.keys.delete", - "path": "v1/{+name}", - "description": "Deletes a ServiceAccountKey." - }, - "get": { - "httpMethod": "GET", - "response": { - "$ref": "ServiceAccountKey" - }, - "parameterOrder": [ - "name" - ], - "parameters": { - "publicKeyType": { - "description": "The output format of the public key requested.\nX509_PEM is the default output format.", - "type": "string", - "location": "query", - "enum": [ - "TYPE_NONE", - "TYPE_X509_PEM_FILE", - "TYPE_RAW_PUBLIC_KEY" - ] - }, - "name": { - "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.", - "type": "string", - "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." - } - } - } - } - } - } - }, - "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" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": {}, - "flatPath": "v1/roles:queryGrantableRoles", - "path": "v1/roles:queryGrantableRoles", - "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": { - "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": { - "description": "Selector specifying which fields to include in a partial response.", - "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": { - "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": { - "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" - } - } + "rootUrl": "https://iam.googleapis.com/" } diff --git a/etc/api/identitytoolkit/v3/identitytoolkit-api.json b/etc/api/identitytoolkit/v3/identitytoolkit-api.json index 92f660ec78..e492151d8a 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/YDuUtEWk-s4RoFmU1uyfiL_piZ0\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/5REpmDGFG7X9F_txWwyqL9Yixn0\"", "discoveryVersion": "v1", "id": "identitytoolkit:v3", "name": "identitytoolkit", "canonicalName": "Identity Toolkit", "version": "v3", - "revision": "20170828", + "revision": "20171122", "title": "Google Identity Toolkit API", "description": "Help the third party sites to implement federated login.", "ownerDomain": "google.com", @@ -120,6 +120,13 @@ "sessionId": { "type": "string", "description": "Session ID which should be passed in the following verifyAssertion request." + }, + "signinMethods": { + "type": "array", + "description": "All sign-in methods this user has used.", + "items": { + "type": "string" + } } } }, @@ -158,6 +165,43 @@ } } }, + "EmailLinkSigninResponse": { + "id": "EmailLinkSigninResponse", + "type": "object", + "description": "Response of email signIn.", + "properties": { + "email": { + "type": "string", + "description": "The user's email." + }, + "expiresIn": { + "type": "string", + "description": "Expiration time of STS id token in seconds.", + "format": "int64" + }, + "idToken": { + "type": "string", + "description": "The STS id token to login the newly signed in user." + }, + "isNewUser": { + "type": "boolean", + "description": "Whether the user is new." + }, + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#EmailLinkSigninResponse\".", + "default": "identitytoolkit#EmailLinkSigninResponse" + }, + "localId": { + "type": "string", + "description": "The RP local ID of the user." + }, + "refreshToken": { + "type": "string", + "description": "The refresh token for the signed in user." + } + } + }, "EmailTemplate": { "id": "EmailTemplate", "type": "object", @@ -360,6 +404,25 @@ } } }, + "IdentitytoolkitRelyingpartyEmailLinkSigninRequest": { + "id": "IdentitytoolkitRelyingpartyEmailLinkSigninRequest", + "type": "object", + "description": "Request to sign in with email.", + "properties": { + "email": { + "type": "string", + "description": "The email address of the user." + }, + "idToken": { + "type": "string", + "description": "Token for linking flow." + }, + "oobCode": { + "type": "string", + "description": "The confirmation code." + } + } + }, "IdentitytoolkitRelyingpartyGetAccountInfoRequest": { "id": "IdentitytoolkitRelyingpartyGetAccountInfoRequest", "type": "object", @@ -1751,6 +1814,21 @@ "https://www.googleapis.com/auth/firebase" ] }, + "emailLinkSignin": { + "id": "identitytoolkit.relyingparty.emailLinkSignin", + "path": "emailLinkSignin", + "httpMethod": "POST", + "description": "Reset password for a user.", + "request": { + "$ref": "IdentitytoolkitRelyingpartyEmailLinkSigninRequest" + }, + "response": { + "$ref": "EmailLinkSigninResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "getAccountInfo": { "id": "identitytoolkit.relyingparty.getAccountInfo", "path": "getAccountInfo", diff --git a/etc/api/kgsearch/v1/kgsearch-api.json b/etc/api/kgsearch/v1/kgsearch-api.json index a4f00c436d..1bb16a23bc 100644 --- a/etc/api/kgsearch/v1/kgsearch-api.json +++ b/etc/api/kgsearch/v1/kgsearch-api.json @@ -1,24 +1,28 @@ { - "ownerName": "Google", "discoveryVersion": "v1", + "ownerName": "Google", "version_module": true, "resources": { "entities": { "methods": { "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": { - "indent": { + "types": { "location": "query", + "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 + }, + "indent": { "description": "Enables indenting of json results.", - "type": "boolean" + "type": "boolean", + "location": "query" }, "languages": { "description": "The list of language codes (defined in ISO 693) to run the query with,\ne.g. 'en'.", @@ -27,58 +31,49 @@ "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" + "type": "string", + "repeated": true, + "location": "query" }, "limit": { "location": "query", - "format": "int32", "description": "Limits the number of entities to be returned.", + "format": "int32", "type": "integer" }, "prefix": { + "location": "query", "description": "Enables prefix match against names and aliases of entities", - "type": "boolean", - "location": "query" + "type": "boolean" }, "query": { "location": "query", "description": "The literal query string for search.", "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" } }, - "flatPath": "v1/entities:search" + "flatPath": "v1/entities:search", + "path": "v1/entities:search", + "id": "kgsearch.entities.search" } } } }, "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" - }, - "bearer_token": { "location": "query", - "description": "OAuth bearer token.", - "type": "string" + "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": { + "description": "OAuth bearer token.", "type": "string", "location": "query" }, @@ -88,22 +83,23 @@ "type": "string" }, "prettyPrint": { - "default": "true", - "type": "boolean", "location": "query", - "description": "Returns response with indentations and line breaks." + "description": "Returns response with indentations and line breaks.", + "type": "boolean", + "default": "true" }, - "uploadType": { - "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" }, - "fields": { + "uploadType": { "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" }, "$.xgafv": { + "description": "V1 error format.", "type": "string", "enumDescriptions": [ "v1 error format", @@ -113,8 +109,7 @@ "enum": [ "1", "2" - ], - "description": "V1 error format." + ] }, "callback": { "location": "query", @@ -137,15 +132,20 @@ "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" + }, + "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" } }, "schemas": { @@ -153,17 +153,17 @@ "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" }, + "itemListElement": { + "description": "The item list of search results.", + "type": "array", + "items": { + "type": "any" + } + }, "@type": { "description": "The schema type of top-level JSON-LD object, e.g. ItemList.", "type": "any" @@ -172,11 +172,11 @@ "id": "SearchResponse" } }, - "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" + }, "version": "v1", "baseUrl": "https://kgsearch.googleapis.com/", "servicePath": "", @@ -187,8 +187,8 @@ "ownerDomain": "google.com", "name": "kgsearch", "batchPath": "batch", - "id": "kgsearch:v1", + "revision": "20171103", "documentationLink": "https://developers.google.com/knowledge-graph/", - "revision": "20170925", + "id": "kgsearch:v1", "title": "Knowledge Graph Search API" } diff --git a/etc/api/language/v1/language-api.json b/etc/api/language/v1/language-api.json index 7b0c648c49..8078b1ff24 100644 --- a/etc/api/language/v1/language-api.json +++ b/etc/api/language/v1/language-api.json @@ -1,807 +1,11 @@ { - "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", + "revision": "20171204", "documentationLink": "https://cloud.google.com/natural-language/", - "revision": "20170918", "discoveryVersion": "v1", "version_module": true, "schemas": { - "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": { - "extractEntitySentiment": { - "description": "Extract entities and their associated sentiment.", - "type": "boolean" - }, - "extractDocumentSentiment": { - "description": "Extract document-level sentiment.", - "type": "boolean" - }, - "extractSyntax": { - "description": "Extract syntax information.", - "type": "boolean" - }, - "extractEntities": { - "description": "Extract entities.", - "type": "boolean" - } - } - }, - "EntityMention": { - "id": "EntityMention", - "description": "Represents a mention for an entity in the text. Currently, proper noun\nmentions are supported.", - "type": "object", - "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": { - "$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." - } - } - }, - "Sentence": { - "id": "Sentence", - "description": "Represents a sentence in the input document.", - "type": "object", - "properties": { - "text": { - "description": "The sentence text.", - "$ref": "TextSpan" - }, - "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" - } - } - }, - "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", - "HTML" - ], - "enum": [ - "TYPE_UNSPECIFIED", - "PLAIN_TEXT", - "HTML" - ] - } - } - }, - "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": { - "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": { - "form": { - "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" - ], - "description": "The grammatical form.", - "type": "string" - }, - "number": { - "description": "The grammatical number.", - "type": "string", - "enumDescriptions": [ - "Number is not applicable in the analyzed language or is not predicted.", - "Singular", - "Plural", - "Dual" - ], - "enum": [ - "NUMBER_UNKNOWN", - "SINGULAR", - "PLURAL", - "DUAL" - ] - }, - "voice": { - "description": "The grammatical 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" - ] - }, - "aspect": { - "description": "The grammatical aspect.", - "type": "string", - "enumDescriptions": [ - "Aspect is not applicable in the analyzed language or is not predicted.", - "Perfective", - "Imperfective", - "Progressive" - ], - "enum": [ - "ASPECT_UNKNOWN", - "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": { - "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" - ], - "enum": [ - "UNKNOWN", - "ADJ", - "ADP", - "ADV", - "CONJ", - "DET", - "NOUN", - "NUM", - "PRON", - "PRT", - "PUNCT", - "VERB", - "X", - "AFFIX" - ] - }, - "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": { - "description": "The grammatical person.", - "type": "string", - "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" - ] - }, - "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": { - "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.", - "type": "string" - }, - "tense": { - "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" - ], - "enum": [ - "TENSE_UNKNOWN", - "CONDITIONAL_TENSE", - "FUTURE", - "PAST", - "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" - ], - "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": "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": { @@ -811,113 +15,63 @@ }, "sentences": { "description": "Sentences in the input document.", + "type": "array", "items": { "$ref": "Sentence" - }, - "type": "array" + } }, "tokens": { "description": "Tokens, along with their syntactic information, in the input document.", + "type": "array", "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" + "id": "AnalyzeSyntaxResponse" }, "AnnotateTextResponse": { - "id": "AnnotateTextResponse", "description": "The text annotations response message.", "type": "object", "properties": { + "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" + } + }, + "categories": { + "description": "Categories identified in the input document.", + "type": "array", + "items": { + "$ref": "ClassificationCategory" + } + }, "documentSentiment": { - "description": "The overall sentiment for the document. Populated if the user enables\nAnnotateTextRequest.Features.extract_document_sentiment.", - "$ref": "Sentiment" + "$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.", - "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.", + "type": "array", "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." - } - } + }, + "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", @@ -1098,25 +252,40 @@ "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.", + "format": "int32", "type": "integer" } }, "id": "DependencyEdge" }, + "TextSpan": { + "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", + "description": "Represents an output piece of text.", + "type": "object" + }, "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" }, + "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" @@ -1126,34 +295,561 @@ "description": "Parts of speech tag for this token." } }, - "id": "Token" + "id": "Token", + "description": "Represents the smallest syntactic building block of the text." }, - "TextSpan": { - "id": "TextSpan", - "description": "Represents an output piece of text.", + "ClassifyTextResponse": { + "properties": { + "categories": { + "description": "Categories representing the input document.", + "type": "array", + "items": { + "$ref": "ClassificationCategory" + } + } + }, + "id": "ClassifyTextResponse", + "description": "The document classification response message.", + "type": "object" + }, + "EntityMention": { + "description": "Represents a mention for an entity in the text. Currently, proper noun\nmentions are supported.", "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" + "text": { + "$ref": "TextSpan", + "description": "The mention text." }, - "content": { - "description": "The content of the output text.", + "type": { + "enumDescriptions": [ + "Unknown", + "Proper name", + "Common noun (or noun compound)" + ], + "enum": [ + "TYPE_UNKNOWN", + "PROPER", + "COMMON" + ], + "description": "The type of the entity mention.", + "type": "string" + }, + "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.", + "$ref": "Sentiment" + } + }, + "id": "EntityMention" + }, + "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" + }, + "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." + } + }, + "id": "AnalyzeEntitySentimentRequest" + }, + "PartOfSpeech": { + "properties": { + "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": { + "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.", + "type": "string" + }, + "tense": { + "enumDescriptions": [ + "Tense is not applicable in the analyzed language or is not predicted.", + "Conditional", + "Future", + "Past", + "Present", + "Imperfect", + "Pluperfect" + ], + "enum": [ + "TENSE_UNKNOWN", + "CONDITIONAL_TENSE", + "FUTURE", + "PAST", + "PRESENT", + "IMPERFECT", + "PLUPERFECT" + ], + "description": "The grammatical tense.", + "type": "string" + }, + "reciprocity": { + "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.", + "type": "string" + }, + "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" + ], + "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", + "PLURAL", + "DUAL" + ], + "description": "The grammatical number.", + "type": "string" + }, + "voice": { + "description": "The grammatical 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" + ] + }, + "aspect": { + "description": "The grammatical aspect.", + "type": "string", + "enumDescriptions": [ + "Aspect is not applicable in the analyzed language or is not predicted.", + "Perfective", + "Imperfective", + "Progressive" + ], + "enum": [ + "ASPECT_UNKNOWN", + "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": { + "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": { + "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" + ] + }, + "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" + ] + } + }, + "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" + }, + "ClassificationCategory": { + "id": "ClassificationCategory", + "description": "Represents a category returned from the text classifier.", + "type": "object", + "properties": { + "confidence": { + "description": "The classifier's confidence of the category. Number represents how certain\nthe classifier is that this category represents the given text.", + "format": "float", + "type": "number" + }, + "name": { + "description": "The name of the category representing the document.", "type": "string" } } }, + "AnalyzeSyntaxRequest": { + "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": "AnalyzeSyntaxRequest", + "description": "The syntax analysis request message." + }, + "AnalyzeEntitiesResponse": { + "id": "AnalyzeEntitiesResponse", + "description": "The entity analysis response message.", + "type": "object", + "properties": { + "entities": { + "description": "The recognized entities in the input document.", + "type": "array", + "items": { + "$ref": "Entity" + } + }, + "language": { + "type": "string", + "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." + } + } + }, + "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": { + "type": "string", + "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." + }, + "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" + }, + "sentiment": { + "$ref": "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." + }, + "mentions": { + "description": "The mentions of this entity in the input document. The API currently\nsupports proper noun mentions.", + "type": "array", + "items": { + "$ref": "EntityMention" + } + } + }, + "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": { + "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." + }, + "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.", + "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": "AnalyzeSentimentRequest" + }, "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.", @@ -1161,20 +857,395 @@ }, "type": "object" }, - "type": "array" + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." }, "code": { - "format": "int32", "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" + }, + "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": { + "extractEntities": { + "description": "Extract entities.", + "type": "boolean" + }, + "classifyText": { + "description": "Classify the full document into categories.", + "type": "boolean" + }, + "extractSyntax": { + "description": "Extract syntax information.", + "type": "boolean" + }, + "extractDocumentSentiment": { + "description": "Extract document-level sentiment.", + "type": "boolean" + }, + "extractEntitySentiment": { + "description": "Extract entities and their associated sentiment.", + "type": "boolean" + } + }, + "id": "Features" + }, + "Document": { + "properties": { + "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" + }, + "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": { + "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": { + "description": "Input document.", + "$ref": "Document" + } + }, + "id": "AnalyzeEntitiesRequest" + }, + "ClassifyTextRequest": { + "description": "The document classification request message.", + "type": "object", + "properties": { + "document": { + "$ref": "Document", + "description": "Input document." + } + }, + "id": "ClassifyTextRequest" + }, + "AnalyzeEntitySentimentResponse": { + "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.", + "type": "array", + "items": { + "$ref": "Entity" + } + } + }, + "id": "AnalyzeEntitySentimentResponse", + "description": "The entity-level sentiment analysis response message.", + "type": "object" + }, + "AnalyzeSentimentResponse": { + "description": "The sentiment analysis response message.", + "type": "object", + "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": { + "description": "The sentiment for all the sentences in the document.", + "type": "array", + "items": { + "$ref": "Sentence" + } + } + }, + "id": "AnalyzeSentimentResponse" } }, "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" + "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": { + "analyzeSyntax": { + "response": { + "$ref": "AnalyzeSyntaxResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "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", + "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" + } + }, + "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" + ], + "flatPath": "v1/documents:annotateText", + "path": "v1/documents:annotateText", + "id": "language.documents.annotateText" + }, + "classifyText": { + "flatPath": "v1/documents:classifyText", + "path": "v1/documents:classifyText", + "id": "language.documents.classifyText", + "request": { + "$ref": "ClassifyTextRequest" + }, + "description": "Classifies a document into categories.", + "response": { + "$ref": "ClassifyTextResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "analyzeSentiment": { + "response": { + "$ref": "AnalyzeSentimentResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "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", + "description": "Analyzes the sentiment of the provided text.", + "request": { + "$ref": "AnalyzeSentimentRequest" + } + }, + "analyzeEntitySentiment": { + "path": "v1/documents:analyzeEntitySentiment", + "id": "language.documents.analyzeEntitySentiment", + "description": "Finds entities, similar to AnalyzeEntities in the text and analyzes\nsentiment associated with each entity and its mentions.", + "request": { + "$ref": "AnalyzeEntitySentimentRequest" + }, + "response": { + "$ref": "AnalyzeEntitySentimentResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1/documents:analyzeEntitySentiment" + }, + "analyzeEntities": { + "path": "v1/documents:analyzeEntities", + "id": "language.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.", + "response": { + "$ref": "AnalyzeEntitiesResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/documents:analyzeEntities" + } + } + } + }, + "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": { + "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" + }, + "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" + }, + "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": { + "type": "string", + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." + }, + "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" + } + }, + "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": "" } diff --git a/etc/api/language/v1beta1/language-api.json b/etc/api/language/v1beta1/language-api.json index 75bfb4753e..2055094945 100644 --- a/etc/api/language/v1beta1/language-api.json +++ b/etc/api/language/v1beta1/language-api.json @@ -1,229 +1,244 @@ { + "ownerDomain": "google.com", + "name": "language", + "batchPath": "batch", + "title": "Google Cloud Natural Language API", + "ownerName": "Google", + "resources": { + "documents": { + "methods": { + "annotateText": { + "request": { + "$ref": "AnnotateTextRequest" + }, + "description": "A convenience method that provides all the features that analyzeSentiment,\nanalyzeEntities, and analyzeSyntax provide in one call.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "AnnotateTextResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/documents:annotateText", + "id": "language.documents.annotateText", + "path": "v1beta1/documents:annotateText" + }, + "analyzeEntities": { + "response": { + "$ref": "AnalyzeEntitiesResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1beta1/documents:analyzeEntities", + "path": "v1beta1/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": { + "response": { + "$ref": "AnalyzeSyntaxResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta1/documents:analyzeSyntax", + "path": "v1beta1/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." + }, + "analyzeSentiment": { + "flatPath": "v1beta1/documents:analyzeSentiment", + "id": "language.documents.analyzeSentiment", + "path": "v1beta1/documents:analyzeSentiment", + "request": { + "$ref": "AnalyzeSentimentRequest" + }, + "description": "Analyzes the sentiment of the provided text.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "AnalyzeSentimentResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + }, + "parameters": { + "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": { + "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": { + "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" + }, + "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": { + "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." + } + }, + "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": "", "basePath": "", - "id": "language:v1beta1", + "revision": "20171204", "documentationLink": "https://cloud.google.com/natural-language/", - "revision": "20170918", + "id": "language:v1beta1", "discoveryVersion": "v1", "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" + "form": { + "enum": [ + "FORM_UNKNOWN", + "ADNOMIAL", + "AUXILIARY", + "COMPLEMENTIZER", + "FINAL_ENDING", + "GERUND", + "REALIS", + "IRREALIS", + "SHORT", + "LONG", + "ORDER", + "SPECIFIC" ], + "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" + ] + }, + "number": { + "type": "string", + "enumDescriptions": [ + "Number is not applicable in the analyzed language or is not predicted.", + "Singular", + "Plural", + "Dual" + ], + "enum": [ + "NUMBER_UNKNOWN", + "SINGULAR", + "PLURAL", + "DUAL" + ], + "description": "The grammatical number." + }, + "voice": { "enum": [ "VOICE_UNKNOWN", "ACTIVE", @@ -231,25 +246,40 @@ "PASSIVE" ], "description": "The grammatical voice.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Voice is not applicable in the analyzed language or is not predicted.", + "Active", + "Causative", + "Passive" + ] }, "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" - ] + ], + "enum": [ + "ASPECT_UNKNOWN", + "PERFECTIVE", + "IMPERFECTIVE", + "PROGRESSIVE" + ], + "description": "The grammatical aspect." }, "mood": { + "enum": [ + "MOOD_UNKNOWN", + "CONDITIONAL_MOOD", + "IMPERATIVE", + "INDICATIVE", + "INTERROGATIVE", + "JUSSIVE", + "SUBJUNCTIVE" + ], "description": "The grammatical mood.", "type": "string", "enumDescriptions": [ @@ -260,35 +290,9 @@ "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", @@ -305,7 +309,24 @@ "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." }, "gender": { "enum": [ @@ -324,6 +345,7 @@ ] }, "person": { + "type": "string", "enumDescriptions": [ "Person is not applicable in the analyzed language or is not predicted.", "First", @@ -338,8 +360,7 @@ "THIRD", "REFLEXIVE_PERSON" ], - "description": "The grammatical person.", - "type": "string" + "description": "The grammatical person." }, "proper": { "enum": [ @@ -394,16 +415,6 @@ "description": "The grammatical case." }, "tense": { - "type": "string", - "enumDescriptions": [ - "Tense is not applicable in the analyzed language or is not predicted.", - "Conditional", - "Future", - "Past", - "Present", - "Imperfect", - "Pluperfect" - ], "enum": [ "TENSE_UNKNOWN", "CONDITIONAL_TENSE", @@ -413,7 +424,17 @@ "IMPERFECT", "PLUPERFECT" ], - "description": "The grammatical tense." + "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": { "enum": [ @@ -428,54 +449,6 @@ "Reciprocal", "Non-reciprocal" ] - }, - "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" - ], - "description": "The grammatical form." - }, - "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" - ] } }, "id": "PartOfSpeech" @@ -485,6 +458,7 @@ "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.", @@ -497,37 +471,36 @@ "UTF16", "UTF32" ], - "description": "The encoding type used by the API to calculate offsets.", - "type": "string" + "description": "The encoding type used by the API to calculate offsets." }, "document": { - "description": "Input document.", - "$ref": "Document" + "$ref": "Document", + "description": "Input document." } }, "id": "AnalyzeSyntaxRequest" }, "AnalyzeSentimentResponse": { + "type": "object", "properties": { "documentSentiment": { - "description": "The overall sentiment of the input document.", - "$ref": "Sentiment" + "$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" - }, - "type": "array", - "description": "The sentiment for all the sentences in the document." + } } }, "id": "AnalyzeSentimentResponse", - "description": "The sentiment analysis response message.", - "type": "object" + "description": "The sentiment analysis response message." }, "AnalyzeEntitiesResponse": { "description": "The entity analysis response message.", @@ -539,10 +512,10 @@ }, "entities": { "description": "The recognized entities in the input document.", + "type": "array", "items": { "$ref": "Entity" - }, - "type": "array" + } } }, "id": "AnalyzeEntitiesResponse" @@ -551,29 +524,7 @@ "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", @@ -585,14 +536,36 @@ "OTHER" ], "description": "The entity type.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Unknown", + "Person", + "Location", + "Organization", + "Event", + "Work of art", + "Consumer goods", + "Other types" + ] + }, + "metadata": { + "type": "object", + "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." + }, + "salience": { + "type": "number", + "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" }, "mentions": { - "description": "The mentions of this entity in the input document. The API currently\nsupports proper noun mentions.", + "type": "array", "items": { "$ref": "EntityMention" }, - "type": "array" + "description": "The mentions of this entity in the input document. The API currently\nsupports proper noun mentions." }, "name": { "description": "The representative name for the entity.", @@ -602,39 +575,40 @@ "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": { + "type": "array", "items": { "$ref": "Token" }, - "type": "array", "description": "Tokens, along with their syntactic information, in the input document." + }, + "language": { + "type": "string", + "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." + }, + "sentences": { + "type": "array", + "items": { + "$ref": "Sentence" + }, + "description": "Sentences in the input document." } }, - "id": "AnalyzeSyntaxResponse" + "id": "AnalyzeSyntaxResponse", + "description": "The syntax analysis response message." }, "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" + "$ref": "Features", + "description": "The enabled features." }, "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.", @@ -647,8 +621,7 @@ "UTF16", "UTF32" ], - "description": "The encoding type used by the API to calculate offsets.", - "type": "string" + "description": "The encoding type used by the API to calculate offsets." }, "document": { "$ref": "Document", @@ -658,8 +631,6 @@ "id": "AnnotateTextRequest" }, "AnalyzeSentimentRequest": { - "id": "AnalyzeSentimentRequest", - "description": "The sentiment analysis request message.", "type": "object", "properties": { "encodingType": { @@ -682,18 +653,26 @@ "$ref": "Document", "description": "Input document." } - } + }, + "id": "AnalyzeSentimentRequest", + "description": "The sentiment analysis request message." }, "AnnotateTextResponse": { - "description": "The text annotations response message.", "type": "object", "properties": { + "tokens": { + "type": "array", + "items": { + "$ref": "Token" + }, + "description": "Tokens, along with their syntactic information, in the input document.\nPopulated if the user enables\nAnnotateTextRequest.Features.extract_syntax." + }, "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" }, - "type": "array" + "description": "Entities, along with their semantic information, in the input document.\nPopulated if the user enables\nAnnotateTextRequest.Features.extract_entities." }, "documentSentiment": { "$ref": "Sentiment", @@ -704,26 +683,24 @@ "type": "string" }, "sentences": { + "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.", - "items": { - "$ref": "Token" - }, - "type": "array" } }, - "id": "AnnotateTextResponse" + "id": "AnnotateTextResponse", + "description": "The text annotations response message." }, "DependencyEdge": { - "description": "Represents dependency parse tree information for a token.", "type": "object", "properties": { + "headTokenIndex": { + "type": "integer", + "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" + }, "label": { "type": "string", "enumDescriptions": [ @@ -897,213 +874,236 @@ "NCOMP" ], "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" } }, - "id": "DependencyEdge" + "id": "DependencyEdge", + "description": "Represents dependency parse tree information for a token." + }, + "TextSpan": { + "type": "object", + "properties": { + "beginOffset": { + "type": "integer", + "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" + }, + "content": { + "description": "The content of the output text.", + "type": "string" + } + }, + "id": "TextSpan", + "description": "Represents an output piece of text." + }, + "Token": { + "type": "object", + "properties": { + "partOfSpeech": { + "$ref": "PartOfSpeech", + "description": "Parts of speech tag for this token." + }, + "text": { + "$ref": "TextSpan", + "description": "The token text." + }, + "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." + }, + "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": { + "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." + }, + "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": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + } + } + } + }, + "id": "Status" + }, + "EntityMention": { + "type": "object", + "properties": { + "text": { + "$ref": "TextSpan", + "description": "The mention text." + }, + "type": { + "type": "string", + "enumDescriptions": [ + "Unknown", + "Proper name", + "Common noun (or noun compound)" + ], + "enum": [ + "TYPE_UNKNOWN", + "PROPER", + "COMMON" + ], + "description": "The type of the entity mention." + } + }, + "id": "EntityMention", + "description": "Represents a mention for an entity in the text. Currently, proper noun\nmentions are supported." + }, + "Features": { + "type": "object", + "properties": { + "extractEntities": { + "type": "boolean", + "description": "Extract entities." + }, + "extractSyntax": { + "description": "Extract syntax information.", + "type": "boolean" + }, + "extractDocumentSentiment": { + "type": "boolean", + "description": "Extract document-level sentiment." + } + }, + "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." + }, + "Document": { + "type": "object", + "properties": { + "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": { + "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", + "enumDescriptions": [ + "The content type is not specified.", + "Plain text", + "HTML" + ] + }, + "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" + } + }, + "id": "Document", + "description": "################################################################ #\n\nRepresents the input to API methods." + }, + "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." + } + }, + "id": "Sentence" + }, + "Sentiment": { + "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": { + "type": "number", + "description": "Sentiment score between -1.0 (negative sentiment) and 1.0\n(positive sentiment).", + "format": "float" + }, + "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", + "description": "Represents the feeling associated with the entire text or entities in\nthe text." + }, + "AnalyzeEntitiesRequest": { + "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": "AnalyzeEntitiesRequest", + "description": "The entity analysis request message." } }, - "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": "Cloud Natural Language", "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-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": { - "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", - "scopes": [ - "https://www.googleapis.com/auth/cloud-language", - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": {}, - "flatPath": "v1beta1/documents:annotateText", - "id": "language.documents.annotateText", - "path": "v1beta1/documents:annotateText" - }, - "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.", - "response": { - "$ref": "AnalyzeEntitiesResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-language", - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": {}, - "flatPath": "v1beta1/documents:analyzeEntities", - "id": "language.documents.analyzeEntities", - "path": "v1beta1/documents:analyzeEntities" - }, - "analyzeSyntax": { - "response": { - "$ref": "AnalyzeSyntaxResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "parameters": {}, - "scopes": [ - "https://www.googleapis.com/auth/cloud-language", - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "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": { - "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": { - "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": { - "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": { - "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": "" + "rootUrl": "https://language.googleapis.com/" } diff --git a/etc/api/language/v1beta2/language-api.json b/etc/api/language/v1beta2/language-api.json index 1a732a4436..832c957e23 100644 --- a/etc/api/language/v1beta2/language-api.json +++ b/etc/api/language/v1beta2/language-api.json @@ -1,344 +1,229 @@ { + "batchPath": "batch", + "title": "Google Cloud Natural Language API", + "ownerName": "Google", + "resources": { + "documents": { + "methods": { + "classifyText": { + "request": { + "$ref": "ClassifyTextRequest" + }, + "description": "Classifies a document into categories.", + "response": { + "$ref": "ClassifyTextResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1beta2/documents:classifyText", + "path": "v1beta2/documents:classifyText", + "id": "language.documents.classifyText" + }, + "analyzeSentiment": { + "request": { + "$ref": "AnalyzeSentimentRequest" + }, + "description": "Analyzes the sentiment of the provided text.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "AnalyzeSentimentResponse" + }, + "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" + }, + "analyzeEntitySentiment": { + "description": "Finds entities, similar to AnalyzeEntities in the text and analyzes\nsentiment associated with each entity and its mentions.", + "request": { + "$ref": "AnalyzeEntitySentimentRequest" + }, + "response": { + "$ref": "AnalyzeEntitySentimentResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1beta2/documents:analyzeEntitySentiment", + "path": "v1beta2/documents:analyzeEntitySentiment", + "id": "language.documents.analyzeEntitySentiment" + }, + "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" + }, + "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", + "path": "v1beta2/documents:analyzeEntities", + "id": "language.documents.analyzeEntities" + }, + "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", + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1beta2/documents:analyzeSyntax", + "path": "v1beta2/documents:analyzeSyntax", + "id": "language.documents.analyzeSyntax" + }, + "annotateText": { + "flatPath": "v1beta2/documents:annotateText", + "path": "v1beta2/documents:annotateText", + "id": "language.documents.annotateText", + "request": { + "$ref": "AnnotateTextRequest" + }, + "description": "A convenience method that provides all syntax, sentiment, entity, and\nclassification features 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": { + "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": { + "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.", + "type": "boolean", + "default": "true" + }, + "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" + } + }, + "version": "v1beta2", + "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": "", + "revision": "20171204", + "documentationLink": "https://cloud.google.com/natural-language/", + "id": "language:v1beta2", + "discoveryVersion": "v1", "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": { + "id": "AnalyzeEntitiesResponse", "description": "The entity analysis response message.", "type": "object", "properties": { @@ -348,13 +233,12 @@ }, "entities": { "description": "The recognized entities in the input document.", + "type": "array", "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.", @@ -364,6 +248,11 @@ "description": "The representative name for the entity.", "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" + }, "type": { "enum": [ "UNKNOWN", @@ -395,21 +284,16 @@ "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": { + "description": "The mentions of this entity in the input document. The API currently\nsupports proper noun mentions.", + "type": "array", "items": { "$ref": "EntityMention" - }, - "type": "array", - "description": "The mentions of this entity in the input document. The API currently\nsupports proper noun mentions." + } } }, "id": "Entity" @@ -419,6 +303,8 @@ "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.", @@ -430,114 +316,112 @@ "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" + "$ref": "Features", + "description": "The enabled 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." - ] + ], + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "description": "The encoding type used by the API to calculate sentence offsets for the\nsentence sentiment." }, "document": { "description": "Input document.", "$ref": "Document" } }, - "id": "AnalyzeSentimentRequest" + "id": "AnalyzeSentimentRequest", + "description": "The sentiment analysis request message." }, "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" + }, + "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" + } + }, + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", + "type": "integer" } - } + }, + "id": "Status" }, "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.", + "extractSyntax": { + "description": "Extract syntax information.", "type": "boolean" }, "extractDocumentSentiment": { "description": "Extract document-level sentiment.", "type": "boolean" }, - "extractSyntax": { - "type": "boolean", - "description": "Extract syntax information." + "extractEntitySentiment": { + "description": "Extract entities and their associated sentiment.", + "type": "boolean" }, "extractEntities": { "description": "Extract entities.", "type": "boolean" }, "classifyText": { - "description": "Classify the full document into categories.", + "description": "Classify the full document into categories. If this is true,\nthe API will use the default model which classifies into a\n[predefined taxonomy](/natural-language/docs/categories).", "type": "boolean" } }, "id": "Features" }, "Document": { + "type": "object", "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." + "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" }, - "content": { - "description": "The content of the input in string format.", + "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": { - "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.", @@ -548,16 +432,16 @@ "TYPE_UNSPECIFIED", "PLAIN_TEXT", "HTML" - ] + ], + "description": "Required. If the type is not set or is `TYPE_UNSPECIFIED`,\nreturns an `INVALID_ARGUMENT` error." }, - "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.", + "content": { + "description": "The content of the input in string format.", "type": "string" } }, "id": "Document", - "description": "################################################################ #\n\nRepresents the input to API methods.", - "type": "object" + "description": "################################################################ #\n\nRepresents the input to API methods." }, "AnalyzeEntitiesRequest": { "description": "The entity analysis request message.", @@ -607,10 +491,10 @@ }, "entities": { "description": "The recognized entities in the input document with associated sentiments.", + "type": "array", "items": { "$ref": "Entity" - }, - "type": "array" + } } }, "id": "AnalyzeEntitySentimentResponse" @@ -624,15 +508,15 @@ "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" + "type": "string", + "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." }, "sentences": { "description": "The sentiment for all the sentences in the document.", + "type": "array", "items": { "$ref": "Sentence" - }, - "type": "array" + } } }, "id": "AnalyzeSentimentResponse" @@ -646,18 +530,18 @@ "type": "string" }, "sentences": { + "description": "Sentences in the input document.", + "type": "array", "items": { "$ref": "Sentence" - }, - "type": "array", - "description": "Sentences in the input document." + } }, "tokens": { "description": "Tokens, along with their syntactic information, in the input document.", + "type": "array", "items": { "$ref": "Token" - }, - "type": "array" + } } }, "id": "AnalyzeSyntaxResponse" @@ -665,56 +549,50 @@ "AnnotateTextResponse": { "type": "object", "properties": { + "categories": { + "description": "Categories identified in the input document.", + "type": "array", + "items": { + "$ref": "ClassificationCategory" + } + }, "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" + "type": "string", + "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." }, "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" - }, - "type": "array" + } }, "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" - }, - "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", @@ -888,53 +766,77 @@ "MES", "NCOMP" ] + }, + "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" } - } + }, + "id": "DependencyEdge" }, "TextSpan": { - "id": "TextSpan", - "description": "Represents an output piece of text.", - "type": "object", "properties": { "beginOffset": { - "type": "integer", + "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", - "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" } - } + }, + "id": "TextSpan", + "description": "Represents an output piece of text.", + "type": "object" }, "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." + "text": { + "description": "The token text.", + "$ref": "TextSpan" }, "dependencyEdge": { - "$ref": "DependencyEdge", - "description": "Dependency tree parse for this token." - }, - "text": { - "$ref": "TextSpan", - "description": "The token text." + "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": { + "description": "Parts of speech tag for this token.", + "$ref": "PartOfSpeech" } }, "id": "Token" }, - "EntityMention": { + "ClassifyTextResponse": { + "type": "object", "properties": { + "categories": { + "description": "Categories representing the input document.", + "type": "array", + "items": { + "$ref": "ClassificationCategory" + } + } + }, + "id": "ClassifyTextResponse", + "description": "The document classification response message." + }, + "EntityMention": { + "description": "Represents a mention for an entity in the text. Currently, proper noun\nmentions are supported.", + "type": "object", + "properties": { + "text": { + "$ref": "TextSpan", + "description": "The mention text." + }, "type": { - "description": "The type of the entity mention.", - "type": "string", "enumDescriptions": [ "Unknown", "Proper name", @@ -944,37 +846,18 @@ "TYPE_UNKNOWN", "PROPER", "COMMON" - ] - }, - "text": { - "description": "The mention text.", - "$ref": "TextSpan" + ], + "description": "The type of the entity mention.", + "type": "string" }, "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" + "id": "EntityMention" }, "Sentence": { - "id": "Sentence", "description": "Represents a sentence in the input document.", "type": "object", "properties": { @@ -983,27 +866,365 @@ "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." + "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": { - "format": "float", "description": "Sentiment score between -1.0 (negative sentiment) and 1.0\n(positive sentiment).", + "format": "float", "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).", + "format": "float", "type": "number" } }, "id": "Sentiment" + }, + "AnalyzeEntitySentimentRequest": { + "type": "object", + "properties": { + "document": { + "$ref": "Document", + "description": "Input document." + }, + "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." + } + }, + "id": "AnalyzeEntitySentimentRequest", + "description": "The entity-level sentiment analysis request message." + }, + "PartOfSpeech": { + "description": "Represents part of speech information for a token.", + "type": "object", + "properties": { + "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": { + "type": "string", + "enumDescriptions": [ + "Tense is not applicable in the analyzed language or is not predicted.", + "Conditional", + "Future", + "Past", + "Present", + "Imperfect", + "Pluperfect" + ], + "enum": [ + "TENSE_UNKNOWN", + "CONDITIONAL_TENSE", + "FUTURE", + "PAST", + "PRESENT", + "IMPERFECT", + "PLUPERFECT" + ], + "description": "The grammatical tense." + }, + "reciprocity": { + "enum": [ + "RECIPROCITY_UNKNOWN", + "RECIPROCAL", + "NON_RECIPROCAL" + ], + "description": "The grammatical reciprocity.", + "type": "string", + "enumDescriptions": [ + "Reciprocity is not applicable in the analyzed language or is not\npredicted.", + "Reciprocal", + "Non-reciprocal" + ] + }, + "form": { + "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" + ], + "description": "The grammatical form.", + "type": "string" + }, + "number": { + "enumDescriptions": [ + "Number is not applicable in the analyzed language or is not predicted.", + "Singular", + "Plural", + "Dual" + ], + "enum": [ + "NUMBER_UNKNOWN", + "SINGULAR", + "PLURAL", + "DUAL" + ], + "description": "The grammatical number.", + "type": "string" + }, + "voice": { + "description": "The grammatical 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" + ] + }, + "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": { + "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" + ] + }, + "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": { + "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" + ] + } + }, + "id": "PartOfSpeech" + }, + "ClassificationCategory": { + "description": "Represents a category returned from the text classifier.", + "type": "object", + "properties": { + "confidence": { + "description": "The classifier's confidence of the category. Number represents how certain\nthe classifier is that this category represents the given text.", + "format": "float", + "type": "number" + }, + "name": { + "description": "The name of the category representing the document.", + "type": "string" + } + }, + "id": "ClassificationCategory" + }, + "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": "AnalyzeSyntaxRequest" } }, "icons": { @@ -1015,237 +1236,16 @@ "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" + }, + "https://www.googleapis.com/auth/cloud-language": { + "description": "Apply machine learning models to reveal the structure and meaning of text" } } } }, "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" + "name": "language" } diff --git a/etc/api/logging/v2/logging-api.json b/etc/api/logging/v2/logging-api.json index 6a7a63003c..ce95af84a8 100644 --- a/etc/api/logging/v2/logging-api.json +++ b/etc/api/logging/v2/logging-api.json @@ -1,2189 +1,315 @@ { - "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" - }, - "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": { - "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", - "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" - } - }, - "flatPath": "v2/monitoredResourceDescriptors", - "id": "logging.monitoredResourceDescriptors.list", - "path": "v2/monitoredResourceDescriptors", - "description": "Lists the descriptors for monitored resource types used by Stackdriver Logging." - } - } - }, - "organizations": { - "resources": { - "sinks": { - "methods": { - "delete": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "sinkName" - ], - "httpMethod": "DELETE", - "parameters": { - "sinkName": { - "pattern": "^organizations/[^/]+/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\".", - "type": "string", - "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": { - "id": "logging.organizations.sinks.list", - "path": "v2/{+parent}/sinks", - "description": "Lists sinks.", - "response": { - "$ref": "ListSinksResponse" - }, - "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": { - "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": { - "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" - }, - "create": { - "httpMethod": "POST", - "parameterOrder": [ - "parent" - ], - "response": { - "$ref": "LogSink" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin" - ], - "parameters": { - "parent": { - "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\".", - "type": "string", - "required": true - }, - "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" - } - }, - "flatPath": "v2/organizations/{organizationsId}/sinks", - "path": "v2/{+parent}/sinks", - "id": "logging.organizations.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." - }, - "get": { - "path": "v2/{+sinkName}", - "id": "logging.organizations.sinks.get", - "description": "Gets a sink.", - "httpMethod": "GET", - "response": { - "$ref": "LogSink" - }, - "parameterOrder": [ - "sinkName" - ], - "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": "^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}", - "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." - } - } - } - } - }, - "entries": { - "methods": { - "list": { - "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": "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": { - "path": "v2/entries:write", - "id": "logging.entries.write", - "request": { - "$ref": "WriteLogEntriesRequest" - }, - "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": { - "sinks": { - "methods": { - "create": { - "response": { - "$ref": "LogSink" - }, - "parameterOrder": [ - "parent" - ], - "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" - } - }, - "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" - } - }, - "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": "LogSink" - }, - "parameters": { - "sinkName": { - "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/[^/]+$" - } - }, - "scopes": [ - "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.", - "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": { - "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", - "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.", - "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 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, - "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" - } - }, - "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": [ - "sinkName" - ], - "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" - ], - "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", - "path": "v2/{+sinkName}", - "id": "logging.billingAccounts.sinks.get", - "description": "Gets a sink." - }, - "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": { - "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" - ], - "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", - "id": "logging.billingAccounts.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" - } - } - } - }, - "logs": { - "methods": { - "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": "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": { - "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": "^billingAccounts/[^/]+$", - "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 - } - }, - "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": { - "response": { - "$ref": "LogExclusion" - }, - "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/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, - "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$", - "location": "path" - } - }, - "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" - } - } - } - } - } - }, - "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": { - "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.", - "type": "string", - "required": true, - "pattern": "^folders/[^/]+/logs/[^/]+$", - "location": "path" - } - }, - "flatPath": "v2/folders/{foldersId}/logs/{logsId}", - "id": "logging.folders.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." - }, - "list": { - "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" - ], - "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.", - "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" - }, - "parent": { - "type": "string", - "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" - } - }, - "flatPath": "v2/folders/{foldersId}/logs", - "path": "v2/{+parent}/logs", - "id": "logging.folders.logs.list" - } - } - }, - "exclusions": { - "methods": { - "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": "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": { - "name": { - "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, - "pattern": "^folders/[^/]+/exclusions/[^/]+$" - } - }, - "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": "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." - } - } - } - } - } - }, - "parameters": { - "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": { - "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": { - "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" - }, - "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" - } - }, - "version": "v2", - "baseUrl": "https://logging.googleapis.com/", - "servicePath": "", - "description": "Writes log entries and manages your Stackdriver Logging configuration.", - "kind": "discovery#restDescription", "basePath": "", "id": "logging:v2", - "revision": "20170918", "documentationLink": "https://cloud.google.com/logging/docs/", + "revision": "20171204", "discoveryVersion": "v1", "version_module": true, "schemas": { - "LogSink": { + "RequestLog": { + "description": "Complete log information about a single HTTP request to an App Engine application.", "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.", + "megaCycles": { + "description": "Number of CPU megacycles used to process request.", + "format": "int64", "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", + "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" }, - "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.", + "versionId": { + "description": "Version of the application that handled this request.", "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" + "moduleId": { + "type": "string", + "description": "Module of the application that handled this request." }, "endTime": { + "description": "Time when the request finished.", "format": "google-datetime", - "description": "Deprecated. This field is ignored when creating or updating sinks.", + "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": { + "description": "Size in bytes sent back to client by request.", + "format": "int64", + "type": "string" + }, + "traceId": { + "description": "Stackdriver Trace identifier for this request.", + "type": "string" + }, + "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" + }, + "status": { + "type": "integer", + "description": "HTTP response status code. Example: 200, 404.", + "format": "int32" + }, + "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" + }, + "host": { + "description": "Internet host and port number of the resource being requested.", + "type": "string" + }, + "finished": { + "description": "Whether this request is finished or active.", + "type": "boolean" + }, + "httpVersion": { + "description": "HTTP version of request. Example: \"HTTP/1.1\".", "type": "string" }, "startTime": { + "description": "Time when the request started.", "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.", + "latency": { + "description": "Latency of the request.", + "format": "google-duration", "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": { + "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" + } + }, + "id": "RequestLog" + }, + "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": { + "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" + }, + "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" + }, + "disabled": { + "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.", + "type": "boolean" + } + } + }, + "ListMonitoredResourceDescriptorsResponse": { + "description": "Result returned from ListMonitoredResourceDescriptors.", + "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": { + "type": "array", + "items": { + "$ref": "MonitoredResourceDescriptor" + }, + "description": "A list of resource descriptors." + } + }, + "id": "ListMonitoredResourceDescriptorsResponse" + }, + "ListExclusionsResponse": { + "description": "Result returned from ListExclusions.", + "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" + }, + "exclusions": { + "description": "A list of exclusions.", + "type": "array", + "items": { + "$ref": "LogExclusion" + } + } + }, + "id": "ListExclusionsResponse" + }, + "LogEntryOperation": { + "description": "Additional information about a potentially long-running operation with which a log entry is associated.", + "type": "object", + "properties": { + "last": { + "type": "boolean", + "description": "Optional. Set this to True if this is the last log entry in the operation." + }, + "id": { + "type": "string", + "description": "Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same 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" + }, + "first": { + "description": "Optional. Set this to True if this is the first log entry in the operation.", + "type": "boolean" + } + }, + "id": "LogEntryOperation" + }, + "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.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": { + "version": { + "type": "string", + "enumDescriptions": [ + "Stackdriver Logging API v2.", + "Stackdriver Logging API v1." + ], + "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." + }, + "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" + }, + "description": { + "description": "Optional. A description of this metric, which is used in documentation.", + "type": "string" + }, + "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" + }, + "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." + }, + "name": { + "type": "string", + "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\"." + }, + "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" + } + } + } + }, + "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": { + "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" + } + } + }, + "id": "MonitoredResource" + }, + "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": { "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", @@ -2197,12 +323,43 @@ "V2", "V1" ] + }, + "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" + }, + "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." + }, + "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": { + "description": "Deprecated. This field is ignored when creating or updating sinks.", + "format": "google-datetime", + "type": "string" + }, + "writerIdentity": { + "type": "string", + "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." + }, + "startTime": { + "description": "Deprecated. This field is ignored when creating or updating sinks.", + "format": "google-datetime", + "type": "string" } }, - "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." + "id": "LogSink" }, "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.", @@ -2210,78 +367,36 @@ }, "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" - }, - "type": "array" + } } }, - "id": "ListLogsResponse", - "description": "Result returned from ListLogs.", - "type": "object" + "id": "ListLogsResponse" }, "ListSinksResponse": { - "id": "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" - }, - "type": "array" + } + }, + "nextPageToken": { + "type": "string", + "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." } - } + }, + "id": "ListSinksResponse" }, "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": { - "referer": { - "type": "string", - "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" @@ -2299,51 +414,96 @@ "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." + "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.", + "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": { + "type": "string", + "description": "The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.", + "format": "int64" + }, + "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" + }, + "protocol": { + "description": "Protocol used for the request. Examples: \"HTTP/1.1\", \"HTTP/2\", \"websocket\"", + "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" } }, "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", + "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}\"." + }, + "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" + "type": "string", + "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." } }, - "id": "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" }, "LogEntrySourceLocation": { "description": "Additional information about the source code location that produced the log entry.", "type": "object", "properties": { + "line": { + "description": "Optional. Line within the source file. 1-based; 0 indicates no line number available.", + "format": "int64", + "type": "string" + }, "file": { "description": "Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.", "type": "string" @@ -2351,41 +511,32 @@ "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" }, "ListLogEntriesResponse": { - "id": "ListLogEntriesResponse", - "description": "Result returned from ListLogEntries.", - "type": "object", "properties": { + "nextPageToken": { + "type": "string", + "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." + }, "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.", + "type": "array", "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" + } } - } + }, + "id": "ListLogEntriesResponse", + "description": "Result returned from ListLogEntries.", + "type": "object" }, "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.", @@ -2412,118 +563,122 @@ "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" } }, "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": { + "width": { + "description": "Must be greater than 0.", "format": "double", - "description": "Lower bound of the first bucket.", "type": "number" }, + "offset": { + "type": "number", + "description": "Lower bound of the first bucket.", + "format": "double" + }, "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" }, "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" + "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" }, "SourceLocation": { "description": "Specifies a location in a source code file.", "type": "object", "properties": { "file": { - "type": "string", - "description": "Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name." + "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.", + "format": "int64", "type": "string" } }, "id": "SourceLocation" }, "ListLogEntriesRequest": { + "description": "The parameters to ListLogEntries.", + "type": "object", "properties": { + "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" + } + }, "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" }, - "type": "array" + "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." }, "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" }, "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." + "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": { - "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.", + "format": "int32", "type": "integer" }, "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" + "type": "string", + "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." } }, - "id": "ListLogEntriesRequest", - "description": "The parameters to ListLogEntries.", - "type": "object" + "id": "ListLogEntriesRequest" }, "Explicit": { + "type": "object", "properties": { "bounds": { "description": "The values must be monotonically increasing.", + "type": "array", "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" + "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." }, "SourceReference": { "description": "A reference to a particular snapshot of the source tree used to build and deploy an application.", @@ -2547,31 +702,42 @@ "id": "WriteLogEntriesResponse" }, "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": { - "numFiniteBuckets": { - "format": "int32", - "description": "Must be greater than 0.", - "type": "integer" - }, "growthFactor": { - "type": "number", + "description": "Must be greater than 1.", "format": "double", - "description": "Must be greater than 1." + "type": "number" }, "scale": { - "format": "double", "description": "Must be greater than 0.", + "format": "double", "type": "number" + }, + "numFiniteBuckets": { + "description": "Must be greater than 0.", + "format": "int32", + "type": "integer" } }, - "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" + "id": "Exponential" }, "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 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.", + "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" @@ -2586,17 +752,6 @@ "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" @@ -2605,11 +760,17 @@ "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.", @@ -2619,13 +780,7 @@ "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" @@ -2639,13 +794,13 @@ "description": "The exponential buckets.", "$ref": "Exponential" }, - "explicitBuckets": { - "description": "The explicit buckets.", - "$ref": "Explicit" - }, "linearBuckets": { "description": "The linear bucket.", "$ref": "Linear" + }, + "explicitBuckets": { + "$ref": "Explicit", + "description": "The explicit buckets." } } }, @@ -2653,27 +808,61 @@ "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": { + "description": "A list of logs-based metrics.", + "type": "array", "items": { "$ref": "LogMetric" - }, - "type": "array", - "description": "A list of logs-based metrics." + } + }, + "nextPageToken": { + "type": "string", + "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." } }, "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": { + "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" + ] + }, + "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\". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota.", + "type": "string" + }, + "description": { + "description": "A detailed description of the metric, which can be used in documentation.", + "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.", + "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", + "description": "The resource name of the metric descriptor.", "type": "string" }, "type": { @@ -2681,6 +870,8 @@ "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.", @@ -2698,113 +889,26 @@ "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." } - } + }, + "id": "MetricDescriptor" }, "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" }, + "labels": { + "description": "Optional. A set of user-defined (key, value) data that provides additional information about the log entry.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "severity": { "enumDescriptions": [ "(0) The log entry has no assigned severity level.", @@ -2832,310 +936,2612 @@ "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.", + "$ref": "LogEntrySourceLocation", + "description": "Optional. Source code location information associated with the log entry, if any." + }, + "spanId": { + "description": "Optional. The span ID within the trace associated with the log entry. For Stackdriver Trace spans, this is the same format that the Stackdriver Trace API v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such as \u003ccode\u003e\"000000000000004a\"\u003c/code\u003e.", "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": { + "receiveTimestamp": { + "description": "Output only. The time the log entry was received by Stackdriver Logging.", "format": "google-datetime", - "description": "Time when the request finished.", "type": "string" }, - "userAgent": { - "description": "User agent that made the request.", + "timestamp": { + "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.", + "format": "google-datetime", "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.", + "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]\"\nA project number may optionally be used in place of PROJECT_ID. The project number is translated to its corresponding PROJECT_ID internally and the log_name field will contain PROJECT_ID in queries and exports.[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" }, - "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" + "httpRequest": { + "$ref": "HttpRequest", + "description": "Optional. Information about the HTTP request associated with this log entry, if applicable." }, "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" + "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.", + "$ref": "MonitoredResource" }, - "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.", + "jsonPayload": { "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": "Properties of the object.", + "type": "any" }, - "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\".", + "description": "The log entry payload, represented as a structure that is expressed as a JSON 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 assigns its own unique identifier. The insert_id is also used to order log entries that have the same timestamp value.", + "type": "string" + }, + "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" + }, + "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. Some Google Cloud Platform services use this field for their log entry payloads.", "type": "object" } }, - "id": "MonitoredResource" + "id": "LogEntry" } - } + }, + "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": "Logging", + "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.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/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", + "fullyEncodeReservedExpansion": true, + "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" + }, + "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" + } + }, + "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" + } + } + }, + "organizations": { + "resources": { + "logs": { + "methods": { + "delete": { + "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": "^organizations/[^/]+/logs/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/organizations/{organizationsId}/logs/{logsId}", + "path": "v2/{+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.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "logName" + ], + "httpMethod": "DELETE" + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListLogsResponse" + }, + "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": { + "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", + "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/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." + } + } + }, + "sinks": { + "methods": { + "delete": { + "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + "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.", + "response": { + "$ref": "Empty" + }, + "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, + "type": "string", + "pattern": "^organizations/[^/]+/sinks/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "list": { + "description": "Lists sinks.", + "response": { + "$ref": "ListSinksResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "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": { + "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": "v2/organizations/{organizationsId}/sinks", + "path": "v2/{+parent}/sinks", + "id": "logging.organizations.sinks.list" + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "LogSink" + }, + "parameters": { + "parent": { + "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\".", + "required": true, + "type": "string" + }, + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/organizations/{organizationsId}/sinks", + "id": "logging.organizations.sinks.create", + "path": "v2/{+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." + }, + "get": { + "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.organizations.sinks.get", + "description": "Gets a sink.", + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "GET", + "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\".", + "required": true, + "type": "string", + "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" + ] + }, + "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", + "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": "^organizations/[^/]+/sinks/[^/]+$" + }, + "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" + }, + "updateMask": { + "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.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.organizations.sinks.patch" + }, + "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" + }, + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "PUT", + "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": "^organizations/[^/]+/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 set to false or defaulted to false.", + "type": "boolean", + "location": "query" + }, + "updateMask": { + "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.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + } + }, + "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.organizations.sinks.update" + } + } + }, + "exclusions": { + "methods": { + "delete": { + "description": "Deletes an exclusion.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "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\".", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+/exclusions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}", + "id": "logging.organizations.exclusions.delete", + "path": "v2/{+name}" + }, + "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": { + "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 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", + "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" + } + }, + "flatPath": "v2/organizations/{organizationsId}/exclusions", + "path": "v2/{+parent}/exclusions", + "id": "logging.organizations.exclusions.list" + }, + "get": { + "path": "v2/{+name}", + "id": "logging.organizations.exclusions.get", + "description": "Gets the description of an exclusion.", + "response": { + "$ref": "LogExclusion" + }, + "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/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ], + "parameters": { + "name": { + "required": true, + "type": "string", + "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\"." + } + }, + "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}" + }, + "patch": { + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "location": "query", + "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\".", + "format": "google-fieldmask", + "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\".", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+/exclusions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "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." + }, + "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.", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "LogExclusion" + }, + "parameters": { + "parent": { + "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\".", + "required": true, + "type": "string", + "pattern": "^organizations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/organizations/{organizationsId}/exclusions", + "id": "logging.organizations.exclusions.create", + "path": "v2/{+parent}/exclusions" + } + } + } + } + }, + "entries": { + "methods": { + "list": { + "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" + ], + "flatPath": "v2/entries:list", + "path": "v2/entries:list", + "id": "logging.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." + }, + "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": "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." + } + } + }, + "sinks": { + "methods": { + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "DELETE", + "parameters": { + "sinkName": { + "pattern": "^[^/]+/[^/]+/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" + ], + "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.sinks.delete", + "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted." + }, + "list": { + "description": "Lists sinks.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListSinksResponse" + }, + "parameters": { + "parent": { + "required": true, + "type": "string", + "pattern": "^[^/]+/[^/]+$", + "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" + } + }, + "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/{v2Id}/{v2Id1}/sinks", + "id": "logging.sinks.list", + "path": "v2/{+parent}/sinks" + }, + "get": { + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "GET", + "parameters": { + "sinkName": { + "pattern": "^[^/]+/[^/]+/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/{v2Id}/{v2Id1}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.sinks.get", + "description": "Gets a sink." + }, + "update": { + "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", + "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": "^[^/]+/[^/]+/sinks/[^/]+$" + }, + "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." + }, + "updateMask": { + "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.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.sinks.update" + }, + "create": { + "flatPath": "v2/{v2Id}/{v2Id1}/sinks", + "path": "v2/{+parent}/sinks", + "id": "logging.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 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", + "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\".", + "required": true, + "type": "string", + "pattern": "^[^/]+/[^/]+$", + "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" + } + } + } + } + }, + "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": { + "pattern": "^[^/]+/[^/]+/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" + } + }, + "flatPath": "v2/{v2Id}/{v2Id1}/logs/{logsId}", + "path": "v2/{+logName}", + "id": "logging.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/{v2Id}/{v2Id1}/logs", + "path": "v2/{+parent}/logs", + "id": "logging.logs.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": { + "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 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": "^[^/]+/[^/]+$" + } + }, + "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" + ] + } + } + }, + "projects": { + "resources": { + "metrics": { + "methods": { + "create": { + "id": "logging.projects.metrics.create", + "path": "v2/{+parent}/metrics", + "request": { + "$ref": "LogMetric" + }, + "description": "Creates a logs-based metric.", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "LogMetric" + }, + "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.", + "required": true, + "type": "string" + } + }, + "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" + }, + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "metricName" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "metricName": { + "location": "path", + "description": "The resource name of the metric to delete:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n", + "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": "v2/projects/{projectsId}/metrics/{metricsId}", + "id": "logging.projects.metrics.delete", + "path": "v2/{+metricName}", + "description": "Deletes a logs-based metric." + }, + "list": { + "id": "logging.projects.metrics.list", + "path": "v2/{+parent}/metrics", + "description": "Lists logs-based metrics.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListLogMetricsResponse" + }, + "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": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Required. The name of the project containing the metrics:\n\"projects/[PROJECT_ID]\"\n", + "required": true, + "type": "string" + }, + "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" + } + }, + "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" + }, + "get": { + "description": "Gets a logs-based metric.", + "response": { + "$ref": "LogMetric" + }, + "parameterOrder": [ + "metricName" + ], + "httpMethod": "GET", + "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" + } + }, + "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/{metricsId}", + "path": "v2/{+metricName}", + "id": "logging.projects.metrics.get" + }, + "update": { + "response": { + "$ref": "LogMetric" + }, + "parameterOrder": [ + "metricName" + ], + "httpMethod": "PUT", + "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.", + "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": "v2/projects/{projectsId}/metrics/{metricsId}", + "path": "v2/{+metricName}", + "id": "logging.projects.metrics.update", + "request": { + "$ref": "LogMetric" + }, + "description": "Creates or updates a logs-based metric." + } + } + }, + "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": "^projects/[^/]+/logs/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/projects/{projectsId}/logs/{logsId}", + "id": "logging.projects.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" + }, + "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": { + "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": { + "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" + } + }, + "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}/logs", + "path": "v2/{+parent}/logs", + "id": "logging.projects.logs.list" + } + } + }, + "sinks": { + "methods": { + "list": { + "description": "Lists sinks.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListSinksResponse" + }, + "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": { + "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/projects/{projectsId}/sinks", + "id": "logging.projects.sinks.list", + "path": "v2/{+parent}/sinks" + }, + "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 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", + "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": "^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" + } + }, + "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": { + "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}", + "path": "v2/{+sinkName}", + "id": "logging.projects.sinks.get", + "description": "Gets a sink.", + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "GET" + }, + "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", + "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 set to false or defaulted to false.", + "type": "boolean", + "location": "query" + }, + "updateMask": { + "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.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "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.patch" + }, + "update": { + "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", + "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": { + "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" + }, + "updateMask": { + "location": "query", + "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.", + "format": "google-fieldmask", + "type": "string" + } + }, + "scopes": [ + "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" + }, + "delete": { + "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.projects.sinks.delete", + "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", + "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" + ] + } + } + }, + "exclusions": { + "methods": { + "delete": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "name": { + "required": true, + "type": "string", + "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\"." + } + }, + "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.projects.exclusions.delete", + "description": "Deletes an exclusion.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE" + }, + "list": { + "response": { + "$ref": "ListExclusionsResponse" + }, + "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": { + "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": { + "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", + "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/projects/{projectsId}/exclusions", + "path": "v2/{+parent}/exclusions", + "id": "logging.projects.exclusions.list", + "description": "Lists all the exclusions in a parent resource." + }, + "get": { + "response": { + "$ref": "LogExclusion" + }, + "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/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\".", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/exclusions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.projects.exclusions.get", + "description": "Gets the description of an exclusion." + }, + "patch": { + "path": "v2/{+name}", + "id": "logging.projects.exclusions.patch", + "request": { + "$ref": "LogExclusion" + }, + "description": "Changes one or more properties of an existing exclusion.", + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "location": "query", + "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\".", + "format": "google-fieldmask", + "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\".", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/exclusions/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}" + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "LogExclusion" + }, + "parameters": { + "parent": { + "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\".", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "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." + } + } + } + } + }, + "billingAccounts": { + "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", + "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.", + "required": true, + "type": "string", + "pattern": "^billingAccounts/[^/]+/logs/[^/]+$" + } + }, + "flatPath": "v2/billingAccounts/{billingAccountsId}/logs/{logsId}", + "path": "v2/{+logName}", + "id": "logging.billingAccounts.logs.delete" + }, + "list": { + "flatPath": "v2/billingAccounts/{billingAccountsId}/logs", + "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.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListLogsResponse" + }, + "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" + } + }, + "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" + ] + } + } + }, + "sinks": { + "methods": { + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListSinksResponse" + }, + "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": { + "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": "^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": "v2/billingAccounts/{billingAccountsId}/sinks", + "id": "logging.billingAccounts.sinks.list", + "path": "v2/{+parent}/sinks", + "description": "Lists sinks." + }, + "create": { + "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 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", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "parent": { + "pattern": "^billingAccounts/[^/]+$", + "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" + }, + "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" + } + }, + "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks" + }, + "get": { + "description": "Gets a sink.", + "httpMethod": "GET", + "parameterOrder": [ + "sinkName" + ], + "response": { + "$ref": "LogSink" + }, + "parameters": { + "sinkName": { + "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\".", + "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/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + "id": "logging.billingAccounts.sinks.get", + "path": "v2/{+sinkName}" + }, + "patch": { + "path": "v2/{+sinkName}", + "id": "logging.billingAccounts.sinks.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", + "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": "^billingAccounts/[^/]+/sinks/[^/]+$" + }, + "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" + }, + "updateMask": { + "type": "string", + "location": "query", + "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.", + "format": "google-fieldmask" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}" + }, + "update": { + "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": "^billingAccounts/[^/]+/sinks/[^/]+$" + }, + "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" + }, + "updateMask": { + "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.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + } + }, + "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. 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.", + "httpMethod": "PUT", + "parameterOrder": [ + "sinkName" + ], + "response": { + "$ref": "LogSink" + } + }, + "delete": { + "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", + "parameters": { + "sinkName": { + "pattern": "^billingAccounts/[^/]+/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" + ], + "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.billingAccounts.sinks.delete" + } + } + }, + "exclusions": { + "methods": { + "create": { + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "required": true, + "type": "string", + "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", + "path": "v2/{+parent}/exclusions", + "id": "logging.billingAccounts.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." + }, + "delete": { + "path": "v2/{+name}", + "id": "logging.billingAccounts.exclusions.delete", + "description": "Deletes an exclusion.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "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\".", + "required": true, + "type": "string", + "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}" + }, + "list": { + "path": "v2/{+parent}/exclusions", + "id": "logging.billingAccounts.exclusions.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": { + "parent": { + "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", + "required": true, + "type": "string", + "pattern": "^billingAccounts/[^/]+$" + }, + "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": { + "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/billingAccounts/{billingAccountsId}/exclusions" + }, + "get": { + "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.billingAccounts.exclusions.get", + "description": "Gets the description of an exclusion.", + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^billingAccounts/[^/]+/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\".", + "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" + ] + }, + "patch": { + "request": { + "$ref": "LogExclusion" + }, + "description": "Changes one or more properties of an existing exclusion.", + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "LogExclusion" + }, + "parameters": { + "updateMask": { + "location": "query", + "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\".", + "format": "google-fieldmask", + "type": "string" + }, + "name": { + "pattern": "^billingAccounts/[^/]+/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\".", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}", + "id": "logging.billingAccounts.exclusions.patch", + "path": "v2/{+name}" + } + } + } + } + }, + "folders": { + "resources": { + "logs": { + "methods": { + "delete": { + "flatPath": "v2/folders/{foldersId}/logs/{logsId}", + "path": "v2/{+logName}", + "id": "logging.folders.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.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "logName" + ], + "httpMethod": "DELETE", + "parameters": { + "logName": { + "pattern": "^folders/[^/]+/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" + ] + }, + "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": { + "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": { + "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/[^/]+$" + } + }, + "flatPath": "v2/folders/{foldersId}/logs", + "path": "v2/{+parent}/logs", + "id": "logging.folders.logs.list" + } + } + }, + "sinks": { + "methods": { + "get": { + "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + "id": "logging.folders.sinks.get", + "path": "v2/{+sinkName}", + "description": "Gets a sink.", + "httpMethod": "GET", + "parameterOrder": [ + "sinkName" + ], + "response": { + "$ref": "LogSink" + }, + "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\".", + "required": true, + "type": "string", + "pattern": "^folders/[^/]+/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" + ] + }, + "patch": { + "path": "v2/{+sinkName}", + "id": "logging.folders.sinks.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", + "parameters": { + "sinkName": { + "required": true, + "type": "string", + "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\"." + }, + "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" + }, + "updateMask": { + "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.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}" + }, + "update": { + "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.folders.sinks.update", + "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", + "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 set to false or defaulted to false.", + "type": "boolean" + }, + "updateMask": { + "location": "query", + "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.", + "format": "google-fieldmask", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "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": "^folders/[^/]+/sinks/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}", + "path": "v2/{+sinkName}", + "id": "logging.folders.sinks.delete", + "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" + }, + "list": { + "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": { + "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/[^/]+$" + }, + "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": { + "type": "integer", + "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" + } + }, + "flatPath": "v2/folders/{foldersId}/sinks", + "path": "v2/{+parent}/sinks", + "id": "logging.folders.sinks.list", + "description": "Lists sinks." + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "LogSink" + }, + "parameters": { + "parent": { + "required": true, + "type": "string", + "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\"." + }, + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/folders/{foldersId}/sinks", + "id": "logging.folders.sinks.create", + "path": "v2/{+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." + } + } + }, + "exclusions": { + "methods": { + "list": { + "path": "v2/{+parent}/exclusions", + "id": "logging.folders.exclusions.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": { + "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": { + "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": { + "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", + "required": true, + "type": "string", + "pattern": "^folders/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/folders/{foldersId}/exclusions" + }, + "get": { + "description": "Gets the description of an exclusion.", + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "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\".", + "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}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.folders.exclusions.get" + }, + "patch": { + "request": { + "$ref": "LogExclusion" + }, + "description": "Changes one or more properties of an existing exclusion.", + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "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\".", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, + "name": { + "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\".", + "required": true, + "type": "string", + "pattern": "^folders/[^/]+/exclusions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.folders.exclusions.patch" + }, + "create": { + "response": { + "$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\".", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "flatPath": "v2/folders/{foldersId}/exclusions", + "path": "v2/{+parent}/exclusions", + "id": "logging.folders.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." + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "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\".", + "required": true, + "type": "string", + "pattern": "^folders/[^/]+/exclusions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.folders.exclusions.delete", + "description": "Deletes an exclusion." + } + } + } + } + }, + "exclusions": { + "methods": { + "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.", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "LogExclusion" + }, + "parameters": { + "parent": { + "required": true, + "type": "string", + "pattern": "^[^/]+/[^/]+$", + "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/{v2Id}/{v2Id1}/exclusions", + "id": "logging.exclusions.create", + "path": "v2/{+parent}/exclusions" + }, + "delete": { + "path": "v2/{+name}", + "id": "logging.exclusions.delete", + "description": "Deletes an exclusion.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "name": { + "pattern": "^[^/]+/[^/]+/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\".", + "required": true, + "type": "string" + } + }, + "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}" + }, + "list": { + "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": { + "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": { + "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": { + "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", + "required": true, + "type": "string", + "pattern": "^[^/]+/[^/]+$", + "location": "path" + } + }, + "flatPath": "v2/{v2Id}/{v2Id1}/exclusions", + "path": "v2/{+parent}/exclusions", + "id": "logging.exclusions.list", + "description": "Lists all the exclusions in a parent resource." + }, + "get": { + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "LogExclusion" + }, + "parameters": { + "name": { + "pattern": "^[^/]+/[^/]+/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\".", + "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/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", + "id": "logging.exclusions.get", + "path": "v2/{+name}", + "description": "Gets the description of an exclusion." + }, + "patch": { + "description": "Changes one or more properties of an existing exclusion.", + "request": { + "$ref": "LogExclusion" + }, + "response": { + "$ref": "LogExclusion" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "parameters": { + "name": { + "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\".", + "required": true, + "type": "string", + "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$" + }, + "updateMask": { + "type": "string", + "location": "query", + "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\".", + "format": "google-fieldmask" + } + }, + "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}", + "path": "v2/{+name}", + "id": "logging.exclusions.patch" + } + } + } + }, + "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" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "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" + }, + "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": { + "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": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" + } + }, + "version": "v2", + "baseUrl": "https://logging.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Writes log entries and manages your Stackdriver Logging configuration.", + "servicePath": "" } diff --git a/etc/api/logging/v2beta1/logging-api.json b/etc/api/logging/v2beta1/logging-api.json index bfb094ae7c..bc05729aab 100644 --- a/etc/api/logging/v2beta1/logging-api.json +++ b/etc/api/logging/v2beta1/logging-api.json @@ -1,72 +1,106 @@ { - "batchPath": "batch", + "fullyEncodeReservedExpansion": true, "title": "Stackdriver Logging API", "ownerName": "Google", "resources": { + "monitoredResourceDescriptors": { + "methods": { + "list": { + "description": "Lists the descriptors for monitored resource types used by Stackdriver Logging.", + "response": { + "$ref": "ListMonitoredResourceDescriptorsResponse" + }, + "parameterOrder": [], + "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": { + "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/monitoredResourceDescriptors", + "path": "v2beta1/monitoredResourceDescriptors", + "id": "logging.monitoredResourceDescriptors.list" + } + } + }, "organizations": { "resources": { "logs": { "methods": { "delete": { + "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.", - "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" - } - }, + "parameterOrder": [ + "logName" + ], + "httpMethod": "DELETE", "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" + "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}" }, "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" - ], + "httpMethod": "GET", "parameters": { + "parent": { + "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", + "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", - "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" + "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/organizations/{organizationsId}/logs", "path": "v2beta1/{+parent}/logs", "id": "logging.organizations.logs.list", @@ -79,15 +113,6 @@ "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", @@ -97,18 +122,18 @@ ], "flatPath": "v2beta1/entries:list", "path": "v2beta1/entries:list", - "id": "logging.entries.list" + "id": "logging.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.", + "response": { + "$ref": "ListLogEntriesResponse" + }, + "parameterOrder": [], + "httpMethod": "POST" }, "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", @@ -116,212 +141,69 @@ "https://www.googleapis.com/auth/logging.write" ], "flatPath": "v2beta1/entries:write", + "id": "logging.entries.write", "path": "v2beta1/entries:write", - "id": "logging.entries.write" + "request": { + "$ref": "WriteLogEntriesRequest" + }, + "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" + } } } }, "projects": { "resources": { - "sinks": { + "logs": { "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" + "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" + } }, - "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" - }, + "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.", + "httpMethod": "DELETE", "parameterOrder": [ - "sinkName" + "logName" ], - "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}" + "response": { + "$ref": "Empty" + } }, "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": { + "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.", + "format": "int32", "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" + "type": "string" } }, "scopes": [ @@ -333,142 +215,28 @@ "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" - ], + "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", "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" + "$ref": "ListLogsResponse" }, "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" - } - } - }, + "httpMethod": "GET" + } + } + }, + "sinks": { + "methods": { "create": { - "description": "Creates a logs-based metric.", + "path": "v2beta1/{+parent}/sinks", + "id": "logging.projects.sinks.create", "request": { - "$ref": "LogMetric" + "$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": "LogMetric" + "$ref": "LogSink" }, "parameterOrder": [ "parent" @@ -476,87 +244,53 @@ "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", + "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/[^/]+$", "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" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/logging.admin", - "https://www.googleapis.com/auth/logging.write" + "https://www.googleapis.com/auth/logging.admin" ], - "flatPath": "v2beta1/projects/{projectsId}/metrics", - "id": "logging.projects.metrics.create", - "path": "v2beta1/{+parent}/metrics" + "flatPath": "v2beta1/projects/{projectsId}/sinks" }, "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": { + "sinkName": { + "pattern": "^projects/[^/]+/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.", - "type": "string", + "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, - "pattern": "^billingAccounts/[^/]+/logs/[^/]+$" + "type": "string" } }, - "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." + "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}", + "path": "v2beta1/{+sinkName}", + "id": "logging.projects.sinks.delete", + "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" }, "list": { - "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.", "response": { - "$ref": "ListLogsResponse" + "$ref": "ListSinksResponse" }, "parameterOrder": [ "parent" @@ -569,16 +303,205 @@ "type": "string" }, "pageSize": { - "format": "int32", + "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.", - "type": "integer", - "location": "query" + "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", - "type": "string", + "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", "required": true, - "pattern": "^billingAccounts/[^/]+$", + "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", + "path": "v2beta1/{+parent}/sinks", + "id": "logging.projects.sinks.list", + "description": "Lists sinks." + }, + "get": { + "id": "logging.projects.sinks.get", + "path": "v2beta1/{+sinkName}", + "description": "Gets a sink.", + "httpMethod": "GET", + "parameterOrder": [ + "sinkName" + ], + "response": { + "$ref": "LogSink" + }, + "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}" + }, + "update": { + "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": { + "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" + }, + "updateMask": { + "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.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}", + "path": "v2beta1/{+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" + }, + "response": { + "$ref": "LogSink" + }, + "parameterOrder": [ + "sinkName" + ], + "httpMethod": "PUT" + } + } + }, + "metrics": { + "methods": { + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "LogMetric" + }, + "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.", + "required": true, + "type": "string" + } + }, + "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", + "request": { + "$ref": "LogMetric" + }, + "description": "Creates a logs-based metric." + }, + "delete": { + "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" + } + }, + "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.delete", + "description": "Deletes a logs-based metric.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "metricName" + ], + "httpMethod": "DELETE" + }, + "list": { + "path": "v2beta1/{+parent}/metrics", + "id": "logging.projects.metrics.list", + "description": "Lists logs-based metrics.", + "response": { + "$ref": "ListLogMetricsResponse" + }, + "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": { + "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" + }, + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Required. The name of the project containing the metrics:\n\"projects/[PROJECT_ID]\"\n", + "required": true, + "type": "string" + } + }, + "flatPath": "v2beta1/projects/{projectsId}/metrics" + }, + "get": { + "parameters": { + "metricName": { + "description": "The resource name of the desired metric:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/metrics/[^/]+$", "location": "path" } }, @@ -588,50 +511,148 @@ "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" + "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}", + "path": "v2beta1/{+metricName}", + "id": "logging.projects.metrics.get", + "description": "Gets a logs-based metric.", + "response": { + "$ref": "LogMetric" + }, + "parameterOrder": [ + "metricName" + ], + "httpMethod": "GET" + }, + "update": { + "request": { + "$ref": "LogMetric" + }, + "description": "Creates or updates a logs-based metric.", + "response": { + "$ref": "LogMetric" + }, + "parameterOrder": [ + "metricName" + ], + "httpMethod": "PUT", + "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" + } + }, + "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" } } } } }, - "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" + "billingAccounts": { + "resources": { + "logs": { + "methods": { + "delete": { + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ], + "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" + } }, - "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" + "list": { + "path": "v2beta1/{+parent}/logs", + "id": "logging.billingAccounts.logs.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": { + "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": { + "pattern": "^billingAccounts/[^/]+$", + "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" + } + }, + "flatPath": "v2beta1/billingAccounts/{billingAccountsId}/logs" } - }, - "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": { + "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": { + "description": "OAuth bearer token.", + "type": "string", + "location": "query" + }, "upload_protocol": { "location": "query", "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", @@ -640,8 +661,8 @@ "prettyPrint": { "location": "query", "description": "Returns response with indentations and line breaks.", - "default": "true", - "type": "boolean" + "type": "boolean", + "default": "true" }, "uploadType": { "location": "query", @@ -687,104 +708,178 @@ ], "location": "query" }, - "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": { - "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": { + "access_token": { "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" + "description": "OAuth access token.", + "type": "string" } }, "version": "v2beta1", "baseUrl": "https://logging.googleapis.com/", - "description": "Writes log entries and manages your Stackdriver Logging configuration.", "kind": "discovery#restDescription", + "description": "Writes log entries and manages your Stackdriver Logging configuration.", "servicePath": "", "basePath": "", - "revision": "20170918", - "documentationLink": "https://cloud.google.com/logging/docs/", "id": "logging:v2beta1", + "documentationLink": "https://cloud.google.com/logging/docs/", + "revision": "20171204", "discoveryVersion": "v1", "version_module": true, "schemas": { + "LogLine": { + "description": "Application log line emitted while processing a request.", + "type": "object", + "properties": { + "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" + ] + }, + "logMessage": { + "description": "App-provided log message.", + "type": "string" + }, + "sourceLocation": { + "description": "Where in the source code this log message was written.", + "$ref": "SourceLocation" + }, + "time": { + "description": "Approximate time when this log entry was made.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "LogLine" + }, + "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": { + "numFiniteBuckets": { + "description": "Must be greater than 0.", + "format": "int32", + "type": "integer" + }, + "width": { + "description": "Must be greater than 0.", + "format": "double", + "type": "number" + }, + "offset": { + "description": "Lower bound of the first bucket.", + "format": "double", + "type": "number" + } + }, + "id": "Linear" + }, + "Empty": { + "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", + "properties": {} + }, + "SourceLocation": { + "id": "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": { + "description": "Line within the source file.", + "format": "int64", + "type": "string" + } + } + }, "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.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } + }, + "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" + } }, "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" + "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" }, "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": { "format": "double", "type": "number" - }, - "type": "array", - "description": "The values must be monotonically increasing." + } } - }, - "id": "Explicit" + } }, "SourceReference": { + "id": "SourceReference", "description": "A reference to a particular snapshot of the source tree used to build and deploy an application.", "type": "object", "properties": { @@ -796,74 +891,82 @@ "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" + "description": "Result returned from WriteLogEntries. empty", + "type": "object", + "properties": {} }, "Exponential": { + "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", "properties": { - "scale": { - "format": "double", - "description": "Must be greater than 0.", - "type": "number" - }, "numFiniteBuckets": { - "format": "int32", "description": "Must be greater than 0.", + "format": "int32", "type": "integer" }, "growthFactor": { - "format": "double", "description": "Must be greater than 1.", + "format": "double", + "type": "number" + }, + "scale": { + "description": "Must be greater than 0.", + "format": "double", "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" + "labels": { + "additionalProperties": { + "type": "string" }, - "type": "array" + "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" }, "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 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.", + "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": { - "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": { + "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": { "enumDescriptions": [ "A variable-length string. This is the default.", @@ -877,19 +980,11 @@ ], "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": { + "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": { @@ -897,40 +992,57 @@ "description": "The exponential buckets.", "$ref": "Exponential" }, - "explicitBuckets": { - "$ref": "Explicit", - "description": "The explicit buckets." - }, "linearBuckets": { "description": "The linear bucket.", "$ref": "Linear" + }, + "explicitBuckets": { + "$ref": "Explicit", + "description": "The explicit buckets." } - }, - "id": "BucketOptions" + } }, "ListLogMetricsResponse": { + "id": "ListLogMetricsResponse", + "description": "Result returned from ListLogMetrics.", "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.", "type": "string" } - }, - "id": "ListLogMetricsResponse", - "description": "Result returned from ListLogMetrics." + } }, "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": { + "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.", + "type": "array", + "items": { + "$ref": "LabelDescriptor" + } + }, + "name": { + "description": "The resource name of the metric descriptor.", + "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", @@ -969,92 +1081,40 @@ "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" }, + "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\". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota.", + "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" } - } + }, + "id": "MetricDescriptor" }, "LogEntry": { "description": "An individual entry in a log.", "type": "object", "properties": { - "timestamp": { - "type": "string", - "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." - }, - "receiveTimestamp": { - "format": "google-datetime", - "description": "Output only. The time the log entry was received by Stackdriver Logging.", + "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" }, - "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" - }, - "httpRequest": { - "description": "Optional. Information about the HTTP request associated with this log entry, if applicable.", - "$ref": "HttpRequest" - }, - "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": { - "additionalProperties": { - "description": "Properties of the object.", - "type": "any" - }, - "description": "The log entry payload, represented as a structure that is expressed as a JSON object.", - "type": "object" - }, "operation": { "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).", "type": "string" }, "protoPayload": { + "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", "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.", - "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": { @@ -1063,9 +1123,11 @@ "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": { - "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.", @@ -1087,45 +1149,63 @@ "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" + }, + "spanId": { + "description": "Optional. The span ID within the trace associated with the log entry. For Stackdriver Trace spans, this is the same format that the Stackdriver Trace API v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such as \u003ccode\u003e\"000000000000004a\"\u003c/code\u003e.", + "type": "string" + }, + "timestamp": { + "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.", + "format": "google-datetime", + "type": "string" + }, + "receiveTimestamp": { + "description": "Output only. The time the log entry was received by Stackdriver Logging.", + "format": "google-datetime", + "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]\"\nA project number may optionally be used in place of PROJECT_ID. The project number is translated to its corresponding PROJECT_ID internally and the log_name field will contain PROJECT_ID in queries and exports.[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": { + "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.", + "$ref": "MonitoredResource" + }, + "httpRequest": { + "$ref": "HttpRequest", + "description": "Optional. Information about the HTTP request associated with this log entry, if applicable." + }, + "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" + } } }, "id": "LogEntry" }, "RequestLog": { + "id": "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.", + "format": "google-duration", "type": "string" }, "resource": { @@ -1133,43 +1213,43 @@ "type": "string" }, "status": { - "format": "int32", "description": "HTTP response status code. Example: 200, 404.", + "format": "int32", "type": "integer" }, "taskName": { - "type": "string", - "description": "Task name of the request, in the case of an offline request." + "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.", + "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" }, + "finished": { + "description": "Whether this request is finished or active.", + "type": "boolean" + }, "httpVersion": { "description": "HTTP version of request. Example: \"HTTP/1.1\".", "type": "string" }, "startTime": { - "format": "google-datetime", "description": "Time when the request started.", + "format": "google-datetime", "type": "string" }, "latency": { - "format": "google-duration", "description": "Latency of the request.", + "format": "google-duration", "type": "string" }, "ip": { @@ -1189,8 +1269,8 @@ "type": "string" }, "cost": { - "format": "double", "description": "An indication of the relative cost of serving this request.", + "format": "double", "type": "number" }, "instanceId": { @@ -1198,8 +1278,8 @@ "type": "string" }, "megaCycles": { - "format": "int64", "description": "Number of CPU megacycles used to process request.", + "format": "int64", "type": "string" }, "first": { @@ -1215,8 +1295,8 @@ "type": "string" }, "endTime": { - "format": "google-datetime", "description": "Time when the request finished.", + "format": "google-datetime", "type": "string" }, "userAgent": { @@ -1229,22 +1309,40 @@ }, "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" - }, - "type": "array" + } }, "responseSize": { - "format": "int64", "description": "Size in bytes sent back to client by request.", + "format": "int64", "type": "string" }, "traceId": { "description": "Stackdriver Trace identifier for this request.", "type": "string" + }, + "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" } - }, - "id": "RequestLog" + } }, "ListMonitoredResourceDescriptorsResponse": { "description": "Result returned from ListMonitoredResourceDescriptors.", @@ -1252,10 +1350,10 @@ "properties": { "resourceDescriptors": { "description": "A list of resource descriptors.", + "type": "array", "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.", @@ -1265,93 +1363,93 @@ "id": "ListMonitoredResourceDescriptorsResponse" }, "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.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" }, - "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" }, + "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" - }, - "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." + "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.", + "$ref": "MetricDescriptor" }, "version": { + "enumDescriptions": [ + "Stackdriver Logging API v2.", + "Stackdriver Logging API v1." + ], "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." - ] + "type": "string" }, "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": { + "id": "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." + "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" }, - "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" + "last": { + "description": "Optional. Set this to True if this is the last log entry in the operation.", + "type": "boolean" } - }, - "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" + }, + "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" + } } } }, @@ -1367,17 +1465,17 @@ "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" }, + "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.", + "format": "google-datetime", "type": "string" }, "writerIdentity": { @@ -1385,11 +1483,13 @@ "type": "string" }, "startTime": { - "format": "google-datetime", "description": "Deprecated. This field is ignored when creating or updating sinks.", + "format": "google-datetime", "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.", @@ -1399,86 +1499,86 @@ "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.", + "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" }, - "sinks": { - "description": "A list of sinks.", + "logNames": { + "description": "A list of log names. For example, \"projects/my-project/syslog\" or \"organizations/123/cloudresourcemanager.googleapis.com%2Factivity\".", + "type": "array", "items": { - "$ref": "LogSink" - }, - "type": "array" + "type": "string" + } } }, - "id": "ListSinksResponse", - "description": "Result returned from ListSinks." + "id": "ListLogsResponse" }, "HttpRequest": { + "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", "properties": { + "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" }, - "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", + "description": "The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.", "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" }, - "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" }, + "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" + }, + "requestSize": { + "description": "The size of the HTTP request message in bytes, including the request headers and the request 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\"." + "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\".", @@ -1491,61 +1591,66 @@ "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" + } + }, + "ListSinksResponse": { + "id": "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" + } + } + } }, "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\".", + "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" }, - "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" }, + "description": { + "description": "Optional. A detailed description of the monitored resource type that might be used in documentation.", + "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": { + "description": "Additional information about the source code location that produced the log entry.", + "type": "object", "properties": { + "line": { + "description": "Optional. Line within the source file. 1-based; 0 indicates no line number available.", + "format": "int64", + "type": "string" + }, "file": { "description": "Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.", "type": "string" @@ -1553,16 +1658,9 @@ "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" + "id": "LogEntrySourceLocation" }, "ListLogEntriesResponse": { "description": "Result returned from ListLogEntries.", @@ -1574,129 +1672,35 @@ }, "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.", + "type": "array", "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": { - "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" } }, + "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": "Logging", "auth": { "oauth2": { "scopes": { - "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/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/cloud-platform.read-only": { - "description": "View your data across Google Cloud Platform services" + "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/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" @@ -1706,5 +1710,6 @@ }, "rootUrl": "https://logging.googleapis.com/", "ownerDomain": "google.com", - "name": "logging" + "name": "logging", + "batchPath": "batch" } diff --git a/etc/api/manufacturers/v1/manufacturers-api.json b/etc/api/manufacturers/v1/manufacturers-api.json index e29d537fb6..2e9b2e5085 100644 --- a/etc/api/manufacturers/v1/manufacturers-api.json +++ b/etc/api/manufacturers/v1/manufacturers-api.json @@ -1,149 +1,31 @@ { - "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, "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": { - "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": { "description": "Names of the attributes of the product deleted manually via the\nManufacturer Center UI.\n@OutputOnly", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "finalAttributes": { - "$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" + "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" }, "productId": { - "description": "The ID of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#id.\n@OutputOnly", - "type": "string" + "type": "string", + "description": "The ID of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#id.\n@OutputOnly" }, "uploadedAttributes": { "$ref": "Attributes", @@ -154,32 +36,37 @@ "type": "string" }, "manuallyProvidedAttributes": { - "description": "Attributes of the product provided manually via the Manufacturer Center UI.\n@OutputOnly", - "$ref": "Attributes" + "$ref": "Attributes", + "description": "Attributes of the product provided manually via the Manufacturer Center UI.\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" }, "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", + "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" } }, - "id": "Product" + "id": "Product", + "description": "Product data." }, "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" @@ -189,10 +76,10 @@ "properties": { "products": { "description": "List of the products.", + "type": "array", "items": { "$ref": "Product" - }, - "type": "array" + } }, "nextPageToken": { "description": "The token for the retrieval of the next page of product statuses.", @@ -205,10 +92,6 @@ "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" @@ -216,58 +99,16 @@ "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" }, - "Issue": { - "properties": { - "severity": { - "enum": [ - "SEVERITY_UNSPECIFIED", - "ERROR", - "WARNING", - "INFO" - ], - "description": "The severity of the issue.", - "type": "string", - "enumDescriptions": [ - "Unspecified severity, never used.", - "Error severity. The issue prevents the usage of the whole item.", - "Warning severity. The issue is either one that prevents the usage of the\nattribute that triggered it or one that will soon prevent the usage of\nthe whole item.", - "Info severity. The issue is one that doesn't require immediate attention.\nIt is, for example, used to communicate which attributes are still\npending review." - ] - }, - "description": { - "description": "Description of the issue.", - "type": "string" - }, - "type": { - "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", - "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" @@ -275,9 +116,70 @@ "text": { "description": "A detailed description of the feature.", "type": "string" + }, + "image": { + "$ref": "Image", + "description": "An optional image describing the feature." } }, - "id": "FeatureDescription" + "id": "FeatureDescription", + "description": "A feature description of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#featuredesc.", + "type": "object" + }, + "Issue": { + "type": "object", + "properties": { + "timestamp": { + "description": "The timestamp when this issue appeared.", + "format": "google-datetime", + "type": "string" + }, + "severity": { + "enumDescriptions": [ + "Unspecified severity, never used.", + "Error severity. The issue prevents the usage of the whole item.", + "Warning severity. The issue is either one that prevents the usage of the\nattribute that triggered it or one that will soon prevent the usage of\nthe whole item.", + "Info severity. The issue is one that doesn't require immediate attention.\nIt is, for example, used to communicate which attributes are still\npending review." + ], + "enum": [ + "SEVERITY_UNSPECIFIED", + "ERROR", + "WARNING", + "INFO" + ], + "description": "The severity of the issue.", + "type": "string" + }, + "description": { + "description": "Description of the issue.", + "type": "string" + }, + "type": { + "description": "The server-generated type of the issue, for example,\n“INCORRECT_TEXT_FORMATTING”, “IMAGE_NOT_SERVEABLE”, etc.", + "type": "string" + }, + "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" + } + }, + "id": "Issue", + "description": "Product issue." + }, + "Price": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency in which the price is denoted." + }, + "amount": { + "description": "The numeric value of the price.", + "type": "string" + } + }, + "id": "Price", + "description": "A price." }, "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 `{}`.", @@ -285,55 +187,10 @@ "properties": {}, "id": "Empty" }, - "Price": { - "type": "object", - "properties": { - "currency": { - "description": "The currency in which the price is denoted.", - "type": "string" - }, - "amount": { - "type": "string", - "description": "The numeric value of the price." - } - }, - "id": "Price", - "description": "A price." - }, "Image": { "description": "An image.", "type": "object", "properties": { - "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.", - "The image crawl is still pending.", - "The image was processed and it meets the requirements.", - "The image URL is protected by robots.txt file and cannot be crawled.", - "The image URL is protected by X-Robots-Tag and cannot be crawled.", - "There was an error while crawling the image.", - "The image cannot be processed.", - "The image cannot be decoded.", - "The image is too big.", - "The image was manually overridden and will not be crawled." - ], - "enum": [ - "STATUS_UNSPECIFIED", - "PENDING_PROCESSING", - "PENDING_CRAWL", - "OK", - "ROBOTED", - "XROBOTED", - "CRAWL_ERROR", - "PROCESSING_ERROR", - "DECODING_ERROR", - "TOO_BIG", - "CRAWL_SKIPPED" - ] - }, "type": { "enum": [ "TYPE_UNSPECIFIED", @@ -351,6 +208,40 @@ "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": { + "enumDescriptions": [ + "The image status is unspecified. Should not be used.", + "The image was uploaded and is being processed.", + "The image crawl is still pending.", + "The image was processed and it meets the requirements.", + "The image URL is protected by robots.txt file and cannot be crawled.", + "The image URL is protected by X-Robots-Tag and cannot be crawled.", + "There was an error while crawling the image.", + "The image cannot be processed.", + "The image cannot be decoded.", + "The image is too big.", + "The image was manually overridden and will not be crawled.", + "The image crawl was postponed to avoid overloading the host.", + "The image URL returned a \"404 Not Found\" error." + ], + "enum": [ + "STATUS_UNSPECIFIED", + "PENDING_PROCESSING", + "PENDING_CRAWL", + "OK", + "ROBOTED", + "XROBOTED", + "CRAWL_ERROR", + "PROCESSING_ERROR", + "DECODING_ERROR", + "TOO_BIG", + "CRAWL_SKIPPED", + "HOSTLOADED", + "HTTP_404" + ], + "description": "The status of the image.\n@OutputOnly", + "type": "string" } }, "id": "Image" @@ -359,19 +250,19 @@ "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" + "ageGroup": { + "type": "string", + "description": "The target age group of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#agegroup." }, "productDetail": { "description": "The details of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#productdetail.", + "type": "array", "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.", + "flavor": { + "description": "The flavor of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#flavor.", "type": "string" }, "mpn": { @@ -386,32 +277,32 @@ "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" }, + "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": "The capacity of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#capacity.", + "$ref": "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." + "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.", @@ -421,6 +312,10 @@ "description": "The theme of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#theme.", "type": "string" }, + "targetClientId": { + "description": "The target client id. Should only be used in the accounts of the data\npartners.", + "type": "string" + }, "pattern": { "description": "The pattern of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#pattern.", "type": "string" @@ -430,11 +325,11 @@ "description": "The image of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#image." }, "productType": { + "description": "The type or 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.", @@ -442,45 +337,40 @@ }, "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" + "type": "string", + "description": "The color of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#color." }, "productName": { - "type": "string", - "description": "The canonical name of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#productname." + "description": "The canonical name of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#productname.", + "type": "string" }, "sizeType": { "description": "The size type of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#sizetype.", "type": "string" }, "suggestedRetailPrice": { - "$ref": "Price", - "description": "The suggested retail price (MSRP) of the product. For more information,\nsee https://support.google.com/manufacturers/answer/6124116#price." + "description": "The suggested retail price (MSRP) of the product. For more information,\nsee https://support.google.com/manufacturers/answer/6124116#price.", + "$ref": "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": { "type": "string", @@ -498,27 +388,43 @@ "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": { + "description": "The material of the product. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#material.", + "type": "string" + }, "scent": { "description": "The scent of the product. For more information, see\n https://support.google.com/manufacturers/answer/6124116#scent.", "type": "string" } }, "id": "Attributes" + }, + "Count": { + "properties": { + "value": { + "description": "The numeric value of the number of products in a package.", + "format": "int64", + "type": "string" + }, + "unit": { + "description": "The unit in which these products are counted.", + "type": "string" + } + }, + "id": "Count", + "description": "The number of products in a single package. For more information, see\nhttps://support.google.com/manufacturers/answer/6124116#count.", + "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" }, + "protocol": "rest", "canonicalName": "Manufacturer Center", "auth": { "oauth2": { @@ -541,11 +447,7 @@ "products": { "methods": { "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": "Empty" }, @@ -553,36 +455,7 @@ "parent", "name" ], - "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/[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/manufacturercenter" - ] - }, - "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" - }, - "parameterOrder": [ - "parent", - "name" - ], - "httpMethod": "GET", + "httpMethod": "DELETE", "scopes": [ "https://www.googleapis.com/auth/manufacturercenter" ], @@ -590,26 +463,23 @@ "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, + "type": "string", "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, + "type": "string", "pattern": "^[^/]+$", "location": "path" } }, "flatPath": "v1/accounts/{accountsId}/products/{productsId}", - "id": "manufacturers.accounts.products.get", - "path": "v1/{+parent}/products/{+name}" + "path": "v1/{+parent}/products/{+name}", + "id": "manufacturers.accounts.products.delete" }, "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" @@ -618,29 +488,65 @@ "parent" ], "parameters": { + "pageSize": { + "location": "query", + "description": "Maximum number of product statuses to return in the response, used for\npaging.", + "format": "int32", + "type": "integer" + }, "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" + "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" }, "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" + "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.", + "httpMethod": "GET", + "response": { + "$ref": "Product" + }, + "parameterOrder": [ + "parent", + "name" + ], + "parameters": { + "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.", + "required": true, + "type": "string", + "pattern": "^[^/]+$", + "location": "path" + }, + "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/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/manufacturercenter" + ], + "flatPath": "v1/accounts/{accountsId}/products/{productsId}", + "id": "manufacturers.accounts.products.get", + "path": "v1/{+parent}/products/{+name}" }, "update": { "path": "v1/{+parent}/products/{+name}", @@ -649,38 +555,135 @@ "$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", + "response": { + "$ref": "Product" + }, "parameterOrder": [ "parent", "name" ], - "response": { - "$ref": "Product" + "httpMethod": "PUT", + "parameters": { + "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.", + "required": true, + "type": "string", + "pattern": "^[^/]+$", + "location": "path" + }, + "parent": { + "required": true, + "type": "string", + "pattern": "^accounts/[^/]+$", + "location": "path", + "description": "Parent ID in the format `accounts/{account_id}`.\n\n`account_id` - The ID of the Manufacturer Center account." + } }, "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": { + "pp": { + "location": "query", + "description": "Pretty-print response.", + "type": "boolean", + "default": "true" + }, + "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": { + "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": { + "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": { + "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": "v1", + "baseUrl": "https://manufacturers.googleapis.com/", + "description": "Public API for managing Manufacturer Center related data.", + "kind": "discovery#restDescription", + "servicePath": "", + "basePath": "", + "revision": "20171207", + "documentationLink": "https://developers.google.com/manufacturers/", + "id": "manufacturers:v1" } diff --git a/etc/api/ml/v1/ml-api.json b/etc/api/ml/v1/ml-api.json index 0e30c99f3b..5e57ea6edb 100644 --- a/etc/api/ml/v1/ml-api.json +++ b/etc/api/ml/v1/ml-api.json @@ -1,629 +1,1082 @@ { - "schemas": { - "GoogleLongrunning__ListOperationsResponse": { - "description": "The response message for Operations.ListOperations.", - "type": "object", - "properties": { + "name": "ml", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud Machine Learning Engine", + "ownerName": "Google", + "resources": { + "projects": { + "methods": { + "predict": { + "request": { + "$ref": "GoogleCloudMlV1__PredictRequest" + }, + "description": "Performs prediction on the data in the request.\nCloud ML Engine implements a custom `predict` verb on top of an HTTP POST\nmethod. For details of the format, see the **guide to the\n[predict request format](/ml-engine/docs/v1/predict-request)**.", + "response": { + "$ref": "GoogleApi__HttpBody" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "parameters": { + "name": { + "pattern": "^projects/.+$", + "location": "path", + "description": "Required. The resource name of a model or a version.\n\nAuthorization: requires the `predict` permission on the specified resource.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}:predict", + "path": "v1/{+name}:predict", + "id": "ml.projects.predict" + }, + "getConfig": { + "response": { + "$ref": "GoogleCloudMlV1__GetConfigResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "location": "path", + "description": "Required. The project name.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}:getConfig", + "path": "v1/{+name}:getConfig", + "id": "ml.projects.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." + } + }, + "resources": { "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": { - "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" - }, - "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": { - "trials": { - "description": "Results for individual Hyperparameter trials.\nOnly set for hyperparameter tuning jobs.", - "items": { - "$ref": "GoogleCloudMlV1__HyperparameterOutput" - }, - "type": "array" - }, - "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": "GoogleCloudMlV1__TrainingOutput" - }, - "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": { - "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.", - "items": { - "format": "double", - "type": "number" - }, - "type": "array" - }, - "scaleType": { - "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`).", - "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": { - "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": { - "type": "string", - "enumDescriptions": [ - "You must specify a valid type. Using this unspecified type will result in\nan error.", - "Type for real-valued parameters.", - "Type for integral parameters.", - "The parameter is categorical, with a value chosen from the categories\nfield.", - "The parameter is real valued, with a fixed set of feasible points. If\n`type==DISCRETE`, feasible_points must be provided, and\n{`min_value`, `max_value`} will be ignored." - ], - "enum": [ - "PARAMETER_TYPE_UNSPECIFIED", - "DOUBLE", - "INTEGER", - "CATEGORICAL", - "DISCRETE" - ], - "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" - }, - "categoricalValues": { - "description": "Required if type is `CATEGORICAL`. The list of possible categories.", - "items": { - "type": "string" - }, - "type": "array" - }, - "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": "GoogleCloudMlV1__ParameterSpec" - }, - "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" - }, - "versionName": { - "description": "Use this field if you want to specify a version of the model to use. The\nstring is formatted the same way as `model_version`, with the addition\nof the version information:\n\n`\"projects/\u003cvar\u003e[YOUR_PROJECT]\u003c/var\u003e/models/\u003cvar\u003eYOUR_MODEL/versions/\u003cvar\u003e[YOUR_VERSION]\u003c/var\u003e\"`", - "type": "string" - }, - "modelName": { - "description": "Use this field if you want to use the default version for the specified\nmodel. The string must use the following format:\n\n`\"projects/\u003cvar\u003e[YOUR_PROJECT]\u003c/var\u003e/models/\u003cvar\u003e[YOUR_MODEL]\u003c/var\u003e\"`", - "type": "string" - }, - "outputPath": { - "description": "Required. The output Google Cloud Storage location.", - "type": "string" - }, - "uri": { - "description": "Use this field if you want to specify a Google Cloud Storage path for\nthe model to use.", - "type": "string" - }, - "maxWorkerCount": { - "format": "int64", - "description": "Optional. The maximum number of workers to be used for parallel processing.\nDefaults to 10 if not specified.", - "type": "string" - } - }, - "id": "GoogleCloudMlV1__PredictionInput" - }, - "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": { - "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": "GoogleType__Expr" - }, - "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.", - "items": { - "$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": "GoogleCloudMlV1__ListJobsResponse" - }, - "GoogleCloudMlV1__SetDefaultVersionRequest": { - "description": "Request message for the SetDefaultVersion request.", - "type": "object", - "properties": {}, - "id": "GoogleCloudMlV1__SetDefaultVersionRequest" - }, - "GoogleLongrunning__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": { - "$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" + "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", + "response": { + "$ref": "GoogleProtobuf__Empty" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/operations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/operations/{operationsId}:cancel", + "id": "ml.projects.operations.cancel", + "path": "v1/{+name}:cancel" + }, + "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": "GoogleProtobuf__Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "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": "v1/projects/{projectsId}/operations/{operationsId}", + "path": "v1/{+name}", + "id": "ml.projects.operations.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 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": "GoogleLongrunning__ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The name of the operation's parent resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "pageToken": { + "type": "string", + "location": "query", + "description": "The standard list page token." + }, + "pageSize": { + "location": "query", + "description": "The standard list page size.", + "format": "int32", + "type": "integer" + }, + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/projects/{projectsId}/operations", + "path": "v1/{+name}/operations", + "id": "ml.projects.operations.list" + }, + "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": "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.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/projects/{projectsId}/operations/{operationsId}", + "path": "v1/{+name}", + "id": "ml.projects.operations.get" + } } }, - "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" + "models": { + "methods": { + "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).", + "response": { + "$ref": "GoogleCloudMlV1__Model" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "Required. The name of the model.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/models/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/models/{modelsId}", + "path": "v1/{+name}", + "id": "ml.projects.models.get" + }, + "patch": { + "id": "ml.projects.models.patch", + "path": "v1/{+name}", + "request": { + "$ref": "GoogleCloudMlV1__Model" + }, + "description": "Updates a specific model resource.\n\nCurrently the only supported fields to update are `description` and\n`default_version.name`.", + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "GoogleLongrunning__Operation" + }, + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/models/[^/]+$", + "location": "path", + "description": "Required. The project name." + }, + "updateMask": { + "description": "Required. Specifies the path, relative to `Model`, of the field to update.\n\nFor example, to change the description of a model to \"foo\" and set its\ndefault version to \"version_1\", the `update_mask` parameter would be\nspecified as `description`, `default_version.name`, and the `PATCH`\nrequest body would specify the new value, as follows:\n {\n \"description\": \"foo\",\n \"defaultVersion\": {\n \"name\":\"version_1\"\n }\n }\nIn this example, the model is blindly overwritten since no etag is given.\n\nTo adopt etag mechanism, include `etag` field in the mask, and include the\n`etag` value in your model resource.\n\nCurrently the supported update masks are `description`,\n`default_version.name`, `labels`, and `etag`.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/models/{modelsId}" + }, + "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" + }, + "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/[^/]+/models/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/models/{modelsId}:testIamPermissions", + "id": "ml.projects.models.testIamPermissions", + "path": "v1/{+resource}:testIamPermissions" + }, + "delete": { + "flatPath": "v1/projects/{projectsId}/models/{modelsId}", + "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).", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "GoogleLongrunning__Operation" + }, + "parameters": { + "name": { + "description": "Required. The name of the model.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/models/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "GoogleCloudMlV1__ListModelsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "description": "Required. The name of the project whose models are to be listed.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "filter": { + "description": "Optional. Specifies the subset of models to retrieve.", + "type": "string", + "location": "query" + }, + "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 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" + } + }, + "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": { + "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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/models/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/models/{modelsId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "ml.projects.models.setIamPolicy", + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "request": { + "$ref": "GoogleIamV1__SetIamPolicyRequest" + } + }, + "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/v1/projects.models.versions/create).", + "request": { + "$ref": "GoogleCloudMlV1__Model" + }, + "response": { + "$ref": "GoogleCloudMlV1__Model" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "location": "path", + "description": "Required. The project name.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/models", + "path": "v1/{+parent}/models", + "id": "ml.projects.models.create" + }, + "getIamPolicy": { + "id": "ml.projects.models.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", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "GoogleIamV1__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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/models/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/models/{modelsId}:getIamPolicy" + } }, - "type": "array" + "resources": { + "versions": { + "methods": { + "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.", + "response": { + "$ref": "GoogleCloudMlV1__Version" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "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/v1/projects.models.versions/list).", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}:setDefault", + "path": "v1/{+name}:setDefault", + "id": "ml.projects.models.versions.setDefault" + }, + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "GoogleLongrunning__Operation" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "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/v1/projects.models.versions/list).", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}", + "id": "ml.projects.models.versions.delete", + "path": "v1/{+name}", + "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": { + "id": "ml.projects.models.versions.list", + "path": "v1/{+parent}/versions", + "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", + "response": { + "$ref": "GoogleCloudMlV1__ListVersionsResponse" + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The name of the model for which to list the version.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/models/[^/]+$", + "location": "path" + }, + "filter": { + "location": "query", + "description": "Optional. Specifies the subset of versions to retrieve.", + "type": "string" + }, + "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": { + "type": "integer", + "location": "query", + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions" + }, + "create": { + "id": "ml.projects.models.versions.create", + "path": "v1/{+parent}/versions", + "request": { + "$ref": "GoogleCloudMlV1__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/v1/projects.models.versions/setDefault).", + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "GoogleLongrunning__Operation" + }, + "parameters": { + "parent": { + "description": "Required. The name of the model.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/models/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions" + }, + "patch": { + "httpMethod": "PATCH", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "GoogleLongrunning__Operation" + }, + "parameters": { + "updateMask": { + "location": "query", + "description": "Required. Specifies the path, relative to `Version`, of the field to\nupdate. Must be present and non-empty.\n\nFor example, to change the description of a version to \"foo\", the\n`update_mask` parameter would be specified as `description`, and the\n`PATCH` request body would specify the new value, as follows:\n {\n \"description\": \"foo\"\n }\nIn this example, the version is blindly overwritten since no etag is given.\n\nTo adopt etag mechanism, include `etag` field in the mask, and include the\n`etag` value in your version resource.\n\nCurrently the only supported update masks are `description`, `labels`, and\n`etag`.", + "format": "google-fieldmask", + "type": "string" + }, + "name": { + "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$", + "location": "path", + "description": "Required. The name of the model.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}", + "id": "ml.projects.models.versions.patch", + "path": "v1/{+name}", + "request": { + "$ref": "GoogleCloudMlV1__Version" + }, + "description": "Updates the specified Version resource.\n\nCurrently the only supported field to update is `description`." + }, + "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/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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}", + "path": "v1/{+name}", + "id": "ml.projects.models.versions.get" + } + } + } + } }, - "exemptedMembers": { - "items": { - "type": "string" - }, - "type": "array" + "locations": { + "methods": { + "get": { + "response": { + "$ref": "GoogleCloudMlV1__Location" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "Required. The name of the location.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}", + "path": "v1/{+name}", + "id": "ml.projects.locations.get", + "description": "Get the complete list of CMLE capabilities in a location, along with their\nlocation-specific properties." + }, + "list": { + "response": { + "$ref": "GoogleCloudMlV1__ListLocationsResponse" + }, + "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": { + "type": "integer", + "location": "query", + "description": "Optional. The number of locations 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" + }, + "parent": { + "location": "path", + "description": "Required. The name of the project for which available locations are to be\nlisted (since some locations might be whitelisted for specific projects).", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/locations", + "path": "v1/{+parent}/locations", + "id": "ml.projects.locations.list", + "description": "List all locations that provides at least one type of CMLE capability." + } + } }, - "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" + "jobs": { + "methods": { + "get": { + "description": "Describes a job.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "GoogleCloudMlV1__Job" + }, + "parameters": { + "name": { + "location": "path", + "description": "Required. The name of the job to get the description of.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/jobs/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}", + "id": "ml.projects.jobs.get", + "path": "v1/{+name}" + }, + "patch": { + "description": "Updates a specific job resource.\n\nCurrently the only supported fields to update are `labels`.", + "request": { + "$ref": "GoogleCloudMlV1__Job" + }, + "response": { + "$ref": "GoogleCloudMlV1__Job" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "updateMask": { + "location": "query", + "description": "Required. Specifies the path, relative to `Job`, of the field to update.\nTo adopt etag mechanism, include `etag` field in the mask, and include the\n`etag` value in your job resource.\n\nFor example, to change the labels of a job, the `update_mask` parameter\nwould be specified as `labels`, `etag`, and the\n`PATCH` request body would specify the new value, as follows:\n {\n \"labels\": {\n \"owner\": \"Google\",\n \"color\": \"Blue\"\n }\n \"etag\": \"33a64df551425fcc55e4d42a148795d9f25f89d4\"\n }\nIf `etag` matches the one on the server, the labels of the job will be\nreplaced with the given ones, and the server end `etag` will be\nrecalculated.\n\nCurrently the only supported update masks are `labels` and `etag`.", + "format": "google-fieldmask", + "type": "string" + }, + "name": { + "description": "Required. The job name.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/jobs/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}", + "path": "v1/{+name}", + "id": "ml.projects.jobs.patch" + }, + "testIamPermissions": { + "response": { + "$ref": "GoogleIamV1__TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/jobs/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "id": "ml.projects.jobs.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" + } + }, + "list": { + "description": "Lists the jobs in the project.", + "response": { + "$ref": "GoogleCloudMlV1__ListJobsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "filter": { + "description": "Optional. Specifies the subset of jobs to retrieve.", + "type": "string", + "location": "query" + }, + "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", + "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", + "type": "integer" + }, + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "Required. The name of the project for which to list jobs.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/projects/{projectsId}/jobs", + "path": "v1/{+parent}/jobs", + "id": "ml.projects.jobs.list" + }, + "create": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "location": "path", + "description": "Required. The project name.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/jobs", + "path": "v1/{+parent}/jobs", + "id": "ml.projects.jobs.create", + "description": "Creates a training or a batch prediction job.", + "request": { + "$ref": "GoogleCloudMlV1__Job" + }, + "response": { + "$ref": "GoogleCloudMlV1__Job" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST" + }, + "setIamPolicy": { + "id": "ml.projects.jobs.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "request": { + "$ref": "GoogleIamV1__SetIamPolicyRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "GoogleIamV1__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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/jobs/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:setIamPolicy" + }, + "cancel": { + "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:cancel", + "path": "v1/{+name}:cancel", + "id": "ml.projects.jobs.cancel", + "description": "Cancels a running job.", + "request": { + "$ref": "GoogleCloudMlV1__CancelJobRequest" + }, + "response": { + "$ref": "GoogleProtobuf__Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "location": "path", + "description": "Required. The name of the job to cancel.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/jobs/[^/]+$" + } + } + }, + "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": "GoogleIamV1__Policy" + }, + "parameterOrder": [ + "resource" + ], + "parameters": { + "resource": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/jobs/[^/]+$", + "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" + ], + "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:getIamPolicy", + "id": "ml.projects.jobs.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy" + } + } } - }, - "id": "GoogleIamV1__AuditConfig" + } + } + }, + "parameters": { + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" }, - "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.", - "type": "string" - }, - "description": { - "description": "Optional. The description specified for the model when it was created.", - "type": "string" - }, - "onlinePredictionLogging": { - "description": "Optional. If true, enables StackDriver Logging for online prediction.\nDefault is false.", - "type": "boolean" - } - }, - "id": "GoogleCloudMlV1__Model" + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "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" + ] + }, + "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" + }, + "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" + } + }, + "version": "v1", + "baseUrl": "https://ml.googleapis.com/", + "kind": "discovery#restDescription", + "description": "An API to enable creating and using machine learning models.", + "servicePath": "", + "basePath": "", + "id": "ml:v1", + "documentationLink": "https://cloud.google.com/ml/", + "revision": "20171208", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { "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": { - "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.", + "GoogleIamV1__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": "GoogleIamV1__TestIamPermissionsRequest" + }, + "GoogleCloudMlV1__ListVersionsResponse": { "properties": { "versions": { "description": "The list of versions.", + "type": "array", "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" + "id": "GoogleCloudMlV1__ListVersionsResponse", + "description": "Response message for the ListVersions method.", + "type": "object" + }, + "GoogleCloudMlV1__AutoScaling": { + "type": "object", + "properties": { + "minNodes": { + "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.", + "format": "int32", + "type": "integer" + } + }, + "id": "GoogleCloudMlV1__AutoScaling", + "description": "Options for automatically scaling a model." }, "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.", + "type": "array", "items": { "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", @@ -631,43 +1084,35 @@ }, "type": "object" }, - "type": "array" + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." }, "code": { - "format": "int32", "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", "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" + "type": "string", + "description": "Optional. Pass this token as the `page_token` field of the request for a\nsubsequent call." }, "models": { "description": "The list of models.", + "type": "array", "items": { "$ref": "GoogleCloudMlV1__Model" - }, - "type": "array" + } } }, "id": "GoogleCloudMlV1__ListModelsResponse" @@ -676,33 +1121,6 @@ "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", @@ -731,72 +1149,80 @@ "$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`.", + "pythonVersion": { + "description": "Optional. The version of Python used in training. If not set, the default\nversion is '2.7'.", "type": "string" }, + "parameterServerCount": { + "type": "string", + "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" + }, "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" - }, - "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`.", + "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", + "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 single NVIDIA Tesla K80 GPU. See more about\n \u003ca href=\"/ml-engine/docs/how-tos/using-gpus\"\u003e\n using GPUs for training your model\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 NVIDIA Tesla K80 GPUs.\n \u003c/dd\u003e\n \u003cdt\u003ecomplex_model_l_gpu\u003c/dt\u003e\n \u003cdd\u003e\n A machine equivalent to\n \u003ccode suppresswarning=\"true\"\u003ecomplex_model_l\u003c/code\u003e that also includes\n eight NVIDIA Tesla K80 GPUs.\n \u003c/dd\u003e\n \u003cdt\u003estandard_p100\u003c/dt\u003e\n \u003cdd\u003e\n A machine equivalent to \u003ccode suppresswarning=\"true\"\u003estandard\u003c/code\u003e that\n also includes a single NVIDIA Tesla P100 GPU. The availability of these\n GPUs is in the Alpha launch stage.\n \u003c/dd\u003e\n \u003cdt\u003ecomplex_model_m_p100\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 NVIDIA Tesla P100 GPUs. The availability of these GPUs is in\n the Alpha launch stage.\n \u003c/dd\u003e\n\u003c/dl\u003e\n\nYou must set this value when `scaleTier` is set to `CUSTOM`." + }, + "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": { + "type": "string", + "description": "Required. The Python module name to run after installing the packages." + }, + "region": { + "description": "Required. The Google Compute Engine region to run the training job in.", + "type": "string" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional. Command line arguments to pass to the program." + }, + "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" + }, + "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" } }, "id": "GoogleCloudMlV1__TrainingInput" }, "GoogleCloudMlV1__Job": { + "description": "Represents a training or prediction job.", + "type": "object", "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": { - "format": "google-datetime", - "description": "Output only. When the job processing was completed.", - "type": "string" - }, - "startTime": { - "format": "google-datetime", - "description": "Output only. When the job processing was started.", - "type": "string" - }, - "predictionOutput": { - "$ref": "GoogleCloudMlV1__PredictionOutput", - "description": "The current prediction job result." - }, - "trainingOutput": { - "$ref": "GoogleCloudMlV1__TrainingOutput", - "description": "The current training job result." - }, "trainingInput": { - "description": "Input parameters to create a training job.", - "$ref": "GoogleCloudMlV1__TrainingInput" - }, - "createTime": { - "format": "google-datetime", - "description": "Output only. When the job was created.", - "type": "string" - }, - "predictionInput": { - "$ref": "GoogleCloudMlV1__PredictionInput", - "description": "Input parameters to create a prediction job." + "$ref": "GoogleCloudMlV1__TrainingInput", + "description": "Input parameters to create a training 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", @@ -808,49 +1234,122 @@ "CANCELLED" ], "description": "Output only. The detailed state of a job.", + "type": "string" + }, + "jobId": { + "description": "Required. The user-specified id of the job.", + "type": "string" + }, + "endTime": { + "description": "Output only. When the job processing was completed.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "Output only. When the job processing was started.", + "format": "google-datetime", + "type": "string" + }, + "predictionOutput": { + "$ref": "GoogleCloudMlV1__PredictionOutput", + "description": "The current prediction job result." + }, + "trainingOutput": { + "description": "The current training job result.", + "$ref": "GoogleCloudMlV1__TrainingOutput" + }, + "createTime": { + "description": "Output only. When the job was created.", + "format": "google-datetime", + "type": "string" + }, + "labels": { + "description": "Optional. One or more labels that you can add, to organize your jobs.\nEach label is a key-value pair, where both the key and the value are\narbitrary strings that you supply.\nFor more information, see the documentation on\n\u003ca href=\"/ml-engine/docs/how-tos/resource-labels\"\u003eusing labels\u003c/a\u003e.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "predictionInput": { + "$ref": "GoogleCloudMlV1__PredictionInput", + "description": "Input parameters to create a prediction job." + }, + "errorMessage": { + "description": "Output only. The details of a failure or a cancellation.", + "type": "string" + }, + "etag": { + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a job from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform job updates in order to avoid race\nconditions: An `etag` is returned in the response to `GetJob`, and\nsystems are expected to put that etag in the request to `UpdateJob` to\nensure that their change will be applied to the same version of the job.", + "format": "byte", + "type": "string" + } + }, + "id": "GoogleCloudMlV1__Job" + }, + "GoogleCloudMlV1__Capability": { + "type": "object", + "properties": { + "availableAccelerators": { + "description": "Available accelerators for the capability.", + "type": "array", + "items": { + "enum": [ + "ACCELERATOR_TYPE_UNSPECIFIED", + "NVIDIA_TESLA_K80", + "NVIDIA_TESLA_P100" + ], + "type": "string" + }, + "enumDescriptions": [ + "Unspecified accelerator type. Default to no GPU.", + "Nvidia tesla k80 GPU.", + "Nvidia tesla P100 GPU." + ] + }, + "type": { + "enum": [ + "TYPE_UNSPECIFIED", + "TRAINING", + "BATCH_PREDICTION", + "ONLINE_PREDICTION" + ], "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": "GoogleCloudMlV1__Job", - "description": "Represents a training or prediction job.\n\nNext ID: 16", - "type": "object" + "id": "GoogleCloudMlV1__Capability" }, "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": { + "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" }, "extensions": { "description": "Application specific response metadata. Must be set in the first response\nfor streaming APIs.", + "type": "array", "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" + }, + "type": "object" + } } }, - "id": "GoogleApi__HttpBody" + "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.", + "type": "object" }, "GoogleCloudMlV1__GetConfigResponse": { "id": "GoogleCloudMlV1__GetConfigResponse", @@ -858,9 +1357,9 @@ "type": "object", "properties": { "serviceAccountProject": { - "format": "int64", + "type": "string", "description": "The project number for `service_account`.", - "type": "string" + "format": "int64" }, "serviceAccount": { "description": "The service account Cloud ML uses to access resources in the project.", @@ -869,18 +1368,47 @@ } }, "GoogleIamV1__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": "GoogleIamV1__TestIamPermissionsResponse" + "id": "GoogleIamV1__TestIamPermissionsResponse", + "description": "Response message for `TestIamPermissions` method.", + "type": "object" + }, + "GoogleCloudMlV1__HyperparameterOutput": { + "id": "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": { + "trialId": { + "description": "The trial id for these results.", + "type": "string" + }, + "allMetrics": { + "description": "All recorded object metrics for this trial. This field is not currently\npopulated.", + "type": "array", + "items": { + "$ref": "GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric" + } + }, + "finalMetric": { + "$ref": "GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric", + "description": "The final objective metric seen for this trial." + }, + "hyperparameters": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The hyperparameters given to this trial." + } + } }, "GoogleIamV1__SetIamPolicyRequest": { "description": "Request message for `SetIamPolicy` method.", @@ -891,101 +1419,720 @@ "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.", + "format": "google-fieldmask", "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.", + "GoogleCloudMlV1__PredictionOutput": { + "description": "Represents results of a prediction job.", "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" + }, + "nodeHours": { + "description": "Node hours used by the batch prediction job.", + "format": "double", + "type": "number" + }, + "predictionCount": { + "type": "string", + "description": "The number of generated predictions.", + "format": "int64" + }, + "errorCount": { + "description": "The number of data instances which resulted in errors.", + "format": "int64", + "type": "string" } }, - "id": "GoogleCloudMlV1__PredictionOutput", - "description": "Represents results of a prediction job.", - "type": "object" + "id": "GoogleCloudMlV1__PredictionOutput" }, "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": { + "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": { - "format": "int32", + "type": "integer", "description": "Version of the `Policy`. The default version is 0.", - "type": "integer" + "format": "int32" }, "auditConfigs": { "description": "Specifies cloud audit logging configuration for this policy.", + "type": "array", "items": { "$ref": "GoogleIamV1__AuditConfig" - }, - "type": "array" + } }, "bindings": { + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error.", + "type": "array", "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" + } + }, + "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" + }, + "GoogleLongrunning__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": "GoogleLongrunning__Operation" + } + } + }, + "id": "GoogleLongrunning__ListOperationsResponse" + }, + "GoogleCloudMlV1__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\nlast billing cycle plus the cost for each prediction performed.", + "format": "int32", + "type": "integer" + } + }, + "id": "GoogleCloudMlV1__ManualScaling" + }, + "GoogleIamV1__Binding": { + "description": "Associates `members` with a `role`.", + "type": "object", + "properties": { + "role": { + "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.\nRequired", + "type": "string" + }, + "condition": { + "$ref": "GoogleType__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", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "GoogleIamV1__Binding" + }, + "GoogleCloudMlV1__TrainingOutput": { + "description": "Represents results of a training job. Output only.", + "type": "object", + "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", + "items": { + "$ref": "GoogleCloudMlV1__HyperparameterOutput" + } + } + }, + "id": "GoogleCloudMlV1__TrainingOutput" + }, + "GoogleCloudMlV1__PredictRequest": { + "properties": { + "httpBody": { + "description": "\nRequired. The prediction request body.", + "$ref": "GoogleApi__HttpBody" + } + }, + "id": "GoogleCloudMlV1__PredictRequest", + "description": "Request for predictions to be issued against a trained model.", + "type": "object" + }, + "GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric": { + "description": "An observed value of a metric.", + "type": "object", + "properties": { + "trainingStep": { + "description": "The global training step for this metric.", + "format": "int64", + "type": "string" + }, + "objectiveValue": { + "description": "The objective value at this training step.", + "format": "double", + "type": "number" + } + }, + "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\nLINT.IfChange", + "type": "object", + "properties": { + "lastUseTime": { + "description": "Output only. The time the version was last used for prediction.", + "format": "google-datetime", + "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" + }, + "autoScaling": { + "$ref": "GoogleCloudMlV1__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." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. One or more labels that you can add, to organize your model\nversions. Each label is a key-value pair, where both the key and the value\nare arbitrary strings that you supply.\nFor more information, see the documentation on\n\u003ca href=\"/ml-engine/docs/how-tos/resource-labels\"\u003eusing labels\u003c/a\u003e.", + "type": "object" + }, + "createTime": { + "description": "Output only. The time the version was created.", + "format": "google-datetime", + "type": "string" + }, + "errorMessage": { + "description": "Output only. The details of a failure or a cancellation.", + "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" }, "etag": { + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a model from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform model updates in order to avoid race\nconditions: An `etag` is returned in the response to `GetVersion`, and\nsystems are expected to put that etag in the request to `UpdateVersion` to\nensure that their change will be applied to the model as intended.", "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" + }, + "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" + }, + "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." + ] + }, + "manualScaling": { + "$ref": "GoogleCloudMlV1__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." + }, + "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" + } + }, + "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" + } + }, + "scaleType": { + "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." + ], + "enum": [ + "NONE", + "UNIT_LINEAR_SCALE", + "UNIT_LOG_SCALE", + "UNIT_REVERSE_LOG_SCALE" + ] + }, + "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", + "type": "number" + }, + "type": { + "enumDescriptions": [ + "You must specify a valid type. Using this unspecified type will result in\nan error.", + "Type for real-valued parameters.", + "Type for integral parameters.", + "The parameter is categorical, with a value chosen from the categories\nfield.", + "The parameter is real valued, with a fixed set of feasible points. If\n`type==DISCRETE`, feasible_points must be provided, and\n{`min_value`, `max_value`} will be ignored." + ], + "enum": [ + "PARAMETER_TYPE_UNSPECIFIED", + "DOUBLE", + "INTEGER", + "CATEGORICAL", + "DISCRETE" + ], + "description": "Required. The type of the parameter.", + "type": "string" + }, + "parameterName": { + "description": "Required. The parameter name must be unique amongst all ParameterConfigs in\na HyperparameterSpec message. E.g., \"learning_rate\".", + "type": "string" + }, + "categoricalValues": { + "description": "Required if type is `CATEGORICAL`. The list of possible categories.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "GoogleCloudMlV1__ParameterSpec" + }, + "GoogleCloudMlV1__Location": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "capabilities": { + "description": "Capabilities available in the location.", + "type": "array", + "items": { + "$ref": "GoogleCloudMlV1__Capability" + } + } + }, + "id": "GoogleCloudMlV1__Location" + }, + "GoogleCloudMlV1__PredictionInput": { + "id": "GoogleCloudMlV1__PredictionInput", + "description": "Represents input parameters for a prediction job.", + "type": "object", + "properties": { + "outputPath": { + "description": "Required. The output Google Cloud Storage location.", + "type": "string" + }, + "uri": { + "description": "Use this field if you want to specify a Google Cloud Storage path for\nthe model to use.", + "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" + }, + "signatureName": { + "description": "Optional. The name of the signature defined in the SavedModel to use for\nthis job. Please refer to\n[SavedModel](https://tensorflow.github.io/serving/serving_basic.html)\nfor information about how to use signatures.\n\nDefaults to\n[DEFAULT_SERVING_SIGNATURE_DEF_KEY](https://www.tensorflow.org/api_docs/python/tf/saved_model/signature_constants)\n, which is \"serving_default\".", + "type": "string" + }, + "dataFormat": { + "description": "Required. The format of the input data files.", + "type": "string", + "enumDescriptions": [ + "Unspecified format.", + "Each line of the file is a JSON dictionary representing one record.", + "Deprecated. Use JSON instead.", + "INPUT ONLY. The source file is a TFRecord file.", + "INPUT ONLY. The source file is a GZIP-compressed TFRecord file." + ], + "enum": [ + "DATA_FORMAT_UNSPECIFIED", + "JSON", + "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.", + "type": "string" + }, + "batchSize": { + "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.", + "format": "int64", + "type": "string" + }, + "inputPaths": { + "description": "Required. The Google Cloud Storage location of the input data files.\nMay contain wildcards.", + "type": "array", + "items": { + "type": "string" + } + }, + "region": { + "description": "Required. The Google Compute Engine region to run the prediction job in.", + "type": "string" + }, + "versionName": { + "description": "Use this field if you want to specify a version of the model to use. The\nstring is formatted the same way as `model_version`, with the addition\nof the version information:\n\n`\"projects/\u003cvar\u003e[YOUR_PROJECT]\u003c/var\u003e/models/\u003cvar\u003eYOUR_MODEL/versions/\u003cvar\u003e[YOUR_VERSION]\u003c/var\u003e\"`", + "type": "string" + }, + "modelName": { + "description": "Use this field if you want to use the default version for the specified\nmodel. The string must use the following format:\n\n`\"projects/\u003cvar\u003e[YOUR_PROJECT]\u003c/var\u003e/models/\u003cvar\u003e[YOUR_MODEL]\u003c/var\u003e\"`", "type": "string" } } + }, + "GoogleCloudMlV1__OperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "type": "object", + "properties": { + "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.", + "An operation to update an existing model.", + "An operation to update an existing version.", + "An operation to update project configuration." + ], + "enum": [ + "OPERATION_TYPE_UNSPECIFIED", + "CREATE_VERSION", + "DELETE_VERSION", + "DELETE_MODEL", + "UPDATE_MODEL", + "UPDATE_VERSION", + "UPDATE_CONFIG" + ], + "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" + }, + "projectNumber": { + "description": "Contains the project number associated with the operation.", + "format": "int64", + "type": "string" + }, + "createTime": { + "description": "The time the operation was submitted.", + "format": "google-datetime", + "type": "string" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "The user labels, inherited from the model or the model version being\noperated on.", + "type": "object" + }, + "modelName": { + "description": "Contains the name of the model associated with the operation.", + "type": "string" + } + }, + "id": "GoogleCloudMlV1__OperationMetadata" + }, + "GoogleIamV1__AuditLogConfig": { + "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" + } + }, + "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": "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." + }, + "GoogleType__Expr": { + "id": "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": { + "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" + }, + "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" + }, + "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" + } + } + }, + "GoogleCloudMlV1__HyperparameterSpec": { + "description": "Represents a set of hyperparameters to optimize.", + "type": "object", + "properties": { + "maxParallelTrials": { + "type": "integer", + "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" + }, + "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" + }, + "params": { + "description": "Required. The set of parameters to tune.", + "type": "array", + "items": { + "$ref": "GoogleCloudMlV1__ParameterSpec" + } + }, + "maxTrials": { + "description": "Optional. How many training trials should be attempted to optimize\nthe specified hyperparameters.\n\nDefaults to one.", + "format": "int32", + "type": "integer" + } + }, + "id": "GoogleCloudMlV1__HyperparameterSpec" + }, + "GoogleCloudMlV1__ListLocationsResponse": { + "type": "object", + "properties": { + "locations": { + "description": "Locations where at least one type of CMLE capability is available.", + "type": "array", + "items": { + "$ref": "GoogleCloudMlV1__Location" + } + }, + "nextPageToken": { + "description": "Optional. Pass this token as the `page_token` field of the request for a\nsubsequent call.", + "type": "string" + } + }, + "id": "GoogleCloudMlV1__ListLocationsResponse" + }, + "GoogleCloudMlV1__ListJobsResponse": { + "description": "Response message for the ListJobs method.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Optional. Pass this token as the `page_token` field of the request for a\nsubsequent call.", + "type": "string" + }, + "jobs": { + "description": "The list of jobs.", + "type": "array", + "items": { + "$ref": "GoogleCloudMlV1__Job" + } + } + }, + "id": "GoogleCloudMlV1__ListJobsResponse" + }, + "GoogleCloudMlV1__SetDefaultVersionRequest": { + "description": "Request message for the SetDefaultVersion request.", + "type": "object", + "properties": {}, + "id": "GoogleCloudMlV1__SetDefaultVersionRequest" + }, + "GoogleLongrunning__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": "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": { + "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": "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": { + "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" + } + }, + "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": { + "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." + }, + "auditLogConfigs": { + "description": "The configuration for logging of each type of permission.\nNext ID: 4", + "type": "array", + "items": { + "$ref": "GoogleIamV1__AuditLogConfig" + } + }, + "exemptedMembers": { + "type": "array", + "items": { + "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.", + "type": "object", + "properties": { + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. One or more labels that you can add, to organize your models.\nEach label is a key-value pair, where both the key and the value are\narbitrary strings that you supply.\nFor more information, see the documentation on\n\u003ca href=\"/ml-engine/docs/how-tos/resource-labels\"\u003eusing labels\u003c/a\u003e.", + "type": "object" + }, + "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.", + "type": "string" + }, + "defaultVersion": { + "$ref": "GoogleCloudMlV1__Version", + "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)." + }, + "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", + "items": { + "type": "string" + } + }, + "description": { + "description": "Optional. The description specified for the model when it was created.", + "type": "string" + }, + "onlinePredictionLogging": { + "description": "Optional. If true, enables StackDriver Logging for online prediction.\nDefault is false.", + "type": "boolean" + }, + "etag": { + "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a model from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform model updates in order to avoid race\nconditions: An `etag` is returned in the response to `GetModel`, and\nsystems are expected to put that etag in the request to `UpdateModel` to\nensure that their change will be applied to the model as intended.", + "format": "byte", + "type": "string" + } + }, + "id": "GoogleCloudMlV1__Model" } }, "protocol": "rest", @@ -1004,843 +2151,5 @@ } }, "rootUrl": "https://ml.googleapis.com/", - "ownerDomain": "google.com", - "name": "ml", - "batchPath": "batch", - "title": "Google Cloud Machine Learning Engine", - "ownerName": "Google", - "resources": { - "projects": { - "methods": { - "getConfig": { - "response": { - "$ref": "GoogleCloudMlV1__GetConfigResponse" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "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": { - "flatPath": "v1/projects/{projectsId}:predict", - "id": "ml.projects.predict", - "path": "v1/{+name}:predict", - "request": { - "$ref": "GoogleCloudMlV1__PredictRequest" - }, - "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": { - "type": "string", - "required": true, - "pattern": "^projects/.+$", - "location": "path", - "description": "Required. The resource name of a model or a version.\n\nAuthorization: requires the `predict` permission on the specified resource." - } - } - } - }, - "resources": { - "jobs": { - "methods": { - "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" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "POST", - "parameters": { - "name": { - "description": "Required. The name of the job to cancel.", - "type": "string", - "required": true, - "pattern": "^projects/[^/]+/jobs/[^/]+$", - "location": "path" - } - }, - "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": "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/[^/]+/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", - "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", - "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": { - "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": { - "httpMethod": "GET", - "response": { - "$ref": "GoogleCloudMlV1__Model" - }, - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "pattern": "^projects/[^/]+/models/[^/]+$", - "location": "path", - "description": "Required. The name of the model.", - "type": "string", - "required": true - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "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": { - "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" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "POST", - "parameters": { - "name": { - "description": "The name of the operation resource to be cancelled.", - "type": "string", - "required": true, - "pattern": "^projects/[^/]+/operations/[^/]+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/projects/{projectsId}/operations/{operationsId}:cancel", - "id": "ml.projects.operations.cancel", - "path": "v1/{+name}:cancel" - } - } - } - } - } - }, - "parameters": { - "upload_protocol": { - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string" - }, - "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" - }, - "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": { - "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": { - "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": "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 + "ownerDomain": "google.com" } diff --git a/etc/api/monitoring/v3/monitoring-api.json b/etc/api/monitoring/v3/monitoring-api.json index 75bac9b6d7..191387b69f 100644 --- a/etc/api/monitoring/v3/monitoring-api.json +++ b/etc/api/monitoring/v3/monitoring-api.json @@ -1,24 +1,129 @@ { + "fullyEncodeReservedExpansion": true, + "title": "Stackdriver Monitoring API", + "ownerName": "Google", "resources": { "projects": { "resources": { - "timeSeries": { + "metricDescriptors": { "methods": { - "create": { - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], + "delete": { + "flatPath": "v3/projects/{projectsId}/metricDescriptors/{metricDescriptorsId}", + "path": "v3/{+name}", + "id": "monitoring.projects.metricDescriptors.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/[^/]+$", - "location": "path", - "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", + "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 + "pattern": "^projects/[^/]+/metricDescriptors/.+$", + "location": "path" + } + } + }, + "list": { + "description": "Lists metric descriptors that match a filter. This method does not require a Stackdriver account.", + "response": { + "$ref": "ListMetricDescriptorsResponse" + }, + "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", + "https://www.googleapis.com/auth/monitoring.write" + ], + "parameters": { + "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": { + "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": { + "location": "query", + "description": "A positive number that is the maximum number of results to return.", + "format": "int32", + "type": "integer" + }, + "filter": { + "type": "string", + "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" + } + }, + "flatPath": "v3/projects/{projectsId}/metricDescriptors", + "path": "v3/{+name}/metricDescriptors", + "id": "monitoring.projects.metricDescriptors.list" + }, + "get": { + "response": { + "$ref": "MetricDescriptor" + }, + "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", + "https://www.googleapis.com/auth/monitoring.write" + ], + "parameters": { + "name": { + "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 value of {metric_id} is \"compute.googleapis.com/instance/disk/read_bytes_count\".", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/metricDescriptors/.+$" + } + }, + "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." + }, + "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": { + "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" } }, "scopes": [ @@ -26,23 +131,75 @@ "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/monitoring.write" ], - "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" - } - }, + "flatPath": "v3/projects/{projectsId}/metricDescriptors", + "path": "v3/{+name}/metricDescriptors", + "id": "monitoring.projects.metricDescriptors.create" + } + } + }, + "timeSeries": { + "methods": { "list": { + "description": "Lists time series that match a filter. This method does not require a Stackdriver account.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListTimeSeriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read" + ], "parameters": { + "view": { + "description": "Specifies which information is returned about the time series.", + "type": "string", + "location": "query", + "enum": [ + "FULL", + "HEADERS" + ] + }, + "aggregation.groupByFields": { + "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", + "repeated": true + }, + "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": { + "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", + "type": "integer", + "location": "query" + }, "orderBy": { "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", "location": "query" }, "aggregation.crossSeriesReducer": { - "location": "query", "enum": [ "REDUCE_NONE", "REDUCE_MEAN", @@ -59,13 +216,14 @@ "REDUCE_PERCENTILE_05" ], "description": "The approach to be used to combine time series. Not all reducer functions may be applied to all time series, depending on the metric type and the value type of the original time series. Reduction may change the metric type of 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" - }, - "filter": { - "description": "A monitoring filter that specifies which time series should be returned. The filter must specify a single metric type, and can additionally specify metric labels and other information. For example:\nmetric.type = \"compute.googleapis.com/instance/cpu/usage_time\" AND\n metric.label.instance_name = \"my-instance-name\"\n", "type": "string", "location": "query" }, + "filter": { + "location": "query", + "description": "A monitoring filter that specifies which time series should be returned. The filter must specify a single metric type, and can additionally specify metric labels and other information. For example:\nmetric.type = \"compute.googleapis.com/instance/cpu/usage_time\" AND\n metric.label.instance_name = \"my-instance-name\"\n", + "type": "string" + }, "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", @@ -97,232 +255,208 @@ }, "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.", + "format": "google-datetime", "type": "string" - }, - "view": { - "location": "query", - "enum": [ - "FULL", - "HEADERS" - ], - "description": "Specifies which information is returned about the time series.", - "type": "string" - }, + } + }, + "flatPath": "v3/projects/{projectsId}/timeSeries", + "id": "monitoring.projects.timeSeries.list", + "path": "v3/{+name}/timeSeries" + }, + "create": { + "request": { + "$ref": "CreateTimeSeriesRequest" + }, + "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.", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { "name": { "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", - "type": "string", "required": true, + "type": "string", "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.write" + ], + "flatPath": "v3/projects/{projectsId}/timeSeries", + "id": "monitoring.projects.timeSeries.create", + "path": "v3/{+name}/timeSeries" + } + } + }, + "uptimeCheckConfigs": { + "methods": { + "delete": { + "description": "Deletes an uptime check configuration. Note that this method will fail if the uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "pattern": "^projects/[^/]+/uptimeCheckConfigs/[^/]+$", + "location": "path", + "description": "The uptime check configuration to delete. The format isprojects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ], + "flatPath": "v3/projects/{projectsId}/uptimeCheckConfigs/{uptimeCheckConfigsId}", + "id": "monitoring.projects.uptimeCheckConfigs.delete", + "path": "v3/{+name}" + }, + "list": { + "description": "Lists the existing valid uptime check configurations for the project, leaving out any invalid configurations.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListUptimeCheckConfigsResponse" + }, "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", - "id": "monitoring.projects.timeSeries.list", - "path": "v3/{+name}/timeSeries", - "description": "Lists time series that match a filter. This method does not require a Stackdriver account.", + "parameters": { + "pageSize": { + "location": "query", + "description": "The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is \u003c=0, the server will decide the number of results to be returned.", + "format": "int32", + "type": "integer" + }, + "parent": { + "description": "The project whose uptime check configurations are listed. The format isprojects/[PROJECT_ID].", + "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 more results from the previous method call.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v3/projects/{projectsId}/uptimeCheckConfigs", + "id": "monitoring.projects.uptimeCheckConfigs.list", + "path": "v3/{+parent}/uptimeCheckConfigs" + }, + "get": { + "flatPath": "v3/projects/{projectsId}/uptimeCheckConfigs/{uptimeCheckConfigsId}", + "id": "monitoring.projects.uptimeCheckConfigs.get", + "path": "v3/{+name}", + "description": "Gets a single uptime check configuration.", + "httpMethod": "GET", "response": { - "$ref": "ListTimeSeriesResponse" + "$ref": "UptimeCheckConfig" }, "parameterOrder": [ "name" ], - "httpMethod": "GET" - } - } - }, - "metricDescriptors": { - "methods": { - "create": { "parameters": { "name": { - "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\".", - "type": "string", + "pattern": "^projects/[^/]+/uptimeCheckConfigs/[^/]+$", + "location": "path", + "description": "The uptime check configuration to retrieve. The format isprojects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].", "required": true, - "pattern": "^projects/[^/]+$", - "location": "path" + "type": "string" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.write" - ], - "flatPath": "v3/projects/{projectsId}/metricDescriptors", - "id": "monitoring.projects.metricDescriptors.create", - "path": "v3/{+name}/metricDescriptors", - "description": "Creates a new metric descriptor. User-created metric descriptors define custom metrics.", - "request": { - "$ref": "MetricDescriptor" - }, - "response": { - "$ref": "MetricDescriptor" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "POST" + "https://www.googleapis.com/auth/monitoring.read" + ] }, - "delete": { - "description": "Deletes a metric descriptor. Only user-created custom metrics can be deleted.", - "response": { - "$ref": "Empty" - }, + "patch": { + "httpMethod": "PATCH", "parameterOrder": [ "name" ], - "httpMethod": "DELETE", + "response": { + "$ref": "UptimeCheckConfig" + }, + "parameters": { + "updateMask": { + "location": "query", + "description": "Optional. If present, only the listed fields in the current uptime check configuration are updated with values from the new configuration. If this field is empty, then the current configuration is completely replaced with the new configuration.", + "format": "google-fieldmask", + "type": "string" + }, + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/uptimeCheckConfigs/[^/]+$", + "location": "path", + "description": "A unique resource name for this UptimeCheckConfig. The format is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field should be omitted when creating the uptime check configuration; on create, the resource name is assigned by the server and included in the response." + } + }, "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\".", - "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", - "https://www.googleapis.com/auth/monitoring.read", - "https://www.googleapis.com/auth/monitoring.write" - ], - "flatPath": "v3/projects/{projectsId}/metricDescriptors/{metricDescriptorsId}", + "flatPath": "v3/projects/{projectsId}/uptimeCheckConfigs/{uptimeCheckConfigsId}", + "id": "monitoring.projects.uptimeCheckConfigs.patch", "path": "v3/{+name}", - "id": "monitoring.projects.metricDescriptors.get", - "description": "Gets a single metric descriptor. This method does not require a Stackdriver account.", - "httpMethod": "GET", + "request": { + "$ref": "UptimeCheckConfig" + }, + "description": "Updates an uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via \"updateMask\". Returns the updated configuration." + }, + "create": { + "request": { + "$ref": "UptimeCheckConfig" + }, + "description": "Creates a new uptime check configuration.", "response": { - "$ref": "MetricDescriptor" + "$ref": "UptimeCheckConfig" }, "parameterOrder": [ - "name" - ] - }, - "list": { + "parent" + ], + "httpMethod": "POST", "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 project on which to execute the request. The format is \"projects/{project_id_or_number}\".", - "type": "string", + "parent": { "required": true, + "type": "string", "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" + "location": "path", + "description": "The project in which to create the uptime check. The format is:projects/[PROJECT_ID]." } }, "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}/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" - ] + "flatPath": "v3/projects/{projectsId}/uptimeCheckConfigs", + "path": "v3/{+parent}/uptimeCheckConfigs", + "id": "monitoring.projects.uptimeCheckConfigs.create" } } }, "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" @@ -338,230 +472,91 @@ "https://www.googleapis.com/auth/monitoring.write" ], "parameters": { + "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" + }, + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The project on which to execute the request. The format is \"projects/{project_id_or_number}\"." + }, "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", - "format": "int32", "description": "A positive number that is the maximum number of results to return.", + "format": "int32", "type": "integer" - }, - "filter": { - "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", - "location": "query" } }, "flatPath": "v3/projects/{projectsId}/monitoredResourceDescriptors", - "id": "monitoring.projects.monitoredResourceDescriptors.list", "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." + }, + "get": { + "response": { + "$ref": "MonitoredResourceDescriptor" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "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", + "pattern": "^projects/[^/]+/monitoredResourceDescriptors/[^/]+$" + } + }, + "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", + "description": "Gets a single monitored resource descriptor. 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" - ], - "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": "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": { + "flatPath": "v3/projects/{projectsId}/groups/{groupsId}/members", + "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", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read" + ], "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.", + "format": "google-datetime", "type": "string" }, "filter": { @@ -575,48 +570,209 @@ "type": "string" }, "pageSize": { - "format": "int32", + "location": "query", "description": "A positive number that is the maximum number of results to return.", - "type": "integer", - "location": "query" + "format": "int32", + "type": "integer" }, "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" + "format": "google-datetime", + "type": "string", + "location": "query" + }, + "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" } - }, - "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" - ] + } } } } + }, + "methods": { + "delete": { + "description": "Deletes an existing group.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "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}", + "path": "v3/{+name}", + "id": "monitoring.projects.groups.delete" + }, + "list": { + "flatPath": "v3/projects/{projectsId}/groups", + "path": "v3/{+name}/groups", + "id": "monitoring.projects.groups.list", + "description": "Lists the existing groups.", + "response": { + "$ref": "ListGroupsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "description": "A positive number that is the maximum number of results to return.", + "format": "int32", + "type": "integer" + }, + "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": { + "description": "The project whose groups are to be listed. The format is \"projects/{project_id_or_number}\".", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "childrenOfGroup": { + "location": "query", + "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" + }, + "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": { + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read" + ] + }, + "get": { + "flatPath": "v3/projects/{projectsId}/groups/{groupsId}", + "id": "monitoring.projects.groups.get", + "path": "v3/{+name}", + "description": "Gets a single group.", + "httpMethod": "GET", + "response": { + "$ref": "Group" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The group to retrieve. The format is \"projects/{project_id_or_number}/groups/{group_id}\".", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/groups/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read" + ] + }, + "update": { + "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" + }, + "response": { + "$ref": "Group" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ], + "parameters": { + "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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/groups/[^/]+$", + "location": "path" + }, + "validateOnly": { + "description": "If true, validate this request but do not update the existing group.", + "type": "boolean", + "location": "query" + } + } + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Group" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ], + "parameters": { + "name": { + "description": "The project in which to create the group. The format is \"projects/{project_id_or_number}\".", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "validateOnly": { + "description": "If true, validate this request but do not create the group.", + "type": "boolean", + "location": "query" + } + }, + "flatPath": "v3/projects/{projectsId}/groups", + "id": "monitoring.projects.groups.create", + "path": "v3/{+name}/groups", + "description": "Creates a new group.", + "request": { + "$ref": "Group" + } + } } }, "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" }, @@ -624,21 +780,60 @@ "name" ], "httpMethod": "POST", + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "The project in which to create the time series. The format is \"projects/PROJECT_ID_OR_NUMBER\"." + } + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/monitoring.write" ], - "parameters": { - "name": { - "pattern": "^projects/[^/]+$", - "location": "path", - "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}/collectdTimeSeries", + "path": "v3/{+name}/collectdTimeSeries", + "id": "monitoring.projects.collectdTimeSeries.create", + "request": { + "$ref": "CreateCollectdTimeSeriesRequest" }, - "flatPath": "v3/projects/{projectsId}/collectdTimeSeries" + "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" + } + } + } + } + }, + "uptimeCheckIps": { + "methods": { + "list": { + "flatPath": "v3/uptimeCheckIps", + "id": "monitoring.uptimeCheckIps.list", + "path": "v3/uptimeCheckIps", + "description": "Returns the list of IPs that checkers run from", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListUptimeCheckIpsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.read" + ], + "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 more results from the previous method call. NOTE: this field is not yet implemented", + "type": "string" + }, + "pageSize": { + "description": "The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is \u003c=0, the server will decide the number of results to be returned. NOTE: this field is not yet implemented", + "format": "int32", + "type": "integer", + "location": "query" } } } @@ -646,29 +841,17 @@ } }, "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": { - "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\")." }, "$.xgafv": { - "description": "V1 error format.", "type": "string", "enumDescriptions": [ "v1 error format", @@ -678,14 +861,16 @@ "enum": [ "1", "2" - ] + ], + "description": "V1 error format." }, "callback": { + "location": "query", "description": "JSONP", - "type": "string", - "location": "query" + "type": "string" }, "alt": { + "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -698,625 +883,64 @@ "json", "media", "proto" - ], - "type": "string" + ] }, "access_token": { + "location": "query", "description": "OAuth access token.", - "type": "string", - "location": "query" + "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" }, "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.", - "default": "true", - "type": "boolean" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" + "type": "boolean", + "default": "true" }, "oauth_token": { - "description": "OAuth 2.0 token for the current user.", + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." + }, + "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" } }, "version": "v3", "baseUrl": "https://monitoring.googleapis.com/", "servicePath": "", - "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.", + "kind": "discovery#restDescription", "basePath": "", - "revision": "20170918", + "revision": "20171204", "documentationLink": "https://cloud.google.com/monitoring/api/", "id": "monitoring:v3", "discoveryVersion": "v1", "version_module": true, "schemas": { - "CollectdValue": { - "description": "A single data point from a collectd-based plugin.", - "type": "object", - "properties": { - "value": { - "$ref": "TypedValue", - "description": "The measurement value." - }, - "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" - ] - }, - "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" - }, - "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" - }, - "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" - } - } - }, - "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": { - "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" - ] - }, - "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" - }, - "description": { - "description": "A detailed description of the metric, which can be used in documentation.", - "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" - }, - "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" - } - } - }, - "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" - }, - "CreateTimeSeriesRequest": { - "description": "The CreateTimeSeries request.", - "type": "object", - "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.", - "items": { - "$ref": "TimeSeries" - }, - "type": "array" - } - }, - "id": "CreateTimeSeriesRequest" - }, - "Distribution": { - "description": "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.", - "type": "object", - "properties": { - "range": { - "$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": { - "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.", - "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.", - "items": { - "format": "int64", - "type": "string" - }, - "type": "array" - }, - "bucketOptions": { - "description": "Required in the Stackdriver Monitoring API v3. Defines the histogram bucket boundaries.", - "$ref": "BucketOptions" - }, - "sumOfSquaredDeviation": { - "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": { - "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": { - "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" - } - } - } - }, - "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.", - "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" - }, - "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": "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" - }, - "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" - } - } - }, - "TypedValue": { - "description": "A single strongly-typed value.", - "type": "object", - "properties": { - "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": { - "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": { - "format": "int64", - "description": "A 64-bit integer. Its range is approximately ±9.2x10\u003csup\u003e18\u003c/sup\u003e.", - "type": "string" - } - }, - "id": "TypedValue" - }, - "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.", - "items": { - "$ref": "CollectdValue" - }, - "type": "array" - }, - "typeInstance": { - "description": "The measurement type instance. Example: \"used\".", - "type": "string" - }, - "metadata": { - "additionalProperties": { - "$ref": "TypedValue" - }, - "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" - } - }, - "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": { - "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" - } - }, - "id": "Linear" - }, "Option": { - "id": "Option", "description": "A protocol buffer option, which can be attached to a message, field, enumeration, etc.", "type": "object", "properties": { @@ -1326,50 +950,119 @@ }, "value": { "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": "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" } - } + }, + "id": "Option" + }, + "ContentMatcher": { + "properties": { + "content": { + "description": "String content to match", + "type": "string" + } + }, + "id": "ContentMatcher", + "description": "Used to perform string matching. Currently, this matches on the exact content. In the future, it can be expanded to allow for regular expressions and more complex matching.", + "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" + "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" + }, + "InternalChecker": { + "description": "Nimbus InternalCheckers.", + "type": "object", + "properties": { + "gcpZone": { + "description": "The GCP zone the uptime check should egress from. Only respected for internal uptime checks, where internal_network is specified.", + "type": "string" + }, + "network": { + "description": "The internal network to perform this uptime check on.", + "type": "string" + }, + "displayName": { + "description": "The checker's human-readable name.", + "type": "string" + }, + "projectId": { + "description": "The GCP project ID. Not necessarily the same as the project_id for the config.", + "type": "string" + }, + "checkerId": { + "description": "The checker ID.", + "type": "string" + } + }, + "id": "InternalChecker" + }, + "TcpCheck": { + "description": "Information required for a TCP uptime check request.", + "type": "object", + "properties": { + "port": { + "description": "The port to the page to run the check against. Will be combined with host (specified within the MonitoredResource) to construct the full URL. Required.", + "format": "int32", + "type": "integer" + } + }, + "id": "TcpCheck" }, "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": { "format": "double", "type": "number" - }, - "type": "array" + } } - } + }, + "id": "Explicit" }, "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": { - "format": "google-datetime", "description": "Required. The end of the time interval.", + "format": "google-datetime", "type": "string" }, "startTime": { - "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.", + "format": "google-datetime", "type": "string" } + }, + "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." + }, + "ListUptimeCheckIpsResponse": { + "id": "ListUptimeCheckIpsResponse", + "description": "The protocol for the ListUptimeCheckIps response.", + "type": "object", + "properties": { + "uptimeCheckIps": { + "description": "The returned list of IP addresses (including region and location) that the checkers run from.", + "type": "array", + "items": { + "$ref": "UptimeCheckIp" + } + }, + "nextPageToken": { + "type": "string", + "description": "This field represents the pagination token to retrieve the next page of results. If the value is empty, it means no further results for the request. To retrieve the next page of results, the value of the next_page_token is passed to the subsequent List method call (in the request message's page_token field). NOTE: this field is not yet implemented" + } } }, "Exponential": { @@ -1377,18 +1070,18 @@ "type": "object", "properties": { "growthFactor": { - "format": "double", "description": "Must be greater than 1.", + "format": "double", "type": "number" }, "scale": { - "format": "double", "description": "Must be greater than 0.", + "format": "double", "type": "number" }, "numFiniteBuckets": { - "format": "int32", "description": "Must be greater than 0.", + "format": "int32", "type": "integer" } }, @@ -1398,66 +1091,31 @@ "description": "A single data point in a time series.", "type": "object", "properties": { - "interval": { - "$ref": "TimeInterval", - "description": "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." - }, "value": { "$ref": "TypedValue", "description": "The value of the data point." + }, + "interval": { + "$ref": "TimeInterval", + "description": "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." } }, "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.", + "format": "int32", "type": "integer" }, - "jsonName": { - "description": "The field JSON name.", - "type": "string" - }, "kind": { - "description": "The field type.", - "type": "string", "enumDescriptions": [ "Field type unknown.", "Field type double.", @@ -1499,39 +1157,92 @@ "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" - }, - "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" } - } + }, + "id": "Field" }, - "Metric": { - "description": "A specific metric, identified by specifying values for all of the labels of a MetricDescriptor.", + "ListUptimeCheckConfigsResponse": { + "description": "The protocol for the ListUptimeCheckConfigs response.", "type": "object", + "properties": { + "uptimeCheckConfigs": { + "description": "The returned uptime check configurations.", + "type": "array", + "items": { + "$ref": "UptimeCheckConfig" + } + }, + "nextPageToken": { + "description": "This field represents the pagination token to retrieve the next page of results. If the value is empty, it means no further results for the request. To retrieve the next page of results, the value of the next_page_token is passed to the subsequent List method call (in the request message's page_token field).", + "type": "string" + } + }, + "id": "ListUptimeCheckConfigsResponse" + }, + "Metric": { "properties": { "labels": { + "description": "The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.", + "type": "object", "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" + "id": "Metric", + "description": "A specific metric, identified by specifying values for all of the labels of a MetricDescriptor.", + "type": "object" }, "ListTimeSeriesResponse": { "description": "The ListTimeSeries response.", @@ -1539,10 +1250,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.", @@ -1552,21 +1263,12 @@ "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.", @@ -1576,56 +1278,28 @@ "STRING", "BOOL", "INT64" - ] + ], + "description": "The type of data that can be assigned to the label.", + "type": "string" + }, + "key": { + "description": "The label key.", + "type": "string" } - } - }, - "Group": { - "id": "Group", - "description": "The description of a dynamic collection of monitored resources. Each group has a filter that is matched against monitored resources and their associated metadata. If a group's filter matches an available monitored resource, then that resource is a member of that group. Groups can contain any number of monitored resources, and each monitored resource can be a member of any number of groups.Groups can be nested in parent-child hierarchies. The parentName field identifies an optional parent for each group. If a group has a parent, then the only monitored resources available to be matched by the group's filter are the resources contained in the parent group. In other words, a group contains the monitored resources that match its filter and the filters of all the group's ancestors. A group without a parent can contain any monitored resource.For example, consider an infrastructure running a set of instances with two user-defined tags: \"environment\" and \"role\". A parent group has a filter, environment=\"production\". A child of that parent group has a filter, role=\"transcoder\". The parent group contains all instances in the production environment, regardless of their roles. The child group contains instances that have the transcoder role and are in the production environment.The monitored resources contained in a group can change at any moment, depending on what resources exist and what filters are associated with the group and its ancestors.", - "type": "object", - "properties": { - "filter": { - "description": "The filter used to determine which monitored resources belong to this group.", - "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" - }, - "isCluster": { - "description": "If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.", - "type": "boolean" - } - } + }, + "id": "LabelDescriptor", + "description": "A description of a label.", + "type": "object" }, "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" + "sourceContext": { + "$ref": "SourceContext", + "description": "The source context." }, "syntax": { - "description": "The source syntax.", - "type": "string", "enumDescriptions": [ "Syntax proto2.", "Syntax proto3." @@ -1633,68 +1307,863 @@ "enum": [ "SYNTAX_PROTO2", "SYNTAX_PROTO3" - ] - }, - "sourceContext": { - "$ref": "SourceContext", - "description": "The source context." + ], + "description": "The source syntax.", + "type": "string" }, "options": { "description": "The protocol buffer options.", + "type": "array", "items": { "$ref": "Option" - }, - "type": "array" + } }, "fields": { "description": "The list of fields.", + "type": "array", "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.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "Type" + }, + "Group": { + "properties": { + "displayName": { + "description": "A user-assigned name for this group, used only for display purposes.", + "type": "string" + }, + "isCluster": { + "description": "If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.", + "type": "boolean" + }, + "filter": { + "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": { + "type": "string", + "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, \"\"." + } + }, + "id": "Group", + "description": "The description of a dynamic collection of monitored resources. Each group has a filter that is matched against monitored resources and their associated metadata. If a group's filter matches an available monitored resource, then that resource is a member of that group. Groups can contain any number of monitored resources, and each monitored resource can be a member of any number of groups.Groups can be nested in parent-child hierarchies. The parentName field identifies an optional parent for each group. If a group has a parent, then the only monitored resources available to be matched by the group's filter are the resources contained in the parent group. In other words, a group contains the monitored resources that match its filter and the filters of all the group's ancestors. A group without a parent can contain any monitored resource.For example, consider an infrastructure running a set of instances with two user-defined tags: \"environment\" and \"role\". A parent group has a filter, environment=\"production\". A child of that parent group has a filter, role=\"transcoder\". The parent group contains all instances in the production environment, regardless of their roles. The child group contains instances that have the transcoder role and are in the production environment.The monitored resources contained in a group can change at any moment, depending on what resources exist and what filters are associated with the group and its ancestors.", + "type": "object" + }, + "BasicAuthentication": { + "id": "BasicAuthentication", + "description": "A type of authentication to perform against the specified resource or URL that uses username and password. Currently, only Basic authentication is supported in Uptime Monitoring.", + "type": "object", + "properties": { + "password": { + "description": "The password to authenticate.", + "type": "string" + }, + "username": { + "description": "The username to authenticate.", + "type": "string" } } }, "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." + "$ref": "Exponential", + "description": "The exponential buckets." }, "linearBuckets": { - "$ref": "Linear", - "description": "The linear bucket." + "description": "The linear bucket.", + "$ref": "Linear" + }, + "explicitBuckets": { + "description": "The explicit buckets.", + "$ref": "Explicit" + } + }, + "id": "BucketOptions" + }, + "HttpCheck": { + "properties": { + "useSsl": { + "description": "If true, use HTTPS instead of HTTP to run the check.", + "type": "boolean" + }, + "maskHeaders": { + "description": "Boolean specifiying whether to encrypt the header information. Encryption should be specified for any headers related to authentication that you do not wish to be seen when retrieving the configuration. The server will be responsible for encrypting the headers. On Get/List calls, if mask_headers is set to True then the headers will be obscured with ******.", + "type": "boolean" + }, + "authInfo": { + "$ref": "BasicAuthentication", + "description": "The authentication information. Optional when creating an HTTP check; defaults to empty." + }, + "headers": { + "description": "The list of headers to send as part of the uptime check request. If two headers have the same key and different values, they should be entered as a single header, with the value being a comma-separated list of all the desired values as described at https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). Entering two separate headers with the same key in a Create call will cause the first to be overwritten by the second.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "path": { + "description": "The path to the page to run the check against. Will be combined with the host (specified within the MonitoredResource) and port to construct the full URL. Optional (defaults to \"/\").", + "type": "string" + }, + "port": { + "description": "The port to the page to run the check against. Will be combined with host (specified within the MonitoredResource) and path to construct the full URL. Optional (defaults to 80 without SSL, or 443 with SSL).", + "format": "int32", + "type": "integer" + } + }, + "id": "HttpCheck", + "description": "Information involved in an HTTP/HTTPS uptime check request.", + "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": { + "type": "string", + "description": "The data source for the collectd value. For example there are two data sources for network measurements: \"rx\" and \"tx\"." + } + }, + "id": "CollectdValue" + }, + "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": { + "type": "array", + "items": { + "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 is a common set of message types for APIs to use." + }, + "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 user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client." + } + }, + "id": "Status" + }, + "MetricDescriptor": { + "properties": { + "metricKind": { + "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", + "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." + ] + }, + "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\". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota.", + "type": "string" + }, + "description": { + "description": "A detailed description of the metric, which can be used in documentation.", + "type": "string" + }, + "unit": { + "type": "string", + "description": "Optional. The unit in which the metric value is reported. For example, kBy/s means kilobytes/sec, and 1 is the dimensionless unit. The supported units are a subset of The Unified Code for Units of Measure standard (http://unitsofmeasure.org/ucum.html).\u003cbr\u003e\u003cbr\u003e This field is part of the metric's documentation, but it is ignored by Stackdriver." + }, + "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.", + "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" + } + }, + "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" + }, + "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" + } + } + }, + "Range": { + "description": "The range of the population values.", + "type": "object", + "properties": { + "min": { + "description": "The minimum of the population values.", + "format": "double", + "type": "number" + }, + "max": { + "description": "The maximum of the population values.", + "format": "double", + "type": "number" + } + }, + "id": "Range" + }, + "ListGroupsResponse": { + "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" + }, + "group": { + "description": "The groups that match the specified filters.", + "type": "array", + "items": { + "$ref": "Group" + } + } + }, + "id": "ListGroupsResponse", + "description": "The ListGroups response.", + "type": "object" + }, + "UptimeCheckConfig": { + "id": "UptimeCheckConfig", + "description": "This message configures which resources and services to monitor for availability.", + "type": "object", + "properties": { + "timeout": { + "description": "The maximum amount of time to wait for the request to complete (must be between 1 and 60 seconds). Required.", + "format": "google-duration", + "type": "string" + }, + "period": { + "description": "How often the uptime check is performed. Currently, only 1, 5, 10, and 15 minutes are supported. Required.", + "format": "google-duration", + "type": "string" + }, + "name": { + "description": "A unique resource name for this UptimeCheckConfig. The format is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field should be omitted when creating the uptime check configuration; on create, the resource name is assigned by the server and included in the response.", + "type": "string" + }, + "httpCheck": { + "$ref": "HttpCheck", + "description": "Contains information needed to make an HTTP or HTTPS check." + }, + "resourceGroup": { + "description": "The group resource associated with the configuration.", + "$ref": "ResourceGroup" + }, + "tcpCheck": { + "$ref": "TcpCheck", + "description": "Contains information needed to make a TCP check." + }, + "internalCheckers": { + "description": "The internal checkers that this check will egress from. If is_internal is true and this list is empty, the check will egress from all InternalCheckers configured for the project that owns this CheckConfig.", + "type": "array", + "items": { + "$ref": "InternalChecker" + } + }, + "isInternal": { + "description": "Denotes whether this check is a check that egresses from InternalCheckers.", + "type": "boolean" + }, + "selectedRegions": { + "enumDescriptions": [ + "Default value if no region is specified. Will result in uptime checks running from all regions.", + "Allows checks to run from locations within the United States of America.", + "Allows checks to run from locations within the continent of Europe.", + "Allows checks to run from locations within the continent of South America.", + "Allows checks to run from locations within the Asia Pacific area (ex: Singapore)." + ], + "description": "The list of regions from which the check will be run. If this field is specified, enough regions to include a minimum of 3 locations must be provided, or an error message is returned. Not specifying this field will result in uptime checks running from all regions.", + "type": "array", + "items": { + "enum": [ + "REGION_UNSPECIFIED", + "USA", + "EUROPE", + "SOUTH_AMERICA", + "ASIA_PACIFIC" + ], + "type": "string" + } + }, + "displayName": { + "description": "A human-friendly name for the uptime check configuration. The display name should be unique within a Stackdriver Account in order to make it easier to identify; however, uniqueness is not enforced. Required.", + "type": "string" + }, + "monitoredResource": { + "description": "The monitored resource associated with the configuration.", + "$ref": "MonitoredResource" + }, + "contentMatchers": { + "description": "The expected content on the page the check is run against. Currently, only the first entry in the list is supported, and other entries will be ignored. The server will look for an exact match of the string in the page response's content. This field is optional and should only be specified if a content match is required.", + "type": "array", + "items": { + "$ref": "ContentMatcher" + } + } + } + }, + "ListGroupMembersResponse": { + "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.", + "format": "int32", + "type": "integer" + }, + "members": { + "description": "A set of monitored resources in the group.", + "type": "array", + "items": { + "$ref": "MonitoredResource" + } + } + }, + "id": "ListGroupMembersResponse", + "description": "The ListGroupMembers response.", + "type": "object" + }, + "CreateCollectdTimeSeriesRequest": { + "id": "CreateCollectdTimeSeriesRequest", + "description": "The CreateCollectdTimeSeries request.", + "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" + } + } + }, + "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.", + "type": "array", + "items": { + "$ref": "MonitoredResourceDescriptor" + } + } + }, + "id": "ListMonitoredResourceDescriptorsResponse" + }, + "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": { + "valueType": { + "enum": [ + "VALUE_TYPE_UNSPECIFIED", + "BOOL", + "INT64", + "DOUBLE", + "STRING", + "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.", + "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." + ] + }, + "resource": { + "description": "The associated monitored resource. Custom metrics can use only certain monitored resource types in their time series data.", + "$ref": "MonitoredResource" + }, + "metricKind": { + "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", + "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" + ] + }, + "metric": { + "description": "The associated metric. A fully-specified metric used to identify the time series.", + "$ref": "Metric" + }, + "points": { + "type": "array", + "items": { + "$ref": "Point" + }, + "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." + } + }, + "id": "TimeSeries" + }, + "CreateTimeSeriesRequest": { + "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" + } + } + }, + "id": "CreateTimeSeriesRequest", + "description": "The CreateTimeSeries request.", + "type": "object" + }, + "Distribution": { + "type": "object", + "properties": { + "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", + "type": "number" + }, + "range": { + "$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": { + "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": { + "description": "The arithmetic mean of the values in the population. If count is zero then this field must be zero.", + "format": "double", + "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": { + "type": "string", + "format": "int64" + } + }, + "bucketOptions": { + "$ref": "BucketOptions", + "description": "Required in the Stackdriver Monitoring API v3. Defines the histogram bucket boundaries." + } + }, + "id": "Distribution", + "description": "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." + }, + "MonitoredResource": { + "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", + "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": { + "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" + } + }, + "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" + } + } + }, + "CollectdPayloadError": { + "description": "Describes the error status for payloads that were not written.", + "type": "object", + "properties": { + "index": { + "description": "The zero-based index in CreateCollectdTimeSeriesRequest.collectd_payloads.", + "format": "int32", + "type": "integer" + }, + "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" + }, + "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.", + "type": "array", + "items": { + "$ref": "CollectdValueError" + } + } + }, + "id": "CollectdPayloadError" + }, + "MonitoredResourceDescriptor": { + "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": { + "type": "string", + "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\"." + }, + "description": { + "description": "Optional. A detailed description of the monitored resource type that might be used in documentation.", + "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" + } + }, + "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" + }, + "TypedValue": { + "description": "A single strongly-typed value.", + "type": "object", + "properties": { + "boolValue": { + "description": "A Boolean value: true or false.", + "type": "boolean" + }, + "stringValue": { + "description": "A variable-length string value.", + "type": "string" + }, + "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", + "type": "number" + }, + "int64Value": { + "description": "A 64-bit integer. Its range is approximately ±9.2x10\u003csup\u003e18\u003c/sup\u003e.", + "format": "int64", + "type": "string" + }, + "distributionValue": { + "description": "A distribution value.", + "$ref": "Distribution" + } + }, + "id": "TypedValue" + }, + "ResourceGroup": { + "description": "The resource submessage for group checks. It can be used instead of a monitored resource, when multiple resources are being monitored.", + "type": "object", + "properties": { + "resourceType": { + "description": "The resource type of the group members.", + "type": "string", + "enumDescriptions": [ + "Default value (not valid).", + "A group of instances (could be either GCE or AWS_EC2).", + "A group of AWS load balancers." + ], + "enum": [ + "RESOURCE_TYPE_UNSPECIFIED", + "INSTANCE", + "AWS_ELB_LOAD_BALANCER" + ] + }, + "groupId": { + "description": "The group of resources being monitored. Should be only the group_id, not projects/\u003cproject_id\u003e/groups/\u003cgroup_id\u003e.", + "type": "string" + } + }, + "id": "ResourceGroup" + }, + "CollectdValueError": { + "description": "Describes the error status for values that were not written.", + "type": "object", + "properties": { + "index": { + "description": "The zero-based index in CollectdPayload.values within the parent CreateCollectdTimeSeriesRequest.collectd_payloads.", + "format": "int32", + "type": "integer" + }, + "error": { + "description": "Records the error status for the value.", + "$ref": "Status" + } + }, + "id": "CollectdValueError" + }, + "UptimeCheckIp": { + "id": "UptimeCheckIp", + "description": "Contains the region, location, and list of IP addresses where checkers in the location run from.", + "type": "object", + "properties": { + "ipAddress": { + "type": "string", + "description": "The IP address from which the uptime check originates. This is a full IP address (not an IP address range). Most IP addresses, as of this publication, are in IPv4 format; however, one should not rely on the IP addresses being in IPv4 format indefinitely and should support interpreting this field in either IPv4 or IPv6 format." + }, + "region": { + "description": "A broad region category in which the IP address is located.", + "type": "string", + "enumDescriptions": [ + "Default value if no region is specified. Will result in uptime checks running from all regions.", + "Allows checks to run from locations within the United States of America.", + "Allows checks to run from locations within the continent of Europe.", + "Allows checks to run from locations within the continent of South America.", + "Allows checks to run from locations within the Asia Pacific area (ex: Singapore)." + ], + "enum": [ + "REGION_UNSPECIFIED", + "USA", + "EUROPE", + "SOUTH_AMERICA", + "ASIA_PACIFIC" + ] + }, + "location": { + "description": "A more specific location within the region that typically encodes a particular city/town/metro (and its containing state/province or country) within the broader umbrella region category.", + "type": "string" + } + } + }, + "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": { + "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" + }, + "values": { + "description": "The measured values during this time interval. Each value must have a different dataSourceName.", + "type": "array", + "items": { + "$ref": "CollectdValue" + } + }, + "typeInstance": { + "description": "The measurement type instance. Example: \"used\".", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "$ref": "TypedValue" + }, + "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" + } + }, + "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.", + "type": "array", + "items": { + "$ref": "CollectdPayloadError" + } + } + }, + "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": { + "numFiniteBuckets": { + "description": "Must be greater than 0.", + "format": "int32", + "type": "integer" + }, + "width": { + "description": "Must be greater than 0.", + "format": "double", + "type": "number" + }, + "offset": { + "description": "Lower bound of the first bucket.", + "format": "double", + "type": "number" } } } }, + "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", "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": { - "description": "View and write monitoring data for all of your Google and third-party Cloud and API projects" + "https://www.googleapis.com/auth/monitoring.read": { + "description": "View monitoring data for all of your Google Cloud and third-party projects" } } } @@ -1702,8 +2171,5 @@ "rootUrl": "https://monitoring.googleapis.com/", "ownerDomain": "google.com", "name": "monitoring", - "batchPath": "batch", - "fullyEncodeReservedExpansion": true, - "title": "Stackdriver Monitoring API", - "ownerName": "Google" + "batchPath": "batch" } diff --git a/etc/api/oauth2/v1/oauth2-api.json b/etc/api/oauth2/v1/oauth2-api.json index 1de8b48fe7..5d10fd70fd 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/PozAB5R3hMeaeI5NL5FrPjwfUdY\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/aOar0nPm5R4X4KFni2wDM6gghm0\"", "discoveryVersion": "v1", "id": "oauth2:v1", "name": "oauth2", "version": "v1", - "revision": "20170807", + "revision": "20170921", "title": "Google OAuth2 API", "description": "Obtains end-user authorization grants for use with other Google APIs.", "ownerDomain": "google.com", diff --git a/etc/api/oauth2/v2/oauth2-api.json b/etc/api/oauth2/v2/oauth2-api.json index 7cd7d2a7fb..9ae2177cfe 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/UI_PjeJG3puXfKEXm-20UHWIhYQ\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/BzEfukeh3bFCumL8KphVZA4lHuM\"", "discoveryVersion": "v1", "id": "oauth2:v2", "name": "oauth2", "version": "v2", - "revision": "20170807", + "revision": "20170921", "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/v2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/oslogin/v1/oslogin-api.json b/etc/api/oslogin/v1/oslogin-api.json new file mode 100644 index 0000000000..96e53ced96 --- /dev/null +++ b/etc/api/oslogin/v1/oslogin-api.json @@ -0,0 +1,428 @@ +{ + "ownerDomain": "google.com", + "name": "oslogin", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud OS Login API", + "ownerName": "Google", + "resources": { + "users": { + "resources": { + "projects": { + "methods": { + "delete": { + "description": "Deletes a POSIX account.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "location": "path", + "description": "A reference to the POSIX account to update. POSIX accounts are identified\nby the project ID they are associated with. A reference to the POSIX\naccount is in format `users/{user}/projects/{project}`.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+/projects/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1/users/{usersId}/projects/{projectsId}", + "path": "v1/{+name}", + "id": "oslogin.users.projects.delete" + } + } + }, + "sshPublicKeys": { + "methods": { + "delete": { + "description": "Deletes an SSH public key.", + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + "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}`.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "id": "oslogin.users.sshPublicKeys.delete", + "path": "v1/{+name}" + }, + "get": { + "description": "Retrieves an SSH public key.", + "response": { + "$ref": "SshPublicKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "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}`.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "path": "v1/{+name}", + "id": "oslogin.users.sshPublicKeys.get" + }, + "patch": { + "response": { + "$ref": "SshPublicKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "parameters": { + "updateMask": { + "location": "query", + "description": "Mask to control which fields get updated. Updates all if not present.", + "format": "google-fieldmask", + "type": "string" + }, + "name": { + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + "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}`.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "path": "v1/{+name}", + "id": "oslogin.users.sshPublicKeys.patch", + "description": "Updates an SSH public key and returns the profile information. This method\nsupports patch semantics.", + "request": { + "$ref": "SshPublicKey" + } + } + } + } + }, + "methods": { + "importSshPublicKey": { + "response": { + "$ref": "ImportSshPublicKeyResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "projectId": { + "location": "query", + "description": "The project ID of the Google Cloud Platform project.", + "type": "string" + }, + "parent": { + "description": "The unique ID for the user in format `users/{user}`.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1/users/{usersId}:importSshPublicKey", + "path": "v1/{+parent}:importSshPublicKey", + "id": "oslogin.users.importSshPublicKey", + "request": { + "$ref": "SshPublicKey" + }, + "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." + }, + "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", + "parameters": { + "name": { + "description": "The unique ID for the user in format `users/{user}`.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1/users/{usersId}/loginProfile", + "path": "v1/{+name}/loginProfile", + "id": "oslogin.users.getLoginProfile" + } + } + } + }, + "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" + }, + "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": { + "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", + "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": { + "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://oslogin.googleapis.com/", + "servicePath": "", + "kind": "discovery#restDescription", + "description": "Manages OS login configuration for Google account users.", + "basePath": "", + "id": "oslogin:v1", + "documentationLink": "https://cloud.google.com/compute/docs/oslogin/rest/", + "revision": "20171120", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "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" + }, + "SshPublicKey": { + "description": "The SSH public key information associated with a Google account.", + "type": "object", + "properties": { + "expirationTimeUsec": { + "description": "An expiration time in microseconds since epoch.", + "format": "int64", + "type": "string" + }, + "fingerprint": { + "description": "Output only. The SHA-256 fingerprint of the SSH public key.", + "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" + }, + "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" + }, + "PosixAccount": { + "description": "The POSIX account information associated with a Google account.", + "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" + }, + "gecos": { + "description": "The GECOS (user information) entry 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" + }, + "primary": { + "description": "Only one POSIX account can be marked as primary.", + "type": "boolean" + }, + "accountId": { + "description": "Output only. A POSIX account identifier.", + "type": "string" + }, + "gid": { + "description": "The default group ID.", + "format": "int64", + "type": "string" + }, + "uid": { + "description": "The user ID.", + "format": "int64", + "type": "string" + }, + "username": { + "description": "The username of the POSIX account.", + "type": "string" + } + }, + "id": "PosixAccount" + }, + "LoginProfile": { + "description": "The user profile information used for logging in to a virtual machine on\nGoogle Compute Engine.", + "type": "object", + "properties": { + "name": { + "description": "The primary email address that uniquely identifies the user.", + "type": "string" + }, + "posixAccounts": { + "description": "The list of POSIX accounts associated with the user.", + "type": "array", + "items": { + "$ref": "PosixAccount" + } + }, + "suspended": { + "description": "Indicates if the user is suspended. A suspended user cannot log in but\ntheir profile information is retained.", + "type": "boolean" + }, + "sshPublicKeys": { + "additionalProperties": { + "$ref": "SshPublicKey" + }, + "description": "A map from SSH public key fingerprint to the associated key object.", + "type": "object" + } + }, + "id": "LoginProfile" + } + }, + "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 OS Login", + "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/compute": { + "description": "View and manage your Google Compute Engine resources" + } + } + } + }, + "rootUrl": "https://oslogin.googleapis.com/" +} diff --git a/etc/api/oslogin/v1alpha/oslogin-api.json b/etc/api/oslogin/v1alpha/oslogin-api.json index d362de76e3..0d830cadce 100644 --- a/etc/api/oslogin/v1alpha/oslogin-api.json +++ b/etc/api/oslogin/v1alpha/oslogin-api.json @@ -1,4 +1,24 @@ { + "canonicalName": "Cloud OS Login", + "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/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" + } + } + } + }, + "rootUrl": "https://oslogin.googleapis.com/", "ownerDomain": "google.com", "name": "oslogin", "batchPath": "batch", @@ -9,10 +29,6 @@ "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" }, @@ -21,11 +37,16 @@ ], "httpMethod": "POST", "parameters": { + "projectId": { + "location": "query", + "description": "The project ID of the Google Cloud Platform project.", + "type": "string" + }, "parent": { "location": "path", "description": "The unique ID for the user in format `users/{user}`.", - "type": "string", "required": true, + "type": "string", "pattern": "^users/[^/]+$" } }, @@ -34,8 +55,12 @@ "https://www.googleapis.com/auth/compute" ], "flatPath": "v1alpha/users/{usersId}:importSshPublicKey", + "path": "v1alpha/{+parent}:importSshPublicKey", "id": "oslogin.users.importSshPublicKey", - "path": "v1alpha/{+parent}:importSshPublicKey" + "request": { + "$ref": "SshPublicKey" + }, + "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." }, "getLoginProfile": { "description": "Retrieves the profile information used for logging in to a virtual machine\non Google Compute Engine.", @@ -55,70 +80,34 @@ "parameters": { "name": { "description": "The unique ID for the user in format `users/{user}`.", - "type": "string", "required": true, + "type": "string", "pattern": "^users/[^/]+$", "location": "path" } }, "flatPath": "v1alpha/users/{usersId}/loginProfile", - "id": "oslogin.users.getLoginProfile", - "path": "v1alpha/{+name}/loginProfile" + "path": "v1alpha/{+name}/loginProfile", + "id": "oslogin.users.getLoginProfile" } }, "resources": { "sshPublicKeys": { "methods": { - "patch": { - "description": "Updates an SSH public key and returns the profile information. This method\nsupports patch semantics.", - "request": { - "$ref": "SshPublicKey" + "delete": { + "response": { + "$ref": "Empty" }, - "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" - }, + "httpMethod": "DELETE", "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", + "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}`.", "required": true, + "type": "string", "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$" } }, @@ -128,8 +117,74 @@ ], "flatPath": "v1alpha/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", "path": "v1alpha/{+name}", + "id": "oslogin.users.sshPublicKeys.delete", + "description": "Deletes an SSH public key." + }, + "get": { + "description": "Retrieves an SSH public key.", + "response": { + "$ref": "SshPublicKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "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}`.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$" + } + }, + "flatPath": "v1alpha/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "path": "v1alpha/{+name}", "id": "oslogin.users.sshPublicKeys.get" }, + "patch": { + "flatPath": "v1alpha/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "path": "v1alpha/{+name}", + "id": "oslogin.users.sshPublicKeys.patch", + "description": "Updates an SSH public key and returns the profile information. This method\nsupports patch semantics.", + "request": { + "$ref": "SshPublicKey" + }, + "response": { + "$ref": "SshPublicKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "parameters": { + "updateMask": { + "description": "Mask to control which fields get updated. Updates all if not present.", + "format": "google-fieldmask", + "type": "string", + "location": "query" + }, + "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}`.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + "location": "path" + } + } + } + } + }, + "projects": { + "methods": { "delete": { "response": { "$ref": "Empty" @@ -138,23 +193,23 @@ "name" ], "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "A reference to the POSIX account to update. POSIX accounts are identified\nby the project ID they are associated with. A reference to the POSIX\naccount is in format `users/{user}/projects/{project}`.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+/projects/[^/]+$", + "location": "path" + } + }, "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", + "flatPath": "v1alpha/users/{usersId}/projects/{projectsId}", "path": "v1alpha/{+name}", - "description": "Deletes an SSH public key." + "id": "oslogin.users.projects.delete", + "description": "Deletes a POSIX account." } } } @@ -162,71 +217,6 @@ } }, "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\").", @@ -235,36 +225,110 @@ "prettyPrint": { "location": "query", "description": "Returns response with indentations and line breaks.", - "default": "true", - "type": "boolean" + "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" }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", + "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": { + "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": { + "location": "query", + "description": "OAuth 2.0 token for the current user.", + "type": "string" } }, "version": "v1alpha", "baseUrl": "https://oslogin.googleapis.com/", "kind": "discovery#restDescription", - "description": "Manages OS login configuration for Directory API users.", + "description": "Manages OS login configuration for Google account users.", "servicePath": "", "basePath": "", "id": "oslogin:v1alpha", "documentationLink": "https://cloud.google.com/compute/docs/oslogin/rest/", - "revision": "20170926", + "revision": "20171120", "discoveryVersion": "v1", "version_module": true, "schemas": { "PosixAccount": { - "description": "The POSIX account information associated with a Directory API User.", + "description": "The POSIX account information associated with a Google account.", "type": "object", "properties": { + "uid": { + "description": "The user ID.", + "format": "int64", + "type": "string" + }, + "username": { + "description": "The username of the POSIX account.", + "type": "string" + }, "shell": { "description": "The path to the logic shell for this account.", "type": "string" @@ -273,39 +337,45 @@ "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" }, + "systemId": { + "description": "System identifier for which account the username or uid applies to.\nBy default, the empty value is used.", + "type": "string" + }, "primary": { "description": "Only one POSIX account can be marked as primary.", "type": "boolean" }, + "accountId": { + "description": "Output only. A POSIX account identifier.", + "type": "string" + }, "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.", + "description": "The user profile information used for logging in to a virtual machine on\nGoogle Compute Engine.", "type": "object", "properties": { + "name": { + "description": "A unique user ID for identifying the user.", + "type": "string" + }, + "posixAccounts": { + "description": "The list of POSIX accounts associated with the Directory API user.", + "type": "array", + "items": { + "$ref": "PosixAccount" + } + }, "suspended": { "description": "Indicates if the user is suspended.", "type": "boolean" @@ -316,32 +386,27 @@ }, "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" }, + "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" + }, "SshPublicKey": { - "description": "The SSH public key information associated with a Directory API User.", + "description": "The SSH public key information associated with a Google account.", "type": "object", "properties": { "expirationTimeUsec": { - "format": "int64", "description": "An expiration time in microseconds since epoch.", + "format": "int64", "type": "string" }, "fingerprint": { - "description": "The SHA-256 fingerprint of the SSH public key.\nOutput only.", + "description": "Output only. The SHA-256 fingerprint of the SSH public key.", "type": "string" }, "key": { @@ -351,12 +416,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": { "description": "A response message for importing an SSH public key.", "type": "object", @@ -371,27 +430,7 @@ }, "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/" + "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/oslogin/v1beta/oslogin-api.json b/etc/api/oslogin/v1beta/oslogin-api.json index d643e92381..6bcb8123f7 100644 --- a/etc/api/oslogin/v1beta/oslogin-api.json +++ b/etc/api/oslogin/v1beta/oslogin-api.json @@ -1,64 +1,87 @@ { - "version": "v1beta", - "baseUrl": "https://oslogin.googleapis.com/", "kind": "discovery#restDescription", - "description": "Manages OS login configuration for Directory API users.", + "description": "Manages OS login configuration for Google account users.", "servicePath": "", "basePath": "", - "revision": "20170926", - "documentationLink": "https://cloud.google.com/compute/docs/oslogin/rest/", "id": "oslogin:v1beta", + "documentationLink": "https://cloud.google.com/compute/docs/oslogin/rest/", + "revision": "20171120", "discoveryVersion": "v1", "version_module": true, "schemas": { - "LoginProfile": { + "PosixAccount": { + "description": "The POSIX account information associated with a Google account.", "type": "object", "properties": { - "posixAccounts": { - "items": { - "$ref": "PosixAccount" - }, - "type": "array", - "description": "The list of POSIX accounts associated with the user." + "primary": { + "description": "Only one POSIX account can be marked as primary.", + "type": "boolean" + }, + "accountId": { + "description": "Output only. A POSIX account identifier.", + "type": "string" + }, + "gid": { + "description": "The default group ID.", + "format": "int64", + "type": "string" + }, + "uid": { + "description": "The user ID.", + "format": "int64", + "type": "string" + }, + "username": { + "description": "The username of the POSIX account.", + "type": "string" + }, + "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" + } + }, + "id": "PosixAccount" + }, + "LoginProfile": { + "description": "The user profile information used for logging in to a virtual machine on\nGoogle Compute Engine.", + "type": "object", + "properties": { + "suspended": { + "description": "Indicates if the user is suspended. A suspended user cannot log in but\ntheir profile information is retained.", + "type": "boolean" + }, + "sshPublicKeys": { + "description": "A map from SSH public key fingerprint to the associated key object.", + "type": "object", + "additionalProperties": { + "$ref": "SshPublicKey" + } }, "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" + "posixAccounts": { + "description": "The list of POSIX accounts associated with the user.", + "type": "array", + "items": { + "$ref": "PosixAccount" + } } }, - "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" + "id": "LoginProfile" }, "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 `{}`.", @@ -66,7 +89,28 @@ "properties": {}, "id": "Empty" }, + "SshPublicKey": { + "description": "The SSH public key information associated with a Google account.", + "type": "object", + "properties": { + "expirationTimeUsec": { + "description": "An expiration time in microseconds since epoch.", + "format": "int64", + "type": "string" + }, + "fingerprint": { + "description": "Output only. The SHA-256 fingerprint of the SSH public key.", + "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" + }, "ImportSshPublicKeyResponse": { + "description": "A response message for importing an SSH public key.", "type": "object", "properties": { "loginProfile": { @@ -74,49 +118,7 @@ "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" + "id": "ImportSshPublicKeyResponse" } }, "protocol": "rest", @@ -161,120 +163,64 @@ "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" ], + "parameters": { + "projectId": { + "location": "query", + "description": "The project ID of the Google Cloud Platform project.", + "type": "string" + }, + "parent": { + "description": "The unique ID for the user in format `users/{user}`.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+$", + "location": "path" + } + }, "flatPath": "v1beta/users/{usersId}:importSshPublicKey", - "id": "oslogin.users.importSshPublicKey", "path": "v1beta/{+parent}:importSshPublicKey", + "id": "oslogin.users.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" - ], + "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.", "response": { "$ref": "LoginProfile" }, - "parameters": { - "name": { - "location": "path", - "description": "The unique ID for the user in format `users/{user}`.", - "type": "string", - "required": true, - "pattern": "^users/[^/]+$" - } - }, + "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" ], - "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." + "parameters": { + "name": { + "location": "path", + "description": "The unique ID for the user in format `users/{user}`.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+$" + } + }, + "flatPath": "v1beta/users/{usersId}/loginProfile" } }, "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": { @@ -288,8 +234,8 @@ "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, + "type": "string", "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$" } }, @@ -298,8 +244,99 @@ "https://www.googleapis.com/auth/compute" ], "flatPath": "v1beta/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", - "id": "oslogin.users.sshPublicKeys.get", - "path": "v1beta/{+name}" + "path": "v1beta/{+name}", + "id": "oslogin.users.sshPublicKeys.get" + }, + "patch": { + "request": { + "$ref": "SshPublicKey" + }, + "description": "Updates an SSH public key and returns the profile information. This method\nsupports patch semantics.", + "response": { + "$ref": "SshPublicKey" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "updateMask": { + "location": "query", + "description": "Mask to control which fields get updated. Updates all if not present.", + "format": "google-fieldmask", + "type": "string" + }, + "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}`.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1beta/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "path": "v1beta/{+name}", + "id": "oslogin.users.sshPublicKeys.patch" + }, + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "pattern": "^users/[^/]+/sshPublicKeys/[^/]+$", + "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}`.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1beta/users/{usersId}/sshPublicKeys/{sshPublicKeysId}", + "id": "oslogin.users.sshPublicKeys.delete", + "path": "v1beta/{+name}", + "description": "Deletes an SSH public key." + } + } + }, + "projects": { + "methods": { + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "A reference to the POSIX account to update. POSIX accounts are identified\nby the project ID they are associated with. A reference to the POSIX\naccount is in format `users/{user}/projects/{project}`.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+/projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ], + "flatPath": "v1beta/users/{usersId}/projects/{projectsId}", + "path": "v1beta/{+name}", + "id": "oslogin.users.projects.delete", + "description": "Deletes a POSIX account." } } } @@ -307,22 +344,6 @@ } }, "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\").", @@ -331,26 +352,20 @@ "prettyPrint": { "location": "query", "description": "Returns response with indentations and line breaks.", - "default": "true", - "type": "boolean" + "type": "boolean", + "default": "true" }, "uploadType": { - "type": "string", "location": "query", - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." + "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", + "description": "Selector specifying which fields to include in a partial response.", "type": "string" }, "$.xgafv": { - "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" @@ -360,12 +375,15 @@ "1", "2" ], - "description": "V1 error format." + "description": "V1 error format.", + "type": "string" + }, + "callback": { + "location": "query", + "description": "JSONP", + "type": "string" }, "alt": { - "location": "query", - "description": "Data format for response.", - "default": "json", "enum": [ "json", "media", @@ -376,22 +394,43 @@ "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" + "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." + "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." + "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" + }, + "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": "v1beta", + "baseUrl": "https://oslogin.googleapis.com/" } diff --git a/etc/api/partners/v2/partners-api.json b/etc/api/partners/v2/partners-api.json index 887c9ee3d9..515ab1be78 100644 --- a/etc/api/partners/v2/partners-api.json +++ b/etc/api/partners/v2/partners-api.json @@ -1,36 +1,360 @@ { - "discoveryVersion": "v1", + "batchPath": "batch", + "documentationLink": "https://developers.google.com/partners/", + "id": "partners:v2", + "revision": "20171206", + "title": "Google Partners API", "ownerName": "Google", + "discoveryVersion": "v1", "version_module": true, "resources": { - "v2": { + "leads": { "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.", + "list": { + "response": { + "$ref": "ListLeadsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "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" + }, + "orderBy": { + "location": "query", + "description": "How to order Leads. Currently, only `create_time`\nand `create_time desc` are supported", + "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" + }, + "pageToken": { + "type": "string", + "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." + }, + "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": { + "location": "query", + "description": "IP address to use instead of the user's geo-located IP address.", + "type": "string" + } + }, + "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": { + "resources": { + "history": { + "methods": { + "list": { + "flatPath": "v2/offers/history", + "path": "v2/offers/history", + "id": "partners.offers.history.list", + "description": "Lists the Historical Offers for the current user (or user's entire company)", + "response": { + "$ref": "ListOffersHistoryResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "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" + }, + "pageToken": { + "description": "Token to retrieve a specific page.", + "type": "string", + "location": "query" + }, + "pageSize": { + "description": "Maximum number of rows to return per page.", + "format": "int32", + "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" + }, + "requestMetadata.locale": { + "description": "Locale to use for the current request.", + "type": "string", + "location": "query" + }, + "requestMetadata.userOverrides.ipAddress": { + "type": "string", + "location": "query", + "description": "IP address to use instead of the user's geo-located IP address." + }, + "entireCompany": { + "location": "query", + "description": "if true, show history for the entire company. Requires user to be admin.", + "type": "boolean" + }, + "requestMetadata.experimentIds": { + "location": "query", + "description": "Experiment IDs the current request belongs to.", + "type": "string", + "repeated": true + }, + "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.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" + } + } + } + } + } + }, + "methods": { + "list": { + "description": "Lists the Offers available for the current user", "httpMethod": "GET", "parameterOrder": [], "response": { - "$ref": "GetPartnersStatusResponse" + "$ref": "ListOffersResponse" }, "parameters": { + "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" + }, + "requestMetadata.experimentIds": { + "repeated": true, + "location": "query", + "description": "Experiment IDs the current request belongs to.", + "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": { + "location": "query", + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "type": "string" + }, + "requestMetadata.partnersSessionId": { + "type": "string", + "location": "query", + "description": "Google Partners session ID." + }, + "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" + } + }, + "flatPath": "v2/offers", + "id": "partners.offers.list", + "path": "v2/offers" + } + } + }, + "userStates": { + "methods": { + "list": { + "flatPath": "v2/userStates", + "path": "v2/userStates", + "id": "partners.userStates.list", + "description": "Lists states for current user.", + "response": { + "$ref": "ListUserStatesResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "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": { + "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": { + "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": { + "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" + } + } + } + } + }, + "analytics": { + "methods": { + "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" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "requestMetadata.userOverrides.userId": { + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "type": "string", + "location": "query" + }, + "requestMetadata.partnersSessionId": { + "description": "Google Partners session ID.", + "type": "string", + "location": "query" + }, + "pageToken": { + "description": "A token identifying a page of results that the server returns.\nTypically, this is the value of `ListAnalyticsResponse.next_page_token`\nreturned from the previous call to\nListAnalytics.\nWill be a date string in `YYYY-MM-DD` format representing the end date\nof the date range of results to return.\nIf unspecified or set to \"\", default value is the current date.", + "type": "string", + "location": "query" + }, + "pageSize": { + "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", + "type": "integer", + "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." }, "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.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": { + "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/analytics", + "path": "v2/analytics", + "id": "partners.analytics.list" + } + } + }, + "v2": { + "methods": { + "updateCompanies": { + "flatPath": "v2/companies", + "path": "v2/companies", + "id": "partners.updateCompanies", + "description": "Update company.\nShould only be called within the context of an authorized logged in user.", + "request": { + "$ref": "Company" + }, + "response": { + "$ref": "Company" + }, + "parameterOrder": [], + "httpMethod": "PATCH", + "parameters": { + "requestMetadata.locale": { + "description": "Locale to use for the current request.", + "type": "string", + "location": "query" + }, + "requestMetadata.userOverrides.ipAddress": { + "type": "string", + "location": "query", + "description": "IP address to use instead of the user's geo-located IP address." + }, + "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.", + "format": "google-fieldmask", + "type": "string" + }, "requestMetadata.experimentIds": { "repeated": true, "location": "query", @@ -43,91 +367,114 @@ "type": "string" }, "requestMetadata.userOverrides.userId": { - "type": "string", "location": "query", - "description": "Logged-in user ID to impersonate instead of the user's ID." + "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": { + "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." + } + } + }, + "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" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "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" + }, + "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": { + "location": "query", + "description": "IP address to use instead of the user's geo-located IP address.", + "type": "string" } } }, "updateLeads": { - "flatPath": "v2/leads", - "id": "partners.updateLeads", - "path": "v2/leads", - "description": "Updates the specified lead.", "request": { "$ref": "Lead" }, + "description": "Updates the specified lead.", + "httpMethod": "PATCH", + "parameterOrder": [], "response": { "$ref": "Lead" }, - "parameterOrder": [], - "httpMethod": "PATCH", "parameters": { - "requestMetadata.experimentIds": { - "description": "Experiment IDs the current request belongs to.", + "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", - "repeated": true, "location": "query" }, + "requestMetadata.userOverrides.ipAddress": { + "description": "IP address to use instead of the user's geo-located IP address.", + "type": "string", + "location": "query" + }, + "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": { + "repeated": true, + "location": "query", + "description": "Experiment IDs the current request belongs to.", + "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.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.", @@ -137,101 +484,24 @@ "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" + "flatPath": "v2/leads", + "id": "partners.updateLeads", + "path": "v2/leads" } } }, "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": { + "flatPath": "v2/users/{userId}/companyRelation", + "id": "partners.users.createCompanyRelation", + "path": "v2/users/{userId}/companyRelation", + "description": "Creates a user's company relation. Affiliates the user to a company.", + "request": { + "$ref": "CompanyRelation" + }, "httpMethod": "PUT", "parameterOrder": [ "userId" @@ -249,8 +519,8 @@ "userId": { "location": "path", "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 + "required": true, + "type": "string" }, "requestMetadata.trafficSource.trafficSubId": { "location": "query", @@ -258,9 +528,9 @@ "type": "string" }, "requestMetadata.userOverrides.userId": { - "location": "query", "description": "Logged-in user ID to impersonate instead of the user's ID.", - "type": "string" + "type": "string", + "location": "query" }, "requestMetadata.partnersSessionId": { "location": "query", @@ -268,9 +538,9 @@ "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", - "location": "query" + "type": "string" }, "requestMetadata.locale": { "location": "query", @@ -278,60 +548,28 @@ "type": "string" }, "requestMetadata.userOverrides.ipAddress": { - "type": "string", "location": "query", - "description": "IP address to use instead of the user's geo-located IP address." + "description": "IP address to use instead of the user's geo-located IP address.", + "type": "string" } - }, - "flatPath": "v2/users/{userId}/companyRelation", - "path": "v2/users/{userId}/companyRelation", - "id": "partners.users.createCompanyRelation", - "request": { - "$ref": "CompanyRelation" - }, - "description": "Creates a user's company relation. Affiliates the user to a company." + } }, - "get": { - "path": "v2/users/{userId}", - "id": "partners.users.get", - "description": "Gets a user.", - "httpMethod": "GET", + "deleteCompanyRelation": { + "path": "v2/users/{userId}/companyRelation", + "id": "partners.users.deleteCompanyRelation", + "description": "Deletes a user's company relation. Unaffiliaites the user from a company.", + "response": { + "$ref": "Empty" + }, "parameterOrder": [ "userId" ], - "response": { - "$ref": "User" - }, + "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": { - "description": "Google Partners session ID.", - "type": "string", - "location": "query" - }, - "userView": { - "location": "query", - "enum": [ - "BASIC", - "PROFILE", - "PUBLIC_PROFILE" - ], - "description": "Specifies what parts of the user information to return.", - "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", - "location": "query" + "type": "string" }, "requestMetadata.userOverrides.ipAddress": { "description": "IP address to use instead of the user's geo-located IP address.", @@ -350,25 +588,75 @@ "type": "string" }, "userId": { - "location": "path", - "description": "Identifier of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean the currently\nauthenticated user.", + "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 + "location": "path" + }, + "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" } }, - "flatPath": "v2/users/{userId}" + "flatPath": "v2/users/{userId}/companyRelation" }, - "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": [], + "get": { "response": { - "$ref": "UserProfile" + "$ref": "User" }, + "parameterOrder": [ + "userId" + ], + "httpMethod": "GET", "parameters": { + "requestMetadata.experimentIds": { + "repeated": true, + "location": "query", + "description": "Experiment IDs the current request belongs to.", + "type": "string" + }, + "userId": { + "location": "path", + "description": "Identifier of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean the currently\nauthenticated user.", + "required": true, + "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": { + "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" + }, + "userView": { + "type": "string", + "location": "query", + "enum": [ + "BASIC", + "PROFILE", + "PUBLIC_PROFILE" + ], + "description": "Specifies what parts of the user information to return." + }, "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.", @@ -380,146 +668,179 @@ "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" + "description": "IP address to use instead of the user's geo-located IP address." } }, - "flatPath": "v2/users/profile", - "path": "v2/users/profile", - "id": "partners.users.updateProfile" - } - } - }, - "companies": { - "methods": { - "list": { - "httpMethod": "GET", + "flatPath": "v2/users/{userId}", + "path": "v2/users/{userId}", + "id": "partners.users.get", + "description": "Gets a user." + }, + "updateProfile": { + "request": { + "$ref": "UserProfile" + }, + "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.", + "httpMethod": "PATCH", "parameterOrder": [], "response": { - "$ref": "ListCompaniesResponse" + "$ref": "UserProfile" }, "parameters": { - "specializations": { - "repeated": true, + "requestMetadata.trafficSource.trafficSubId": { "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.", + "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" }, - "maxMonthlyBudget.currencyCode": { - "description": "The 3-letter currency code defined in ISO 4217.", - "type": "string", - "location": "query" - }, "requestMetadata.userOverrides.userId": { + "location": "query", "description": "Logged-in user ID to impersonate instead of the user's ID.", - "type": "string", - "location": "query" - }, - "minMonthlyBudget.currencyCode": { - "location": "query", - "description": "The 3-letter currency code defined in ISO 4217.", "type": "string" }, - "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" - ] - }, - "address": { - "description": "The address to use when searching for companies.\nIf not given, the geo-located address of the request is used.", + "requestMetadata.partnersSessionId": { + "description": "Google Partners session ID.", "type": "string", "location": "query" }, - "requestMetadata.locale": { - "location": "query", - "description": "Locale to use for the current request.", - "type": "string" - }, - "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", - "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" - ] - }, "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.", + "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" + }, + "requestMetadata.experimentIds": { + "description": "Experiment IDs the current request belongs to.", + "type": "string", + "repeated": true, + "location": "query" + } + }, + "flatPath": "v2/users/profile", + "id": "partners.users.updateProfile", + "path": "v2/users/profile" + } + } + }, + "companies": { + "methods": { + "get": { + "description": "Gets a company.", + "response": { + "$ref": "GetCompanyResponse" + }, + "parameterOrder": [ + "companyId" + ], + "httpMethod": "GET", + "parameters": { + "requestMetadata.userOverrides.ipAddress": { + "description": "IP address to use instead of the user's geo-located IP address.", "type": "string", "location": "query" }, + "companyId": { + "location": "path", + "description": "The ID of the company to retrieve.", + "required": true, + "type": "string" + }, + "requestMetadata.experimentIds": { + "location": "query", + "description": "Experiment IDs the current request belongs to.", + "type": "string", + "repeated": true + }, + "currencyCode": { + "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." + }, "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" }, - "minMonthlyBudget.nanos": { - "type": "integer", - "location": "query", - "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." + "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.", + "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" + }, + "view": { + "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" + }, + "requestMetadata.locale": { + "type": "string", + "location": "query", + "description": "Locale to use for the current request." + }, + "address": { + "location": "query", + "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": { + "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." + } + }, + "flatPath": "v2/companies/{companyId}", + "path": "v2/companies/{companyId}", + "id": "partners.companies.get" + }, + "list": { + "description": "Lists companies.", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListCompaniesResponse" + }, + "parameters": { + "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" + }, + "requestMetadata.partnersSessionId": { + "type": "string", + "location": "query", + "description": "Google Partners session ID." + }, + "companyName": { + "description": "Company name to search for.", "type": "string", "location": "query" }, @@ -528,16 +849,7 @@ "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", "I_AUTOMOTIVE", @@ -550,14 +862,20 @@ "I_RETAIL", "I_TECHNOLOGY", "I_TRAVEL" - ] + ], + "description": "List of industries the company can help with.", + "type": "string", + "repeated": true, + "location": "query" }, "websiteUrl": { - "location": "query", "description": "Website URL that will help to find a better matched company.\n.", - "type": "string" + "type": "string", + "location": "query" }, "gpsMotivations": { + "type": "string", + "repeated": true, "location": "query", "enum": [ "GPS_MOTIVATION_UNSPECIFIED", @@ -565,146 +883,148 @@ "GPSM_HELP_WITH_WEBSITE", "GPSM_NO_WEBSITE" ], - "description": "List of reasons for using Google Partner Search to get companies.", + "description": "List of reasons for using Google Partner Search to get companies." + }, + "languageCodes": { + "location": "query", + "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\").", "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\").", - "type": "string", - "repeated": true, - "location": "query" - }, "pageSize": { - "format": "int32", + "location": "query", "description": "Requested page size. Server may return fewer companies than requested.\nIf unspecified, server picks an appropriate default.", - "type": "integer", - "location": "query" + "format": "int32", + "type": "integer" }, "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.", - "type": "string", "repeated": true, - "location": "query" + "location": "query", + "description": "Experiment IDs the current request belongs to.", + "type": "string" }, "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" }, - "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.", + "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.", "type": "string", "repeated": true, - "location": "query" - }, - "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": "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" + "enum": [ + "BADGE_SPECIALIZATION_UNKNOWN", + "BADGE_SPECIALIZATION_ADWORDS_SEARCH", + "BADGE_SPECIALIZATION_ADWORDS_DISPLAY", + "BADGE_SPECIALIZATION_ADWORDS_MOBILE", + "BADGE_SPECIALIZATION_ADWORDS_VIDEO", + "BADGE_SPECIALIZATION_ADWORDS_SHOPPING" + ] }, - "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.", + "maxMonthlyBudget.currencyCode": { + "description": "The 3-letter currency code defined in ISO 4217.", "type": "string", "location": "query" }, - "requestMetadata.partnersSessionId": { - "type": "string", - "location": "query", - "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" + }, + "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`.", + ] + }, + "requestMetadata.locale": { + "description": "Locale to use for the current request.", "type": "string", "location": "query" }, - "requestMetadata.locale": { + "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": { "location": "query", - "description": "Locale to use for the current request.", + "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + "format": "int64", "type": "string" }, - "address": { + "maxMonthlyBudget.nanos": { "location": "query", - "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" + "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": { + "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, + "location": "query" + }, + "maxMonthlyBudget.units": { + "type": "string", + "location": "query", + "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + "format": "int64" + }, + "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." } }, - "flatPath": "v2/companies/{companyId}", - "id": "partners.companies.get", - "path": "v2/companies/{companyId}", - "description": "Gets a company." + "flatPath": "v2/companies", + "id": "partners.companies.list", + "path": "v2/companies" } }, "resources": { "leads": { "methods": { "create": { + "description": "Creates an advertiser lead for the given company ID.", "request": { "$ref": "CreateLeadRequest" }, - "description": "Creates an advertiser lead for the given company ID.", - "httpMethod": "POST", - "parameterOrder": [ - "companyId" - ], "response": { "$ref": "CreateLeadResponse" }, + "parameterOrder": [ + "companyId" + ], + "httpMethod": "POST", "parameters": { "companyId": { "description": "The ID of the company to contact.", - "type": "string", "required": true, + "type": "string", "location": "path" } }, @@ -719,29 +1039,25 @@ "userEvents": { "methods": { "log": { - "parameters": {}, - "flatPath": "v2/userEvents:log", - "id": "partners.userEvents.log", - "path": "v2/userEvents:log", - "description": "Logs a user event.", - "request": { - "$ref": "LogUserEventRequest" - }, "response": { "$ref": "LogUserEventResponse" }, "parameterOrder": [], - "httpMethod": "POST" + "httpMethod": "POST", + "parameters": {}, + "flatPath": "v2/userEvents:log", + "path": "v2/userEvents:log", + "id": "partners.userEvents.log", + "request": { + "$ref": "LogUserEventRequest" + }, + "description": "Logs a user event." } } }, "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" }, @@ -749,14 +1065,22 @@ "httpMethod": "POST", "parameters": {}, "flatPath": "v2/clientMessages:log", + "path": "v2/clientMessages:log", "id": "partners.clientMessages.log", - "path": "v2/clientMessages:log" + "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.", + "request": { + "$ref": "LogMessageRequest" + } } } }, "exams": { "methods": { "getToken": { + "flatPath": "v2/exams/{examType}/token", + "path": "v2/exams/{examType}/token", + "id": "partners.exams.getToken", + "description": "Gets an Exam Token for a Partner's user to take an exam in the Exams System", "response": { "$ref": "ExamToken" }, @@ -765,22 +1089,6 @@ ], "httpMethod": "GET", "parameters": { - "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" - }, - "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.", @@ -802,312 +1110,7 @@ "CET_MOBILE_SITES" ], "description": "The exam type we are requesting a token for.", - "type": "string", - "required": true - }, - "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": { - "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/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" - } - } - }, - "leads": { - "methods": { - "list": { - "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.partnersSessionId": { - "type": "string", - "location": "query", - "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": { - "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": { - "description": "Locale to use for the current request.", - "type": "string", - "location": "query" - } - }, - "flatPath": "v2/offers", - "path": "v2/offers", - "id": "partners.offers.list" - } - }, - "resources": { - "history": { - "methods": { - "list": { - "description": "Lists the Historical Offers for the current user (or user's entire company)", - "httpMethod": "GET", - "parameterOrder": [], - "response": { - "$ref": "ListOffersHistoryResponse" - }, - "parameters": { - "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", - "location": "query" - }, - "pageToken": { - "location": "query", - "description": "Token to retrieve a specific page.", - "type": "string" - }, - "pageSize": { - "format": "int32", - "description": "Maximum number of rows to return per page.", - "type": "integer", - "location": "query" - }, - "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" - } - }, - "flatPath": "v2/offers/history", - "path": "v2/offers/history", - "id": "partners.offers.history.list" - } - } - } - } - }, - "analytics": { - "methods": { - "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" - }, - "parameterOrder": [], - "httpMethod": "GET", - "parameters": { - "requestMetadata.userOverrides.userId": { - "type": "string", - "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" - }, - "pageToken": { - "location": "query", - "description": "A token identifying a page of results that the server returns.\nTypically, this is the value of `ListAnalyticsResponse.next_page_token`\nreturned from the previous call to\nListAnalytics.\nWill be a date string in `YYYY-MM-DD` format representing the end date\nof the date range of results to return.\nIf unspecified or set to \"\", default value is the current date.", - "type": "string" - }, - "pageSize": { - "location": "query", - "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" - }, - "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" - }, - "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" - } - } - }, - "userStates": { - "methods": { - "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.", + "required": true, "type": "string" }, "requestMetadata.userOverrides.userId": { @@ -1115,6 +1118,11 @@ "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.", @@ -1129,49 +1137,31 @@ "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" } - }, - "flatPath": "v2/userStates", - "path": "v2/userStates", - "id": "partners.userStates.list", - "description": "Lists states for current user.", - "httpMethod": "GET", - "parameterOrder": [], - "response": { - "$ref": "ListUserStatesResponse" } } } } }, "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." - }, - "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": { + "uploadType": { + "type": "string", "location": "query", - "description": "JSONP", - "type": "string" + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." }, "$.xgafv": { + "location": "query", "enum": [ "1", "2" @@ -1181,10 +1171,15 @@ "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", @@ -1197,29 +1192,28 @@ "json", "media", "proto" - ], - "type": "string" + ] }, "access_token": { + "description": "OAuth access token.", "type": "string", - "location": "query", - "description": "OAuth access token." + "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", "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": { "location": "query", @@ -1227,1112 +1221,78 @@ "type": "string" }, "bearer_token": { + "location": "query", "description": "OAuth bearer token.", + "type": "string" + }, + "upload_protocol": { "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" } }, "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": { - "warning": { - "description": "Whether this certification is in the state of warning.", - "type": "boolean" - }, - "expiration": { - "format": "google-datetime", - "description": "Date this certification is due to expire.", - "type": "string" - }, - "achieved": { - "description": "Whether this certification has been achieved.", - "type": "boolean" - }, - "certificationType": { - "description": "The type of certification, the area of expertise.", - "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" - ] - }, - "lastAchieved": { - "format": "google-datetime", - "description": "The date the user last achieved certification.", - "type": "string" - } - }, - "id": "Certification" - }, - "User": { - "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": { - "$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" - }, - "profile": { - "$ref": "UserProfile", - "description": "The profile information of a Partners user, contains all the directly\neditable user information." - }, - "company": { - "$ref": "CompanyRelation", - "description": "The company that the user is associated with.\nIf not present, the user is not associated with any company." - }, - "lastAccessTime": { - "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", - "items": { - "$ref": "AdWordsManagerAccountInfo" - }, - "type": "array" - }, - "primaryEmails": { - "description": "The list of emails the user has access to/can select as primary.\n@OutputOnly", - "items": { - "type": "string" - }, - "type": "array" - }, - "internalId": { - "type": "string", - "description": "The internal user ID.\nOnly available for a whitelisted set of api clients." - } - }, - "id": "User" - }, - "ListAnalyticsResponse": { - "description": "Response message for\nListAnalytics.", - "type": "object", - "properties": { - "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." - }, - "analytics": { - "description": "The list of analytics.\nSorted in ascending order of\nAnalytics.event_date.", - "items": { - "$ref": "Analytics" - }, - "type": "array" - } - }, - "id": "ListAnalyticsResponse" - }, - "ListLeadsResponse": { - "description": "Response message for ListLeads.", - "type": "object", - "properties": { - "nextPageToken": { - "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" - }, - "leads": { - "description": "The list of leads.", - "items": { - "$ref": "Lead" - }, - "type": "array" - } - }, - "id": "ListLeadsResponse" - }, "Company": { "description": "A company resource in the Google Partners API. Once certified, it qualifies\nfor being searched by advertisers.", "type": "object", "properties": { + "convertedMinMonthlyBudget": { + "$ref": "Money", + "description": "The minimum monthly budget that the company accepts for partner business,\nconverted to the requested currency code." + }, + "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", + "I_AUTOMOTIVE", + "I_BUSINESS_TO_BUSINESS", + "I_CONSUMER_PACKAGED_GOODS", + "I_EDUCATION", + "I_FINANCE", + "I_HEALTHCARE", + "I_MEDIA_AND_ENTERTAINMENT", + "I_RETAIL", + "I_TECHNOLOGY", + "I_TRAVEL" + ], + "type": "string" + } + }, + "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": { - "format": "int64", "description": "The Primary AdWords Manager Account id.", + "format": "int64", "type": "string" }, "name": { @@ -2341,17 +1301,17 @@ }, "localizedInfos": { "description": "The list of localized info for the company.", + "type": "array", "items": { "$ref": "LocalizedCompanyInfo" - }, - "type": "array" + } }, "certificationStatuses": { "description": "The list of Google Partners certification statuses for the company.", + "type": "array", "items": { "$ref": "CertificationStatus" - }, - "type": "array" + } }, "id": { "description": "The ID of the company.", @@ -2362,18 +1322,9 @@ "description": "The unconverted minimum monthly budget that the company accepts for partner\nbusiness." }, "services": { - "enumDescriptions": [ - "Unchosen.", - "Help with advanced AdWords support.", - "Help with advertising on Google.", - "Help with an enhanced website.", - "Help with an online marketing plan.", - "Help with mobile and video ads.", - "Help with mobile websites." - ], "description": "Services the company can help with.", + "type": "array", "items": { - "type": "string", "enum": [ "SERVICE_UNSPECIFIED", "S_ADVANCED_ADWORDS_SUPPORT", @@ -2382,13 +1333,22 @@ "S_AN_ONLINE_MARKETING_PLAN", "S_MOBILE_AND_VIDEO_ADS", "S_MOBILE_WEBSITE_SERVICES" - ] + ], + "type": "string" }, - "type": "array" + "enumDescriptions": [ + "Unchosen.", + "Help with advanced AdWords support.", + "Help with advertising on Google.", + "Help with an enhanced website.", + "Help with an online marketing plan.", + "Help with mobile and video ads.", + "Help with mobile websites." + ] }, "primaryLocation": { - "description": "The primary location of the company.", - "$ref": "Location" + "$ref": "Location", + "description": "The primary location of the company." }, "publicProfile": { "$ref": "PublicProfile", @@ -2396,13 +1356,19 @@ }, "ranks": { "description": "Information related to the ranking of the company within the list of\ncompanies.", + "type": "array", "items": { "$ref": "Rank" - }, - "type": "array" + } + }, + "specializationStatus": { + "description": "The list of Google Partners specialization statuses for the company.", + "type": "array", + "items": { + "$ref": "SpecializationStatus" + } }, "badgeTier": { - "type": "string", "enumDescriptions": [ "Tier badge is not set.", "Agency has regular partner badge.", @@ -2413,14 +1379,15 @@ "BADGE_TIER_REGULAR", "BADGE_TIER_PREMIER" ], - "description": "Partner badge tier" + "description": "Partner badge tier", + "type": "string" }, - "specializationStatus": { - "description": "The list of Google Partners specialization statuses for the company.", + "autoApprovalEmailDomains": { + "description": "Email domains that allow users with a matching email address to get\nauto-approved for associating with this company.", + "type": "array", "items": { - "$ref": "SpecializationStatus" - }, - "type": "array" + "type": "string" + } }, "companyTypes": { "enumDescriptions": [ @@ -2437,6 +1404,7 @@ "Full-service AdWords account management for local businesses." ], "description": "Company type labels listed on the company's profile.", + "type": "array", "items": { "type": "string", "enum": [ @@ -2452,98 +1420,73 @@ "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.", - "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": { - "enum": [ - "COMPANY_PROFILE_STATUS_UNSPECIFIED", - "HIDDEN", - "PUBLISHED", - "SEARCHABLE" - ], - "description": "The public viewability status of the company's profile.", "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." - ] + ], + "enum": [ + "COMPANY_PROFILE_STATUS_UNSPECIFIED", + "HIDDEN", + "PUBLISHED", + "SEARCHABLE" + ], + "description": "The public viewability status of the company's profile." }, "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": { - "items": { - "enum": [ - "INDUSTRY_UNSPECIFIED", - "I_AUTOMOTIVE", - "I_BUSINESS_TO_BUSINESS", - "I_CONSUMER_PACKAGED_GOODS", - "I_EDUCATION", - "I_FINANCE", - "I_HEALTHCARE", - "I_MEDIA_AND_ENTERTAINMENT", - "I_RETAIL", - "I_TECHNOLOGY", - "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" + } } }, "id": "Company" }, + "ListLeadsResponse": { + "description": "Response message for ListLeads.", + "type": "object", + "properties": { + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + }, + "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" + } + }, + "nextPageToken": { + "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" + } + }, + "id": "ListLeadsResponse" + }, "CreateLeadResponse": { "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.", @@ -2560,10 +1503,6 @@ "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." @@ -2572,6 +1511,7 @@ "id": "CreateLeadResponse" }, "GetCompanyResponse": { + "description": "Response message for GetCompany.", "type": "object", "properties": { "company": { @@ -2579,36 +1519,25 @@ "$ref": "Company" }, "responseMetadata": { - "description": "Current response metadata.", - "$ref": "ResponseMetadata" + "$ref": "ResponseMetadata", + "description": "Current response metadata." } }, - "id": "GetCompanyResponse", - "description": "Response message for GetCompany." + "id": "GetCompanyResponse" }, "Location": { + "id": "Location", + "description": "A location with address and geographic coordinates. May optionally contain a\ndetailed (multi-field) version of the address.", "type": "object", "properties": { - "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." - }, - "dependentLocality": { - "description": "Dependent locality or sublocality. Used for UK dependent localities, or\nneighborhoods or boroughs in other locations.", - "type": "string" - }, "regionCode": { "description": "CLDR (Common Locale Data Repository) region code .", "type": "string" }, + "dependentLocality": { + "type": "string", + "description": "Dependent locality or sublocality. Used for UK dependent localities, or\nneighborhoods or boroughs in other locations." + }, "address": { "description": "The single string version of the address.", "type": "string" @@ -2627,14 +1556,24 @@ }, "addressLine": { "description": "The following address lines represent the most specific part of any\naddress.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } + }, + "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" + }, + "latLng": { + "description": "The latitude and longitude of the location, in degrees.", + "$ref": "LatLng" } - }, - "id": "Location", - "description": "A location with address and geographic coordinates. May optionally contain a\ndetailed (multi-field) version of the address." + } }, "ExamToken": { "id": "ExamToken", @@ -2642,15 +1581,28 @@ "type": "object", "properties": { "examId": { - "format": "int64", "description": "The id of the exam the token is for.", + "format": "int64", "type": "string" }, "token": { - "type": "string", - "description": "The token, only present if the user has access to the exam." + "description": "The token, only present if the user has access to the exam.", + "type": "string" }, "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 the token belongs to.", "type": "string", "enumDescriptions": [ @@ -2665,19 +1617,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" ] } } @@ -2687,8 +1626,8 @@ "type": "object", "properties": { "numberUsersPass": { - "format": "int32", "description": "The number of people who have passed the certification exam.", + "format": "int32", "type": "integer" }, "type": { @@ -2725,7 +1664,6 @@ "id": "CertificationExamStatus" }, "OptIns": { - "description": "A set of opt-ins for a user.", "type": "object", "properties": { "specialOffers": { @@ -2736,56 +1674,98 @@ "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" } }, - "id": "OptIns" + "id": "OptIns", + "description": "A set of opt-ins for a user." }, "Rank": { + "id": "Rank", + "description": "Information related to ranking of results.", "type": "object", "properties": { "type": { - "enumDescriptions": [ - "Unchosen.", - "Total final score." - ], "enum": [ "RANK_TYPE_UNSPECIFIED", "RT_FINAL_SCORE" ], "description": "The type of rank.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Unchosen.", + "Total final score." + ] }, "value": { - "format": "double", "description": "The numerical value of the rank.", + "format": "double", "type": "number" } - }, - "id": "Rank", - "description": "Information related to ranking of results." + } }, "UserProfile": { "description": "The profile information of a Partners user.", "type": "object", "properties": { + "givenName": { + "description": "The user's given name.", + "type": "string" + }, + "address": { + "$ref": "Location", + "description": "The user's mailing address, contains multiple fields." + }, + "industries": { + "description": "A list of ids representing which industries the user selected.", + "type": "array", + "items": { + "type": "string" + } + }, + "familyName": { + "description": "The user's family name.", + "type": "string" + }, + "languages": { + "description": "The list of languages this user understands.", + "type": "array", + "items": { + "type": "string" + } + }, + "emailOptIns": { + "$ref": "OptIns", + "description": "The list of opt-ins for the user, related to communication preferences." + }, + "markets": { + "description": "A list of ids representing which markets the user was interested in.", + "type": "array", + "items": { + "type": "string" + } + }, + "migrateToAfa": { + "description": "Whether or not to migrate the user's exam data to Academy for Ads.", + "type": "boolean" + }, "phoneNumber": { "description": "The user's phone number.", "type": "string" }, "adwordsManagerAccount": { - "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.", + "format": "int64", "type": "string" }, "primaryCountryCode": { @@ -2796,66 +1776,28 @@ "description": "The email address the user has selected on the Partners site as primary.", "type": "string" }, - "channels": { - "description": "A list of ids representing which channels the user selected they were in.", - "items": { - "type": "string" - }, - "type": "array" - }, "profilePublic": { "description": "Whether the user's public profile is visible to anyone with the URL.", "type": "boolean" }, + "channels": { + "description": "A list of ids representing which channels the user selected they were in.", + "type": "array", + "items": { + "type": "string" + } + }, "jobFunctions": { "description": "A list of ids represnting which job categories the user selected.", + "type": "array", "items": { "type": "string" - }, - "type": "array" - }, - "givenName": { - "type": "string", - "description": "The user's given name." - }, - "address": { - "$ref": "Location", - "description": "The user's mailing address, contains multiple fields." - }, - "industries": { - "description": "A list of ids representing which industries the user selected.", - "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": { - "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.", - "items": { - "type": "string" - }, - "type": "array" + } } }, "id": "UserProfile" }, "GetPartnersStatusResponse": { - "id": "GetPartnersStatusResponse", "description": "Response message for\nGetPartnersStatus.", "type": "object", "properties": { @@ -2863,52 +1805,14 @@ "description": "Current response metadata.", "$ref": "ResponseMetadata" } - } + }, + "id": "GetPartnersStatusResponse" }, "HistoricalOffer": { + "id": "HistoricalOffer", "description": "Historical information about a Google Partners Offer.", "type": "object", "properties": { - "status": { - "description": "Status of the offer.", - "type": "string", - "enumDescriptions": [ - "Unset.", - "Offer distributed.", - "Offer redeemed.", - "Offer awarded.", - "Offer expired." - ], - "enum": [ - "OFFER_STATUS_UNSPECIFIED", - "OFFER_STATUS_DISTRIBUTED", - "OFFER_STATUS_REDEEMED", - "OFFER_STATUS_AWARDED", - "OFFER_STATUS_EXPIRED" - ] - }, - "clientEmail": { - "description": "Email address for client.", - "type": "string" - }, - "clientId": { - "type": "string", - "format": "int64", - "description": "ID of client." - }, - "clientName": { - "description": "Name of the client.", - "type": "string" - }, - "lastModifiedTime": { - "format": "google-datetime", - "description": "Time last action was taken.", - "type": "string" - }, - "adwordsUrl": { - "description": "Client's AdWords page URL.", - "type": "string" - }, "offerType": { "enumDescriptions": [ "Unset.", @@ -2934,8 +1838,8 @@ "type": "string" }, "expirationTime": { - "format": "google-datetime", "description": "Time this offer expires.", + "format": "google-datetime", "type": "string" }, "offerCode": { @@ -2943,16 +1847,53 @@ "type": "string" }, "creationTime": { - "format": "google-datetime", "description": "Time offer was first created.", + "format": "google-datetime", + "type": "string" + }, + "clientEmail": { + "type": "string", + "description": "Email address for client." + }, + "status": { + "enumDescriptions": [ + "Unset.", + "Offer distributed.", + "Offer redeemed.", + "Offer awarded.", + "Offer expired." + ], + "enum": [ + "OFFER_STATUS_UNSPECIFIED", + "OFFER_STATUS_DISTRIBUTED", + "OFFER_STATUS_REDEEMED", + "OFFER_STATUS_AWARDED", + "OFFER_STATUS_EXPIRED" + ], + "description": "Status of the offer.", + "type": "string" + }, + "clientId": { + "description": "ID of client.", + "format": "int64", + "type": "string" + }, + "clientName": { + "description": "Name of the client.", + "type": "string" + }, + "lastModifiedTime": { + "description": "Time last action was taken.", + "format": "google-datetime", + "type": "string" + }, + "adwordsUrl": { + "description": "Client's AdWords page URL.", "type": "string" } - }, - "id": "HistoricalOffer" + } }, "UserOverrides": { - "description": "Values to use instead of the user's respective defaults. These are only\nhonored by whitelisted products.", - "type": "object", "properties": { "userId": { "description": "Logged-in user ID to impersonate instead of the user's ID.", @@ -2963,178 +1904,59 @@ "type": "string" } }, - "id": "UserOverrides" + "id": "UserOverrides", + "description": "Values to use instead of the user's respective defaults. These are only\nhonored by whitelisted products.", + "type": "object" }, "LogUserEventRequest": { "description": "Request message for\nLogUserEvent.", "type": "object", "properties": { + "eventCategory": { + "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.", + "type": "string" + }, "lead": { - "$ref": "Lead", - "description": "Advertiser lead information." + "description": "Advertiser lead information.", + "$ref": "Lead" }, "eventAction": { - "enum": [ - "EVENT_ACTION_UNSPECIFIED", - "SMB_CLICKED_FIND_A_PARTNER_BUTTON_BOTTOM", - "SMB_CLICKED_FIND_A_PARTNER_BUTTON_TOP", - "AGENCY_CLICKED_JOIN_NOW_BUTTON_BOTTOM", - "AGENCY_CLICKED_JOIN_NOW_BUTTON_TOP", - "SMB_CANCELED_PARTNER_CONTACT_FORM", - "SMB_CLICKED_CONTACT_A_PARTNER", - "SMB_COMPLETED_PARTNER_CONTACT_FORM", - "SMB_ENTERED_EMAIL_IN_CONTACT_PARTNER_FORM", - "SMB_ENTERED_NAME_IN_CONTACT_PARTNER_FORM", - "SMB_ENTERED_PHONE_IN_CONTACT_PARTNER_FORM", - "SMB_FAILED_RECAPTCHA_IN_CONTACT_PARTNER_FORM", - "PARTNER_VIEWED_BY_SMB", - "SMB_CANCELED_PARTNER_CONTACT_FORM_ON_GPS", - "SMB_CHANGED_A_SEARCH_PARAMETER_TOP", - "SMB_CLICKED_CONTACT_A_PARTNER_ON_GPS", - "SMB_CLICKED_SHOW_MORE_PARTNERS_BUTTON_BOTTOM", - "SMB_COMPLETED_PARTNER_CONTACT_FORM_ON_GPS", - "SMB_NO_PARTNERS_AVAILABLE_WITH_SEARCH_CRITERIA", - "SMB_PERFORMED_SEARCH_ON_GPS", - "SMB_VIEWED_A_PARTNER_ON_GPS", - "SMB_CANCELED_PARTNER_CONTACT_FORM_ON_PROFILE_PAGE", - "SMB_CLICKED_CONTACT_A_PARTNER_ON_PROFILE_PAGE", - "SMB_CLICKED_PARTNER_WEBSITE", - "SMB_COMPLETED_PARTNER_CONTACT_FORM_ON_PROFILE_PAGE", - "SMB_VIEWED_A_PARTNER_PROFILE", - "AGENCY_CLICKED_ACCEPT_TOS_BUTTON", - "AGENCY_CHANGED_TOS_COUNTRY", - "AGENCY_ADDED_ADDRESS_IN_MY_PROFILE_PORTAL", - "AGENCY_ADDED_PHONE_NUMBER_IN_MY_PROFILE_PORTAL", - "AGENCY_CHANGED_PRIMARY_ACCOUNT_ASSOCIATION", - "AGENCY_CHANGED_PRIMARY_COUNTRY_ASSOCIATION", - "AGENCY_CLICKED_AFFILIATE_BUTTON_IN_MY_PROFILE_IN_PORTAL", - "AGENCY_CLICKED_GIVE_EDIT_ACCESS_IN_MY_PROFILE_PORTAL", - "AGENCY_CLICKED_LOG_OUT_IN_MY_PROFILE_PORTAL", - "AGENCY_CLICKED_MY_PROFILE_LEFT_NAV_IN_PORTAL", - "AGENCY_CLICKED_SAVE_AND_CONTINUE_AT_BOT_OF_COMPLETE_PROFILE", - "AGENCY_CLICKED_UNAFFILIATE_IN_MY_PROFILE_PORTAL", - "AGENCY_FILLED_OUT_COMP_AFFILIATION_IN_MY_PROFILE_PORTAL", - "AGENCY_SUCCESSFULLY_CONNECTED_WITH_COMPANY_IN_MY_PROFILE", - "AGENCY_CLICKED_CREATE_MCC_IN_MY_PROFILE_PORTAL", - "AGENCY_DIDNT_HAVE_AN_MCC_ASSOCIATED_ON_COMPLETE_PROFILE", - "AGENCY_HAD_AN_MCC_ASSOCIATED_ON_COMPLETE_PROFILE", - "AGENCY_ADDED_JOB_FUNCTION_IN_MY_PROFILE_PORTAL", - "AGENCY_LOOKED_AT_JOB_FUNCTION_DROP_DOWN", - "AGENCY_SELECTED_ACCOUNT_MANAGER_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_MY_PROFILE_PORTAL", - "AGENCY_LOOKED_AT_ADD_CHANNEL_DROP_DOWN", - "AGENCY_SELECTED_CROSS_CHANNEL_FROM_ADD_CHANNEL", - "AGENCY_SELECTED_DISPLAY_FROM_ADD_CHANNEL", - "AGENCY_SELECTED_MOBILE_FROM_ADD_CHANNEL", - "AGENCY_SELECTED_SEARCH_FROM_ADD_CHANNEL", - "AGENCY_SELECTED_SOCIAL_FROM_ADD_CHANNEL", - "AGENCY_SELECTED_TOOLS_FROM_ADD_CHANNEL", - "AGENCY_SELECTED_YOUTUBE_FROM_ADD_CHANNEL", - "AGENCY_ADDED_INDUSTRIES_IN_MY_PROFILE_PORTAL", - "AGENCY_CHANGED_ADD_INDUSTRIES_DROP_DOWN", - "AGENCY_ADDED_MARKETS_IN_MY_PROFILE_PORTAL", - "AGENCY_CHANGED_ADD_MARKETS_DROP_DOWN", - "AGENCY_CHECKED_RECIEVE_MAIL_PROMOTIONS_MYPROFILE", - "AGENCY_CHECKED_RECIEVE_MAIL_PROMOTIONS_SIGNUP", - "AGENCY_SELECTED_OPT_IN_BETA_TESTS_AND_MKT_RESEARCH", - "AGENCY_SELECTED_OPT_IN_BETA_TESTS_IN_MY_PROFILE_PORTAL", - "AGENCY_SELECTED_OPT_IN_NEWS_IN_MY_PROFILE_PORTAL", - "AGENCY_SELECTED_OPT_IN_NEWS_INVITATIONS_AND_PROMOS", - "AGENCY_SELECTED_OPT_IN_PERFORMANCE_SUG_IN_MY_PROFILE_PORTAL", - "AGENCY_SELECTED_OPT_IN_PERFORMANCE_SUGGESTIONS", - "AGENCY_SELECTED_OPT_IN_SELECT_ALL_EMAIL_NOTIFICATIONS", - "AGENCY_SELECTED_SELECT_ALL_OPT_INS_IN_MY_PROFILE_PORTAL", - "AGENCY_CLICKED_BACK_BUTTON_ON_CONNECT_WITH_COMPANY", - "AGENCY_CLICKED_CONTINUE_TO_OVERVIEW_ON_CONNECT_WITH_COMPANY", - "AGECNY_CLICKED_CREATE_MCC_CONNECT_WITH_COMPANY_NOT_FOUND", - "AGECNY_CLICKED_GIVE_EDIT_ACCESS_CONNECT_WITH_COMPANY_NOT_FOUND", - "AGECNY_CLICKED_LOG_OUT_CONNECT_WITH_COMPANY_NOT_FOUND", - "AGENCY_CLICKED_SKIP_FOR_NOW_ON_CONNECT_WITH_COMPANY_PAGE", - "AGENCY_CLOSED_CONNECTED_TO_COMPANY_X_BUTTON_WRONG_COMPANY", - "AGENCY_COMPLETED_FIELD_CONNECT_WITH_COMPANY", - "AGECNY_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_CLICKED_GET_CERTIFIED_LINK_IN_PORTAL_NOTIFICATIONS", - "AGENCY_CLICKED_GET_VIDEO_ADS_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_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_CERT_ADWORDS_PAGE", - "AGENCY_CLICKED_SEE_EXAMS_CERTIFICATION_MAIN_PAGE", - "AGENCY_CLICKED_TAKE_EXAM_ON_CERT_EXAM_PAGE", - "AGENCY_OPENED_LAST_ADMIN_DIALOG", - "AGENCY_OPENED_DIALOG_WITH_NO_USERS", - "AGENCY_PROMOTED_USER_TO_ADMIN", - "AGENCY_UNAFFILIATED", - "AGENCY_CHANGED_ROLES", - "SMB_CLICKED_COMPANY_NAME_LINK_TO_PROFILE", - "SMB_VIEWED_ADWORDS_CERTIFICATE", - "SMB_VIEWED_ADWORDS_SEARCH_CERTIFICATE", - "SMB_VIEWED_ADWORDS_DISPLAY_CERTIFICATE", - "SMB_CLICKED_ADWORDS_CERTIFICATE_HELP_ICON", - "SMB_VIEWED_ANALYTICS_CERTIFICATE", - "SMB_VIEWED_DOUBLECLICK_CERTIFICATE", - "SMB_VIEWED_MOBILE_SITES_CERTIFICATE", - "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", - "AGENCY_CLICKED_LEFT_NAV_STORIES", - "CLICKED", - "SMB_VIEWED_MOBILE_CERTIFICATE", - "AGENCY_FAILED_COMPANY_VERIFICATION", - "VISITED_LANDING", - "VISITED_GPS", - "VISITED_AGENCY_PORTAL", - "CANCELLED_INDIVIDUAL_SIGN_UP", - "CANCELLED_COMPANY_SIGN_UP", - "AGENCY_CLICKED_SIGN_IN_BUTTON_TOP", - "AGENCY_CLICKED_SAVE_AND_CONTINUE_AT_BOT_OF_INCOMPLETE_PROFILE", - "AGENCY_UNSELECTED_OPT_IN_NEWS_INVITATIONS_AND_PROMOS", - "AGENCY_UNSELECTED_OPT_IN_BETA_TESTS_AND_MKT_RESEARCH", - "AGENCY_UNSELECTED_OPT_IN_PERFORMANCE_SUGGESTIONS", - "AGENCY_SELECTED_OPT_OUT_UNSELECT_ALL_EMAIL_NOTIFICATIONS", - "AGENCY_LINKED_INDIVIDUAL_MCC", - "AGENCY_SUGGESTED_TO_USER", - "AGENCY_IGNORED_SUGGESTED_AGENCIES_AND_SEARCHED", - "AGENCY_PICKED_SUGGESTED_AGENCY", - "AGENCY_SEARCHED_FOR_AGENCIES", - "AGENCY_PICKED_SEARCHED_AGENCY", - "AGENCY_DISMISSED_AFFILIATION_WIDGET", - "AGENCY_CLICKED_INSIGHTS_DOWNLOAD_CONTENT", - "AGENCY_PROGRESS_INSIGHTS_VIEW_CONTENT", - "AGENCY_CLICKED_CANCEL_ACCEPT_TOS_BUTTON", - "SMB_ENTERED_WEBSITE_IN_CONTACT_PARTNER_FORM" - ], - "description": "The action that occurred.", - "type": "string", "enumDescriptions": [ "Unchosen.", "Advertiser clicked `Find a partner` bottom button.", @@ -3292,24 +2114,182 @@ "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." - ] + "Advertiser entered website in contact form.", + "Agency opted in for migrating their exams to Academy for Ads.", + "Agency opted out for migrating their exams to Academy for Ads." + ], + "enum": [ + "EVENT_ACTION_UNSPECIFIED", + "SMB_CLICKED_FIND_A_PARTNER_BUTTON_BOTTOM", + "SMB_CLICKED_FIND_A_PARTNER_BUTTON_TOP", + "AGENCY_CLICKED_JOIN_NOW_BUTTON_BOTTOM", + "AGENCY_CLICKED_JOIN_NOW_BUTTON_TOP", + "SMB_CANCELED_PARTNER_CONTACT_FORM", + "SMB_CLICKED_CONTACT_A_PARTNER", + "SMB_COMPLETED_PARTNER_CONTACT_FORM", + "SMB_ENTERED_EMAIL_IN_CONTACT_PARTNER_FORM", + "SMB_ENTERED_NAME_IN_CONTACT_PARTNER_FORM", + "SMB_ENTERED_PHONE_IN_CONTACT_PARTNER_FORM", + "SMB_FAILED_RECAPTCHA_IN_CONTACT_PARTNER_FORM", + "PARTNER_VIEWED_BY_SMB", + "SMB_CANCELED_PARTNER_CONTACT_FORM_ON_GPS", + "SMB_CHANGED_A_SEARCH_PARAMETER_TOP", + "SMB_CLICKED_CONTACT_A_PARTNER_ON_GPS", + "SMB_CLICKED_SHOW_MORE_PARTNERS_BUTTON_BOTTOM", + "SMB_COMPLETED_PARTNER_CONTACT_FORM_ON_GPS", + "SMB_NO_PARTNERS_AVAILABLE_WITH_SEARCH_CRITERIA", + "SMB_PERFORMED_SEARCH_ON_GPS", + "SMB_VIEWED_A_PARTNER_ON_GPS", + "SMB_CANCELED_PARTNER_CONTACT_FORM_ON_PROFILE_PAGE", + "SMB_CLICKED_CONTACT_A_PARTNER_ON_PROFILE_PAGE", + "SMB_CLICKED_PARTNER_WEBSITE", + "SMB_COMPLETED_PARTNER_CONTACT_FORM_ON_PROFILE_PAGE", + "SMB_VIEWED_A_PARTNER_PROFILE", + "AGENCY_CLICKED_ACCEPT_TOS_BUTTON", + "AGENCY_CHANGED_TOS_COUNTRY", + "AGENCY_ADDED_ADDRESS_IN_MY_PROFILE_PORTAL", + "AGENCY_ADDED_PHONE_NUMBER_IN_MY_PROFILE_PORTAL", + "AGENCY_CHANGED_PRIMARY_ACCOUNT_ASSOCIATION", + "AGENCY_CHANGED_PRIMARY_COUNTRY_ASSOCIATION", + "AGENCY_CLICKED_AFFILIATE_BUTTON_IN_MY_PROFILE_IN_PORTAL", + "AGENCY_CLICKED_GIVE_EDIT_ACCESS_IN_MY_PROFILE_PORTAL", + "AGENCY_CLICKED_LOG_OUT_IN_MY_PROFILE_PORTAL", + "AGENCY_CLICKED_MY_PROFILE_LEFT_NAV_IN_PORTAL", + "AGENCY_CLICKED_SAVE_AND_CONTINUE_AT_BOT_OF_COMPLETE_PROFILE", + "AGENCY_CLICKED_UNAFFILIATE_IN_MY_PROFILE_PORTAL", + "AGENCY_FILLED_OUT_COMP_AFFILIATION_IN_MY_PROFILE_PORTAL", + "AGENCY_SUCCESSFULLY_CONNECTED_WITH_COMPANY_IN_MY_PROFILE", + "AGENCY_CLICKED_CREATE_MCC_IN_MY_PROFILE_PORTAL", + "AGENCY_DIDNT_HAVE_AN_MCC_ASSOCIATED_ON_COMPLETE_PROFILE", + "AGENCY_HAD_AN_MCC_ASSOCIATED_ON_COMPLETE_PROFILE", + "AGENCY_ADDED_JOB_FUNCTION_IN_MY_PROFILE_PORTAL", + "AGENCY_LOOKED_AT_JOB_FUNCTION_DROP_DOWN", + "AGENCY_SELECTED_ACCOUNT_MANAGER_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_MY_PROFILE_PORTAL", + "AGENCY_LOOKED_AT_ADD_CHANNEL_DROP_DOWN", + "AGENCY_SELECTED_CROSS_CHANNEL_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_DISPLAY_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_MOBILE_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_SEARCH_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_SOCIAL_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_TOOLS_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_YOUTUBE_FROM_ADD_CHANNEL", + "AGENCY_ADDED_INDUSTRIES_IN_MY_PROFILE_PORTAL", + "AGENCY_CHANGED_ADD_INDUSTRIES_DROP_DOWN", + "AGENCY_ADDED_MARKETS_IN_MY_PROFILE_PORTAL", + "AGENCY_CHANGED_ADD_MARKETS_DROP_DOWN", + "AGENCY_CHECKED_RECIEVE_MAIL_PROMOTIONS_MYPROFILE", + "AGENCY_CHECKED_RECIEVE_MAIL_PROMOTIONS_SIGNUP", + "AGENCY_SELECTED_OPT_IN_BETA_TESTS_AND_MKT_RESEARCH", + "AGENCY_SELECTED_OPT_IN_BETA_TESTS_IN_MY_PROFILE_PORTAL", + "AGENCY_SELECTED_OPT_IN_NEWS_IN_MY_PROFILE_PORTAL", + "AGENCY_SELECTED_OPT_IN_NEWS_INVITATIONS_AND_PROMOS", + "AGENCY_SELECTED_OPT_IN_PERFORMANCE_SUG_IN_MY_PROFILE_PORTAL", + "AGENCY_SELECTED_OPT_IN_PERFORMANCE_SUGGESTIONS", + "AGENCY_SELECTED_OPT_IN_SELECT_ALL_EMAIL_NOTIFICATIONS", + "AGENCY_SELECTED_SELECT_ALL_OPT_INS_IN_MY_PROFILE_PORTAL", + "AGENCY_CLICKED_BACK_BUTTON_ON_CONNECT_WITH_COMPANY", + "AGENCY_CLICKED_CONTINUE_TO_OVERVIEW_ON_CONNECT_WITH_COMPANY", + "AGECNY_CLICKED_CREATE_MCC_CONNECT_WITH_COMPANY_NOT_FOUND", + "AGECNY_CLICKED_GIVE_EDIT_ACCESS_CONNECT_WITH_COMPANY_NOT_FOUND", + "AGECNY_CLICKED_LOG_OUT_CONNECT_WITH_COMPANY_NOT_FOUND", + "AGENCY_CLICKED_SKIP_FOR_NOW_ON_CONNECT_WITH_COMPANY_PAGE", + "AGENCY_CLOSED_CONNECTED_TO_COMPANY_X_BUTTON_WRONG_COMPANY", + "AGENCY_COMPLETED_FIELD_CONNECT_WITH_COMPANY", + "AGECNY_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_CLICKED_GET_CERTIFIED_LINK_IN_PORTAL_NOTIFICATIONS", + "AGENCY_CLICKED_GET_VIDEO_ADS_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_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_CERT_ADWORDS_PAGE", + "AGENCY_CLICKED_SEE_EXAMS_CERTIFICATION_MAIN_PAGE", + "AGENCY_CLICKED_TAKE_EXAM_ON_CERT_EXAM_PAGE", + "AGENCY_OPENED_LAST_ADMIN_DIALOG", + "AGENCY_OPENED_DIALOG_WITH_NO_USERS", + "AGENCY_PROMOTED_USER_TO_ADMIN", + "AGENCY_UNAFFILIATED", + "AGENCY_CHANGED_ROLES", + "SMB_CLICKED_COMPANY_NAME_LINK_TO_PROFILE", + "SMB_VIEWED_ADWORDS_CERTIFICATE", + "SMB_VIEWED_ADWORDS_SEARCH_CERTIFICATE", + "SMB_VIEWED_ADWORDS_DISPLAY_CERTIFICATE", + "SMB_CLICKED_ADWORDS_CERTIFICATE_HELP_ICON", + "SMB_VIEWED_ANALYTICS_CERTIFICATE", + "SMB_VIEWED_DOUBLECLICK_CERTIFICATE", + "SMB_VIEWED_MOBILE_SITES_CERTIFICATE", + "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", + "AGENCY_CLICKED_LEFT_NAV_STORIES", + "CLICKED", + "SMB_VIEWED_MOBILE_CERTIFICATE", + "AGENCY_FAILED_COMPANY_VERIFICATION", + "VISITED_LANDING", + "VISITED_GPS", + "VISITED_AGENCY_PORTAL", + "CANCELLED_INDIVIDUAL_SIGN_UP", + "CANCELLED_COMPANY_SIGN_UP", + "AGENCY_CLICKED_SIGN_IN_BUTTON_TOP", + "AGENCY_CLICKED_SAVE_AND_CONTINUE_AT_BOT_OF_INCOMPLETE_PROFILE", + "AGENCY_UNSELECTED_OPT_IN_NEWS_INVITATIONS_AND_PROMOS", + "AGENCY_UNSELECTED_OPT_IN_BETA_TESTS_AND_MKT_RESEARCH", + "AGENCY_UNSELECTED_OPT_IN_PERFORMANCE_SUGGESTIONS", + "AGENCY_SELECTED_OPT_OUT_UNSELECT_ALL_EMAIL_NOTIFICATIONS", + "AGENCY_LINKED_INDIVIDUAL_MCC", + "AGENCY_SUGGESTED_TO_USER", + "AGENCY_IGNORED_SUGGESTED_AGENCIES_AND_SEARCHED", + "AGENCY_PICKED_SUGGESTED_AGENCY", + "AGENCY_SEARCHED_FOR_AGENCIES", + "AGENCY_PICKED_SEARCHED_AGENCY", + "AGENCY_DISMISSED_AFFILIATION_WIDGET", + "AGENCY_CLICKED_INSIGHTS_DOWNLOAD_CONTENT", + "AGENCY_PROGRESS_INSIGHTS_VIEW_CONTENT", + "AGENCY_CLICKED_CANCEL_ACCEPT_TOS_BUTTON", + "SMB_ENTERED_WEBSITE_IN_CONTACT_PARTNER_FORM", + "AGENCY_SELECTED_OPT_IN_AFA_MIGRATION", + "AGENCY_SELECTED_OPT_OUT_AFA_MIGRATION" + ], + "description": "The action that occurred.", + "type": "string" + }, + "requestMetadata": { + "description": "Current request metadata.", + "$ref": "RequestMetadata" }, "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", @@ -3326,117 +2306,57 @@ "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." + "eventDatas": { + "description": "List of event data for the event.", + "type": "array", + "items": { + "$ref": "EventData" + } } }, "id": "LogUserEventRequest" }, "AnalyticsDataPoint": { - "id": "AnalyticsDataPoint", "description": "Details of the analytics events for a `Company` within a single day.", "type": "object", "properties": { - "eventCount": { - "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" + } + }, + "eventCount": { + "description": "Number of times the type of event occurred.\nMeaning depends on context (e.g. profile views, contacts, etc.).", + "format": "int32", + "type": "integer" } - } + }, + "id": "AnalyticsDataPoint" }, "Analytics": { - "description": "Analytics data for a `Company` within a single day.", "type": "object", "properties": { - "searchViews": { - "$ref": "AnalyticsDataPoint", - "description": "Instances of users seeing the `Company` in Google Partners Search results\non the specified date." + "contacts": { + "description": "Instances of users contacting the `Company`\non the specified date.", + "$ref": "AnalyticsDataPoint" + }, + "eventDate": { + "description": "Date on which these events occurred.", + "$ref": "Date" }, "profileViews": { "$ref": "AnalyticsDataPoint", "description": "Instances of users viewing the `Company` profile\non the specified date." }, - "eventDate": { - "$ref": "Date", - "description": "Date on which these events occurred." - }, - "contacts": { - "$ref": "AnalyticsDataPoint", - "description": "Instances of users contacting the `Company`\non the specified date." + "searchViews": { + "description": "Instances of users seeing the `Company` in Google Partners Search results\non the specified date.", + "$ref": "AnalyticsDataPoint" } }, - "id": "Analytics" - }, - "PublicProfile": { - "description": "Basic information from a public profile.", - "type": "object", - "properties": { - "profileImage": { - "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" - }, - "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" + "id": "Analytics", + "description": "Analytics data for a `Company` within a single day." }, "AdWordsManagerAccountInfo": { "description": "Information about a particular AdWords Manager Account.\nRead more at https://support.google.com/adwords/answer/6139186", @@ -3447,49 +2367,896 @@ "type": "string" }, "id": { - "type": "string", + "description": "The AdWords Manager Account id.", "format": "int64", - "description": "The AdWords Manager Account id." + "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" + }, + "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" + }, + "url": { + "type": "string", + "description": "The URL of the public profile." + } + }, + "id": "PublicProfile" + }, "ResponseMetadata": { "id": "ResponseMetadata", "description": "Common data that is in each API response.", "type": "object", "properties": { "debugInfo": { - "description": "Debug information about this request.", - "$ref": "DebugInfo" + "$ref": "DebugInfo", + "description": "Debug information about this request." } } }, "RecaptchaChallenge": { - "id": "RecaptchaChallenge", "description": "\u003ca href=\"https://www.google.com/recaptcha/\"\u003ereCaptcha\u003c/a\u003e challenge info.", "type": "object", "properties": { - "response": { - "description": "The response to the reCaptcha challenge.", - "type": "string" - }, "id": { "type": "string", "description": "The ID of the reCaptcha challenge." + }, + "response": { + "description": "The response to the reCaptcha challenge.", + "type": "string" + } + }, + "id": "RecaptchaChallenge" + }, + "AvailableOffer": { + "type": "object", + "properties": { + "offerLevel": { + "enum": [ + "OFFER_LEVEL_UNSPECIFIED", + "OFFER_LEVEL_DENY_PROBLEM", + "OFFER_LEVEL_DENY_CONTRACT", + "OFFER_LEVEL_MANUAL", + "OFFER_LEVEL_LIMIT_0", + "OFFER_LEVEL_LIMIT_5", + "OFFER_LEVEL_LIMIT_15", + "OFFER_LEVEL_LIMIT_50" + ], + "description": "Level of this offer.", + "type": "string", + "enumDescriptions": [ + "Unset.", + "Users/Agencies that have no offers because of a problem.", + "Users/Agencies that have no offers due to contractural agreements.", + "Users/Agencies that have a manually-configured limit.", + "Some Agencies don't get any offers.", + "Basic level gets 5 per month.", + "Agencies with adequate AHI and spend get 15/month.", + "Badged partners (even in grace) get 50 per month." + ] + }, + "name": { + "description": "Name of the offer.", + "type": "string" + }, + "qualifiedCustomersComplete": { + "description": "Whether or not the list of qualified customers is definitely complete.", + "type": "boolean" + }, + "id": { + "description": "ID of this offer.", + "format": "int64", + "type": "string" + }, + "countryOfferInfos": { + "description": "Offer info by country.", + "type": "array", + "items": { + "$ref": "CountryOfferInfo" + } + }, + "offerType": { + "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" + ], + "description": "Type of offer." + }, + "maxAccountAge": { + "description": "The maximum age of an account [in days] to be eligible.", + "format": "int32", + "type": "integer" + }, + "qualifiedCustomer": { + "description": "Customers who qualify for this offer.", + "type": "array", + "items": { + "$ref": "OfferCustomer" + } + }, + "terms": { + "description": "Terms of the offer.", + "type": "string" + }, + "showSpecialOfferCopy": { + "description": "Should special text be shown on the offers page.", + "type": "boolean" + }, + "available": { + "description": "The number of codes for this offer that are available for distribution.", + "format": "int32", + "type": "integer" + }, + "description": { + "description": "Description of the offer.", + "type": "string" + } + }, + "id": "AvailableOffer", + "description": "Available Offers to be distributed." + }, + "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.", + "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" + }, + "Money": { + "type": "object", + "properties": { + "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" + }, + "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" + } + }, + "id": "Money", + "description": "Represents an amount of money with its currency type." + }, + "AnalyticsSummary": { + "description": "Analytics aggregated data for a `Company` for a given date range.", + "type": "object", + "properties": { + "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" + }, + "contactsCount": { + "description": "Aggregated number of times users contacted the `Company`\nfor 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": { + "description": "Message level of client message.", + "type": "string", + "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" + ] + }, + "details": { + "description": "Details about the client message.", + "type": "string" + } + }, + "id": "LogMessageRequest" + }, + "DebugInfo": { + "id": "DebugInfo", + "description": "Debug information about this request.", + "type": "object", + "properties": { + "serviceUrl": { + "type": "string", + "description": "URL of the service that handled this request." + }, + "serverInfo": { + "description": "Info about the server that serviced this request.", + "type": "string" + }, + "serverTraceInfo": { + "description": "Server-side debug stack trace.", + "type": "string" } } }, - "AvailableOffer": { - "description": "Available Offers to be distributed.", + "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": { - "countryOfferInfos": { - "description": "Offer info by country.", + "givenName": { + "description": "First name of lead source.", + "type": "string" + }, + "minMonthlyBudget": { + "description": "The minimum monthly budget lead source is willing to spend.", + "$ref": "Money" + }, + "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": { + "enum": [ + "LEAD_STATE_UNSPECIFIED", + "LEAD", + "CONTACTED", + "CLIENT", + "OTHER" + ], + "description": "The lead's state in relation to the company.", + "type": "string", + "enumDescriptions": [ + "Unchosen.", + "Lead not yet contacted.", + "Lead has been contacted.", + "Lead has become a client.", + "Lead in a state not covered by other options." + ] + }, + "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": { - "$ref": "CountryOfferInfo" + "enum": [ + "GPS_MOTIVATION_UNSPECIFIED", + "GPSM_HELP_WITH_ADVERTISING", + "GPSM_HELP_WITH_WEBSITE", + "GPSM_NO_WEBSITE" + ], + "type": "string" + } + }, + "email": { + "type": "string", + "description": "Email address of lead source." + }, + "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": { + "type": "string", + "description": "Phone number of lead source." + }, + "adwordsCustomerId": { + "type": "string", + "description": "The AdWords Customer ID of the lead.", + "format": "int64" + }, + "createTime": { + "type": "string", + "description": "Timestamp of when this lead was created.", + "format": "google-datetime" + }, + "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": { + "type": "object", + "properties": { + "userStates": { + "description": "User's states.", + "type": "array", + "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": { + "description": "Current response metadata.", + "$ref": "ResponseMetadata" + } + }, + "id": "ListUserStatesResponse", + "description": "Response message for\nListUserStates." + }, + "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.", + "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" + }, + "website": { + "description": "The website URL for this company.", + "type": "string" + }, + "phoneNumber": { + "description": "The phone number for the company's primary address.", + "type": "string" + }, + "primaryCountryCode": { + "description": "The primary country code of the company.", + "type": "string" + }, + "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": { + "type": "string", + "description": "The timestamp when the user was approved.\n@OutputOnly", + "format": "google-datetime" + }, + "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" + }, + "primaryAddress": { + "$ref": "Location", + "description": "The primary location of the company." + }, + "managerAccount": { + "description": "The AdWords manager account # associated this company.", + "format": "int64", + "type": "string" + }, + "name": { + "description": "The name (in the company's primary language) for the company.", + "type": "string" + }, + "segment": { + "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." + ], + "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" + } + } + }, + "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": { + "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" + }, + "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": {} + }, + "TrafficSource": { + "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", + "description": "Source of traffic for the current request.", + "type": "object" + }, + "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": { + "$ref": "UserOverrides", + "description": "Values to use instead of the user's respective defaults for the current\nrequest. These are only honored by whitelisted products." + }, + "partnersSessionId": { + "description": "Google Partners session ID.", + "type": "string" + }, + "experimentIds": { + "description": "Experiment IDs the current request belongs to.", + "type": "array", + "items": { + "type": "string" + } + }, + "trafficSource": { + "$ref": "TrafficSource", + "description": "Source of traffic for the current request." + } + }, + "id": "RequestMetadata" + }, + "CreateLeadRequest": { + "description": "Request message for CreateLead.", + "type": "object", + "properties": { + "requestMetadata": { + "$ref": "RequestMetadata", + "description": "Current request metadata." + }, + "lead": { + "$ref": "Lead", + "description": "The lead resource. The `LeadType` must not be `LEAD_TYPE_UNSPECIFIED`\nand either `email` or `phone_number` must be provided." + }, + "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": { + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Data values." + }, + "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" + } + }, + "id": "EventData" + }, + "ExamStatus": { + "description": "A user's information on a specific exam.", + "type": "object", + "properties": { + "passed": { + "description": "Whether this exam has been passed and not expired.", + "type": "boolean" + }, + "taken": { + "description": "The date the user last taken this exam.", + "format": "google-datetime", + "type": "string" + }, + "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": { + "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." + ], + "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." + } + }, + "id": "ExamStatus" + }, + "ListOffersResponse": { + "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": { + "description": "Available Offers to be distributed.", + "type": "array", + "items": { + "$ref": "AvailableOffer" + } + }, + "responseMetadata": { + "description": "Current response metadata.", + "$ref": "ResponseMetadata" + } + }, + "id": "ListOffersResponse", + "description": "Response for ListOffer." + }, + "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": { + "description": "Type of offer country is eligible for.", + "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" + ] + }, + "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": { + "description": "Current response metadata.", + "$ref": "ResponseMetadata" + }, + "companies": { + "type": "array", + "items": { + "$ref": "Company" + }, + "description": "The list of companies." + } + }, + "id": "ListCompaniesResponse" + }, + "OfferCustomer": { + "description": "Customers qualified for an offer.", + "type": "object", + "properties": { + "spendXAmount": { + "description": "Formatted Spend X amount with currency code.", + "type": "string" + }, + "adwordsUrl": { + "description": "URL to the customer's AdWords page.", + "type": "string" + }, + "eligibilityDaysLeft": { + "description": "Days the customer is still eligible.", + "format": "int32", + "type": "integer" }, "offerType": { "enumDescriptions": [ @@ -3504,135 +3271,376 @@ "OFFER_TYPE_VIDEO", "OFFER_TYPE_SPEND_MATCH" ], - "description": "Type of offer.", + "description": "Type of the offer", "type": "string" }, - "maxAccountAge": { - "format": "int32", - "description": "The maximum age of an account [in days] to be eligible.", - "type": "integer" - }, - "qualifiedCustomer": { - "description": "Customers who qualify for this offer.", - "items": { - "$ref": "OfferCustomer" - }, - "type": "array" - }, - "terms": { - "description": "Terms of the offer.", + "externalCid": { + "description": "External CID for the customer.", + "format": "int64", "type": "string" }, - "showSpecialOfferCopy": { - "type": "boolean", - "description": "Should special text be shown on the offers page." - }, - "available": { - "type": "integer", - "format": "int32", - "description": "The number of codes for this offer that are available for distribution." - }, - "description": { - "description": "Description of the offer.", + "countryCode": { + "description": "Country code of the customer.", "type": "string" }, - "offerLevel": { - "enumDescriptions": [ - "Unset.", - "Users/Agencies that have no offers because of a problem.", - "Users/Agencies that have no offers due to contractural agreements.", - "Users/Agencies that have a manually-configured limit.", - "Some Agencies don't get any offers.", - "Basic level gets 5 per month.", - "Agencies with adequate AHI and spend get 15/month.", - "Badged partners (even in grace) get 50 per month." - ], - "enum": [ - "OFFER_LEVEL_UNSPECIFIED", - "OFFER_LEVEL_DENY_PROBLEM", - "OFFER_LEVEL_DENY_CONTRACT", - "OFFER_LEVEL_MANUAL", - "OFFER_LEVEL_LIMIT_0", - "OFFER_LEVEL_LIMIT_5", - "OFFER_LEVEL_LIMIT_15", - "OFFER_LEVEL_LIMIT_50" - ], - "description": "Level of this offer.", + "creationTime": { + "description": "Time the customer was created.", + "format": "google-datetime", + "type": "string" + }, + "getYAmount": { + "description": "Formatted Get Y amount with currency code.", "type": "string" }, "name": { - "description": "Name of the offer.", + "description": "Name of the customer.", + "type": "string" + } + }, + "id": "OfferCustomer" + }, + "CertificationStatus": { + "type": "object", + "properties": { + "examStatuses": { + "description": "List of certification exam statuses.", + "type": "array", + "items": { + "$ref": "CertificationExamStatus" + } + }, + "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" }, - "qualifiedCustomersComplete": { - "description": "Whether or not the list of qualified customers is definitely complete.", + "userCount": { + "description": "Number of people who are certified,", + "format": "int32", + "type": "integer" + }, + "isCertified": { + "description": "Whether certification is passing.", + "type": "boolean" + } + }, + "id": "CertificationStatus", + "description": "Google Partners certification status." + }, + "LocalizedCompanyInfo": { + "description": "The localized company information.", + "type": "object", + "properties": { + "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" + }, + "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" + } + }, + "id": "LocalizedCompanyInfo" + }, + "LogUserEventResponse": { + "type": "object", + "properties": { + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + } + }, + "id": "LogUserEventResponse", + "description": "Response message for\nLogUserEvent." + }, + "ListOffersHistoryResponse": { + "description": "Response for ListOfferHistory.", + "type": "object", + "properties": { + "canShowEntireCompany": { + "description": "True if the user has the option to show entire company history.", "type": "boolean" }, - "id": { - "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)", - "type": "object", - "properties": { - "longitude": { - "format": "double", - "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", - "type": "number" - }, - "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": { + "totalResults": { + "description": "Number of results across all pages.", "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" + }, + "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": { + "$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": { + "id": "Certification", + "description": "A user's information on a specific certification.", + "type": "object", + "properties": { + "achieved": { + "description": "Whether this certification has been achieved.", + "type": "boolean" + }, + "expiration": { + "description": "Date this certification is due to expire.", + "format": "google-datetime", + "type": "string" + }, + "warning": { + "description": "Whether this certification is in the state of warning.", + "type": "boolean" + }, + "certificationType": { + "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" + ], + "description": "The type of certification, the area of expertise." + }, + "lastAchieved": { + "type": "string", + "description": "The date the user last achieved certification.", + "format": "google-datetime" } } + }, + "User": { + "description": "A resource representing a user of the Partners platform.", + "type": "object", + "properties": { + "company": { + "$ref": "CompanyRelation", + "description": "The company that the user is associated with.\nIf not present, the user is not associated with any company." + }, + "profile": { + "$ref": "UserProfile", + "description": "The profile information of a Partners user, contains all the directly\neditable user information." + }, + "lastAccessTime": { + "description": "The most recent time the user interacted with the Partners site.\n@OutputOnly", + "format": "google-datetime", + "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" + } + }, + "primaryEmails": { + "description": "The list of emails the user has access to/can select as primary.\n@OutputOnly", + "type": "array", + "items": { + "type": "string" + } + }, + "internalId": { + "description": "The internal user ID.\nOnly available for a whitelisted set of api clients.", + "type": "string" + }, + "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" + }, + "publicProfile": { + "description": "Information about a user's external public profile outside Google Partners.", + "$ref": "PublicProfile" + }, + "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" + } + } + }, + "id": "User" + }, + "ListAnalyticsResponse": { + "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" + }, + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + }, + "analyticsSummary": { + "$ref": "AnalyticsSummary", + "description": "Aggregated information across the response's\nanalytics." + } + }, + "id": "ListAnalyticsResponse" } }, + "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": "v2", "baseUrl": "https://partners.googleapis.com/", "canonicalName": "Partners", - "servicePath": "", - "description": "Searches certified companies and creates contact leads with them, and also audits the usage of clients.", "kind": "discovery#restDescription", + "description": "Searches certified companies and creates contact leads with them, and also audits the usage of clients.", + "servicePath": "", "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" + "name": "partners" } diff --git a/etc/api/people/v1/people-api.json b/etc/api/people/v1/people-api.json index ebc8c59429..8081815a15 100644 --- a/etc/api/people/v1/people-api.json +++ b/etc/api/people/v1/people-api.json @@ -1,59 +1,1362 @@ { - "revision": "20170925", + "rootUrl": "https://people.googleapis.com/", + "ownerDomain": "google.com", + "name": "people", + "batchPath": "batch", + "title": "Google People API", + "ownerName": "Google", + "resources": { + "people": { + "resources": { + "connections": { + "methods": { + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "resourceName" + ], + "response": { + "$ref": "ListConnectionsResponse" + }, + "parameters": { + "requestMask.includeField": { + "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" + }, + "pageSize": { + "description": "The number of connections to include in the response. Valid values are\nbetween 1 and 2000, inclusive. Defaults to 100.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "syncToken": { + "location": "query", + "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" + }, + "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* 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" + }, + "sortOrder": { + "location": "query", + "enum": [ + "LAST_MODIFIED_ASCENDING", + "FIRST_NAME_ASCENDING", + "LAST_NAME_ASCENDING" + ], + "description": "The order in which the connections should be sorted. Defaults to\n`LAST_MODIFIED_ASCENDING`.", + "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" + }, + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/contacts", + "https://www.googleapis.com/auth/contacts.readonly" + ], + "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\nconnected profiles.\n\u003cbr\u003e\nThe request throws a 400 error if 'personFields' is not specified." + } + } + } + }, + "methods": { + "getBatchGet": { + "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.", + "response": { + "$ref": "GetPeopleResponse" + }, + "parameterOrder": [], + "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": { + "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* 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" + }, + "requestMask.includeField": { + "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 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", + "repeated": true, + "location": "query" + } + }, + "flatPath": "v1/people:batchGet", + "path": "v1/people:batchGet", + "id": "people.people.getBatchGet" + }, + "get": { + "flatPath": "v1/people/{peopleId}", + "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": { + "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* 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" + }, + "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" + } + } + }, + "updateContact": { + "httpMethod": "PATCH", + "parameterOrder": [ + "resourceName" + ], + "response": { + "$ref": "Person" + }, + "parameters": { + "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\n`people/`\u003cvar\u003eperson_id\u003c/var\u003e.", + "required": true, + "type": "string", + "pattern": "^people/[^/]+$", + "location": "path" + }, + "updatePersonFields": { + "location": "query", + "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* locales\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* relations\n* residences\n* skills\n* urls", + "format": "google-fieldmask", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "flatPath": "v1/people/{peopleId}:updateContact", + "id": "people.people.updateContact", + "path": "v1/{+resourceName}: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": { + "path": "v1/people:createContact", + "id": "people.people.createContact", + "request": { + "$ref": "Person" + }, + "description": "Create a new contact and return the person resource for that contact.", + "response": { + "$ref": "Person" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "The resource name of the owning person resource.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "flatPath": "v1/people:createContact" + }, + "deleteContact": { + "description": "Delete a contact person. Any non-contact data will not be deleted.", + "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" + } + } + }, + "contactGroups": { + "methods": { + "delete": { + "description": "Delete an existing contact group owned by the authenticated user by\nspecifying a contact group resource name.", + "httpMethod": "DELETE", + "parameterOrder": [ + "resourceName" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "resourceName": { + "description": "The resource name of the contact group to delete.", + "required": true, + "type": "string", + "pattern": "^contactGroups/[^/]+$", + "location": "path" + }, + "deleteContacts": { + "location": "query", + "description": "Set to true to also delete the contacts in the specified group.", + "type": "boolean" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "flatPath": "v1/contactGroups/{contactGroupsId}", + "id": "people.contactGroups.delete", + "path": "v1/{+resourceName}" + }, + "batchGet": { + "description": "Get a list of contact groups owned by the authenticated user by specifying\na list of contact group resource names.", + "response": { + "$ref": "BatchGetContactGroupsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "resourceNames": { + "description": "The resource names of the contact groups to get.", + "type": "string", + "repeated": true, + "location": "query" + }, + "maxMembers": { + "location": "query", + "description": "Specifies the maximum number of members to return for each group.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/contacts", + "https://www.googleapis.com/auth/contacts.readonly" + ], + "flatPath": "v1/contactGroups:batchGet", + "path": "v1/contactGroups:batchGet", + "id": "people.contactGroups.batchGet" + }, + "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": { + "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", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "The maximum number of resources to return.", + "format": "int32", + "type": "integer" + }, + "syncToken": { + "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", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/contacts", + "https://www.googleapis.com/auth/contacts.readonly" + ], + "flatPath": "v1/contactGroups", + "path": "v1/contactGroups", + "id": "people.contactGroups.list" + }, + "create": { + "request": { + "$ref": "CreateContactGroupRequest" + }, + "description": "Create a new contact group owned by the authenticated user.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "ContactGroup" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "flatPath": "v1/contactGroups", + "id": "people.contactGroups.create", + "path": "v1/contactGroups" + }, + "get": { + "description": "Get a specific contact group owned by the authenticated user by specifying\na contact group resource name.", + "response": { + "$ref": "ContactGroup" + }, + "parameterOrder": [ + "resourceName" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/contacts", + "https://www.googleapis.com/auth/contacts.readonly" + ], + "parameters": { + "maxMembers": { + "location": "query", + "description": "Specifies the maximum number of members to return.", + "format": "int32", + "type": "integer" + }, + "resourceName": { + "pattern": "^contactGroups/[^/]+$", + "location": "path", + "description": "The resource name of the contact group to get.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/contactGroups/{contactGroupsId}", + "path": "v1/{+resourceName}", + "id": "people.contactGroups.get" + }, + "update": { + "response": { + "$ref": "ContactGroup" + }, + "parameterOrder": [ + "resourceName" + ], + "httpMethod": "PUT", + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "flatPath": "v1/contactGroups/{contactGroupsId}", + "path": "v1/{+resourceName}", + "id": "people.contactGroups.update", + "request": { + "$ref": "UpdateContactGroupRequest" + }, + "description": "Update the name of an existing contact group owned by the authenticated\nuser." + } + }, + "resources": { + "members": { + "methods": { + "modify": { + "response": { + "$ref": "ModifyContactGroupMembersResponse" + }, + "parameterOrder": [ + "resourceName" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/contacts" + ], + "parameters": { + "resourceName": { + "description": "The resource name of the contact group to modify.", + "required": true, + "type": "string", + "pattern": "^contactGroups/[^/]+$", + "location": "path" + } + }, + "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" + } + } + } + } + } + } + }, + "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" + }, + "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" + }, + "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.", + "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": "v1", + "baseUrl": "https://people.googleapis.com/", + "servicePath": "", + "description": "Provides access to information about profiles and contacts.", + "kind": "discovery#restDescription", + "basePath": "", + "revision": "20171211", "documentationLink": "https://developers.google.com/people/", "id": "people:v1", "discoveryVersion": "v1", "version_module": true, "schemas": { - "BraggingRights": { - "description": "A person's bragging rights.", + "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.\n**DEPRECATED** (Message will not be returned.)", + "type": "object", + "properties": { + "metadata": { + "description": "Metadata about the interest.", + "$ref": "FieldMetadata" + }, + "value": { + "description": "The interest; for example, `stargazing`.", + "type": "string" + } + }, + "id": "Interest" + }, + "Nickname": { + "description": "A person's nickname.", "type": "object", "properties": { "metadata": { "$ref": "FieldMetadata", - "description": "Metadata about the bragging rights." + "description": "Metadata about the nickname." }, + "type": { + "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.`" + ], + "enum": [ + "DEFAULT", + "MAIDEN_NAME", + "INITIALS", + "GPLUS", + "OTHER_NAME" + ] + }, + "value": { + "description": "The nickname.", + "type": "string" + } + }, + "id": "Nickname" + }, + "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": { + "properties": { + "metadata": { + "description": "Metadata about the skill.", + "$ref": "FieldMetadata" + }, + "value": { + "description": "The skill; for example, `underwater basket weaving`.", + "type": "string" + } + }, + "id": "Skill", + "description": "A skill that the person has.", + "type": "object" + }, + "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" + }, + "Tagline": { + "properties": { + "value": { + "description": "The tagline.", + "type": "string" + }, + "metadata": { + "description": "Metadata about the tagline.", + "$ref": "FieldMetadata" + } + }, + "id": "Tagline", + "description": "A read-only brief one-line description of the person.", + "type": "object" + }, + "Name": { + "description": "A person's name. If the name is a mononym, the family name is empty.", + "type": "object", + "properties": { + "honorificPrefix": { + "description": "The honorific prefixes, such as `Mrs.` or `Dr.`", + "type": "string" + }, + "phoneticHonorificSuffix": { + "description": "The honorific suffixes spelled as they sound.", + "type": "string" + }, + "givenName": { + "description": "The given name.", + "type": "string" + }, + "middleName": { + "description": "The middle name(s).", + "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" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the name." + }, + "phoneticMiddleName": { + "description": "The middle name(s) spelled as they sound.", + "type": "string" + }, + "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" + } + }, + "id": "Name" + }, + "Locale": { + "description": "A person's locale preference.", + "type": "object", + "properties": { + "value": { + "description": "The well-formed [IETF BCP 47](https://tools.ietf.org/html/bcp47)\nlanguage tag representing the locale.", + "type": "string" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the locale." + } + }, + "id": "Locale" + }, + "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" + }, + "UserDefined": { + "description": "Arbitrary user data that is populated by the end users.", + "type": "object", + "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" + }, + "Biography": { + "description": "A person's short biography.", + "type": "object", + "properties": { + "metadata": { + "description": "Metadata about the biography.", + "$ref": "FieldMetadata" + }, + "value": { + "description": "The short biography.", + "type": "string" + }, + "contentType": { + "description": "The content type of the biography.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "Plain text.", + "HTML text." + ], + "enum": [ + "CONTENT_TYPE_UNSPECIFIED", + "TEXT_PLAIN", + "TEXT_HTML" + ] + } + }, + "id": "Biography" + }, + "FieldMetadata": { + "properties": { + "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" + }, + "primary": { + "description": "True if the field is the primary field; false if the field is a secondary\nfield.", + "type": "boolean" + } + }, + "id": "FieldMetadata", + "description": "Metadata about a field.", + "type": "object" + }, + "Source": { + "description": "The source of a field.", + "type": "object", + "properties": { + "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" + }, + "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": { + "description": "**Only populated in `person.metadata.sources`.**\n\nMetadata about a source of type PROFILE.", + "$ref": "ProfileMetadata" + } + }, + "id": "Source" + }, + "RelationshipInterest": { + "description": "A person's read-only relationship interest .", + "type": "object", + "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" + }, + "GetPeopleResponse": { + "type": "object", + "properties": { + "responses": { + "description": "The response for each requested resource name.", + "type": "array", + "items": { + "$ref": "PersonResponse" + } + } + }, + "id": "GetPeopleResponse" + }, + "PhoneNumber": { + "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 `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" + } + }, + "id": "PhoneNumber", + "description": "A person's phone number.", + "type": "object" + }, + "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": { + "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": { + "description": "Metadata about the photo.", + "$ref": "FieldMetadata" + }, + "default": { + "description": "True if the photo is a default photo;\nfalse if the photo is a user-provided photo.", + "type": "boolean" + } + }, + "id": "Photo" + }, + "ListConnectionsResponse": { + "properties": { + "nextPageToken": { + "description": "The token that can be used to retrieve the next page of results.", + "type": "string" + }, + "connections": { + "description": "The list of people that the requestor is connected to.", + "type": "array", + "items": { + "$ref": "Person" + } + }, + "nextSyncToken": { + "description": "The token that can be used to retrieve changes since the last request.", + "type": "string" + }, + "totalItems": { + "description": "The total number of items in the list without pagination.", + "format": "int32", + "type": "integer" + }, + "totalPeople": { + "description": "**DEPRECATED** (Please use totalItems)\nThe total number of people in the list without pagination.", + "format": "int32", + "type": "integer" + } + }, + "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": { + "metadata": { + "description": "Metadata about the birthday.", + "$ref": "FieldMetadata" + }, + "text": { + "description": "A free-form string representing the user's birthday.", + "type": "string" + }, + "date": { + "$ref": "Date", + "description": "The date of the birthday." + } + }, + "id": "Birthday" + }, + "CreateContactGroupRequest": { + "description": "A request to create a new contact group.", + "type": "object", + "properties": { + "contactGroup": { + "$ref": "ContactGroup", + "description": "The contact group to create." + } + }, + "id": "CreateContactGroupRequest" + }, + "Address": { + "description": "A person's physical address. May be a P.O. box or street address. All fields\nare optional.", + "type": "object", + "properties": { + "countryCode": { + "description": "The [ISO 3166-1 alpha-2](http://www.iso.org/iso/country_codes.htm) country\ncode of the address.", + "type": "string" + }, + "formattedType": { + "description": "The read-only type of the address translated and formatted in the viewer's\naccount locale or the `Accept-Language` HTTP header locale.", + "type": "string" + }, + "city": { + "description": "The city of the address.", + "type": "string" + }, + "formattedValue": { + "description": "The unstructured value of the address. If this is not set by the user it\nwill be automatically constructed from structured values.", + "type": "string" + }, + "country": { + "description": "The country of the address.", + "type": "string" + }, + "type": { + "description": "The type of the 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" + }, + "extendedAddress": { + "description": "The extended address of the address; for example, the apartment number.", + "type": "string" + }, + "poBox": { + "description": "The P.O. box of the address.", + "type": "string" + }, + "postalCode": { + "description": "The postal code of the address.", + "type": "string" + }, + "region": { + "description": "The region of the address; for example, the state or province.", + "type": "string" + }, + "streetAddress": { + "description": "The street address.", + "type": "string" + }, + "metadata": { + "description": "Metadata about the address.", + "$ref": "FieldMetadata" + } + }, + "id": "Address" + }, + "ContactGroupMembership": { + "description": "A Google contact group membership.", + "type": "object", + "properties": { + "contactGroupId": { + "description": "The contact group ID for the contact group membership. The contact group\nID can be custom or predefined. Possible values include, but are not\nlimited to, the following:\n\n* `myContacts`\n* `starred`\n* A numerical ID for user-created groups.", + "type": "string" + } + }, + "id": "ContactGroupMembership" + }, + "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.", + "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", + "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": { + "description": "The read-only metadata about a person.", + "type": "object", + "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", + "items": { + "$ref": "Source" + } + }, + "previousResourceNames": { + "description": "Any former resource names this person has had. Populated only for\n[`connections.list`](/people/api/rest/v1/people.connections/list) requests\nthat include a sync token.\n\nThe resource name may change when adding or removing fields that link a\ncontact and profile such as a verified email, verified phone number, or\nprofile URL.", + "type": "array", + "items": { + "type": "string" + } + }, + "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" + } + }, + "id": "PersonMetadata" + }, + "ModifyContactGroupMembersRequest": { + "properties": { + "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" + } + }, + "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" + } + } + }, + "id": "ModifyContactGroupMembersRequest", + "description": "A request to modify an existing contact group's members.", + "type": "object" + }, + "ContactGroupResponse": { + "description": "The response for a specific contact group.", + "type": "object", + "properties": { + "requestedResourceName": { + "description": "The original requested resource name.", + "type": "string" + }, + "contactGroup": { + "$ref": "ContactGroup", + "description": "The contact group." + }, + "status": { + "$ref": "Status", + "description": "The status of the response." + } + }, + "id": "ContactGroupResponse" + }, + "Url": { + "description": "A person's associated URLs.", + "type": "object", + "properties": { + "value": { + "description": "The URL.", + "type": "string" + }, + "formattedType": { + "description": "The read-only type of the URL translated and formatted in the viewer's\naccount locale or the `Accept-Language` HTTP header locale.", + "type": "string" + }, + "metadata": { + "description": "Metadata about the URL.", + "$ref": "FieldMetadata" + }, + "type": { + "description": "The type of the URL. The type can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `home`\n* `work`\n* `blog`\n* `profile`\n* `homePage`\n* `ftp`\n* `reservations`\n* `appInstallPage`: website for a Google+ application.\n* `other`", + "type": "string" + } + }, + "id": "Url" + }, + "ImClient": { + "description": "A person's instant messaging client.", + "type": "object", + "properties": { + "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" + }, + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the IM client." + }, + "type": { + "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.", + "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.", + "type": "string" + }, + "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" + } + }, + "id": "ImClient" + }, + "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" + }, + "Membership": { + "description": "A person's read-only membership in a group.", + "type": "object", + "properties": { + "metadata": { + "description": "Metadata about the membership.", + "$ref": "FieldMetadata" + }, + "contactGroupMembership": { + "$ref": "ContactGroupMembership", + "description": "The contact group membership." + }, + "domainMembership": { + "$ref": "DomainMembership", + "description": "The domain membership." + } + }, + "id": "Membership" + }, + "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" + }, + "RelationshipStatus": { + "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", + "description": "A person's read-only relationship status.", + "type": "object" + }, + "BraggingRights": { + "description": "A person's bragging rights.", + "type": "object", + "properties": { "value": { "description": "The bragging rights; for example, `climbed mount everest`.", "type": "string" + }, + "metadata": { + "description": "Metadata about the bragging rights.", + "$ref": "FieldMetadata" } }, "id": "BraggingRights" }, "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" - }, - "type": { - "description": "The type of the organization. The type can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `work`\n* `school`", - "type": "string" - }, - "jobDescription": { - "description": "The person's job description at the organization.", - "type": "string" - }, "endDate": { "$ref": "Date", "description": "The end date when the person left the organization." @@ -77,15 +1380,57 @@ "location": { "description": "The location of the organization office the person works at.", "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.", + "type": "string" + }, + "type": { + "description": "The type of the organization. The type can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `work`\n* `school`", + "type": "string" + }, + "phoneticName": { + "description": "The phonetic name of the organization.", + "type": "string" + }, + "jobDescription": { + "description": "The person's job description at the organization.", + "type": "string" } }, - "id": "Organization", - "description": "A person's past or current organization. Overlapping date ranges are\npermitted.", - "type": "object" + "id": "Organization" }, "AgeRangeType": { + "description": "A person's age range.", + "type": "object", "properties": { + "metadata": { + "$ref": "FieldMetadata", + "description": "Metadata about the age range." + }, "ageRange": { + "enumDescriptions": [ + "Unspecified.", + "Younger than eighteen.", + "Between eighteen and twenty.", + "Twenty-one and older." + ], "enum": [ "AGE_RANGE_UNSPECIFIED", "LESS_THAN_EIGHTEEN", @@ -93,26 +1438,12 @@ "TWENTY_ONE_OR_OLDER" ], "description": "The age range.", - "type": "string", - "enumDescriptions": [ - "Unspecified.", - "Younger than eighteen.", - "Between eighteen and twenty.", - "Twenty-one and older." - ] - }, - "metadata": { - "description": "Metadata about the age range.", - "$ref": "FieldMetadata" + "type": "string" } }, - "id": "AgeRangeType", - "description": "A person's age range.", - "type": "object" + "id": "AgeRangeType" }, "ListContactGroupsResponse": { - "description": "The response to a list contact groups request.", - "type": "object", "properties": { "contactGroups": { "description": "The list of contact groups. Members of the contact groups are not\npopulated.", @@ -135,12 +1466,22 @@ "type": "string" } }, - "id": "ListContactGroupsResponse" + "id": "ListContactGroupsResponse", + "description": "The response to a list contact groups request.", + "type": "object" }, "PersonResponse": { "description": "The response for a single person", "type": "object", "properties": { + "person": { + "description": "The person.", + "$ref": "Person" + }, + "status": { + "$ref": "Status", + "description": "The status of the response." + }, "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", @@ -149,28 +1490,14 @@ "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" - }, - "status": { - "description": "The status of the response.", - "$ref": "Status" } }, "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" @@ -178,23 +1505,29 @@ "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": { + "$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" } }, - "id": "Relation", - "description": "A person's relation to another person.", - "type": "object" + "id": "Relation" }, "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" @@ -203,6 +1536,28 @@ "description": "A contact group.", "type": "object", "properties": { + "etag": { + "description": "The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the\nresource. Used for web cache validation.", + "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" + }, + "groupType": { + "enum": [ + "GROUP_TYPE_UNSPECIFIED", + "USER_CONTACT_GROUP", + "SYSTEM_CONTACT_GROUP" + ], + "description": "The read-only contact group type.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "User defined contact group.", + "System defined contact group." + ] + }, "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", @@ -214,40 +1569,18 @@ "description": "The contact group name set by the group owner or a system provided name\nfor system groups.", "type": "string" }, + "metadata": { + "description": "Metadata about the contact group.", + "$ref": "ContactGroupMetadata" + }, "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" @@ -256,167 +1589,6 @@ "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": { - "birthdays": { - "description": "The person's birthdays.", - "type": "array", - "items": { - "$ref": "Birthday" - } - }, - "userDefined": { - "description": "The person's user defined data.", - "type": "array", - "items": { - "$ref": "UserDefined" - } - }, - "locales": { - "description": "The person's locale preferences.", - "type": "array", - "items": { - "$ref": "Locale" - } - }, - "relationshipInterests": { - "description": "The person's read-only relationship interests.", - "type": "array", - "items": { - "$ref": "RelationshipInterest" - } - }, - "urls": { - "description": "The person's associated URLs.", - "type": "array", - "items": { - "$ref": "Url" - } - }, - "nicknames": { - "description": "The person's nicknames.", - "type": "array", - "items": { - "$ref": "Nickname" - } - }, - "names": { - "description": "The person's names.", - "type": "array", - "items": { - "$ref": "Name" - } - }, - "relations": { - "description": "The person's relations.", - "type": "array", - "items": { - "$ref": "Relation" - } - }, - "occupations": { - "description": "The person's occupations.", - "type": "array", - "items": { - "$ref": "Occupation" - } - }, - "emailAddresses": { - "description": "The person's email addresses.", - "type": "array", - "items": { - "$ref": "EmailAddress" - } - }, - "organizations": { - "description": "The person's past or current organizations.", - "type": "array", - "items": { - "$ref": "Organization" - } - }, - "etag": { - "description": "The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the\nresource. Used for web cache validation.", - "type": "string" - }, - "braggingRights": { - "description": "The person's bragging rights.", - "type": "array", - "items": { - "$ref": "BraggingRights" - } - }, - "metadata": { - "description": "Read-only metadata about the person.", - "$ref": "PersonMetadata" - }, - "residences": { - "description": "The person's residences.", - "type": "array", - "items": { - "$ref": "Residence" - } - }, - "genders": { - "description": "The person's genders.", - "type": "array", - "items": { - "$ref": "Gender" - } - }, - "interests": { - "description": "The person's interests.", - "type": "array", - "items": { - "$ref": "Interest" - } - }, - "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\n`people/`\u003cvar\u003eperson_id\u003c/var\u003e.", - "type": "string" - }, - "biographies": { - "description": "The person's biographies.", - "type": "array", - "items": { - "$ref": "Biography" - } - }, - "skills": { - "description": "The person's skills.", - "type": "array", - "items": { - "$ref": "Skill" - } - }, - "relationshipStatuses": { - "description": "The person's read-only relationship statuses.", - "type": "array", - "items": { - "$ref": "RelationshipStatus" - } - }, - "photos": { - "description": "The person's read-only photos.", - "type": "array", - "items": { - "$ref": "Photo" - } - }, - "ageRange": { - "enumDescriptions": [ - "Unspecified.", - "Younger than eighteen.", - "Between eighteen and twenty.", - "Twenty-one and older." - ], - "enum": [ - "AGE_RANGE_UNSPECIFIED", - "LESS_THAN_EIGHTEEN", - "EIGHTEEN_TO_TWENTY", - "TWENTY_ONE_OR_OLDER" - ], - "description": "**DEPRECATED** (Please use `person.ageRanges` instead)**\n\nThe person's read-only age range.", - "type": "string" - }, "taglines": { "description": "The person's read-only taglines.", "type": "array", @@ -472,22 +1644,185 @@ "items": { "$ref": "ImClient" } + }, + "birthdays": { + "description": "The person's birthdays.", + "type": "array", + "items": { + "$ref": "Birthday" + } + }, + "userDefined": { + "description": "The person's user defined data.", + "type": "array", + "items": { + "$ref": "UserDefined" + } + }, + "locales": { + "description": "The person's locale preferences.", + "type": "array", + "items": { + "$ref": "Locale" + } + }, + "relationshipInterests": { + "description": "The person's read-only relationship interests.", + "type": "array", + "items": { + "$ref": "RelationshipInterest" + } + }, + "urls": { + "description": "The person's associated URLs.", + "type": "array", + "items": { + "$ref": "Url" + } + }, + "nicknames": { + "description": "The person's nicknames.", + "type": "array", + "items": { + "$ref": "Nickname" + } + }, + "relations": { + "description": "The person's relations.", + "type": "array", + "items": { + "$ref": "Relation" + } + }, + "names": { + "description": "The person's names.", + "type": "array", + "items": { + "$ref": "Name" + } + }, + "occupations": { + "description": "The person's occupations.", + "type": "array", + "items": { + "$ref": "Occupation" + } + }, + "emailAddresses": { + "description": "The person's email addresses.", + "type": "array", + "items": { + "$ref": "EmailAddress" + } + }, + "organizations": { + "description": "The person's past or current organizations.", + "type": "array", + "items": { + "$ref": "Organization" + } + }, + "etag": { + "description": "The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the\nresource. Used for web cache validation.", + "type": "string" + }, + "braggingRights": { + "description": "The person's bragging rights.", + "type": "array", + "items": { + "$ref": "BraggingRights" + } + }, + "metadata": { + "$ref": "PersonMetadata", + "description": "Read-only metadata about the person." + }, + "residences": { + "description": "The person's residences.", + "type": "array", + "items": { + "$ref": "Residence" + } + }, + "genders": { + "description": "The person's genders.", + "type": "array", + "items": { + "$ref": "Gender" + } + }, + "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\n`people/`\u003cvar\u003eperson_id\u003c/var\u003e.", + "type": "string" + }, + "interests": { + "description": "The person's interests.\n**DEPRECATED** (No values will be returned.)", + "type": "array", + "items": { + "$ref": "Interest" + } + }, + "biographies": { + "description": "The person's biographies.", + "type": "array", + "items": { + "$ref": "Biography" + } + }, + "skills": { + "description": "The person's skills.", + "type": "array", + "items": { + "$ref": "Skill" + } + }, + "relationshipStatuses": { + "description": "The person's read-only relationship statuses.", + "type": "array", + "items": { + "$ref": "RelationshipStatus" + } + }, + "photos": { + "description": "The person's read-only photos.", + "type": "array", + "items": { + "$ref": "Photo" + } + }, + "ageRange": { + "enumDescriptions": [ + "Unspecified.", + "Younger than eighteen.", + "Between eighteen and twenty.", + "Twenty-one and older." + ], + "enum": [ + "AGE_RANGE_UNSPECIFIED", + "LESS_THAN_EIGHTEEN", + "EIGHTEEN_TO_TWENTY", + "TWENTY_ONE_OR_OLDER" + ], + "description": "**DEPRECATED** (Please use `person.ageRanges` instead)**\n\nThe person's read-only age range.", + "type": "string" } }, "id": "Person" }, "UpdateContactGroupRequest": { + "description": "A request to update an existing contact group. Only the name can be updated.", + "type": "object", "properties": { "contactGroup": { - "description": "The contact group to update.", - "$ref": "ContactGroup" + "$ref": "ContactGroup", + "description": "The contact group to update." } }, - "id": "UpdateContactGroupRequest", - "description": "A request to update an existing contact group. Only the name can be updated.", - "type": "object" + "id": "UpdateContactGroupRequest" }, "ContactGroupMetadata": { + "description": "The read-only metadata about a contact group.", + "type": "object", "properties": { "updateTime": { "description": "The time the group was last updated.", @@ -499,17 +1834,15 @@ "type": "boolean" } }, - "id": "ContactGroupMetadata", - "description": "The read-only metadata about a contact group.", - "type": "object" + "id": "ContactGroupMetadata" }, "Residence": { "description": "A person's past or current residence.", "type": "object", "properties": { "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the residence." + "description": "Metadata about the residence.", + "$ref": "FieldMetadata" }, "current": { "description": "True if the residence is the person's current residence;\nfalse if the residence is a past residence.", @@ -526,9 +1859,13 @@ "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" + "$ref": "FieldMetadata", + "description": "Metadata about the event." }, "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`", @@ -537,10 +1874,6 @@ "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" @@ -578,12 +1911,6 @@ ] }, "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": { @@ -594,14 +1921,18 @@ "GOOGLE_APPS_USER" ], "type": "string" - } + }, + "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." + ] } }, "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`", @@ -612,785 +1943,13 @@ "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.", + "description": "Metadata about the gender.", "$ref": "FieldMetadata" } }, - "id": "UserDefined", - "description": "Arbitrary user data that is populated by the end users.", + "id": "Gender", + "description": "A person's gender.", "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.", - "type": "array", - "items": { - "$ref": "PersonResponse" - } - } - }, - "id": "GetPeopleResponse", - "type": "object" - }, - "PhoneNumber": { - "description": "A person's phone number.", - "type": "object", - "properties": { - "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 `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": { - "properties": { - "nextPageToken": { - "description": "The token that can be used to retrieve the next page of results.", - "type": "string" - }, - "connections": { - "description": "The list of people that the requestor is connected to.", - "type": "array", - "items": { - "$ref": "Person" - } - }, - "nextSyncToken": { - "description": "The token that can be used to retrieve changes since the last request.", - "type": "string" - }, - "totalItems": { - "description": "The total number of items in the list without pagination.", - "format": "int32", - "type": "integer" - }, - "totalPeople": { - "description": "**DEPRECATED** (Please use totalItems)\nThe total number of people in the list without pagination.", - "format": "int32", - "type": "integer" - } - }, - "id": "ListConnectionsResponse", - "type": "object" - }, - "Birthday": { - "properties": { - "date": { - "description": "The date of the birthday.", - "$ref": "Date" - }, - "metadata": { - "$ref": "FieldMetadata", - "description": "Metadata about the birthday." - }, - "text": { - "description": "A free-form string representing the user's birthday.", - "type": "string" - } - }, - "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" - }, - "CreateContactGroupRequest": { - "description": "A request to create a new contact group.", - "type": "object", - "properties": { - "contactGroup": { - "description": "The contact group to create.", - "$ref": "ContactGroup" - } - }, - "id": "CreateContactGroupRequest" - }, - "Address": { - "description": "A person's physical address. May be a P.O. box or street address. All fields\nare optional.", - "type": "object", - "properties": { - "poBox": { - "description": "The P.O. box of the address.", - "type": "string" - }, - "postalCode": { - "description": "The postal code of the address.", - "type": "string" - }, - "region": { - "description": "The region of the address; for example, the state or province.", - "type": "string" - }, - "streetAddress": { - "description": "The street address.", - "type": "string" - }, - "metadata": { - "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.", - "type": "string" - }, - "formattedType": { - "description": "The read-only type of the address translated and formatted in the viewer's\naccount locale or the `Accept-Language` HTTP header locale.", - "type": "string" - }, - "city": { - "description": "The city of the address.", - "type": "string" - }, - "formattedValue": { - "description": "The unstructured value of the address. If this is not set by the user it\nwill be automatically constructed from structured values.", - "type": "string" - }, - "country": { - "description": "The country of the address.", - "type": "string" - }, - "type": { - "description": "The type of the 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" - }, - "extendedAddress": { - "description": "The extended address of the address; for example, the apartment number.", - "type": "string" - } - }, - "id": "Address" - }, - "ContactGroupMembership": { - "description": "A Google contact group membership.", - "type": "object", - "properties": { - "contactGroupId": { - "description": "The contact group ID for the contact group membership. The contact group\nID can be custom or predefined. Possible values include, but are not\nlimited to, the following:\n\n* `myContacts`\n* `starred`\n* A numerical ID for user-created groups.", - "type": "string" - } - }, - "id": "ContactGroupMembership" - }, - "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.", - "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", - "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", - "items": { - "$ref": "Source" - } - }, - "previousResourceNames": { - "description": "Any former resource names this person has had. Populated only for\n[`connections.list`](/people/api/rest/v1/people.connections/list) requests\nthat include a sync token.\n\nThe resource name may change when adding or removing fields that link a\ncontact and profile such as a verified email, verified phone number, or\nprofile URL.", - "type": "array", - "items": { - "type": "string" - } - }, - "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" - } - }, - "id": "PersonMetadata", - "description": "The read-only metadata about a person.", - "type": "object" - }, - "ModifyContactGroupMembersRequest": { - "properties": { - "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": "ModifyContactGroupMembersRequest", - "description": "A request to modify an existing contact group's members.", - "type": "object" - }, - "ContactGroupResponse": { - "properties": { - "requestedResourceName": { - "description": "The original requested resource name.", - "type": "string" - }, - "contactGroup": { - "description": "The contact group.", - "$ref": "ContactGroup" - }, - "status": { - "$ref": "Status", - "description": "The status of the response." - } - }, - "id": "ContactGroupResponse", - "description": "The response for a specific contact group.", - "type": "object" - }, - "Url": { - "properties": { - "metadata": { - "description": "Metadata about the URL.", - "$ref": "FieldMetadata" - }, - "type": { - "description": "The type of the URL. The type can be custom or predefined.\nPossible values include, but are not limited to, the following:\n\n* `home`\n* `work`\n* `blog`\n* `profile`\n* `homePage`\n* `ftp`\n* `reservations`\n* `appInstallPage`: website for a Google+ application.\n* `other`", - "type": "string" - }, - "value": { - "description": "The URL.", - "type": "string" - }, - "formattedType": { - "description": "The read-only type of the URL translated and formatted in the viewer's\naccount locale or the `Accept-Language` HTTP header locale.", - "type": "string" - } - }, - "id": "Url", - "description": "A person's associated URLs.", - "type": "object" - }, - "ImClient": { - "description": "A person's instant messaging client.", - "type": "object", - "properties": { - "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" - }, - "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": { - "description": "Metadata about the IM client.", - "$ref": "FieldMetadata" - }, - "type": { - "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" - }, - "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" - }, - "username": { - "description": "The user name used in the IM client.", - "type": "string" - } - }, - "id": "ImClient" - }, - "DomainMembership": { - "properties": { - "inViewerDomain": { - "description": "True if the person is in the viewer's Google Apps domain.", - "type": "boolean" - } - }, - "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": { - "$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" } }, "icons": { @@ -1402,6 +1961,12 @@ "auth": { "oauth2": { "scopes": { + "https://www.googleapis.com/auth/user.birthday.read": { + "description": "View your complete date of birth" + }, + "https://www.googleapis.com/auth/contacts.readonly": { + "description": "View your contacts" + }, "https://www.googleapis.com/auth/plus.login": { "description": "Know the list of people in your circles, your age range, and language" }, @@ -1417,578 +1982,13 @@ "https://www.googleapis.com/auth/user.addresses.read": { "description": "View your street addresses" }, - "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" - }, - "https://www.googleapis.com/auth/contacts.readonly": { - "description": "View your contacts" + "https://www.googleapis.com/auth/user.phonenumbers.read": { + "description": "View your phone numbers" } } } - }, - "rootUrl": "https://people.googleapis.com/", - "ownerDomain": "google.com", - "name": "people", - "batchPath": "batch", - "title": "Google People API", - "ownerName": "Google", - "resources": { - "people": { - "methods": { - "getBatchGet": { - "httpMethod": "GET", - "parameterOrder": [], - "response": { - "$ref": "GetPeopleResponse" - }, - "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": "**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": { - "repeated": true, - "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": [ - "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" - ], - "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": { - "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": [ - "LAST_MODIFIED_ASCENDING", - "FIRST_NAME_ASCENDING", - "LAST_NAME_ASCENDING" - ], - "description": "The order in which the connections should be sorted. Defaults to\n`LAST_MODIFIED_ASCENDING`.", - "type": "string" - }, - "requestSyncToken": { - "description": "Whether the response should include a sync token, which can be used to get\nall changes since the last request.", - "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" - }, - "pageSize": { - "location": "query", - "description": "The number of connections to include in the response. Valid values are\nbetween 1 and 2000, inclusive. Defaults to 100.", - "format": "int32", - "type": "integer" - }, - "requestMask.includeField": { - "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" - ], - "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" - } - } - } - } - } - } - }, - "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": { - "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" - }, - "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" - }, - "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" - }, - "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://people.googleapis.com/", - "kind": "discovery#restDescription", - "description": "Provides access to information about profiles and contacts.", - "servicePath": "", - "basePath": "" + } } diff --git a/etc/api/plus/v1/plus-api.json b/etc/api/plus/v1/plus-api.json index 13f4eb82ce..ac7e1fb078 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/e5EzALeRN0V4G9pDZ9NMnYZoVEo\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/_-wHHBOc4xeuo22Q1pblI2Gv-vs\"", "discoveryVersion": "v1", "id": "plus:v1", "name": "plus", "version": "v1", - "revision": "20170828", + "revision": "20171030", "title": "Google+ API", "description": "Builds on top of the Google+ platform.", "ownerDomain": "google.com", diff --git a/etc/api/plusdomains/v1/plusdomains-api.json b/etc/api/plusdomains/v1/plusdomains-api.json index 2ff097a310..dc99c5adf6 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/mgTNhRz8BUIUTZvlG4NGzgfWt2o\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Vo5c3NDWXSr5mx5IDaATqckEqqM\"", "discoveryVersion": "v1", "id": "plusDomains:v1", "name": "plusDomains", "version": "v1", - "revision": "20170828", + "revision": "20171030", "title": "Google+ Domains API", "description": "Builds on top of the Google+ platform for Google Apps Domains.", "ownerDomain": "google.com", diff --git a/etc/api/poly/v1/poly-api.json b/etc/api/poly/v1/poly-api.json new file mode 100644 index 0000000000..913f083788 --- /dev/null +++ b/etc/api/poly/v1/poly-api.json @@ -0,0 +1,588 @@ +{ + "ownerName": "Google", + "resources": { + "users": { + "resources": { + "likedassets": { + "methods": { + "list": { + "response": { + "$ref": "ListLikedAssetsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "location": "path", + "description": "A valid user id. Currently, only the special value 'me', representing the\ncurrently-authenticated user is supported. To use 'me', you must pass\nan OAuth token with the request.", + "required": true, + "type": "string", + "pattern": "^users/[^/]+$" + }, + "orderBy": { + "location": "query", + "description": "Specifies an ordering for assets. Acceptable values are:\n`BEST`, `NEWEST`, `OLDEST`, 'LIKED_TIME'. Defaults to `LIKED_TIME`, which\nranks assets based on how recently they were liked.", + "type": "string" + }, + "pageToken": { + "description": "Specifies a continuation token from a previous search whose results were\nsplit into multiple pages. To get the next page, submit the same request\nspecifying the value from\nnext_page_token.", + "type": "string", + "location": "query" + }, + "pageSize": { + "description": "The maximum number of assets to be returned. This value must be between `1`\nand `100`. Defaults to `20`.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "format": { + "description": "Return only assets with the matching format. Acceptable values are:\n`BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, `TILT`.", + "type": "string", + "location": "query" + } + }, + "flatPath": "v1/users/{usersId}/likedassets", + "path": "v1/{+name}/likedassets", + "id": "poly.users.likedassets.list", + "description": "Lists assets that the user has liked. Only the value 'me', representing\nthe currently-authenticated user, is supported. May include assets with an\naccess level of UNLISTED." + } + } + }, + "assets": { + "methods": { + "list": { + "description": "Lists assets authored by the given user. Only the value 'me', representing\nthe currently-authenticated user, is supported. May include assets with an\naccess level of PRIVATE or\nUNLISTED and assets which are\nAll Rights Reserved for the\ncurrently-authenticated user.", + "response": { + "$ref": "ListUserAssetsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "pageSize": { + "location": "query", + "description": "The maximum number of assets to be returned. This value must be between `1`\nand `100`. Defaults to `20`.", + "format": "int32", + "type": "integer" + }, + "visibility": { + "enum": [ + "VISIBILITY_UNSPECIFIED", + "PUBLISHED", + "PRIVATE" + ], + "description": "The visibility of the assets to be returned.\nDefaults to VISIBILITY_UNSPECIFIED which returns all assets.", + "type": "string", + "location": "query" + }, + "name": { + "pattern": "^users/[^/]+$", + "location": "path", + "description": "A valid user id. Currently, only the special value 'me', representing the\ncurrently-authenticated user is supported. To use 'me', you must pass\nan OAuth token with the request.", + "required": true, + "type": "string" + }, + "orderBy": { + "description": "Specifies an ordering for assets. Acceptable values are:\n`BEST`, `NEWEST`, `OLDEST`. Defaults to `BEST`, which ranks assets\nbased on a combination of popularity and other features.", + "type": "string", + "location": "query" + }, + "format": { + "description": "Return only assets with the matching format. Acceptable values are:\n`BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, and `TILT`.", + "type": "string", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "Specifies a continuation token from a previous search whose results were\nsplit into multiple pages. To get the next page, submit the same request\nspecifying the value from\nnext_page_token.", + "type": "string" + } + }, + "flatPath": "v1/users/{usersId}/assets", + "path": "v1/{+name}/assets", + "id": "poly.users.assets.list" + } + } + } + } + }, + "assets": { + "methods": { + "get": { + "response": { + "$ref": "Asset" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "pattern": "^assets/[^/]+$", + "location": "path", + "description": "Required. An asset's name in the form `assets/{ASSET_ID}`.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/assets/{assetsId}", + "path": "v1/{+name}", + "id": "poly.assets.get", + "description": "Returns detailed information about an asset given its name.\nPRIVATE assets are returned only if\n the currently authenticated user (via OAuth token) is the author of the asset." + }, + "list": { + "description": "Lists all public, remixable assets. These are assets with an access level of\nPUBLIC and published under the\nCC-By license.", + "httpMethod": "GET", + "response": { + "$ref": "ListAssetsResponse" + }, + "parameterOrder": [], + "parameters": { + "keywords": { + "location": "query", + "description": "One or more search terms to be matched against all text that Poly has\nindexed for assets, which includes display_name,\ndescription, and tags. Multiple keywords should be\nseparated by spaces.", + "type": "string" + }, + "orderBy": { + "location": "query", + "description": "Specifies an ordering for assets. Acceptable values are:\n`BEST`, `NEWEST`, `OLDEST`. Defaults to `BEST`, which ranks assets\nbased on a combination of popularity and other features.", + "type": "string" + }, + "format": { + "description": "Return only assets with the matching format. Acceptable values are:\n`BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, `TILT`.", + "type": "string", + "location": "query" + }, + "curated": { + "description": "Return only assets that have been curated by the Poly team.", + "type": "boolean", + "location": "query" + }, + "category": { + "location": "query", + "description": "Filter assets based on the specified category. Supported values are:\n`animals`, `architecture`, `art`, `food`, `nature`, `objects`, `people`, `scenes`,\n`technology`, and `transport`.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "Specifies a continuation token from a previous search whose results were\nsplit into multiple pages. To get the next page, submit the same request\nspecifying the value from next_page_token.", + "type": "string" + }, + "maxComplexity": { + "enum": [ + "COMPLEXITY_UNSPECIFIED", + "COMPLEX", + "MEDIUM", + "SIMPLE" + ], + "description": "Returns assets that are of the specified complexity or less. Defaults to\nCOMPLEX. For example, a request for\nMEDIUM assets also includes\nSIMPLE assets.", + "type": "string", + "location": "query" + }, + "pageSize": { + "description": "The maximum number of assets to be returned. This value must be between `1`\nand `100`. Defaults to `20`.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "flatPath": "v1/assets", + "id": "poly.assets.list", + "path": "v1/assets" + } + } + } + }, + "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": { + "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": { + "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": { + "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.", + "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" + } + }, + "version": "v1", + "baseUrl": "https://poly.googleapis.com/", + "servicePath": "", + "description": "The Poly API provides read-only access to assets hosted on \u003ca href=\"https://poly.google.com\"\u003epoly.google.com\u003c/a\u003e.\n", + "kind": "discovery#restDescription", + "basePath": "", + "revision": "20171209", + "documentationLink": "https://developers.google.com/poly/", + "id": "poly:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "Quaternion": { + "properties": { + "y": { + "description": "The y component.", + "format": "double", + "type": "number" + }, + "x": { + "description": "The x component.", + "format": "double", + "type": "number" + }, + "z": { + "description": "The z component.", + "format": "double", + "type": "number" + }, + "w": { + "description": "The scalar component.", + "format": "double", + "type": "number" + } + }, + "id": "Quaternion", + "description": "A [Quaternion](//en.wikipedia.org/wiki/Quaternion). Please note: if in the\nresponse you see \"w: 1\" and nothing else this is the default value of\n[0, 0, 0, 1] where x,y, and z are 0.", + "type": "object" + }, + "FormatComplexity": { + "description": "Information on the complexity of this Format.", + "type": "object", + "properties": { + "lodHint": { + "description": "A non-negative integer that represents the level of detail (LOD) of this\nformat relative to other formats of the same asset with the same\nformat_type.\nThis hint allows you to sort formats from the most-detailed (0) to\nleast-detailed (integers greater than 0).", + "format": "int32", + "type": "integer" + }, + "triangleCount": { + "description": "The estimated number of triangles.", + "format": "int64", + "type": "string" + } + }, + "id": "FormatComplexity" + }, + "ListUserAssetsResponse": { + "properties": { + "userAssets": { + "description": "A list of UserAssets matching the request.", + "type": "array", + "items": { + "$ref": "UserAsset" + } + }, + "nextPageToken": { + "description": "The continuation token for retrieving the next page. If empty,\nindicates that there are no more pages. To get the next page, submit the\nsame request specifying this value as the\npage_token.", + "type": "string" + }, + "totalSize": { + "description": "The total number of assets in the list, without pagination.", + "format": "int32", + "type": "integer" + } + }, + "id": "ListUserAssetsResponse", + "description": "A response message from a request to list.", + "type": "object" + }, + "UserAsset": { + "description": "Data about the user's asset.", + "type": "object", + "properties": { + "asset": { + "$ref": "Asset", + "description": "An Asset." + } + }, + "id": "UserAsset" + }, + "File": { + "description": "Represents a file in Poly, which can be a root,\nresource, or thumbnail file.", + "type": "object", + "properties": { + "contentType": { + "description": "The MIME content-type, such as `image/png`.\nFor more information, see\n[MIME types](//developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).", + "type": "string" + }, + "relativePath": { + "description": "The path of the resource file relative to the root file.\nFor root or thumbnail files, this is just the filename.", + "type": "string" + }, + "url": { + "description": "The URL where the file data can be retrieved.", + "type": "string" + } + }, + "id": "File" + }, + "ListLikedAssetsResponse": { + "properties": { + "nextPageToken": { + "description": "The continuation token for retrieving the next page. If empty,\nindicates that there are no more pages. To get the next page, submit the\nsame request specifying this value as the\npage_token.", + "type": "string" + }, + "assets": { + "description": "A list of assets that match the criteria specified in the request.", + "type": "array", + "items": { + "$ref": "Asset" + } + }, + "totalSize": { + "description": "The total number of assets in the list, without pagination.", + "format": "int32", + "type": "integer" + } + }, + "id": "ListLikedAssetsResponse", + "description": "A response message from a request to list.", + "type": "object" + }, + "ListAssetsResponse": { + "description": "A response message from a request to list.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "The continuation token for retrieving the next page. If empty,\nindicates that there are no more pages. To get the next page, submit the\nsame request specifying this value as the\npage_token.", + "type": "string" + }, + "assets": { + "description": "A list of assets that match the criteria specified in the request.", + "type": "array", + "items": { + "$ref": "Asset" + } + }, + "totalSize": { + "description": "The total number of assets in the list, without pagination.", + "format": "int32", + "type": "integer" + } + }, + "id": "ListAssetsResponse" + }, + "Format": { + "properties": { + "resources": { + "description": "A list of dependencies of the root element. May include, but is not\nlimited to, materials, textures, and shader programs.", + "type": "array", + "items": { + "$ref": "File" + } + }, + "formatComplexity": { + "$ref": "FormatComplexity", + "description": "Complexity stats about this representation of the asset." + }, + "root": { + "$ref": "File", + "description": "The root of the file hierarchy. This will always be populated.\nFor some format_types - such as `TILT`, which are self-contained -\nthis is all of the data.\n\nOther types - such as `OBJ` - often reference other data elements.\nThese are contained in the resources field." + }, + "formatType": { + "description": "A short string that identifies the format type of this representation.\nPossible values are: `FBX`, `GLTF`, `GLTF2`, `OBJ`, and `TILT`.", + "type": "string" + } + }, + "id": "Format", + "description": "The same asset can be represented in different formats, for example,\na [WaveFront .obj](//en.wikipedia.org/wiki/Wavefront_.obj_file) file with its\ncorresponding .mtl file or a [Khronos glTF](//www.khronos.org/gltf) file\nwith its corresponding .glb binary data. A format refers to a specific\nrepresentation of an asset and contains all information needed to\nretrieve and describe this representation.", + "type": "object" + }, + "Asset": { + "description": "Represents and describes an asset in the Poly library. An asset is a 3D model\nor scene created using [Tilt Brush](//www.tiltbrush.com),\n[Blocks](//vr.google.com/blocks/), or any 3D program that produces a file\nthat can be upload to Poly.", + "type": "object", + "properties": { + "updateTime": { + "description": "The time when the asset was last modified. For published assets, whose\ncontents are immutable, the update time changes only when metadata\nproperties, such as visibility, are updated.", + "format": "google-datetime", + "type": "string" + }, + "license": { + "description": "The license under which the author has made the asset available\nfor use, if any.", + "type": "string", + "enumDescriptions": [ + "Unknown license value.", + "Creative Commons CC-BY 3.0. https://creativecommons.org/licenses/by/3.0/", + "Unlicensed: All Rights Reserved by the author. Unlicensed assets are\n**not** returned by List Assets." + ], + "enum": [ + "UNKNOWN", + "CREATIVE_COMMONS_BY", + "ALL_RIGHTS_RESERVED" + ] + }, + "isCurated": { + "description": "Whether this asset has been curated by the Poly team.", + "type": "boolean" + }, + "formats": { + "description": "A list of Formats where each\nformat describes one representation of the asset.", + "type": "array", + "items": { + "$ref": "Format" + } + }, + "thumbnail": { + "$ref": "File", + "description": "The thumbnail image for the asset." + }, + "presentationParams": { + "description": "Hints for displaying the asset. Note that these parameters are not\nimmutable; the author of an asset may change them post-publication.", + "$ref": "PresentationParams" + }, + "description": { + "description": "The human-readable description, set by the asset's author.", + "type": "string" + }, + "visibility": { + "enumDescriptions": [ + "Unknown (and invalid) visibility.", + "Access to the asset and its underlying files and resources is restricted to\nthe author.\n**Authentication:** You must supply an OAuth token that corresponds to the\nauthor's account.", + "Access to the asset and its underlying files and resources is available to\nanyone with the asset's name. Unlisted assets are **not**\nreturned by List Assets.", + "Access to the asset and its underlying files and resources is available\nto anyone." + ], + "enum": [ + "VISIBILITY_UNSPECIFIED", + "PRIVATE", + "UNLISTED", + "PUBLIC" + ], + "description": "The visibility of the asset and who can access it.", + "type": "string" + }, + "authorName": { + "description": "The author's publicly visible name. Use this name when giving credit to the\nauthor. For more information, see [Licensing](/poly/discover/licensing).", + "type": "string" + }, + "name": { + "description": "The unique identifier for the asset in the form:\n`assets/{ASSET_ID}`.", + "type": "string" + }, + "displayName": { + "description": "The human-readable name, set by the asset's author.", + "type": "string" + }, + "createTime": { + "description": "For published assets, the time when the asset was published.\nFor unpublished assets, the time when the asset was created.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "Asset" + }, + "PresentationParams": { + "description": "Hints for displaying the asset, based on information available when the asset\nwas uploaded.", + "type": "object", + "properties": { + "orientingRotation": { + "$ref": "Quaternion", + "description": "A rotation that should be applied to the object root to make it upright.\nMore precisely, this quaternion transforms from \"object space\" (the space\nin which the object is defined) to \"presentation space\", a coordinate\nsystem where +Y is up, +X is right, -Z is forward. For example, if\nthe object is the Eiffel Tower, in its local coordinate system the\nobject might be laid out such that the base of the tower is on the\nYZ plane and the tip of the tower is towards positive X. In this case\nthis quaternion would specify a rotation (of 90 degrees about the Z\naxis) such that in the presentation space the base of the tower is\naligned with the XZ plane, and the tip of the tower lies towards +Y.\n\nThis rotation is unrelated to the object's pose in the web preview,\nwhich is just a camera position setting and is *not* reflected in this\nrotation.\n\nPlease note: this is applicable only to the gLTF." + }, + "colorSpace": { + "enumDescriptions": [ + "Invalid color value.", + "Linear color values. Default.", + "Colors should be converted to linear by assuming gamma = 2.0." + ], + "enum": [ + "UNKNOWN", + "LINEAR", + "GAMMA" + ], + "description": "The materials' diffuse/albedo color. This does not apply to vertex colors\nor texture maps.", + "type": "string" + } + }, + "id": "PresentationParams" + } + }, + "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": "Poly Service", + "rootUrl": "https://poly.googleapis.com/", + "ownerDomain": "google.com", + "name": "poly", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Poly API" +} diff --git a/etc/api/proximitybeacon/v1beta1/proximitybeacon-api.json b/etc/api/proximitybeacon/v1beta1/proximitybeacon-api.json index 22d2f138a6..023551d077 100644 --- a/etc/api/proximitybeacon/v1beta1/proximitybeacon-api.json +++ b/etc/api/proximitybeacon/v1beta1/proximitybeacon-api.json @@ -1,276 +1,137 @@ { + "basePath": "", + "ownerDomain": "google.com", + "name": "proximitybeacon", + "batchPath": "batch", + "revision": "20171112", + "documentationLink": "https://developers.google.com/beacons/proximity/", + "id": "proximitybeacon:v1beta1", + "title": "Google Proximity Beacon API", "ownerName": "Google", "discoveryVersion": "v1", "version_module": true, "resources": { + "beaconinfo": { + "methods": { + "getforobserved": { + "response": { + "$ref": "GetInfoForObservedBeaconsResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "flatPath": "v1beta1/beaconinfo:getforobserved", + "path": "v1beta1/beaconinfo:getforobserved", + "id": "proximitybeacon.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": { + "update": { + "path": "v1beta1/{+namespaceName}", + "id": "proximitybeacon.namespaces.update", + "request": { + "$ref": "Namespace" + }, + "description": "Updates the information about the specified namespace. Only the namespace\nvisibility can be updated.", + "response": { + "$ref": "Namespace" + }, + "parameterOrder": [ + "namespaceName" + ], + "httpMethod": "PUT", + "parameters": { + "namespaceName": { + "pattern": "^namespaces/[^/]+$", + "location": "path", + "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" + }, + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], + "flatPath": "v1beta1/namespaces/{namespacesId}" + }, + "list": { + "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.", + "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" + } + } + }, "v1beta1": { "methods": { "getEidparams": { - "httpMethod": "GET", + "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.", "response": { "$ref": "EphemeralIdRegistrationParams" }, "parameterOrder": [], + "httpMethod": "GET", "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/userlocation.beacon.registry" ], "flatPath": "v1beta1/eidparams", "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." + "id": "proximitybeacon.getEidparams" } } }, "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" - }, - "parameterOrder": [ - "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" - ], - "flatPath": "v1beta1/beacons/{beaconsId}/attachments/{attachmentsId}" - }, - "list": { - "response": { - "$ref": "ListBeaconAttachmentsResponse" - }, - "parameterOrder": [ - "beaconName" - ], - "httpMethod": "GET", - "parameters": { - "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.", - "type": "string", - "required": true, - "pattern": "^beacons/[^/]+$", - "location": "path" - }, - "projectId": { - "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" - }, - "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", - "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": { - "$ref": "DeleteAttachmentsResponse" - }, - "parameterOrder": [ - "beaconName" - ], - "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/userlocation.beacon.registry" - ], - "parameters": { - "beaconName": { - "pattern": "^beacons/[^/]+$", - "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", - "description": "The project id to delete 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" - }, - "namespacedType": { - "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", - "location": "query" - } - }, - "flatPath": "v1beta1/beacons/{beaconsId}/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." - }, - "create": { - "httpMethod": "POST", - "parameterOrder": [ - "beaconName" - ], - "response": { - "$ref": "BeaconAttachment" - }, - "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.", - "type": "string", - "required": true - }, - "projectId": { - "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}/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" ], + "httpMethod": "GET", "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, + "type": "string", "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" + "type": "string", + "location": "query" } }, "flatPath": "v1beta1/beacons/{beaconsId}", @@ -290,43 +151,40 @@ "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, `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.", - "type": "string", - "required": true, - "pattern": "^beacons/[^/]+$", - "location": "path" - }, "projectId": { "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", "location": "query" + }, + "beaconName": { + "pattern": "^beacons/[^/]+$", + "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, `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" } }, "flatPath": "v1beta1/beacons/{beaconsId}", - "id": "proximitybeacon.beacons.update", "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.", "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" - }, "parameterOrder": [ "beaconName" ], + "response": { + "$ref": "Empty" + }, "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.", - "type": "string", "required": true, + "type": "string", "pattern": "^beacons/[^/]+$", "location": "path" }, @@ -339,9 +197,15 @@ "scopes": [ "https://www.googleapis.com/auth/userlocation.beacon.registry" ], - "flatPath": "v1beta1/beacons/{beaconsId}:decommission" + "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": { + "flatPath": "v1beta1/beacons/{beaconsId}", + "path": "v1beta1/{+beaconName}", + "id": "proximitybeacon.beacons.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" @@ -354,39 +218,33 @@ "https://www.googleapis.com/auth/userlocation.beacon.registry" ], "parameters": { + "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" + }, "beaconName": { "pattern": "^beacons/[^/]+$", "location": "path", "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": { - "location": "query", - "description": "The project id of the beacon to delete. If not provided, the project\nthat is making the request is used.\nOptional.", + "required": true, "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" - }, + "httpMethod": "POST", "parameterOrder": [ "beaconName" ], - "httpMethod": "POST", + "response": { + "$ref": "Empty" + }, "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", "required": true, + "type": "string", "pattern": "^beacons/[^/]+$", "location": "path" }, @@ -399,17 +257,58 @@ "scopes": [ "https://www.googleapis.com/auth/userlocation.beacon.registry" ], - "flatPath": "v1beta1/beacons/{beaconsId}:deactivate" + "flatPath": "v1beta1/beacons/{beaconsId}: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." + }, + "list": { + "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", + "parameterOrder": [], + "response": { + "$ref": "ListBeaconsResponse" + }, + "parameters": { + "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`", + "type": "string" + }, + "pageSize": { + "location": "query", + "description": "The maximum number of records to return for this request, up to a\nserver-defined upper limit.", + "format": "int32", + "type": "integer" + }, + "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" + }, + "pageToken": { + "description": "A pagination token obtained from a previous request to list beacons.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], + "flatPath": "v1beta1/beacons", + "id": "proximitybeacon.beacons.list", + "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.", "response": { "$ref": "Beacon" }, "parameterOrder": [], "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/userlocation.beacon.registry" - ], "parameters": { "projectId": { "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.", @@ -417,188 +316,251 @@ "location": "query" } }, + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], "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." + "id": "proximitybeacon.beacons.register" }, - "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.", + "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.", "response": { - "$ref": "ListBeaconsResponse" - }, - "parameterOrder": [], - "httpMethod": "GET", - "parameters": { - "pageToken": { - "location": "query", - "description": "A pagination token obtained from a previous request to list beacons.", - "type": "string" - }, - "pageSize": { - "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": { - "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", - "location": "query" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/userlocation.beacon.registry" - ], - "flatPath": "v1beta1/beacons" - } - } - }, - "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": "ListNamespacesResponse" - }, - "parameterOrder": [], - "parameters": { - "projectId": { - "description": "The project id to list namespaces under.\nOptional.", - "type": "string", - "location": "query" - } - }, - "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": { - "response": { - "$ref": "Namespace" + "$ref": "Empty" }, "parameterOrder": [ - "namespaceName" + "beaconName" ], - "httpMethod": "PUT", + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/userlocation.beacon.registry" ], "parameters": { - "namespaceName": { - "pattern": "^namespaces/[^/]+$", + "beaconName": { "location": "path", - "description": "Resource name of this namespace. Namespaces names have the format:\n\u003ccode\u003enamespaces/\u003cvar\u003enamespace\u003c/var\u003e\u003c/code\u003e.", + "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", - "required": true + "pattern": "^beacons/[^/]+$" }, "projectId": { - "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" + "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" } }, - "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." + "flatPath": "v1beta1/beacons/{beaconsId}:activate", + "path": "v1beta1/{+beaconName}:activate", + "id": "proximitybeacon.beacons.activate" + } + }, + "resources": { + "attachments": { + "methods": { + "delete": { + "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" + }, + "parameterOrder": [ + "attachmentName" + ], + "httpMethod": "DELETE", + "parameters": { + "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" + }, + "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.", + "required": true, + "type": "string", + "pattern": "^beacons/[^/]+/attachments/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], + "flatPath": "v1beta1/beacons/{beaconsId}/attachments/{attachmentsId}", + "path": "v1beta1/{+attachmentName}", + "id": "proximitybeacon.beacons.attachments.delete" + }, + "list": { + "id": "proximitybeacon.beacons.attachments.list", + "path": "v1beta1/{+beaconName}/attachments", + "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.", + "httpMethod": "GET", + "response": { + "$ref": "ListBeaconAttachmentsResponse" + }, + "parameterOrder": [ + "beaconName" + ], + "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": { + "location": "path", + "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", + "pattern": "^beacons/[^/]+$" + }, + "projectId": { + "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", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], + "flatPath": "v1beta1/beacons/{beaconsId}/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" + }, + "response": { + "$ref": "BeaconAttachment" + }, + "parameterOrder": [ + "beaconName" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], + "parameters": { + "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" + }, + "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" + } + }, + "flatPath": "v1beta1/beacons/{beaconsId}/attachments", + "path": "v1beta1/{+beaconName}/attachments", + "id": "proximitybeacon.beacons.attachments.create" + }, + "batchDelete": { + "response": { + "$ref": "DeleteAttachmentsResponse" + }, + "parameterOrder": [ + "beaconName" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/userlocation.beacon.registry" + ], + "parameters": { + "namespacedType": { + "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", + "location": "query" + }, + "beaconName": { + "pattern": "^beacons/[^/]+$", + "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.", + "required": true, + "type": "string" + }, + "projectId": { + "description": "The project id to delete 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", + "location": "query" + } + }, + "flatPath": "v1beta1/beacons/{beaconsId}/attachments:batchDelete", + "path": "v1beta1/{+beaconName}/attachments:batchDelete", + "id": "proximitybeacon.beacons.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": { + "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.", + "required": true, + "type": "string", + "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" + }, + "pageSize": { + "location": "query", + "description": "Specifies the maximum number of results to return. Defaults to\n10. Maximum 1000. Optional.", + "format": "int32", + "type": "integer" + }, + "alertFilter": { + "location": "query", + "enum": [ + "ALERT_UNSPECIFIED", + "WRONG_LOCATION", + "LOW_BATTERY", + "LOW_ACTIVITY" + ], + "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" + }, + "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", + "path": "v1beta1/{+beaconName}/diagnostics", + "id": "proximitybeacon.beacons.diagnostics.list" + } + } } } } }, "parameters": { - "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.", - "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", - "location": "query" + "type": "string" }, "prettyPrint": { "description": "Returns response with indentations and line breaks.", - "default": "true", "type": "boolean", + "default": "true", "location": "query" }, "uploadType": { @@ -607,163 +569,97 @@ "location": "query" }, "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "callback": { "location": "query", - "description": "JSONP", + "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": [ - "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" + }, + "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.", + "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" } }, "schemas": { - "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": { - "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": "BeaconAttachment" - }, - "EphemeralIdRegistration": { - "properties": { - "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": { - "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": "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": { + "description": "A subset of attachment information served via the\n`beaconinfo.getforobserved` method, used when your users encounter your\nbeacons.", + "type": "object", "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" + }, + "data": { + "description": "An opaque data container for client-provided data.", + "format": "byte", + "type": "string" + }, + "maxDistanceMeters": { + "description": "The distance away from the beacon at which this attachment should be\ndelivered to a mobile app.\n\nSetting this to a value greater than zero indicates that the app should\nbehave as if the beacon is \"seen\" when the mobile device is less than this\ndistance away from the beacon.\n\nDifferent attachments on the same beacon can have different max distances.\n\nNote that even though this value is expressed with fractional meter\nprecision, real-world behavior is likley to be much less precise than one\nmeter, due to the nature of current Bluetooth radio technology.\n\nOptional. When not set or zero, the attachment should be delivered at the\nbeacon's outer limit of detection.", + "format": "double", + "type": "number" } }, - "id": "AttachmentInfo", - "description": "A subset of attachment information served via the\n`beaconinfo.getforobserved` method, used when your users encounter your\nbeacons.", - "type": "object" + "id": "AttachmentInfo" }, "BeaconInfo": { "description": "A subset of beacon information served via the `beaconinfo.getforobserved`\nmethod, which you call when users of your app encounter your beacons.", @@ -773,92 +669,92 @@ "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" - }, - "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" + "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", + "type": "string" }, "minRotationPeriodExponent": { - "format": "uint32", "description": "Indicates the minimum rotation period supported by the service.\nSee EddystoneEidRegistration.rotation_period_exponent", + "format": "uint32", "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" + "maxRotationPeriodExponent": { + "description": "Indicates the maximum rotation period supported by the service.\nSee EddystoneEidRegistration.rotation_period_exponent", + "format": "uint32", + "type": "integer" } }, "id": "EphemeralIdRegistrationParams" }, + "DeleteAttachmentsResponse": { + "description": "Response for a request to delete attachments.", + "type": "object", + "properties": { + "numDeleted": { + "description": "The number of attachments that were deleted.", + "format": "int32", + "type": "integer" + } + }, + "id": "DeleteAttachmentsResponse" + }, "Observation": { "description": "Represents one beacon observed once.", "type": "object", "properties": { "telemetry": { - "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.", + "format": "byte", "type": "string" }, "timestampMs": { - "format": "google-datetime", "description": "Time when the beacon was observed.", + "format": "google-datetime", "type": "string" }, "advertisedId": { - "$ref": "AdvertisedId", - "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." + "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.", + "$ref": "AdvertisedId" } }, "id": "Observation" }, "ListDiagnosticsResponse": { + "description": "Response that contains the requested diagnostics.", + "type": "object", "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.", "type": "string" } }, - "id": "ListDiagnosticsResponse", - "description": "Response that contains the requested diagnostics.", - "type": "object" + "id": "ListDiagnosticsResponse" }, "GetInfoForObservedBeaconsResponse": { "description": "Information about the requested beacons, optionally including attachment\ndata.", @@ -866,18 +762,37 @@ "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" }, "Beacon": { - "description": "Details of a beacon device.", - "type": "object", "properties": { + "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" + }, + "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" + }, + "description": { + "description": "Free text used to identify and describe the beacon. Maximum length 140\ncharacters.\nOptional.", + "type": "string" + }, + "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" + }, + "latLng": { + "$ref": "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." + }, "properties": { "additionalProperties": { "type": "string" @@ -885,17 +800,7 @@ "description": "Properties of the beacon device, for example battery type or firmware\nversion.\nOptional.", "type": "object" }, - "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", @@ -903,13 +808,25 @@ "INACTIVE" ], "description": "Current status of the beacon.\nRequired.", - "type": "string" + "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." + ] + }, + "indoorLevel": { + "description": "The indoor level information for this beacon, if known. As returned by the\nGoogle Maps API.\nOptional.", + "$ref": "IndoorLevel" }, "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.", "type": "string" }, "expectedStability": { + "description": "Expected location stability. This is set when the beacon is registered or\nupdated, not automatically detected in any way.\nOptional.", + "type": "string", "enumDescriptions": [ "Do not use this value.", "Not expected to move, for example a store's front door.", @@ -923,37 +840,16 @@ "PORTABLE", "MOBILE", "ROVING" - ], - "description": "Expected location stability. This is set when the beacon is registered or\nupdated, not automatically detected in any way.\nOptional.", - "type": "string" + ] }, "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.", - "$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" + "$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" + "id": "Beacon", + "description": "Details of a beacon device.", + "type": "object" }, "AdvertisedId": { "description": "Defines a unique identifier of a beacon as broadcast by the device.", @@ -978,8 +874,8 @@ ] }, "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.", + "format": "byte", "type": "string" } }, @@ -1000,19 +896,19 @@ "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": { + "year": { + "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", "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.", + "format": "int32", "type": "integer" }, - "year": { + "month": { + "description": "Month of year. Must be from 1 to 12.", "format": "int32", - "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", "type": "integer" } }, @@ -1024,10 +920,10 @@ "properties": { "namespaces": { "description": "The attachments that corresponded to the request params.", + "type": "array", "items": { "$ref": "Namespace" - }, - "type": "array" + } } }, "id": "ListNamespacesResponse" @@ -1040,84 +936,209 @@ "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" - }, - "type": "array" + } + }, + "totalCount": { + "description": "Estimate of the total number of beacons matched by the query. Higher\nvalues may be less accurate.", + "format": "int64", + "type": "string" } }, "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", "WRONG_LOCATION", - "LOW_BATTERY" + "LOW_BATTERY", + "LOW_ACTIVITY" ], "type": "string" }, - "type": "array" + "enumDescriptions": [ + "Invalid value. Should never appear.", + "The beacon has been reported far from its expected location (the beacon's\nlat_lng field if populated, otherwise, if the beacon's place_id field is\npresent, the center of that place). This may indicate that the beacon has\nbeen moved. This signal is not 100% accurate, but indicates that further\ninvestigation is worthwhile.", + "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.", + "The beacon has been reported at a very low rate or not at all. This may\nindicate that the beacon is broken or just that no one has gone near the\nbeacon in recent days. If this status appears unexpectedly, the beacon\nowner should investigate further." + ] + }, + "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." } }, "id": "Diagnostics", "description": "Diagnostics for a single beacon.", "type": "object" }, - "GetInfoForObservedBeaconsRequest": { - "description": "Request for beacon and attachment information about beacons that\na mobile client has encountered \"in the wild\".", + "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": { "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" + "id": "GetInfoForObservedBeaconsRequest", + "description": "Request for beacon and attachment information about beacons that\na mobile client has encountered \"in the wild\".", + "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 `{}`.", + "BeaconAttachment": { + "description": "Project-specific data associated with a beacon.", + "type": "object", + "properties": { + "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" + }, + "maxDistanceMeters": { + "description": "The distance away from the beacon at which this attachment should be\ndelivered to a mobile app.\n\nSetting this to a value greater than zero indicates that the app should\nbehave as if the beacon is \"seen\" when the mobile device is less than this\ndistance away from the beacon.\n\nDifferent attachments on the same beacon can have different max distances.\n\nNote that even though this value is expressed with fractional meter\nprecision, real-world behavior is likley to be much less precise than one\nmeter, due to the nature of current Bluetooth radio technology.\n\nOptional. When not set or zero, the attachment should be delivered at the\nbeacon's outer limit of detection.\n\nNegative values are invalid and return an error.", + "format": "double", + "type": "number" + }, + "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" + } + }, + "id": "BeaconAttachment" + }, + "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", + "properties": { + "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" + }, + "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" + } + }, + "id": "EphemeralIdRegistration" + }, + "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.", + "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" + }, + "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": { + "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." + ] + } + }, + "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" } }, "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": "v1beta1", @@ -1131,16 +1152,8 @@ } } }, - "servicePath": "", - "description": "Registers, manages, indexes, and searches beacons.", "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" + "description": "Registers, manages, indexes, and searches beacons.", + "servicePath": "", + "rootUrl": "https://proximitybeacon.googleapis.com/" } diff --git a/etc/api/pubsub/v1/pubsub-api.json b/etc/api/pubsub/v1/pubsub-api.json index 8db2743896..83577f41a6 100644 --- a/etc/api/pubsub/v1/pubsub-api.json +++ b/etc/api/pubsub/v1/pubsub-api.json @@ -1,82 +1,82 @@ { + "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", + "revision": "20171129", + "documentationLink": "https://cloud.google.com/pubsub/docs", + "id": "pubsub:v1", + "title": "Google Cloud Pub/Sub API", + "discoveryVersion": "v1", + "ownerName": "Google", "resources": { "projects": { "resources": { - "topics": { - "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" - } - } - } - }, + "subscriptions": { "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.", + "get": { + "description": "Gets the configuration details of a subscription.", "response": { - "$ref": "PublishResponse" + "$ref": "Subscription" }, "parameterOrder": [ - "topic" + "subscription" ], - "httpMethod": "POST", + "httpMethod": "GET", + "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" + } + }, "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.get" + }, + "patch": { + "request": { + "$ref": "UpdateSubscriptionRequest" + }, + "description": "Updates an existing subscription. Note that certain properties of a\nsubscription, such as its topic, are not modifiable.", + "response": { + "$ref": "Subscription" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", "parameters": { - "topic": { - "description": "The messages in the request will be published on this topic.\nFormat is `projects/{project}/topics/{topic}`.", - "type": "string", + "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, - "pattern": "^projects/[^/]+/topics/[^/]+$", + "type": "string", + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", "location": "path" } }, - "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:publish", - "id": "pubsub.projects.topics.publish", - "path": "v1/{+topic}:publish" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}", + "path": "v1/{+name}", + "id": "pubsub.projects.subscriptions.patch" }, "testIamPermissions": { + "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" @@ -88,12 +88,245 @@ "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/[^/]+/topics/[^/]+$", + "type": "string", + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + } + }, + "seek": { + "description": "Seeks an existing subscription to a point in time or to a given snapshot,\nwhichever is provided in the request.", + "request": { + "$ref": "SeekRequest" + }, + "response": { + "$ref": "SeekResponse" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "subscription": { + "description": "The subscription to affect.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:seek", + "path": "v1/{+subscription}:seek", + "id": "pubsub.projects.subscriptions.seek" + }, + "modifyPushConfig": { + "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 name of the subscription.\nFormat is `projects/{project}/subscriptions/{sub}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/subscriptions/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyPushConfig", + "path": "v1/{+subscription}:modifyPushConfig", + "id": "pubsub.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" + } + }, + "delete": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "subscription": { + "description": "The subscription to delete.\nFormat is `projects/{project}/subscriptions/{sub}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "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." + }, + "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.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "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/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:setIamPolicy" + }, + "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" + }, + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "subscription": { + "description": "The name of the subscription.\nFormat is `projects/{project}/subscriptions/{sub}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyAckDeadline", + "path": "v1/{+subscription}:modifyAckDeadline", + "id": "pubsub.projects.subscriptions.modifyAckDeadline" + }, + "getIamPolicy": { + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "GET", + "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", + "path": "v1/{+resource}:getIamPolicy", + "id": "pubsub.projects.subscriptions.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." + }, + "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": { + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path", + "description": "The subscription from which messages should be pulled.\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}:pull", + "path": "v1/{+subscription}:pull", + "id": "pubsub.projects.subscriptions.pull" + }, + "list": { + "id": "pubsub.projects.subscriptions.list", + "path": "v1/{+project}/subscriptions", + "description": "Lists matching subscriptions.", + "httpMethod": "GET", + "response": { + "$ref": "ListSubscriptionsResponse" + }, + "parameterOrder": [ + "project" + ], + "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": { + "description": "The name of the cloud project that subscriptions belong to.\nFormat is `projects/{project}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", "location": "path" } }, @@ -101,74 +334,75 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" ], - "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:testIamPermissions", - "id": "pubsub.projects.topics.testIamPermissions", - "path": "v1/{+resource}:testIamPermissions" + "flatPath": "v1/projects/{projectsId}/subscriptions" }, - "delete": { + "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": "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" + } + }, + "acknowledge": { + "httpMethod": "POST", + "parameterOrder": [ + "subscription" + ], "response": { "$ref": "Empty" }, - "parameterOrder": [ - "topic" - ], - "httpMethod": "DELETE", "parameters": { - "topic": { - "type": "string", - "required": true, - "pattern": "^projects/[^/]+/topics/[^/]+$", + "subscription": { "location": "path", - "description": "Name of the topic to delete.\nFormat is `projects/{project}/topics/{topic}`." + "description": "The subscription whose message is being acknowledged.\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}/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" + "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:acknowledge", + "id": "pubsub.projects.subscriptions.acknowledge", + "path": "v1/{+subscription}:acknowledge", + "request": { + "$ref": "AcknowledgeRequest" }, - "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" - }, + "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." + } + } + }, + "snapshots": { + "methods": { "setIamPolicy": { + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "request": { + "$ref": "SetIamPolicyRequest" + }, "response": { "$ref": "Policy" }, @@ -183,28 +417,208 @@ "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/[^/]+$", + "type": "string", + "pattern": "^projects/[^/]+/snapshots/[^/]+$", "location": "path" } }, - "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:setIamPolicy", - "id": "pubsub.projects.topics.setIamPolicy", + "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:setIamPolicy", "path": "v1/{+resource}:setIamPolicy", - "request": { - "$ref": "SetIamPolicyRequest" - }, - "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy." + "id": "pubsub.projects.snapshots.setIamPolicy" }, "create": { - "httpMethod": "PUT", + "request": { + "$ref": "CreateSnapshotRequest" + }, + "description": "Creates a snapshot from the requested subscription.\nIf the snapshot already exists, returns `ALREADY_EXISTS`.\nIf the requested subscription doesn't exist, returns `NOT_FOUND`.\nIf the backlog in the subscription is too old -- and the resulting snapshot\nwould expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned.\nSee also the `Snapshot.expire_time` field.\n\nIf the name is not provided in the request, the server will assign a random\nname for this snapshot on the same project as the subscription, conforming\nto the\n[resource name\nformat](https://cloud.google.com/pubsub/docs/overview#names). The generated\nname is populated in the returned Snapshot object. Note that for REST API\nrequests, you must specify a name in the request.", + "response": { + "$ref": "Snapshot" + }, "parameterOrder": [ "name" ], + "httpMethod": "PUT", + "parameters": { + "name": { + "description": "Optional user-provided name for this snapshot.\nIf the name is not provided in the request, the server will assign a random\nname for this snapshot on the same project as the subscription.\nNote that for REST API requests, you must specify a name.\nFormat is `projects/{project}/snapshots/{snap}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/snapshots/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}", + "path": "v1/{+name}", + "id": "pubsub.projects.snapshots.create" + }, + "getIamPolicy": { + "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "id": "pubsub.projects.snapshots.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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/snapshots/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "patch": { + "path": "v1/{+name}", + "id": "pubsub.projects.snapshots.patch", + "request": { + "$ref": "UpdateSnapshotRequest" + }, + "description": "Updates an existing snapshot. Note that certain properties of a\nsnapshot are not modifiable.", + "response": { + "$ref": "Snapshot" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "parameters": { + "name": { + "location": "path", + "description": "The name of the snapshot.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/snapshots/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}" + }, + "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.", + "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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/snapshots/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "id": "pubsub.projects.snapshots.testIamPermissions" + }, + "delete": { + "description": "Removes an existing snapshot. All messages retained in the snapshot\nare immediately dropped. After a snapshot is deleted, a new one may be\ncreated with the same name, but the new one has no association with the old\nsnapshot or its subscription, unless the same subscription is specified.", + "httpMethod": "DELETE", + "parameterOrder": [ + "snapshot" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "snapshot": { + "location": "path", + "description": "The name of the snapshot to delete.\nFormat is `projects/{project}/snapshots/{snap}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/snapshots/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}", + "id": "pubsub.projects.snapshots.delete", + "path": "v1/{+snapshot}" + }, + "list": { + "httpMethod": "GET", + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ListSnapshotsResponse" + }, + "parameters": { + "pageToken": { + "location": "query", + "description": "The value returned by the last `ListSnapshotsResponse`; indicates that this\nis a continuation of a prior `ListSnapshots` call, and that the system\nshould return the next page of data.", + "type": "string" + }, + "pageSize": { + "location": "query", + "description": "Maximum number of snapshots to return.", + "format": "int32", + "type": "integer" + }, + "project": { + "description": "The name of the cloud project that snapshots belong to.\nFormat is `projects/{project}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/snapshots", + "id": "pubsub.projects.snapshots.list", + "path": "v1/{+project}/snapshots", + "description": "Lists the existing snapshots." + } + } + }, + "topics": { + "methods": { + "create": { + "description": "Creates the given topic with the given name.", + "request": { + "$ref": "Topic" + }, "response": { "$ref": "Topic" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PUT", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" @@ -212,76 +626,16 @@ "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, + "type": "string", "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." + "id": "pubsub.projects.topics.create" }, - "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" @@ -294,56 +648,27 @@ "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/[^/]+$", + "type": "string", + "pattern": "^projects/[^/]+/topics/[^/]+$", "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.", - "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" + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "pubsub.projects.topics.setIamPolicy" }, "getIamPolicy": { - "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:getIamPolicy", - "id": "pubsub.projects.snapshots.getIamPolicy", + "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.", "response": { "$ref": "Policy" @@ -358,116 +683,29 @@ ], "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/[^/]+$" + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path" } - }, - "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": { + "description": "Gets the configuration of a topic.", "response": { - "$ref": "Subscription" + "$ref": "Topic" }, "parameterOrder": [ - "subscription" + "topic" ], "httpMethod": "GET", "parameters": { - "subscription": { - "description": "The name of the subscription to get.\nFormat is `projects/{project}/subscriptions/{sub}`.", - "type": "string", + "topic": { + "description": "The name of the topic to get.\nFormat is `projects/{project}/topics/{topic}`.", "required": true, - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "type": "string", + "pattern": "^projects/[^/]+/topics/[^/]+$", "location": "path" } }, @@ -475,218 +713,214 @@ "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." + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}", + "path": "v1/{+topic}", + "id": "pubsub.projects.topics.get" + }, + "publish": { + "id": "pubsub.projects.topics.publish", + "path": "v1/{+topic}: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" + }, + "parameters": { + "topic": { + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path", + "description": "The messages in the request will be published on this topic.\nFormat is `projects/{project}/topics/{topic}`.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:publish" }, "testIamPermissions": { + "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/[^/]+/subscriptions/[^/]+$", + "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}/subscriptions/{subscriptionsId}:testIamPermissions", + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:testIamPermissions", "path": "v1/{+resource}:testIamPermissions", - "id": "pubsub.projects.subscriptions.testIamPermissions", + "id": "pubsub.projects.topics.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", + "path": "v1/{+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_`.", "response": { "$ref": "Empty" }, "parameterOrder": [ - "subscription" + "topic" ], - "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", + "httpMethod": "DELETE", "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", + "topic": { "required": true, - "pattern": "^projects/[^/]+/subscriptions/[^/]+$" + "type": "string", + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path", + "description": "Name of the topic to delete.\nFormat is `projects/{project}/topics/{topic}`." } }, - "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:pull" + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}" }, "list": { - "httpMethod": "GET", + "response": { + "$ref": "ListTopicsResponse" + }, "parameterOrder": [ "project" ], - "response": { - "$ref": "ListSubscriptionsResponse" - }, + "httpMethod": "GET", "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" + "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": { "location": "query", + "description": "Maximum number of topics to return.", "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/[^/]+$", + }, + "project": { "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", + "description": "The name of the cloud project that topics belong to.\nFormat is `projects/{project}`.", "required": true, - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path" + "type": "string", + "pattern": "^projects/[^/]+$" } }, - "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." + "flatPath": "v1/projects/{projectsId}/topics", + "path": "v1/{+project}/topics", + "id": "pubsub.projects.topics.list", + "description": "Lists matching topics." + } + }, + "resources": { + "subscriptions": { + "methods": { + "list": { + "description": "Lists the names of the subscriptions on this topic.", + "httpMethod": "GET", + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "ListTopicSubscriptionsResponse" + }, + "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": { + "location": "query", + "description": "Maximum number of subscription names to return.", + "format": "int32", + "type": "integer" + }, + "topic": { + "location": "path", + "description": "The name of the topic that subscriptions are attached to.\nFormat is `projects/{project}/topics/{topic}`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/topics/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}/subscriptions", + "id": "pubsub.projects.topics.subscriptions.list", + "path": "v1/{+topic}/subscriptions" + } + } + }, + "snapshots": { + "methods": { + "list": { + "description": "Lists the names of the snapshots on this topic.", + "response": { + "$ref": "ListTopicSnapshotsResponse" + }, + "parameterOrder": [ + "topic" + ], + "httpMethod": "GET", + "parameters": { + "pageToken": { + "description": "The value returned by the last `ListTopicSnapshotsResponse`; indicates\nthat this is a continuation of a prior `ListTopicSnapshots` call, and\nthat the system should return the next page of data.", + "type": "string", + "location": "query" + }, + "pageSize": { + "type": "integer", + "location": "query", + "description": "Maximum number of snapshot names to return.", + "format": "int32" + }, + "topic": { + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path", + "description": "The name of the topic that snapshots are attached to.\nFormat is `projects/{project}/topics/{topic}`.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1/projects/{projectsId}/topics/{topicsId}/snapshots", + "path": "v1/{+topic}/snapshots", + "id": "pubsub.projects.topics.snapshots.list" + } + } } } } @@ -694,17 +928,6 @@ } }, "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": { - "location": "query", - "description": "Pretty-print response.", - "default": "true", - "type": "boolean" - }, "oauth_token": { "description": "OAuth 2.0 token for the current user.", "type": "string", @@ -716,15 +939,15 @@ "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.", - "default": "true", - "type": "boolean" + "type": "boolean", + "default": "true" }, "uploadType": { "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", @@ -736,12 +959,9 @@ "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" @@ -750,12 +970,14 @@ "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", @@ -768,30 +990,313 @@ "json", "media", "proto" - ] - }, - "access_token": { - "description": "OAuth access token.", - "type": "string", - "location": "query" + ], + "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": { + "location": "query", + "description": "OAuth access token.", + "type": "string" + }, + "quotaUser": { "type": "string", - "location": "query" + "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" } }, "schemas": { + "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" + } + } + }, + "id": "PullResponse" + }, + "UpdateSnapshotRequest": { + "description": "Request for the UpdateSnapshot method.", + "type": "object", + "properties": { + "snapshot": { + "description": "The updated snpashot object.", + "$ref": "Snapshot" + }, + "updateMask": { + "description": "Indicates which fields in the provided snapshot to update.\nMust be specified and non-empty.", + "format": "google-fieldmask", + "type": "string" + } + }, + "id": "UpdateSnapshotRequest" + }, + "ListSnapshotsResponse": { + "description": "Response for the `ListSnapshots` method.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "If not empty, indicates that there may be more snapshot that match the\nrequest; this value should be passed in a new `ListSnapshotsRequest`.", + "type": "string" + }, + "snapshots": { + "description": "The resulting snapshots.", + "type": "array", + "items": { + "$ref": "Snapshot" + } + } + }, + "id": "ListSnapshotsResponse" + }, + "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" + }, + "CreateSnapshotRequest": { + "properties": { + "subscription": { + "description": "The subscription whose backlog the snapshot retains.\nSpecifically, the created snapshot is guaranteed to retain:\n (a) The existing backlog on the subscription. More precisely, this is\n defined as the messages in the subscription's backlog that are\n unacknowledged upon the successful completion of the\n `CreateSnapshot` request; as well as:\n (b) Any messages published to the subscription's topic following the\n successful completion of the CreateSnapshot request.\nFormat is `projects/{project}/subscriptions/{sub}`.", + "type": "string" + } + }, + "id": "CreateSnapshotRequest", + "description": "Request for the `CreateSnapshot` method.", + "type": "object" + }, + "ListTopicSnapshotsResponse": { + "description": "Response for the `ListTopicSnapshots` method.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "If not empty, indicates that there may be more snapshots that match\nthe request; this value should be passed in a new\n`ListTopicSnapshotsRequest` to get more snapshots.", + "type": "string" + }, + "snapshots": { + "description": "The names of the snapshots that match the request.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "ListTopicSnapshotsResponse" + }, + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "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" + }, + "Topic": { + "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.", + "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": { + "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" + }, + "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" + } + } + }, + "id": "Policy" + }, + "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" + }, + "SeekRequest": { + "description": "Request for the `Seek` method.", + "type": "object", + "properties": { + "time": { + "description": "The time to seek to.\nMessages retained in the subscription that were published before this\ntime are marked as acknowledged, and messages retained in the\nsubscription that were published after this time are marked as\nunacknowledged. Note that this operation affects only those messages\nretained in the subscription (configured by the combination of\n`message_retention_duration` and `retain_acked_messages`). For example,\nif `time` corresponds to a point before the message retention\nwindow (or to a point before the system's notion of the subscription\ncreation time), only retained messages will be marked as unacknowledged,\nand already-expunged messages will not be restored.", + "format": "google-datetime", + "type": "string" + }, + "snapshot": { + "description": "The snapshot to seek to. The snapshot's topic must be the same as that of\nthe provided subscription.\nFormat is `projects/{project}/snapshots/{snap}`.", + "type": "string" + } + }, + "id": "SeekRequest" + }, + "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" + } + }, + "id": "ReceivedMessage" + }, + "PushConfig": { + "id": "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\".", + "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 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" + } + } + }, + "TestIamPermissionsResponse": { + "type": "object", + "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." + }, + "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", + "type": "integer" + }, + "returnImmediately": { + "description": "If this field set to true, the system will respond immediately even if\nit there are no messages available to return in the `Pull` response.\nOtherwise, the system may wait (for a bounded amount of time) until at\nleast one message is available, rather than returning no messages. The\nclient may cancel the request if it does not wish to wait any longer for\nthe response.", + "type": "boolean" + } + }, + "id": "PullRequest" + }, + "PublishRequest": { + "properties": { + "messages": { + "type": "array", + "items": { + "$ref": "PubsubMessage" + }, + "description": "The messages to publish." + } + }, + "id": "PublishRequest", + "description": "Request for the Publish method.", + "type": "object" + }, + "UpdateSubscriptionRequest": { + "description": "Request for the UpdateSubscription method.", + "type": "object", + "properties": { + "subscription": { + "description": "The updated subscription object.", + "$ref": "Subscription" + }, + "updateMask": { + "description": "Indicates which fields in the provided subscription to update.\nMust be specified and non-empty.", + "format": "google-fieldmask", + "type": "string" + } + }, + "id": "UpdateSubscriptionRequest" + }, "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" - }, - "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" @@ -813,159 +1318,126 @@ "$ref": "PushConfig" }, "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\nnon-streaming pull or send the `ack_id` in a\n`StreamingModifyAckDeadlineRequest` if using streaming pull.\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", - "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" + }, + "messageRetentionDuration": { + "description": "How long to retain unacknowledged messages in the subscription's backlog,\nfrom the moment a message is published.\nIf `retain_acked_messages` is true, then this also configures the retention\nof acknowledged messages, and thus configures how far back in time a `Seek`\ncan be done. Defaults to 7 days. Cannot be more than 7 days or less than 10\nminutes.", + "format": "google-duration", + "type": "string" + }, + "retainAckedMessages": { + "description": "Indicates whether to retain acknowledged messages. If true, then\nmessages are not expunged from the subscription's backlog, even if they are\nacknowledged, until they fall out of the `message_retention_duration`\nwindow.", + "type": "boolean" } }, "id": "Subscription" }, - "TestIamPermissionsRequest": { - "description": "Request message for `TestIamPermissions` method.", + "SeekResponse": { "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" + "properties": {}, + "id": "SeekResponse" }, "ModifyAckDeadlineRequest": { - "id": "ModifyAckDeadlineRequest", - "description": "Request for the ModifyAckDeadline method.", - "type": "object", "properties": { + "ackDeadlineSeconds": { + "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", + "type": "integer" + }, "ackIds": { "description": "List of acknowledgment IDs.", + "type": "array", "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" + } } - } + }, + "id": "ModifyAckDeadlineRequest", + "description": "Request for the ModifyAckDeadline method.", + "type": "object" + }, + "Snapshot": { + "description": "A snapshot resource.", + "type": "object", + "properties": { + "topic": { + "description": "The name of the topic from which this snapshot is retaining messages.", + "type": "string" + }, + "expireTime": { + "description": "The snapshot is guaranteed to exist up until this time.\nA newly-created snapshot expires no later than 7 days from the time of its\ncreation. Its exact lifetime is determined at creation by the existing\nbacklog in the source subscription. Specifically, the lifetime of the\nsnapshot is `7 days - (age of oldest unacked message in the subscription)`.\nFor example, consider a subscription whose oldest unacked message is 3 days\nold. If a snapshot is created from this subscription, the snapshot -- which\nwill always capture this 3-day-old backlog as long as the snapshot\nexists -- will expire in 4 days. The service will refuse to create a\nsnapshot that would expire in less than 1 hour after creation.", + "format": "google-datetime", + "type": "string" + }, + "name": { + "description": "The name of the snapshot.", + "type": "string" + } + }, + "id": "Snapshot" }, "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." + "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" }, + "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` or `StreamingPull` is not called." + } + }, + "id": "ModifyPushConfigRequest", + "description": "Request for the ModifyPushConfig method." + }, "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." + "data": { + "description": "The message payload.", + "format": "byte", + "type": "string" }, "attributes": { + "description": "Optional attributes for this message.", "type": "object", "additionalProperties": { "type": "string" - }, - "description": "Optional attributes for this message." + } + }, + "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": { - "format": "google-datetime", + "type": "string", "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" + "format": "google-datetime" } }, "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.", + "type": "array", "items": { "type": "string" }, - "type": "array" + "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." } }, "id": "AcknowledgeRequest" @@ -977,6 +1449,7 @@ "id": "Empty" }, "ListTopicsResponse": { + "description": "Response for the `ListTopics` method.", "type": "object", "properties": { "nextPageToken": { @@ -985,18 +1458,15 @@ }, "topics": { "description": "The resulting topics.", + "type": "array", "items": { "$ref": "Topic" - }, - "type": "array" + } } }, - "id": "ListTopicsResponse", - "description": "Response for the `ListTopics` method." + "id": "ListTopicsResponse" }, "ListTopicSubscriptionsResponse": { - "id": "ListTopicSubscriptionsResponse", - "description": "Response for the `ListTopicSubscriptions` method.", "type": "object", "properties": { "nextPageToken": { @@ -1005,126 +1475,19 @@ }, "subscriptions": { "description": "The names of the subscriptions that match the request.", - "items": { - "type": "string" - }, - "type": "array" - } - } - }, - "PullResponse": { - "description": "Response for the `Pull` method.", - "type": "object", - "properties": { - "receivedMessages": { - "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" - }, - "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" - } - }, - "id": "ReceivedMessage" - }, - "PushConfig": { - "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" - } - }, - "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.", "items": { "type": "string" - }, - "type": "array" - } - } - }, - "PullRequest": { - "description": "Request for the `Pull` method.", - "type": "object", - "properties": { - "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" - }, - "returnImmediately": { - "description": "If this field set to true, the system will respond immediately even if\nit there are no messages available to return in the `Pull` response.\nOtherwise, the system may wait (for a bounded amount of time) until at\nleast one message is available, rather than returning no messages. The\nclient may cancel the request if it does not wish to wait any longer for\nthe response.", - "type": "boolean" + } } }, - "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.", - "items": { - "$ref": "Subscription" - }, - "type": "array" - } - }, - "id": "ListSubscriptionsResponse" - }, - "PublishRequest": { - "description": "Request for the Publish method.", - "type": "object", - "properties": { - "messages": { - "description": "The messages to publish.", - "items": { - "$ref": "PubsubMessage" - }, - "type": "array" - } - }, - "id": "PublishRequest" + "id": "ListTopicSubscriptionsResponse", + "description": "Response for the `ListTopicSubscriptions` method." } }, "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", @@ -1141,19 +1504,5 @@ } } } - }, - "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", - "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 a47aef5b85..df36aedd0c 100644 --- a/etc/api/pubsub/v1beta1a/pubsub-api.json +++ b/etc/api/pubsub/v1beta1a/pubsub-api.json @@ -1,81 +1,10 @@ { - "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": { - "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": { - "subscription": { - "description": "The subscription to delete.", - "type": "string", - "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" @@ -83,20 +12,20 @@ "parameterOrder": [], "parameters": { "pageToken": { - "location": "query", "description": "The value obtained in the last \u003ccode\u003eListSubscriptionsResponse\u003c/code\u003e\nfor continuation.", - "type": "string" + "type": "string", + "location": "query" + }, + "query": { + "type": "string", + "location": "query", + "description": "A valid label query expression." }, "maxResults": { "location": "query", - "format": "int32", "description": "Maximum number of subscriptions to return.", + "format": "int32", "type": "integer" - }, - "query": { - "description": "A valid label query expression.", - "type": "string", - "location": "query" } }, "scopes": [ @@ -104,29 +33,32 @@ "https://www.googleapis.com/auth/pubsub" ], "flatPath": "v1beta1a/subscriptions", + "id": "pubsub.subscriptions.list", "path": "v1beta1a/subscriptions", - "id": "pubsub.subscriptions.list" + "description": "Lists matching subscriptions." }, "create": { - "response": { - "$ref": "Subscription" - }, - "parameterOrder": [], - "httpMethod": "POST", + "parameters": {}, "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." + "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" + } }, "modifyAckDeadline": { + "path": "v1beta1a/subscriptions/modifyAckDeadline", + "id": "pubsub.subscriptions.modifyAckDeadline", "description": "Modifies the Ack deadline for a message received from a pull request.", "request": { "$ref": "ModifyAckDeadlineRequest" @@ -136,25 +68,42 @@ }, "parameterOrder": [], "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": {}, + "flatPath": "v1beta1a/subscriptions/modifyAckDeadline" + }, + "acknowledge": { + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "Empty" + }, "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" ], - "flatPath": "v1beta1a/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.", + "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." + }, + "pullBatch": { + "flatPath": "v1beta1a/subscriptions/pullBatch", + "path": "v1beta1a/subscriptions/pullBatch", + "id": "pubsub.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" + }, "response": { - "$ref": "Empty" + "$ref": "PullBatchResponse" }, "parameterOrder": [], "httpMethod": "POST", @@ -165,9 +114,6 @@ "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" @@ -181,18 +127,40 @@ "pattern": "^.+$", "location": "path", "description": "The name of the subscription to get.", - "type": "string", - "required": true + "required": true, + "type": "string" } }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" - ] + ], + "flatPath": "v1beta1a/subscriptions/{subscriptionsId}", + "path": "v1beta1a/subscriptions/{+subscription}", + "id": "pubsub.subscriptions.get" }, - "pullBatch": { + "modifyPushConfig": { "response": { - "$ref": "PullBatchResponse" + "$ref": "Empty" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta1a/subscriptions/modifyPushConfig", + "path": "v1beta1a/subscriptions/modifyPushConfig", + "id": "pubsub.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." + }, + "pull": { + "response": { + "$ref": "PullResponse" }, "parameterOrder": [], "httpMethod": "POST", @@ -201,37 +169,63 @@ "https://www.googleapis.com/auth/pubsub" ], "parameters": {}, - "flatPath": "v1beta1a/subscriptions/pullBatch", - "id": "pubsub.subscriptions.pullBatch", - "path": "v1beta1a/subscriptions/pullBatch", + "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": "PullBatchRequest" + "$ref": "PullRequest" + } + }, + "delete": { + "description": "Deletes an existing subscription. All pending messages in the subscription\nare immediately dropped. Calls to Pull after deletion will return\nNOT_FOUND.", + "response": { + "$ref": "Empty" }, - "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." + "parameterOrder": [ + "subscription" + ], + "httpMethod": "DELETE", + "parameters": { + "subscription": { + "description": "The subscription to delete.", + "required": true, + "type": "string", + "pattern": "^.+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta1a/subscriptions/{subscriptionsId}", + "path": "v1beta1a/subscriptions/{+subscription}", + "id": "pubsub.subscriptions.delete" } } }, "topics": { "methods": { "get": { - "httpMethod": "GET", "response": { "$ref": "Topic" }, "parameterOrder": [ "topic" ], + "httpMethod": "GET", "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.", + "required": true, "type": "string", - "required": true + "pattern": "^.+$", + "location": "path" } }, "flatPath": "v1beta1a/topics/{topicsId}", @@ -240,15 +234,11 @@ "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" - }, + "httpMethod": "POST", + "parameterOrder": [], "response": { "$ref": "Empty" }, - "parameterOrder": [], - "httpMethod": "POST", "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", @@ -256,159 +246,159 @@ ], "flatPath": "v1beta1a/topics/publish", "id": "pubsub.topics.publish", - "path": "v1beta1a/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." }, "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": [ - "topic" - ], "response": { "$ref": "Empty" }, + "parameterOrder": [ + "topic" + ], + "httpMethod": "DELETE", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" ], "parameters": { "topic": { - "type": "string", - "required": true, - "pattern": "^.+$", "location": "path", - "description": "Name of the topic to delete." + "description": "Name of the topic to delete.", + "required": true, + "type": "string", + "pattern": "^.+$" } }, - "flatPath": "v1beta1a/topics/{topicsId}" + "flatPath": "v1beta1a/topics/{topicsId}", + "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." }, "publishBatch": { - "flatPath": "v1beta1a/topics/publishBatch", - "path": "v1beta1a/topics/publishBatch", - "id": "pubsub.topics.publishBatch", + "description": "Adds one or more messages to the topic. Returns NOT_FOUND if the topic does\nnot exist.", "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": { "$ref": "PublishBatchResponse" }, + "parameterOrder": [], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" ], - "parameters": {} + "parameters": {}, + "flatPath": "v1beta1a/topics/publishBatch", + "path": "v1beta1a/topics/publishBatch", + "id": "pubsub.topics.publishBatch" }, "list": { - "description": "Lists matching topics.", "response": { "$ref": "ListTopicsResponse" }, "parameterOrder": [], "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], "parameters": { "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" + }, + "maxResults": { + "description": "Maximum number of topics to return.", + "format": "int32", + "type": "integer", + "location": "query" } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ], "flatPath": "v1beta1a/topics", + "path": "v1beta1a/topics", "id": "pubsub.topics.list", - "path": "v1beta1a/topics" + "description": "Lists matching topics." }, "create": { - "description": "Creates the given topic with the given name.", + "flatPath": "v1beta1a/topics", + "id": "pubsub.topics.create", + "path": "v1beta1a/topics", "request": { "$ref": "Topic" }, + "description": "Creates the given topic with the given name.", + "httpMethod": "POST", + "parameterOrder": [], "response": { "$ref": "Topic" }, - "parameterOrder": [], - "httpMethod": "POST", "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" - ], - "flatPath": "v1beta1a/topics", - "id": "pubsub.topics.create", - "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", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." + "location": "query" }, "prettyPrint": { - "location": "query", "description": "Returns response with indentations and line breaks.", + "type": "boolean", "default": "true", - "type": "boolean" - }, - "fields": { - "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" }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + }, "$.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" + "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", @@ -416,208 +406,48 @@ ], "location": "query", "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "type": "string" + "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": { - "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", + "default": "true" + }, + "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" } }, "schemas": { - "ModifyAckDeadlineRequest": { - "properties": { - "subscription": { - "description": "Next Index: 5\nThe name of the subscription from which messages are being pulled.", - "type": "string" - }, - "ackId": { - "description": "The acknowledgment ID. Either this or ack_ids must be populated,\nnot both.", - "type": "string" - }, - "ackDeadlineSeconds": { - "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.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "id": "ModifyAckDeadlineRequest", - "description": "Request for the ModifyAckDeadline method.", - "type": "object" - }, - "PullBatchRequest": { - "description": "Request for the PullBatch method.", - "type": "object", - "properties": { - "subscription": { - "description": "The subscription from which messages should be pulled.", - "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 no messages. The client may cancel the request if it does\nnot wish to wait any longer for the response.", - "type": "boolean" - }, - "maxEvents": { - "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" - } - }, - "id": "PullBatchRequest" - }, - "PubsubMessage": { - "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.", - "items": { - "$ref": "Label" - }, - "type": "array" - } - }, - "id": "PubsubMessage" - }, - "ModifyPushConfigRequest": { - "description": "Request for the ModifyPushConfig method.", - "type": "object", - "properties": { - "pushConfig": { - "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" - }, - "ListTopicsResponse": { - "description": "Response for the ListTopics method.", - "type": "object", - "properties": { - "topic": { - "description": "The resulting topics.", - "items": { - "$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": "ListTopicsResponse" - }, - "PublishBatchRequest": { - "description": "Request for the PublishBatch method.", - "type": "object", - "properties": { - "messages": { - "description": "The messages to publish.", - "items": { - "$ref": "PubsubMessage" - }, - "type": "array" - }, - "topic": { - "description": "The messages in the request will be published on this topic.", - "type": "string" - } - }, - "id": "PublishBatchRequest" - }, - "AcknowledgeRequest": { - "description": "Request for the Acknowledge 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.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "id": "AcknowledgeRequest" - }, - "PullBatchResponse": { - "description": "Response for the PullBatch method.", - "type": "object", - "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.", - "items": { - "$ref": "PullResponse" - }, - "type": "array" - } - }, - "id": "PullBatchResponse" - }, - "Empty": { - "description": "An empty message that you can re-use to avoid defining duplicated empty\nmessages in your project. A typical example is to use it as argument or the\nreturn value of a service API. For instance:\n\n service Foo {\n rpc Bar (proto2.Empty) returns (proto2.Empty) { };\n };\n\nBEGIN GOOGLE-INTERNAL\nThe difference between this one and net/rpc/empty-message.proto is that\n1) The generated message here is in proto2 C++ API.\n2) The proto2.Empty has minimum dependencies\n (no message_set or net/rpc dependencies)\nEND GOOGLE-INTERNAL", - "type": "object", - "properties": {}, - "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.", - "type": "string" + "type": "string", + "description": "This ID must be used to acknowledge the received event or message." }, "pubsubEvent": { "description": "A pubsub message or truncation event.", @@ -627,125 +457,125 @@ "id": "PullResponse" }, "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\".", "type": "string" } }, - "id": "PushConfig", - "description": "Configuration for a push delivery endpoint.", - "type": "object" + "id": "PushConfig" }, "PullRequest": { - "id": "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 FAILED_PRECONDITION. The client may cancel the request if\nit does not wish to wait any longer for the response.", + "type": "boolean" + }, "subscription": { "description": "The subscription from which a message should be pulled.", "type": "string" + } + }, + "id": "PullRequest" + }, + "ListSubscriptionsResponse": { + "id": "ListSubscriptionsResponse", + "description": "Response for the ListSubscriptions method.", + "type": "object", + "properties": { + "subscription": { + "description": "The subscriptions that match the request.", + "type": "array", + "items": { + "$ref": "Subscription" + } }, - "returnImmediately": { - "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." + "nextPageToken": { + "description": "If not empty, indicates that there are more subscriptions that match the\nrequest and this value should be passed to the next\n\u003ccode\u003eListSubscriptionsRequest\u003c/code\u003e to continue.", + "type": "string" } } }, "PubsubEvent": { - "id": "PubsubEvent", "description": "An event indicating a received message or truncation event.", "type": "object", "properties": { + "subscription": { + "description": "The subscription that received the event.", + "type": "string" + }, + "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" }, - "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.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "If not empty, indicates that there are more subscriptions that match the\nrequest and this value should be passed to the next\n\u003ccode\u003eListSubscriptionsRequest\u003c/code\u003e to continue.", - "type": "string" - }, - "subscription": { - "items": { - "$ref": "Subscription" - }, - "type": "array", - "description": "The subscriptions that match the request." } }, - "id": "ListSubscriptionsResponse" + "id": "PubsubEvent" }, "PublishRequest": { "description": "Request for the Publish method.", "type": "object", "properties": { - "message": { - "$ref": "PubsubMessage", - "description": "The message to publish." - }, "topic": { "description": "The message in the request will be published on this topic.", "type": "string" + }, + "message": { + "$ref": "PubsubMessage", + "description": "The message to publish." } }, "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.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "id": "PublishBatchResponse", - "description": "Response for the PublishBatch method.", - "type": "object" - }, "Subscription": { "description": "A subscription resource.", "type": "object", "properties": { - "ackDeadlineSeconds": { - "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." + "description": "The name of the topic from which this subscription is receiving messages.", + "type": "string" }, "pushConfig": { - "$ref": "PushConfig", - "description": "If push delivery is used with this subscription, this field is\nused to configure it." + "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", + "type": "integer" } }, "id": "Subscription" }, + "PublishBatchResponse": { + "id": "PublishBatchResponse", + "description": "Response for the PublishBatch 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" + } + } + } + }, "Topic": { "description": "A topic resource.", "type": "object", @@ -766,8 +596,8 @@ "type": "string" }, "numValue": { - "format": "int64", "description": "An integer value.", + "format": "int64", "type": "string" }, "key": { @@ -776,13 +606,177 @@ } }, "id": "Label" + }, + "ModifyAckDeadlineRequest": { + "description": "Request for the ModifyAckDeadline method.", + "type": "object", + "properties": { + "subscription": { + "description": "Next Index: 5\nThe name of the subscription from which messages are being pulled.", + "type": "string" + }, + "ackId": { + "description": "The acknowledgment ID. Either this or ack_ids must be populated,\nnot both.", + "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", + "type": "integer" + }, + "ackIds": { + "description": "List of acknowledgment IDs. Either this field or ack_id\nshould be populated, not both.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "ModifyAckDeadlineRequest" + }, + "PullBatchRequest": { + "description": "Request for the PullBatch method.", + "type": "object", + "properties": { + "subscription": { + "description": "The subscription from which messages should be pulled.", + "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 no messages. The client may cancel the request if it does\nnot wish to wait any longer for the response.", + "type": "boolean" + }, + "maxEvents": { + "type": "integer", + "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" + } + }, + "id": "PullBatchRequest" + }, + "PubsubMessage": { + "description": "A message data and its labels.", + "type": "object", + "properties": { + "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" + }, + "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" + } + }, + "id": "PubsubMessage" + }, + "ModifyPushConfigRequest": { + "description": "Request for the ModifyPushConfig method.", + "type": "object", + "properties": { + "pushConfig": { + "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" + }, + "PullBatchResponse": { + "description": "Response for the PullBatch method.", + "type": "object", + "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" + } + } + }, + "id": "PullBatchResponse" + }, + "AcknowledgeRequest": { + "description": "Request for the Acknowledge method.", + "type": "object", + "properties": { + "ackId": { + "description": "The acknowledgment ID for the message being acknowledged. This was\nreturned by the Pub/Sub system in the Pull response.", + "type": "array", + "items": { + "type": "string" + } + }, + "subscription": { + "type": "string", + "description": "The subscription whose message is being acknowledged." + } + }, + "id": "AcknowledgeRequest" + }, + "Empty": { + "description": "An empty message that you can re-use to avoid defining duplicated empty\nmessages in your project. A typical example is to use it as argument or the\nreturn value of a service API. For instance:\n\n service Foo {\n rpc Bar (proto2.Empty) returns (proto2.Empty) { };\n };\n\nBEGIN GOOGLE-INTERNAL\nThe difference between this one and net/rpc/empty-message.proto is that\n1) The generated message here is in proto2 C++ API.\n2) The proto2.Empty has minimum dependencies\n (no message_set or net/rpc dependencies)\nEND GOOGLE-INTERNAL", + "type": "object", + "properties": {}, + "id": "Empty" + }, + "PublishBatchRequest": { + "description": "Request for the PublishBatch method.", + "type": "object", + "properties": { + "messages": { + "description": "The messages to publish.", + "type": "array", + "items": { + "$ref": "PubsubMessage" + } + }, + "topic": { + "description": "The messages in the request will be published on this topic.", + "type": "string" + } + }, + "id": "PublishBatchRequest" + }, + "ListTopicsResponse": { + "description": "Response for the ListTopics method.", + "type": "object", + "properties": { + "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" + }, + "topic": { + "type": "array", + "items": { + "$ref": "Topic" + }, + "description": "The resulting topics." + } + }, + "id": "ListTopicsResponse" } }, - "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": "v1beta1a", "baseUrl": "https://pubsub.googleapis.com/", "canonicalName": "Pubsub", @@ -798,10 +792,16 @@ } } }, - "servicePath": "", - "description": "Provides reliable, many-to-many, asynchronous messaging between applications.\n", "kind": "discovery#restDescription", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.\n", + "servicePath": "", "rootUrl": "https://pubsub.googleapis.com/", "basePath": "", - "ownerDomain": "google.com" + "ownerDomain": "google.com", + "name": "pubsub", + "batchPath": "batch", + "revision": "20171129", + "documentationLink": "https://cloud.google.com/pubsub/docs", + "id": "pubsub:v1beta1a", + "title": "Google Cloud Pub/Sub API" } diff --git a/etc/api/pubsub/v1beta2/pubsub-api.json b/etc/api/pubsub/v1beta2/pubsub-api.json index 63b1e46d0b..4dab58a1d6 100644 --- a/etc/api/pubsub/v1beta2/pubsub-api.json +++ b/etc/api/pubsub/v1beta2/pubsub-api.json @@ -1,329 +1,27 @@ { - "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", + "revision": "20171129", "documentationLink": "https://cloud.google.com/pubsub/docs", - "revision": "20170829", + "id": "pubsub:v1beta2", "title": "Google Cloud Pub/Sub API", - "discoveryVersion": "v1", "ownerName": "Google", + "discoveryVersion": "v1", "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." - } - } - } - } - }, "subscriptions": { "methods": { "acknowledge": { "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}:acknowledge", - "id": "pubsub.projects.subscriptions.acknowledge", "path": "v1beta2/{+subscription}:acknowledge", + "id": "pubsub.projects.subscriptions.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" }, - "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" }, @@ -337,33 +35,33 @@ ], "parameters": { "subscription": { - "type": "string", - "required": true, "pattern": "^projects/[^/]+/subscriptions/[^/]+$", "location": "path", - "description": "The subscription whose message is being acknowledged." + "description": "The subscription whose message is being acknowledged.", + "required": true, + "type": "string" } } }, "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" - ], + "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.", - "type": "string", "required": true, - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", - "location": "path" + "type": "string", + "pattern": "^projects/[^/]+/subscriptions/[^/]+$" } }, "scopes": [ @@ -379,53 +77,53 @@ "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.", + "httpMethod": "GET", "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, + "type": "string", "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" ] }, + "get": { + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}", + "path": "v1beta2/{+subscription}", + "id": "pubsub.projects.subscriptions.get", + "description": "Gets the configuration details of a subscription.", + "response": { + "$ref": "Subscription" + }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "subscription": { + "description": "The name of the subscription to get.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "location": "path" + } + } + }, "testIamPermissions": { "httpMethod": "POST", "parameterOrder": [ @@ -434,44 +132,44 @@ "response": { "$ref": "TestIamPermissionsResponse" }, + "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." + } + }, "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", + "path": "v1beta2/{+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." }, "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" - }, + "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`.", + "httpMethod": "POST", "parameterOrder": [ "subscription" ], - "httpMethod": "POST", + "response": { + "$ref": "Empty" + }, "parameters": { "subscription": { "description": "The name of the subscription.", - "type": "string", "required": true, + "type": "string", "pattern": "^projects/[^/]+/subscriptions/[^/]+$", "location": "path" } @@ -484,13 +182,33 @@ "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" + "delete": { + "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.", + "response": { + "$ref": "Empty" }, + "parameterOrder": [ + "subscription" + ], + "httpMethod": "DELETE", + "parameters": { + "subscription": { + "description": "The subscription to delete.", + "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}", + "path": "v1beta2/{+subscription}", + "id": "pubsub.projects.subscriptions.delete" + }, + "pull": { "response": { "$ref": "PullResponse" }, @@ -501,8 +219,8 @@ "parameters": { "subscription": { "description": "The subscription from which messages should be pulled.", - "type": "string", "required": true, + "type": "string", "pattern": "^projects/[^/]+/subscriptions/[^/]+$", "location": "path" } @@ -511,91 +229,96 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" ], - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}: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." }, - "delete": { + "list": { + "flatPath": "v1beta2/projects/{projectsId}/subscriptions", + "path": "v1beta2/{+project}/subscriptions", + "id": "pubsub.projects.subscriptions.list", + "description": "Lists matching subscriptions.", "response": { - "$ref": "Empty" + "$ref": "ListSubscriptionsResponse" }, "parameterOrder": [ - "subscription" + "project" ], - "httpMethod": "DELETE", + "httpMethod": "GET", "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" + "type": "string", + "location": "query" }, "pageSize": { "location": "query", - "format": "int32", "description": "Maximum number of subscriptions to return.", + "format": "int32", "type": "integer" }, "project": { "description": "The name of the cloud project that subscriptions belong to.", - "type": "string", "required": true, + "type": "string", "pattern": "^projects/[^/]+$", "location": "path" } + } + }, + "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.", + "response": { + "$ref": "Subscription" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PUT", + "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" + } }, "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." + "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}", + "path": "v1beta2/{+name}", + "id": "pubsub.projects.subscriptions.create" }, "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" }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/pubsub" ], "parameters": { "resource": { - "type": "string", "required": true, + "type": "string", "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." @@ -603,36 +326,289 @@ }, "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", + "id": "pubsub.projects.subscriptions.setIamPolicy", + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", "request": { - "$ref": "Subscription" + "$ref": "SetIamPolicyRequest" + } + } + } + }, + "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" }, - "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" + "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/[^/]+/topics/[^/]+$" + } + }, + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}:getIamPolicy", + "path": "v1beta2/{+resource}:getIamPolicy", + "id": "pubsub.projects.topics.getIamPolicy" + }, + "get": { + "description": "Gets the configuration of a topic.", + "response": { + "$ref": "Topic" + }, + "parameterOrder": [ + "topic" + ], + "httpMethod": "GET", + "parameters": { + "topic": { + "location": "path", + "description": "The name of the topic to get.", + "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}", + "path": "v1beta2/{+topic}", + "id": "pubsub.projects.topics.get" + }, + "publish": { + "httpMethod": "POST", + "parameterOrder": [ + "topic" ], "response": { - "$ref": "Subscription" + "$ref": "PublishResponse" }, "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", + "topic": { + "description": "The messages in the request will be published on this topic.", "required": true, - "pattern": "^projects/[^/]+/subscriptions/[^/]+$", + "type": "string", + "pattern": "^projects/[^/]+/topics/[^/]+$", "location": "path" } }, - "flatPath": "v1beta2/projects/{projectsId}/subscriptions/{subscriptionsId}" + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}:publish", + "id": "pubsub.projects.topics.publish", + "path": "v1beta2/{+topic}: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" + } + }, + "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": { + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}:testIamPermissions", + "id": "pubsub.projects.topics.testIamPermissions", + "path": "v1beta2/{+resource}:testIamPermissions" + }, + "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", + "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" + }, + "list": { + "flatPath": "v1beta2/projects/{projectsId}/topics", + "id": "pubsub.projects.topics.list", + "path": "v1beta2/{+project}/topics", + "description": "Lists matching topics.", + "httpMethod": "GET", + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ListTopicsResponse" + }, + "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": { + "location": "query", + "description": "Maximum number of topics to return.", + "format": "int32", + "type": "integer" + }, + "project": { + "description": "The name of the cloud project that topics belong to.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "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", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/topics/[^/]+$", + "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\"`." + } + }, + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}", + "path": "v1beta2/{+name}", + "id": "pubsub.projects.topics.create", + "description": "Creates the given topic with the given name.", + "request": { + "$ref": "Topic" + } + } + }, + "resources": { + "subscriptions": { + "methods": { + "list": { + "description": "Lists the name of the subscriptions for this topic.", + "response": { + "$ref": "ListTopicSubscriptionsResponse" + }, + "parameterOrder": [ + "topic" + ], + "httpMethod": "GET", + "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": { + "type": "integer", + "location": "query", + "description": "Maximum number of subscription names to return.", + "format": "int32" + }, + "topic": { + "pattern": "^projects/[^/]+/topics/[^/]+$", + "location": "path", + "description": "The name of the topic that subscriptions are attached to.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ], + "flatPath": "v1beta2/projects/{projectsId}/topics/{topicsId}/subscriptions", + "path": "v1beta2/{+topic}/subscriptions", + "id": "pubsub.projects.topics.subscriptions.list" + } + } } } } @@ -648,28 +624,33 @@ "pp": { "location": "query", "description": "Pretty-print response.", - "default": "true", - "type": "boolean" - }, - "bearer_token": { - "location": "query", - "description": "OAuth bearer token.", - "type": "string" + "type": "boolean", + "default": "true" }, "oauth_token": { - "location": "query", "description": "OAuth 2.0 token for the current user.", - "type": "string" + "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" + "type": "string", + "location": "query" }, "prettyPrint": { "description": "Returns response with indentations and line breaks.", - "default": "true", "type": "boolean", + "default": "true", + "location": "query" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", "location": "query" }, "uploadType": { @@ -677,11 +658,6 @@ "type": "string", "location": "query" }, - "fields": { - "location": "query", - "description": "Selector specifying which fields to include in a partial response.", - "type": "string" - }, "$.xgafv": { "type": "string", "enumDescriptions": [ @@ -696,17 +672,11 @@ "description": "V1 error format." }, "callback": { + "location": "query", "description": "JSONP", - "type": "string", - "location": "query" + "type": "string" }, "alt": { - "enum": [ - "json", - "media", - "proto" - ], - "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -714,7 +684,13 @@ ], "location": "query", "description": "Data format for response.", - "default": "json" + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" }, "access_token": { "location": "query", @@ -722,26 +698,289 @@ "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" } }, "schemas": { + "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": { + "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": { + "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": { + "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" + } + }, + "id": "Subscription" + }, + "TestIamPermissionsRequest": { + "description": "Request message for `TestIamPermissions` method.", + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "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" + }, + "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": { + "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": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + }, + "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" + } + } + }, + "id": "Policy" + }, + "ModifyAckDeadlineRequest": { + "description": "Request for the ModifyAckDeadline method.", + "type": "object", + "properties": { + "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.", + "format": "int32", + "type": "integer" + }, + "ackIds": { + "description": "List of acknowledgment IDs.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "ModifyAckDeadlineRequest" + }, + "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." + } + }, + "id": "SetIamPolicyRequest", + "description": "Request message for `SetIamPolicy` method.", + "type": "object" + }, + "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": { + "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. For JSON requests, the value of this field must be\n[base64-encoded](https://tools.ietf.org/html/rfc4648).", + "format": "byte", + "type": "string" + }, + "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" + } + }, + "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": { + "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", + "description": "Associates `members` with a `role`.", + "type": "object" + }, + "AcknowledgeRequest": { + "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", + "description": "Request for the Acknowledge method." + }, + "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" + }, + "ListTopicsResponse": { + "description": "Response for the `ListTopics` method.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "If not empty, indicates that there may be more topics that match the\nrequest; this value should be passed in a new `ListTopicsRequest`.", + "type": "string" + }, + "topics": { + "description": "The resulting topics.", + "type": "array", + "items": { + "$ref": "Topic" + } + } + }, + "id": "ListTopicsResponse" + }, + "ListTopicSubscriptionsResponse": { + "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`ListTopicSubscriptionsRequest` to get more subscriptions.", + "type": "string" + }, + "subscriptions": { + "description": "The names of the subscriptions that match the request.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "ListTopicSubscriptionsResponse", + "description": "Response for the `ListTopicSubscriptions` method." + }, + "PullResponse": { + "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" + } + } + }, + "id": "PullResponse", + "description": "Response for the `Pull` method.", + "type": "object" + }, + "ReceivedMessage": { + "description": "A message and its corresponding acknowledgment ID.", + "type": "object", + "properties": { + "message": { + "description": "The message.", + "$ref": "PubsubMessage" + }, + "ackId": { + "description": "This ID can be used to acknowledge the received message.", + "type": "string" + } + }, + "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\".", + "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 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" } - }, - "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" @@ -751,11 +990,11 @@ "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" @@ -769,14 +1008,16 @@ "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.", + "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.", @@ -784,292 +1025,51 @@ }, "subscriptions": { "description": "The subscriptions that match the request.", + "type": "array", "items": { "$ref": "Subscription" - }, - "type": "array" + } } }, - "id": "ListSubscriptionsResponse", - "description": "Response for the `ListSubscriptions` method.", - "type": "object" + "id": "ListSubscriptionsResponse" }, "PublishRequest": { + "description": "Request for the Publish method.", "type": "object", "properties": { "messages": { + "description": "The messages to publish.", + "type": "array", "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." + "id": "PublishRequest" + } + }, + "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/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" }, - "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": { - "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.", - "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": { - "type": "integer", - "format": "int32", - "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" - }, - "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" - }, - "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": { - "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. 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": { - "additionalProperties": { - "type": "string" - }, - "description": "Optional attributes for this message.", - "type": "object" - } - }, - "id": "PubsubMessage" - }, - "ModifyPushConfigRequest": { - "type": "object", - "properties": { - "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.", - "$ref": "PushConfig" - } - }, - "id": "ModifyPushConfigRequest", - "description": "Request for the ModifyPushConfig method." - }, - "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", - "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" - }, - "ListTopicsResponse": { - "description": "Response for the `ListTopics` method.", - "type": "object", - "properties": { - "nextPageToken": { - "description": "If not empty, indicates that there may be more topics that match the\nrequest; this value should be passed in a new `ListTopicsRequest`.", - "type": "string" - }, - "topics": { - "description": "The resulting topics.", - "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", - "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`ListTopicSubscriptionsRequest` to get more subscriptions.", - "type": "string" - }, - "subscriptions": { - "description": "The names of the subscriptions that match the request.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "id": "ListTopicSubscriptionsResponse" - }, - "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.", - "items": { - "$ref": "ReceivedMessage" - }, - "type": "array" - } - }, - "id": "PullResponse" - }, - "ReceivedMessage": { - "id": "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" + "https://www.googleapis.com/auth/pubsub": { + "description": "View and manage Pub/Sub topics and subscriptions" } } } - } + }, + "kind": "discovery#restDescription", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.\n", + "servicePath": "", + "rootUrl": "https://pubsub.googleapis.com/" } diff --git a/etc/api/resourceviews/v1beta1/resourceviews-api.json b/etc/api/resourceviews/v1beta1/resourceviews-api.json index 3e8602b694..bb2c81df26 100644 --- a/etc/api/resourceviews/v1beta1/resourceviews-api.json +++ b/etc/api/resourceviews/v1beta1/resourceviews-api.json @@ -23,7 +23,7 @@ "basePath": "/resourceviews/v1beta1/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "resourceviews/v1beta1/projects/", - "batchPath": "batch", + "batchPath": "batch/resourceviews/v1beta1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/runtimeconfig/v1/runtimeconfig-api.json b/etc/api/runtimeconfig/v1/runtimeconfig-api.json index 696bda0be6..67770c3894 100644 --- a/etc/api/runtimeconfig/v1/runtimeconfig-api.json +++ b/etc/api/runtimeconfig/v1/runtimeconfig-api.json @@ -1,5 +1,21 @@ { + "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": "20171030", + "id": "runtimeconfig:v1", + "documentationLink": "https://cloud.google.com/deployment-manager/runtime-configurator/", + "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" + }, "CancelOperationRequest": { "description": "The request message for Operations.CancelOperation.", "type": "object", @@ -12,18 +28,18 @@ "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": { - "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" - } - }, - "type": "array" + }, + "type": "object" + } }, "code": { - "format": "int32", "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", "type": "integer" }, "message": { @@ -33,22 +49,28 @@ }, "id": "Status" }, + "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" + }, "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" @@ -64,40 +86,28 @@ "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": { + "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": "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", - "properties": {}, - "id": "Empty" } }, + "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", "canonicalName": "Cloud RuntimeConfig", "auth": { "oauth2": { @@ -121,49 +131,14 @@ "resources": { "operations": { "methods": { - "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": { + "flatPath": "v1/operations/{operationsId}:cancel", + "path": "v1/{+name}:cancel", + "id": "runtimeconfig.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`.", + "request": { + "$ref": "CancelOperationRequest" + }, "response": { "$ref": "Empty" }, @@ -178,21 +153,18 @@ "parameters": { "name": { "description": "The name of the operation resource to be cancelled.", - "type": "string", "required": true, + "type": "string", "pattern": "^operations/.+$", "location": "path" } - }, - "flatPath": "v1/operations/{operationsId}:cancel", - "id": "runtimeconfig.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`." + } }, "delete": { + "flatPath": "v1/operations/{operationsId}", + "path": "v1/{+name}", + "id": "runtimeconfig.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`.", "response": { "$ref": "Empty" }, @@ -200,58 +172,75 @@ "name" ], "httpMethod": "DELETE", + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "required": true, + "type": "string", + "pattern": "^operations/.+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ] + }, + "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": { + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, "name": { - "description": "The name of the operation resource to be deleted.", - "type": "string", + "location": "path", + "description": "The name of the operation's parent resource.", "required": true, - "pattern": "^operations/.+$", - "location": "path" + "type": "string", + "pattern": "^operations$" + }, + "pageToken": { + "description": "The standard list page token.", + "type": "string", + "location": "query" } }, - "flatPath": "v1/operations/{operationsId}", - "id": "runtimeconfig.operations.delete", + "flatPath": "v1/operations", "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`." + "id": "runtimeconfig.operations.list" } } } }, "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": { + "oauth_token": { "location": "query", - "description": "OAuth access token.", + "description": "OAuth 2.0 token for the current user.", "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": { + "location": "query", "description": "OAuth bearer token.", - "type": "string", - "location": "query" + "type": "string" }, "upload_protocol": { "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", @@ -261,25 +250,22 @@ "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" + "type": "boolean", + "default": "true" }, "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" @@ -288,8 +274,11 @@ "enum": [ "1", "2" - ], - "description": "V1 error format.", + ] + }, + "callback": { + "location": "query", + "description": "JSONP", "type": "string" }, "alt": { @@ -307,17 +296,28 @@ "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": { + "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.", + "type": "boolean", + "default": "true", + "location": "query" } }, - "version": "v1", - "baseUrl": "https://runtimeconfig.googleapis.com/", - "servicePath": "", - "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": "", - "id": "runtimeconfig:v1", - "documentationLink": "https://cloud.google.com/deployment-manager/runtime-configurator/", - "revision": "20170829", - "discoveryVersion": "v1", - "version_module": true + "version": "v1" } diff --git a/etc/api/runtimeconfig/v1beta1/runtimeconfig-api.json b/etc/api/runtimeconfig/v1beta1/runtimeconfig-api.json index b420ecacce..a2c3d3fba2 100644 --- a/etc/api/runtimeconfig/v1beta1/runtimeconfig-api.json +++ b/etc/api/runtimeconfig/v1beta1/runtimeconfig-api.json @@ -1,18 +1,4 @@ { - "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", @@ -24,34 +10,7 @@ "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" }, @@ -65,21 +24,19 @@ ], "parameters": { "name": { + "required": true, + "type": "string", "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 + "description": "The name of the RuntimeConfig resource to retrieve, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`" } }, "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}", + "path": "v1beta1/{+name}", "id": "runtimeconfig.projects.configs.get", - "path": "v1beta1/{+name}" + "description": "Gets information about a RuntimeConfig resource." }, "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" @@ -91,71 +48,74 @@ "name" ], "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], "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, + "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}", + "path": "v1beta1/{+name}", + "id": "runtimeconfig.projects.configs.update" }, "testIamPermissions": { + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}:testIamPermissions", + "path": "v1beta1/{+resource}:testIamPermissions", + "id": "runtimeconfig.projects.configs.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" }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ], "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, + "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}:testIamPermissions", - "path": "v1beta1/{+resource}:testIamPermissions", - "id": "runtimeconfig.projects.configs.testIamPermissions" + } }, "delete": { "description": "Deletes a RuntimeConfig resource.", - "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, "parameterOrder": [ "name" ], - "response": { - "$ref": "Empty" + "httpMethod": "DELETE", + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/configs/[^/]+$", + "location": "path", + "description": "The RuntimeConfig resource to delete, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`" + } }, "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" @@ -176,16 +136,16 @@ }, "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.", + "format": "int32", "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/[^/]+$" + "type": "string", + "pattern": "^projects/[^/]+$", + "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]`." } }, "scopes": [ @@ -193,39 +153,10 @@ "https://www.googleapis.com/auth/cloudruntimeconfig" ], "flatPath": "v1beta1/projects/{projectsId}/configs", - "id": "runtimeconfig.projects.configs.list", "path": "v1beta1/{+parent}/configs", + "id": "runtimeconfig.projects.configs.list", "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": { @@ -238,59 +169,161 @@ "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", - "location": "query" + "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]`.", - "type": "string", "required": true, + "type": "string", "pattern": "^projects/[^/]+$", - "location": "path" + "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]`." + } + }, + "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", - "id": "runtimeconfig.projects.configs.create", - "path": "v1beta1/{+parent}/configs" + "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": { + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}:getIamPolicy", + "path": "v1beta1/{+resource}:getIamPolicy", + "id": "runtimeconfig.projects.configs.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/cloudruntimeconfig" + ], + "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/[^/]+/configs/[^/]+$" + } + } } }, "resources": { "variables": { "methods": { - "create": { + "list": { "response": { - "$ref": "Variable" + "$ref": "ListVariablesResponse" }, "parameterOrder": [ "parent" ], - "httpMethod": "POST", + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloudruntimeconfig" ], "parameters": { - "requestId": { + "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]`", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/configs/[^/]+$" + }, + "filter": { "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.", + "description": "Filters variables by matching the specified filter. For example:\n\n`projects/example-project/config/[CONFIG_NAME]/variables/example-variable`.", "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]`", + "pageToken": { "type": "string", - "required": true, - "pattern": "^projects/[^/]+/configs/[^/]+$", - "location": "path" + "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." + }, + "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." + }, + "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" } }, "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." + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Variable" + }, + "parameters": { + "requestId": { + "type": "string", + "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." + }, + "parent": { + "location": "path", + "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]`", + "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}/variables", "id": "runtimeconfig.projects.configs.variables.create", "path": "v1beta1/{+parent}/variables", "request": { @@ -299,52 +332,52 @@ "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" ], + "httpMethod": "GET", "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/.+$" + "type": "string", + "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$", + "location": "path", + "description": "The name of the variable to return, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIBLE_NAME]`" } }, "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}", + "path": "v1beta1/{+name}", "id": "runtimeconfig.projects.configs.variables.get", - "path": "v1beta1/{+name}" + "description": "Gets information about a single variable." }, "watch": { - "httpMethod": "POST", + "response": { + "$ref": "Variable" + }, "parameterOrder": [ "name" ], - "response": { - "$ref": "Variable" + "httpMethod": "POST", + "parameters": { + "name": { + "required": true, + "type": "string", + "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]`" + } }, "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", @@ -354,35 +387,42 @@ "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": { + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}", + "path": "v1beta1/{+name}", + "id": "runtimeconfig.projects.configs.variables.update", "request": { "$ref": "Variable" }, "description": "Updates an existing variable with a new value.", - "httpMethod": "PUT", + "response": { + "$ref": "Variable" + }, "parameterOrder": [ "name" ], - "response": { - "$ref": "Variable" + "httpMethod": "PUT", + "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/.+$" + } }, "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": { + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}:testIamPermissions", + "path": "v1beta1/{+resource}:testIamPermissions", + "id": "runtimeconfig.projects.configs.variables.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" }, @@ -390,40 +430,28 @@ "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" + "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/[^/]+/configs/[^/]+/variables/.+$" + } } }, "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" - ], + "httpMethod": "DELETE", "parameters": { "recursive": { "location": "query", @@ -431,125 +459,112 @@ "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/.+$" + "type": "string", + "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$", + "location": "path", + "description": "The name of the variable to delete, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]`" } }, - "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" + ], + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}", + "path": "v1beta1/{+name}", + "id": "runtimeconfig.projects.configs.variables.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." + } + } + }, + "operations": { + "methods": { + "get": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", "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": { + "name": { "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", + "description": "The name of the operation resource.", "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" + "pattern": "^projects/[^/]+/configs/[^/]+/operations/.+$" } }, - "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." + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/operations/{operationsId}", + "path": "v1beta1/{+name}", + "id": "runtimeconfig.projects.configs.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." + }, + "testIamPermissions": { + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/operations/{operationsId}:testIamPermissions", + "id": "runtimeconfig.projects.configs.operations.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.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameters": { + "resource": { + "required": true, + "type": "string", + "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." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudruntimeconfig" + ] } } }, "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.", + "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": { + "location": "path", "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" + "type": "string", + "pattern": "^projects/[^/]+/configs/[^/]+/waiters/[^/]+$" } - } - }, - "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", + "id": "runtimeconfig.projects.configs.waiters.delete", "path": "v1beta1/{+name}", - "description": "Gets information about a single waiter." + "description": "Deletes the waiter with the specified name." }, "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" @@ -563,79 +578,43 @@ ], "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.", - "type": "string" + "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" + "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" }, "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 + "pattern": "^projects/[^/]+/configs/[^/]+$" } }, "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters", + "id": "runtimeconfig.projects.configs.waiters.list", "path": "v1beta1/{+parent}/waiters", - "id": "runtimeconfig.projects.configs.waiters.create", - "request": { + "description": "List waiters within the given configuration." + }, + "get": { + "httpMethod": "GET", + "response": { "$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" + "name" ], - "httpMethod": "POST", "parameters": { - "resource": { + "name": { "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", + "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/[^/]+$" } }, @@ -643,66 +622,73 @@ "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" - ], + "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": { + "type": "string", + "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." + }, + "parent": { + "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]`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/configs/[^/]+$" + } + }, "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" + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters", + "path": "v1beta1/{+parent}/waiters", + "id": "runtimeconfig.projects.configs.waiters.create" }, "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", + "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters/{waitersId}:testIamPermissions", "path": "v1beta1/{+resource}:testIamPermissions", - "id": "runtimeconfig.projects.configs.operations.testIamPermissions", + "id": "runtimeconfig.projects.configs.waiters.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." + "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", + "parameters": { + "resource": { + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/configs/[^/]+/waiters/[^/]+$", + "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/cloudruntimeconfig" + ] } } } @@ -718,10 +704,10 @@ "type": "string" }, "prettyPrint": { + "location": "query", "description": "Returns response with indentations and line breaks.", - "default": "true", "type": "boolean", - "location": "query" + "default": "true" }, "fields": { "type": "string", @@ -729,27 +715,27 @@ "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" + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." }, "$.xgafv": { + "type": "string", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], "location": "query", "enum": [ "1", "2" ], - "description": "V1 error format.", + "description": "V1 error format." + }, + "callback": { "type": "string", - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ] + "location": "query", + "description": "JSONP" }, "alt": { "enum": [ @@ -767,31 +753,31 @@ "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" + "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": { + "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.", - "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." }, "pp": { "location": "query", "description": "Pretty-print response.", - "default": "true", - "type": "boolean" + "type": "boolean", + "default": "true" }, "oauth_token": { - "description": "OAuth 2.0 token for the current user.", "type": "string", - "location": "query" + "location": "query", + "description": "OAuth 2.0 token for the current user." }, "bearer_token": { "location": "query", @@ -805,81 +791,46 @@ "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", + "documentationLink": "https://cloud.google.com/deployment-manager/runtime-configurator/", + "revision": "20171030", "discoveryVersion": "v1", "version_module": true, "schemas": { - "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": { - "$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" - } - }, - "id": "Operation" - }, "SetIamPolicyRequest": { - "id": "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", + "description": "Request message for `SetIamPolicy` method." }, "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", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + } + }, + "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." + }, "code": { - "format": "int32", + "type": "integer", "description": "The status code, which should be an enum value of google.rpc.Code.", - "type": "integer" + "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.", - "items": { - "type": "object", - "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - } - }, - "type": "array" } }, "id": "Status" @@ -888,84 +839,84 @@ "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" + }, + "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" } }, "id": "Binding" }, + "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 `{}`." + }, "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" + "type": "string", + "description": "The root of the variable subtree to monitor. For example, `/foo`." + }, + "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" + "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." }, "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" + "type": "string", + "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" } }, "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", - "description": "The condition that a Waiter resource is waiting for.", - "type": "object" + "id": "EndCondition" }, "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" + "id": "TestIamPermissionsResponse", + "description": "Response message for `TestIamPermissions` method." }, "ListVariablesResponse": { "description": "Response for the `ListVariables()` method.", @@ -973,14 +924,14 @@ "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" + "type": "string", + "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" } }, "id": "ListVariablesResponse" @@ -989,46 +940,60 @@ "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": { - "description": { - "description": "An optional description of the RuntimeConfig object.", + "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\n[0-9A-Za-z](?:[_.A-Za-z0-9-]{0,62}[_.A-Za-z0-9])? regular expression.\nThe length of `[CONFIG_NAME]` must be less than 64 characters.\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" }, - "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": { + "type": "string", + "description": "An optional description of the RuntimeConfig object." } }, "id": "RuntimeConfig" }, "WatchVariableRequest": { - "id": "WatchVariableRequest", - "description": "Request for the `WatchVariable()` method.", "type": "object", "properties": { "newerThan": { - "format": "google-datetime", + "type": "string", "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" - } - } - }, - "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" + "format": "google-datetime" } }, - "id": "ListWaitersResponse" + "id": "WatchVariableRequest", + "description": "Request for the `WatchVariable()` method." + }, + "ListWaitersResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "type": "string", + "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" + }, + "waiters": { + "description": "Found waiters in the project.", + "type": "array", + "items": { + "$ref": "Waiter" + } + } + }, + "id": "ListWaitersResponse", + "description": "Response for the `ListWaiters()` method.\nOrder of returned waiter objects is arbitrary." + }, + "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" }, "Waiter": { "type": "object", @@ -1042,49 +1007,63 @@ "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" + "$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." }, "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" + "type": "boolean", + "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." }, "createTime": { - "format": "google-datetime", + "type": "string", "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" + "format": "google-datetime" }, "timeout": { - "format": "google-duration", + "type": "string", "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" + "format": "google-duration" }, "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" + "type": "string", + "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." } }, "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.", + "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": { - "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).", + "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": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + }, + "bindings": { + "type": "array", "items": { - "type": "string" + "$ref": "Binding" }, - "type": "array" + "description": "Associates a list of `members` to a `role`.\n`bindings` with no members will result in an error." } }, - "id": "TestIamPermissionsRequest" + "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": { + "updateTime": { + "type": "string", + "description": "[Output Only] The time of the last variable update.", + "format": "google-datetime" + }, "state": { "type": "string", "enumDescriptions": [ @@ -1099,13 +1078,8 @@ ], "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." }, - "updateTime": { - "format": "google-datetime", - "description": "[Output Only] The time of the last variable update.", - "type": "string" - }, "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.", + "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 match\n[0-9A-Za-z](?:[_.A-Za-z0-9-]{0,62}[_.A-Za-z0-9])? regular expression.\nThe length of a `[VARIABLE_NAME]` must be less than 256 characters.\n\nOnce you create a variable, you cannot change the variable name.", "type": "string" }, "text": { @@ -1113,41 +1087,67 @@ "type": "string" }, "value": { - "format": "byte", + "type": "string", "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" + "format": "byte" } }, - "id": "Variable" + "id": "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)." }, - "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).", + "Operation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", "type": "object", "properties": { - "etag": { - "type": "string", - "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." - }, - "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" + "metadata": { + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." }, - "type": "array" + "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": { + "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": { + "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." } }, - "id": "Policy" + "id": "Operation" } }, "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" + "protocol": "rest", + "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/" } diff --git a/etc/api/safebrowsing/v4/safebrowsing-api.json b/etc/api/safebrowsing/v4/safebrowsing-api.json index cd498f607b..7916beb8a3 100644 --- a/etc/api/safebrowsing/v4/safebrowsing-api.json +++ b/etc/api/safebrowsing/v4/safebrowsing-api.json @@ -1,18 +1,40 @@ { + "rootUrl": "https://safebrowsing.googleapis.com/", "basePath": "", "ownerDomain": "google.com", "name": "safebrowsing", "batchPath": "batch", - "id": "safebrowsing:v4", + "revision": "20171204", "documentationLink": "https://developers.google.com/safe-browsing/", - "revision": "20170921", + "id": "safebrowsing:v4", "title": "Google Safe Browsing API", "discoveryVersion": "v1", "ownerName": "Google", "resources": { + "threatMatches": { + "methods": { + "find": { + "path": "v4/threatMatches:find", + "id": "safebrowsing.threatMatches.find", + "description": "Finds the threat entries that match the Safe Browsing lists.", + "request": { + "$ref": "FindThreatMatchesRequest" + }, + "response": { + "$ref": "FindThreatMatchesResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "flatPath": "v4/threatMatches:find" + } + } + }, "fullHashes": { "methods": { "find": { + "path": "v4/fullHashes:find", + "id": "safebrowsing.fullHashes.find", "description": "Finds the full hashes that match the requested hash prefixes.", "request": { "$ref": "FindFullHashesRequest" @@ -23,22 +45,21 @@ "parameterOrder": [], "httpMethod": "POST", "parameters": {}, - "flatPath": "v4/fullHashes:find", - "id": "safebrowsing.fullHashes.find", - "path": "v4/fullHashes:find" + "flatPath": "v4/fullHashes:find" } } }, "encodedUpdates": { "methods": { "get": { - "httpMethod": "GET", + "description": "", "response": { "$ref": "FetchThreatListUpdatesResponse" }, "parameterOrder": [ "encodedRequest" ], + "httpMethod": "GET", "parameters": { "clientId": { "location": "query", @@ -46,32 +67,27 @@ "type": "string" }, "clientVersion": { + "location": "query", "description": "The version of the client implementation.", - "type": "string", - "location": "query" + "type": "string" }, "encodedRequest": { - "type": "string", - "required": true, - "location": "path", + "description": "A serialized FetchThreatListUpdatesRequest proto.", "format": "byte", - "description": "A serialized FetchThreatListUpdatesRequest proto." + "required": true, + "type": "string", + "location": "path" } }, "flatPath": "v4/encodedUpdates/{encodedRequest}", "path": "v4/encodedUpdates/{encodedRequest}", - "id": "safebrowsing.encodedUpdates.get", - "description": "" + "id": "safebrowsing.encodedUpdates.get" } } }, "threatListUpdates": { "methods": { "fetch": { - "description": "Fetches the most recent threat list updates. A client can request updates\nfor multiple lists at once.", - "request": { - "$ref": "FetchThreatListUpdatesRequest" - }, "response": { "$ref": "FetchThreatListUpdatesResponse" }, @@ -79,99 +95,113 @@ "httpMethod": "POST", "parameters": {}, "flatPath": "v4/threatListUpdates:fetch", + "path": "v4/threatListUpdates:fetch", "id": "safebrowsing.threatListUpdates.fetch", - "path": "v4/threatListUpdates:fetch" + "request": { + "$ref": "FetchThreatListUpdatesRequest" + }, + "description": "Fetches the most recent threat list updates. A client can request updates\nfor multiple lists at once." + } + } + }, + "threatHits": { + "methods": { + "create": { + "id": "safebrowsing.threatHits.create", + "path": "v4/threatHits", + "request": { + "$ref": "ThreatHit" + }, + "description": "Reports a Safe Browsing threat list hit to Google. Only projects with\nTRUSTED_REPORTER visibility can use this method.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "Empty" + }, + "parameters": {}, + "flatPath": "v4/threatHits" } } }, "encodedFullHashes": { "methods": { "get": { - "parameters": { - "clientId": { - "description": "A client ID that (hopefully) uniquely identifies the client implementation\nof the Safe Browsing API.", - "type": "string", - "location": "query" - }, - "clientVersion": { - "type": "string", - "location": "query", - "description": "The version of the client implementation." - }, - "encodedRequest": { - "location": "path", - "format": "byte", - "description": "A serialized FindFullHashesRequest proto.", - "type": "string", - "required": true - } - }, - "flatPath": "v4/encodedFullHashes/{encodedRequest}", - "id": "safebrowsing.encodedFullHashes.get", - "path": "v4/encodedFullHashes/{encodedRequest}", - "description": "", "response": { "$ref": "FindFullHashesResponse" }, "parameterOrder": [ "encodedRequest" ], - "httpMethod": "GET" + "httpMethod": "GET", + "parameters": { + "clientId": { + "location": "query", + "description": "A client ID that (hopefully) uniquely identifies the client implementation\nof the Safe Browsing API.", + "type": "string" + }, + "clientVersion": { + "location": "query", + "description": "The version of the client implementation.", + "type": "string" + }, + "encodedRequest": { + "location": "path", + "description": "A serialized FindFullHashesRequest proto.", + "format": "byte", + "required": true, + "type": "string" + } + }, + "flatPath": "v4/encodedFullHashes/{encodedRequest}", + "path": "v4/encodedFullHashes/{encodedRequest}", + "id": "safebrowsing.encodedFullHashes.get", + "description": "" } } }, "threatLists": { "methods": { "list": { - "description": "Lists the Safe Browsing threat lists available for download.", + "httpMethod": "GET", "response": { "$ref": "ListThreatListsResponse" }, "parameterOrder": [], - "httpMethod": "GET", "parameters": {}, "flatPath": "v4/threatLists", "id": "safebrowsing.threatLists.list", - "path": "v4/threatLists" - } - } - }, - "threatMatches": { - "methods": { - "find": { - "flatPath": "v4/threatMatches:find", - "id": "safebrowsing.threatMatches.find", - "path": "v4/threatMatches:find", - "request": { - "$ref": "FindThreatMatchesRequest" - }, - "description": "Finds the threat entries that match the Safe Browsing lists.", - "response": { - "$ref": "FindThreatMatchesResponse" - }, - "parameterOrder": [], - "httpMethod": "POST", - "parameters": {} + "path": "v4/threatLists", + "description": "Lists the Safe Browsing threat lists available for download." } } } }, "parameters": { - "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "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": { - "default": "true", - "type": "boolean", "location": "query", - "description": "Returns response with indentations and line breaks." + "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", - "location": "query" + "type": "string" }, "uploadType": { "location": "query", @@ -179,30 +209,24 @@ "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", "description": "JSONP", - "type": "string" + "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", @@ -210,83 +234,426 @@ ], "location": "query", "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." + "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" + }, "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", - "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" + "default": "true" } }, "schemas": { - "Constraints": { - "description": "The constraints for this update.", - "type": "object", + "ThreatListDescriptor": { "properties": { - "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.", + "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 platform type targeted by the list's entries.", "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.", - "items": { - "enum": [ - "COMPRESSION_TYPE_UNSPECIFIED", - "RAW", - "RICE" - ], - "type": "string" - }, - "type": "array", + "threatType": { "enumDescriptions": [ "Unknown.", - "Raw, uncompressed data.", - "Rice-Golomb encoded data." - ] + "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 posed by the list's entries.", + "type": "string" }, - "maxUpdateEntries": { + "threatEntryType": { + "enum": [ + "THREAT_ENTRY_TYPE_UNSPECIFIED", + "URL", + "EXECUTABLE", + "IP_RANGE", + "CHROME_EXTENSION", + "FILENAME", + "CERT" + ], + "description": "The entry types contained in the list.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "A URL.", + "An executable program.", + "An IP range.", + "Chrome extension.", + "Filename.", + "CERT" + ] + } + }, + "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.", + "type": "object" + }, + "ClientInfo": { + "description": "The client metadata associated with Safe Browsing API requests.", + "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" + }, + "ThreatInfo": { + "description": "The information regarding one or more threats that a client submits when\nchecking for matches in threat lists.", + "type": "object", + "properties": { + "threatEntryTypes": { + "enumDescriptions": [ + "Unspecified.", + "A URL.", + "An executable program.", + "An IP range.", + "Chrome extension.", + "Filename.", + "CERT" + ], + "description": "The entry types to be checked.", + "type": "array", + "items": { + "enum": [ + "THREAT_ENTRY_TYPE_UNSPECIFIED", + "URL", + "EXECUTABLE", + "IP_RANGE", + "CHROME_EXTENSION", + "FILENAME", + "CERT" + ], + "type": "string" + } + }, + "threatTypes": { + "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." + ], + "description": "The threat types to be checked.", + "type": "array", + "items": { + "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": "string" + } + }, + "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.", + "type": "array", + "items": { + "enum": [ + "PLATFORM_TYPE_UNSPECIFIED", + "WINDOWS", + "LINUX", + "ANDROID", + "OSX", + "IOS", + "ANY_PLATFORM", + "ALL_PLATFORMS", + "CHROME" + ], + "type": "string" + } + }, + "threatEntries": { + "description": "The threat entries to be checked.", + "type": "array", + "items": { + "$ref": "ThreatEntry" + } + } + }, + "id": "ThreatInfo" + }, + "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" + } + } + }, + "id": "ThreatEntryMetadata" + }, + "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", - "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" + "id": "RawHashes" }, - "ThreatMatch": { - "description": "A match when checking a threat entry in the Safe Browsing threat lists.", + "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" + }, + "FindFullHashesRequest": { + "description": "Request to return full hashes matched by the provided hash prefixes.", "type": "object", "properties": { + "clientStates": { + "description": "The current client states for each of the client's local threat lists.", + "type": "array", + "items": { + "format": "byte", + "type": "string" + } + }, + "client": { + "description": "The client metadata.", + "$ref": "ClientInfo" + }, + "threatInfo": { + "description": "The lists and hashes to be checked.", + "$ref": "ThreatInfo" + }, + "apiClient": { + "description": "Client metadata associated with callers of higher-level APIs built on top\nof the client's implementation.", + "$ref": "ClientInfo" + } + }, + "id": "FindFullHashesRequest" + }, + "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": { + "description": "The requested threat list updates.", + "type": "array", + "items": { + "$ref": "ListUpdateRequest" + } + }, + "client": { + "description": "The client metadata.", + "$ref": "ClientInfo" + } + }, + "id": "FetchThreatListUpdatesRequest" + }, + "ListUpdateResponse": { + "properties": { + "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" + }, + "responseType": { + "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.", + "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 for which data is returned.", + "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.", + "type": "array", + "items": { + "$ref": "ThreatEntrySet" + } + }, + "newClientState": { + "description": "The new client state, in encrypted format. Opaque to clients.", + "format": "byte", + "type": "string" + }, + "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.", + "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." + ] + }, "threatEntryType": { "enumDescriptions": [ "Unspecified.", @@ -306,12 +673,76 @@ "FILENAME", "CERT" ], - "description": "The threat entry type matching this threat.", + "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" + } + } + }, + "id": "ListUpdateResponse", + "description": "An update to an individual list.", + "type": "object" + }, + "ThreatMatch": { + "description": "A match when checking a threat entry in the Safe Browsing threat lists.", + "type": "object", + "properties": { + "platformType": { + "enum": [ + "PLATFORM_TYPE_UNSPECIFIED", + "WINDOWS", + "LINUX", + "ANDROID", + "OSX", + "IOS", + "ANY_PLATFORM", + "ALL_PLATFORMS", + "CHROME" + ], + "description": "The platform type matching this threat.", + "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." + ] + }, + "threatEntryType": { + "enum": [ + "THREAT_ENTRY_TYPE_UNSPECIFIED", + "URL", + "EXECUTABLE", + "IP_RANGE", + "CHROME_EXTENSION", + "FILENAME", + "CERT" + ], + "description": "The threat entry type matching this threat.", + "type": "string", + "enumDescriptions": [ + "Unspecified.", + "A URL.", + "An executable program.", + "An IP range.", + "Chrome extension.", + "Filename.", + "CERT" + ] + }, "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.", + "format": "google-duration", "type": "string" }, "threatType": { @@ -357,99 +788,22 @@ "threat": { "description": "The threat matching this threat.", "$ref": "ThreatEntry" - }, - "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 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": { + "description": "An individual threat; for example, a malicious URL or its hash\nrepresentation. Only one of these fields should be set.", + "type": "object", "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.", + "format": "byte", "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.", + "format": "byte", "type": "string" }, "url": { @@ -457,15 +811,223 @@ "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.", + "id": "ThreatEntry" + }, + "MetadataEntry": { + "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", + "description": "A single metadata entry.", "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.", + "FindThreatMatchesRequest": { + "properties": { + "client": { + "$ref": "ClientInfo", + "description": "The client metadata." + }, + "threatInfo": { + "description": "The lists and entries to be checked for matches.", + "$ref": "ThreatInfo" + } + }, + "id": "FindThreatMatchesRequest", + "description": "Request to check entries against lists.", + "type": "object" + }, + "ThreatSource": { + "description": "A single resource related to a threat hit.", "type": "object", "properties": { + "url": { + "description": "The URL of the resource.", + "type": "string" + }, + "remoteIp": { + "description": "The remote IP of the resource in ASCII format. Either IPv4 or IPv6.", + "type": "string" + }, + "referrer": { + "description": "Referrer of the resource. Only set if the referrer is available.", + "type": "string" + }, + "type": { + "enum": [ + "THREAT_SOURCE_TYPE_UNSPECIFIED", + "MATCHING_URL", + "TAB_URL", + "TAB_REDIRECT", + "TAB_RESOURCE" + ], + "description": "The type of source reported.", + "type": "string", + "enumDescriptions": [ + "Unknown.", + "The URL that matched the threat list (for which GetFullHash returned a\nvalid hash).", + "The final top-level URL of the tab that the client was browsing when the\nmatch occurred.", + "A redirect URL that was fetched before hitting the final TAB_URL.", + "A resource loaded within the final TAB_URL." + ] + } + }, + "id": "ThreatSource" + }, + "RawIndices": { + "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.", + "type": "object" + }, + "UserInfo": { + "description": "Details about the user that encountered the threat.", + "type": "object", + "properties": { + "userId": { + "description": "Unique user identifier defined by the client.", + "format": "byte", + "type": "string" + }, + "regionCode": { + "description": "The UN M.49 region code associated with the user's location.", + "type": "string" + } + }, + "id": "UserInfo" + }, + "FetchThreatListUpdatesResponse": { + "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", + "type": "object" + }, + "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": { + "properties": { + "negativeCacheDuration": { + "description": "For requested entities that did not match the threat list, how long to\ncache the response.", + "format": "google-duration", + "type": "string" + }, + "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" + } + } + }, + "id": "FindFullHashesResponse", + "type": "object" + }, + "ThreatEntrySet": { + "description": "A set of threats that should be added or removed from a client's local\ndatabase.", + "type": "object", + "properties": { + "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." + }, + "compressionType": { + "enum": [ + "COMPRESSION_TYPE_UNSPECIFIED", + "RAW", + "RICE" + ], + "description": "The compression type for the entries in this set.", + "type": "string", + "enumDescriptions": [ + "Unknown.", + "Raw, uncompressed data.", + "Rice-Golomb encoded data." + ] + }, + "riceIndices": { + "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.", + "$ref": "RiceDeltaEncoding" + }, + "rawIndices": { + "description": "The raw removal indices for a local list.", + "$ref": "RawIndices" + }, + "rawHashes": { + "description": "The raw SHA256-formatted entries.", + "$ref": "RawHashes" + } + }, + "id": "ThreatEntrySet" + }, + "ThreatHit": { + "properties": { + "resources": { + "description": "The resources related to the threat hit.", + "type": "array", + "items": { + "$ref": "ThreatSource" + } + }, + "entry": { + "$ref": "ThreatEntry", + "description": "The threat entry responsible for the hit. Full hash should be reported for\nhash-based hits." + }, "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", @@ -477,19 +1039,16 @@ "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." - ] + "description": "The platform type reported.", + "type": "string" + }, + "userInfo": { + "$ref": "UserInfo", + "description": "Details about the user that encountered the threat." + }, + "clientInfo": { + "$ref": "ClientInfo", + "description": "Client-reported identification." }, "threatType": { "enum": [ @@ -508,7 +1067,7 @@ "APK_MALWARE_OFFLINE", "SUBRESOURCE_FILTER" ], - "description": "The threat type posed by the list's entries.", + "description": "The threat type reported.", "type": "string", "enumDescriptions": [ "Unknown.", @@ -526,383 +1085,19 @@ "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": { - "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" - ], - "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" - }, - "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" - }, - "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.", - "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." - ], - "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": { - "enum": [ - "PLATFORM_TYPE_UNSPECIFIED", - "WINDOWS", - "LINUX", - "ANDROID", - "OSX", - "IOS", - "ANY_PLATFORM", - "ALL_PLATFORMS", - "CHROME" - ], - "type": "string" - }, - "type": "array" - }, - "threatEntries": { - "description": "The threat entries to be checked.", - "items": { - "$ref": "ThreatEntry" - }, - "type": "array" - } - }, - "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.", + "id": "ThreatHit", "type": "object" }, - "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.", - "items": { - "$ref": "MetadataEntry" - }, - "type": "array" - } - }, - "id": "ThreatEntryMetadata" - }, - "RawIndices": { - "description": "A set of raw indices to remove from a local list.", - "type": "object", - "properties": { - "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" - }, - "rawHashes": { - "format": "byte", - "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": "RawHashes" - }, - "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 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": "FindFullHashesResponse", - "type": "object" - }, - "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).", + "format": "byte", "type": "string" }, "platformType": { - "description": "The type of platform at risk by entries present in the list.", - "type": "string", "enumDescriptions": [ "Unknown platform.", "Threat posed to Windows.", @@ -924,11 +1119,9 @@ "ANY_PLATFORM", "ALL_PLATFORMS", "CHROME" - ] - }, - "constraints": { - "$ref": "Constraints", - "description": "The constraints associated with this request." + ], + "description": "The type of platform at risk by entries present in the list.", + "type": "string" }, "threatType": { "enumDescriptions": [ @@ -965,133 +1158,21 @@ ], "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." }, - "client": { - "description": "The client metadata.", - "$ref": "ClientInfo" - } - } - }, - "ListUpdateResponse": { - "id": "ListUpdateResponse", - "description": "An update to an individual list.", - "type": "object", - "properties": { - "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": { - "$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": [ - "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" - ] - }, - "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.", - "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" - }, - "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.", - "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." - ] + "constraints": { + "description": "The constraints associated with this request.", + "$ref": "Constraints" }, "threatEntryType": { + "enumDescriptions": [ + "Unspecified.", + "A URL.", + "An executable program.", + "An IP range.", + "Chrome extension.", + "Filename.", + "CERT" + ], "enum": [ "THREAT_ENTRY_TYPE_UNSPECIFIED", "URL", @@ -1101,30 +1182,114 @@ "FILENAME", "CERT" ], - "description": "The format of the threats.", - "type": "string", - "enumDescriptions": [ - "Unspecified.", - "A URL.", - "An executable program.", - "An IP range.", - "Chrome extension.", - "Filename.", - "CERT" - ] + "description": "The types of entries present in the list.", + "type": "string" } - } + }, + "id": "ListUpdateRequest", + "description": "A single list update request.", + "type": "object" + }, + "Constraints": { + "properties": { + "supportedCompressions": { + "enumDescriptions": [ + "Unknown.", + "Raw, uncompressed data.", + "Rice-Golomb encoded data." + ], + "description": "The compression types supported by the client.", + "type": "array", + "items": { + "enum": [ + "COMPRESSION_TYPE_UNSPECIFIED", + "RAW", + "RICE" + ], + "type": "string" + } + }, + "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", + "type": "integer" + }, + "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" + } + }, + "id": "Constraints", + "description": "The constraints for this update.", + "type": "object" + }, + "ListThreatListsResponse": { + "type": "object", + "properties": { + "threatLists": { + "description": "The lists available for download by the client.", + "type": "array", + "items": { + "$ref": "ThreatListDescriptor" + } + } + }, + "id": "ListThreatListsResponse" + }, + "RiceDeltaEncoding": { + "description": "The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or\ncompressed removal indices.", + "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": { + "description": "The encoded deltas that are encoded using the Golomb-Rice coder.", + "format": "byte", + "type": "string" + }, + "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" + } + }, + "id": "RiceDeltaEncoding" + }, + "FindThreatMatchesResponse": { + "properties": { + "matches": { + "description": "The threat list matches.", + "type": "array", + "items": { + "$ref": "ThreatMatch" + } + } + }, + "id": "FindThreatMatchesResponse", + "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", + "icons": { + "x32": "http://www.google.com/images/icons/product/search-32.gif", + "x16": "http://www.google.com/images/icons/product/search-16.gif" + }, "version": "v4", "baseUrl": "https://safebrowsing.googleapis.com/", - "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/" + "description": "Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources.", + "kind": "discovery#restDescription" } diff --git a/etc/api/script/v1/script-api.json b/etc/api/script/v1/script-api.json index 64a60928c5..d58de4b37b 100644 --- a/etc/api/script/v1/script-api.json +++ b/etc/api/script/v1/script-api.json @@ -1,76 +1,30 @@ { - "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", + "revision": "20171205", "documentationLink": "https://developers.google.com/apps-script/execution/rest/v1/scripts/run", - "revision": "20170918", - "title": "Google Apps Script Execution API", + "id": "script:v1", + "fullyEncodeReservedExpansion": true, + "title": "Google Apps Script API", "discoveryVersion": "v1", "ownerName": "Google", "resources": { "scripts": { "methods": { "run": { - "id": "script.scripts.run", - "path": "v1/scripts/{scriptId}:run", "request": { "$ref": "ExecutionRequest" }, - "description": "Runs a function in an Apps Script project. The project must be deployed\nfor use with the Apps Script Execution API.\n\nThis method requires authorization with an OAuth 2.0 token that includes at\nleast one of the scopes listed in the [Authorization](#authorization)\nsection; script projects that do not require authorization cannot be\nexecuted through this API. To find the correct scopes to include in the\nauthentication token, open the project in the script editor, then select\n**File \u003e Project properties** and click the **Scopes** tab.", - "httpMethod": "POST", - "parameterOrder": [ - "scriptId" - ], + "description": "Runs a function in an Apps Script project. The project must be deployed\nfor use with the Apps Script API.\n\nThis method requires authorization with an OAuth 2.0 token that includes at\nleast one of the scopes listed in the [Authorization](#authorization)\nsection; script projects that do not require authorization cannot be\nexecuted through this API. To find the correct scopes to include in the\nauthentication token, open the project in the script editor, then select\n**File \u003e Project properties** and click the **Scopes** tab.", "response": { "$ref": "Operation" }, + "parameterOrder": [ + "scriptId" + ], + "httpMethod": "POST", "parameters": { "scriptId": { "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**.", @@ -92,39 +46,52 @@ "https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/userinfo.email" ], - "flatPath": "v1/scripts/{scriptId}:run" + "flatPath": "v1/scripts/{scriptId}:run", + "path": "v1/scripts/{scriptId}:run", + "id": "script.scripts.run" } } } }, "parameters": { - "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\").", + "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" + }, + "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" + "location": "query", + "enum": [ + "1", + "2" + ], + "description": "V1 error format." }, "alt": { "type": "string", @@ -148,14 +115,14 @@ "location": "query" }, "access_token": { + "location": "query", "description": "OAuth access token.", - "type": "string", - "location": "query" + "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", @@ -164,69 +131,54 @@ "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" - }, - "prettyPrint": { - "type": "boolean", - "default": "true", - "location": "query", - "description": "Returns response with indentations and line breaks." + "type": "string", + "location": "query" } }, "schemas": { "Status": { + "type": "object", "properties": { - "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" - }, "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.", + "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" }, "details": { + "description": "An array that contains a single ExecutionError object that provides information about the nature of the error.", "type": "array", "items": { + "type": "object", "additionalProperties": { - "description": "Properties of the object. Contains field @type with type URL.", - "type": "any" - }, - "type": "object" - }, - "description": "An array that contains a single `ExecutionError` object that provides information about the nature of the error." + "type": "any", + "description": "Properties of the object. Contains field @type with type URL." + } + } + }, + "code": { + "description": "The status code. For this API, this value either: \u003cul\u003e \u003cli\u003e 3, indicating an `INVALID_ARGUMENT` error, or\u003c/li\u003e \u003cli\u003e 1, indicating a `CANCELLED` execution.\u003c/li\u003e \u003c/ul\u003e", + "format": "int32", + "type": "integer" } }, "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" + "description": "If a `run` call succeeds but the script function (or Apps Script itself) throws an exception, the response body's error field contains this `Status` object." }, "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": { - "sessionState": { - "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.", "type": "string" }, "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`.", + "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 Apps Script API. Optional; default is `false`.", "type": "boolean" }, "parameters": { @@ -235,70 +187,66 @@ "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)\nscript—that is, it can access information like the user's current\ncursor position (in Docs) or selected cell (in Sheets). To retrieve the\nstate, call\n`Intent.getStringExtra(\"com.google.android.apps.docs.addons.SessionState\")`.\nOptional.", + "type": "string" } }, "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.", "type": "object", "properties": { "result": { - "description": "The return value of the script function. The type matches the object type\nreturned in Apps Script. Functions called through the Execution API cannot\nreturn Apps Script-specific objects (such as a `Document` or a `Calendar`);\nthey can only return primitive types such as a `string`, `number`, `array`,\n`object`, or `boolean`.", + "description": "The return value of the script function. The type matches the object type\nreturned in Apps Script. Functions called using the Apps Script API cannot\nreturn Apps Script-specific objects (such as a `Document` or a `Calendar`);\nthey can only return primitive types such as a `string`, `number`, `array`,\n`object`, or `boolean`.", "type": "any" } }, - "id": "ExecutionResponse" + "id": "ExecutionResponse", + "description": "An object that provides the return value of a function executed using the\nApps Script API. If the script function returns successfully, the response\nbody's response field contains this\n`ExecutionResponse` object." }, "Operation": { - "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", + "description": "A representation of a execution of an Apps Script function that is started using run. The execution response does not arrive until the function finishes executing. The maximum execution runtime is listed in the [Apps Script quotas guide](/apps-script/guides/services/quotas#current_limitations). \u003cp\u003eAfter the execution is started, it can have one of four outcomes:\u003c/p\u003e \u003cul\u003e \u003cli\u003e If the script function returns successfully, the\n response field contains an\n ExecutionResponse object\n with the function's return value in the object's `result` field.\u003c/li\u003e\n\u003cli\u003e If the script function (or Apps Script itself) throws an exception, the\n error field contains a\n Status object. The `Status` object's `details`\n field contains an array with a single\n ExecutionError object that\n provides information about the nature of the error.\u003c/li\u003e\n\u003cli\u003e If the execution has not yet completed,\n the done field is `false` and\n the neither the `response` nor `error` fields are present.\u003c/li\u003e\n\u003cli\u003e If the `run` call itself fails (for example, because of a\n malformed request or an authorization error), the method returns an HTTP\n response code in the 4XX range with a different format for the response\n body. Client libraries automatically convert a 4XX response into an\n exception class.\u003c/li\u003e\n\u003c/ul\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", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" - } + }, + "description": "If the script function returns successfully, this field contains an ExecutionResponse object with the function's return value.", + "type": "object" }, "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" + "$ref": "Status", + "description": "If a `run` call succeeds but the script function (or Apps Script itself) throws an exception, this field contains a Status object. The `Status` object's `details` field contains an array with a single ExecutionError object that provides information about the nature of the error." }, - "metadata": { - "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - }, - "description": "This field is not used.", - "type": "object" + "done": { + "description": "This field indicates whether the script execution has completed. A completed execution has a populated `response` field containing the ExecutionResponse from function that was executed.", + "type": "boolean" } }, "id": "Operation" }, "ScriptStackTraceElement": { - "id": "ScriptStackTraceElement", "description": "A stack trace through the script that shows where the execution failed.", "type": "object", "properties": { + "function": { + "description": "The name of the function that failed.", + "type": "string" + }, "lineNumber": { "description": "The line number where the script failed.", "format": "int32", "type": "integer" - }, - "function": { - "type": "string", - "description": "The name of the function that failed." } - } + }, + "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.", + "description": "An object that provides information about the nature of an error resulting\nfrom an attempted execution of a script function using the Apps Script API.\nIf a run call\nsucceeds but the script function (or Apps Script itself) throws an exception,\nthe response body's error field\ncontains a\nStatus object. The `Status` object's `details` field\ncontains an array with a single one of these `ExecutionError` objects.", "type": "object", "properties": { "errorType": { @@ -310,11 +258,11 @@ "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" - } + }, + "description": "An array of objects that provide a stack trace through the script to show\nwhere the execution failed, with the deepest call first." } }, "id": "ExecutionError" @@ -324,5 +272,50 @@ "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, - "protocol": "rest" + "protocol": "rest", + "version": "v1", + "baseUrl": "https://script.googleapis.com/", + "auth": { + "oauth2": { + "scopes": { + "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" + }, + "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" + } + } + } + }, + "servicePath": "", + "description": "An API for managing and executing Google Apps Script projects.", + "kind": "discovery#restDescription", + "rootUrl": "https://script.googleapis.com/" } diff --git a/etc/api/searchconsole/v1/searchconsole-api.json b/etc/api/searchconsole/v1/searchconsole-api.json index 42d446159f..268ad43134 100644 --- a/etc/api/searchconsole/v1/searchconsole-api.json +++ b/etc/api/searchconsole/v1/searchconsole-api.json @@ -1,4 +1,17 @@ { + "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", + "revision": "20171211", + "documentationLink": "https://developers.google.com/webmaster-tools/search-console-api/", + "id": "searchconsole:v1", + "title": "Google Search Console URL Testing Tools API", "discoveryVersion": "v1", "ownerName": "Google", "version_module": true, @@ -8,10 +21,6 @@ "mobileFriendlyTest": { "methods": { "run": { - "request": { - "$ref": "RunMobileFriendlyTestRequest" - }, - "description": "Runs Mobile-Friendly Test for a given URL.", "response": { "$ref": "RunMobileFriendlyTestResponse" }, @@ -20,7 +29,11 @@ "parameters": {}, "flatPath": "v1/urlTestingTools/mobileFriendlyTest:run", "path": "v1/urlTestingTools/mobileFriendlyTest:run", - "id": "searchconsole.urlTestingTools.mobileFriendlyTest.run" + "id": "searchconsole.urlTestingTools.mobileFriendlyTest.run", + "description": "Runs Mobile-Friendly Test for a given URL.", + "request": { + "$ref": "RunMobileFriendlyTestRequest" + } } } } @@ -28,6 +41,17 @@ } }, "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", @@ -52,16 +76,11 @@ "type": "string" }, "callback": { - "location": "query", "description": "JSONP", - "type": "string" + "type": "string", + "location": "query" }, "alt": { - "enum": [ - "json", - "media", - "proto" - ], "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", @@ -70,7 +89,12 @@ ], "location": "query", "description": "Data format for response.", - "default": "json" + "default": "json", + "enum": [ + "json", + "media", + "proto" + ] }, "access_token": { "location": "query", @@ -88,39 +112,66 @@ "type": "string" }, "pp": { + "location": "query", "description": "Pretty-print response.", "type": "boolean", - "default": "true", - "location": "query" + "default": "true" }, "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", - "location": "query" } }, "schemas": { + "RunMobileFriendlyTestRequest": { + "properties": { + "url": { + "description": "URL for inspection.", + "type": "string" + }, + "requestScreenshot": { + "description": "Whether or not screenshot is requested. Default is false.", + "type": "boolean" + } + }, + "id": "RunMobileFriendlyTestRequest", + "description": "Mobile-friendly test request.", + "type": "object" + }, + "Image": { + "properties": { + "mimeType": { + "description": "The mime-type of the image data.", + "type": "string" + }, + "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" + } + }, + "id": "Image", + "description": "Describe image data.", + "type": "object" + }, "MobileFriendlyIssue": { - "description": "Mobile-friendly issue.", - "type": "object", "properties": { "rule": { + "enumDescriptions": [ + "Unknown rule. Sorry, we don't have any description for the rule that was\nbroken.", + "Plugins incompatible with mobile devices are being used. [Learn more]\n(https://support.google.com/webmasters/answer/6352293#flash_usage).", + "Viewsport is not specified using the meta viewport tag. [Learn more]\n(https://support.google.com/webmasters/answer/6352293#viewport_not_configured).", + "Viewport defined to a fixed width. [Learn more]\n(https://support.google.com/webmasters/answer/6352293#fixed-width_viewport).", + "Content not sized to viewport. [Learn more]\n(https://support.google.com/webmasters/answer/6352293#content_not_sized_to_viewport).", + "Font size is too small for easy reading on a small screen. [Learn More]\n(https://support.google.com/webmasters/answer/6352293#small_font_size).", + "Touch elements are too close to each other. [Learn more]\n(https://support.google.com/webmasters/answer/6352293#touch_elements_too_close)." + ], "enum": [ "MOBILE_FRIENDLY_RULE_UNSPECIFIED", "USES_INCOMPATIBLE_PLUGINS", @@ -131,25 +182,22 @@ "TAP_TARGETS_TOO_CLOSE" ], "description": "Rule violated.", - "type": "string", - "enumDescriptions": [ - "Unknown rule. Sorry, we don't have any description for the rule that was\nbroken.", - "Plugins incompatible with mobile devices are being used. [Learn more]\n(https://support.google.com/webmasters/answer/6352293#flash_usage).", - "Viewsport is not specified using the meta viewport tag. [Learn more]\n(https://support.google.com/webmasters/answer/6352293#viewport_not_configured).", - "Viewport defined to a fixed width. [Learn more]\n(https://support.google.com/webmasters/answer/6352293#fixed-width_viewport).", - "Content not sized to viewport. [Learn more]\n(https://support.google.com/webmasters/answer/6352293#content_not_sized_to_viewport).", - "Font size is too small for easy reading on a small screen. [Learn More]\n(https://support.google.com/webmasters/answer/6352293#small_font_size).", - "Touch elements are too close to each other. [Learn more]\n(https://support.google.com/webmasters/answer/6352293#touch_elements_too_close)." - ] + "type": "string" } }, - "id": "MobileFriendlyIssue" + "id": "MobileFriendlyIssue", + "description": "Mobile-friendly issue.", + "type": "object" }, "RunMobileFriendlyTestResponse": { "properties": { + "screenshot": { + "$ref": "Image", + "description": "Screenshot of the requested URL." + }, "testStatus": { - "$ref": "TestStatus", - "description": "Final state of the test, can be either complete or an error." + "description": "Final state of the test, can be either complete or an error.", + "$ref": "TestStatus" }, "resourceIssues": { "description": "Information about embedded resources issues.", @@ -159,18 +207,18 @@ } }, "mobileFriendliness": { + "enumDescriptions": [ + "Internal error when running this test. Please try running the test again.", + "The page is mobile friendly.", + "The page is not mobile friendly." + ], "enum": [ "MOBILE_FRIENDLY_TEST_RESULT_UNSPECIFIED", "MOBILE_FRIENDLY", "NOT_MOBILE_FRIENDLY" ], "description": "Test verdict, whether the page is mobile friendly or not.", - "type": "string", - "enumDescriptions": [ - "Internal error when running this test. Please try running the test again.", - "The page is mobile friendly.", - "The page is not mobile friendly." - ] + "type": "string" }, "mobileFriendlyIssues": { "description": "List of mobile-usability issues.", @@ -178,10 +226,6 @@ "items": { "$ref": "MobileFriendlyIssue" } - }, - "screenshot": { - "description": "Screenshot of the requested URL.", - "$ref": "Image" } }, "id": "RunMobileFriendlyTestResponse", @@ -193,8 +237,8 @@ "type": "object", "properties": { "blockedResource": { - "description": "Describes a blocked resource issue.", - "$ref": "BlockedResource" + "$ref": "BlockedResource", + "description": "Describes a blocked resource issue." } }, "id": "ResourceIssue" @@ -236,57 +280,13 @@ } }, "id": "TestStatus" - }, - "Image": { - "description": "Describe image data.", - "type": "object", - "properties": { - "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" - }, - "mimeType": { - "description": "The mime-type of the image data.", - "type": "string" - } - }, - "id": "Image" - }, - "RunMobileFriendlyTestRequest": { - "properties": { - "url": { - "description": "URL for inspection.", - "type": "string" - }, - "requestScreenshot": { - "description": "Whether or not screenshot is requested. Default is false.", - "type": "boolean" - } - }, - "id": "RunMobileFriendlyTestRequest", - "description": "Mobile-friendly test request.", - "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://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" + "baseUrl": "https://searchconsole.googleapis.com/" } diff --git a/etc/api/serviceconsumermanagement/v1/serviceconsumermanagement-api.json b/etc/api/serviceconsumermanagement/v1/serviceconsumermanagement-api.json new file mode 100644 index 0000000000..214e45a795 --- /dev/null +++ b/etc/api/serviceconsumermanagement/v1/serviceconsumermanagement-api.json @@ -0,0 +1,2362 @@ +{ + "version": "v1", + "baseUrl": "https://serviceconsumermanagement.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Provides management methods for configuring service producer resources on Google Cloud.", + "servicePath": "", + "basePath": "", + "revision": "20171211", + "documentationLink": "https://cloud.google.com/service-consumer-management/docs/overview", + "id": "serviceconsumermanagement:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "CustomError": { + "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", + "properties": { + "types": { + "type": "array", + "items": { + "type": "string" + }, + "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.", + "type": "array", + "items": { + "$ref": "CustomErrorRule" + } + } + } + }, + "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": { + "type": "boolean", + "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." + }, + "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.", + "type": "array", + "items": { + "$ref": "HttpRule" + } + } + }, + "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" + } + } + }, + "id": "SourceInfo" + }, + "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" + } + }, + "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": { + "urlQueryParameter": { + "description": "Define the URL query parameter name to use for the parameter. It is case\nsensitive.", + "type": "string" + }, + "httpHeader": { + "description": "Define the HTTP header name to use for the parameter. It is case\ninsensitive.", + "type": "string" + }, + "name": { + "description": "Define the name of the parameter, such as \"api_key\" . It is case sensitive.", + "type": "string" + } + }, + "id": "SystemParameter" + }, + "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": { + "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" + } + }, + "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" + } + } + }, + "id": "Monitoring" + }, + "Field": { + "type": "object", + "properties": { + "jsonName": { + "description": "The field JSON name.", + "type": "string" + }, + "kind": { + "description": "The field type.", + "type": "string", + "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" + ] + }, + "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": { + "description": "The field cardinality.", + "type": "string", + "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" + ] + }, + "packed": { + "type": "boolean", + "description": "Whether to use alternative packed wire representation." + }, + "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": { + "type": "integer", + "description": "The field number.", + "format": "int32" + } + }, + "id": "Field", + "description": "A single field of a message type." + }, + "Enum": { + "description": "Enum type definition.", + "type": "object", + "properties": { + "name": { + "description": "Enum type name.", + "type": "string" + }, + "enumvalue": { + "description": "Enum value definitions.", + "type": "array", + "items": { + "$ref": "EnumValue" + } + }, + "options": { + "description": "Protocol buffer options.", + "type": "array", + "items": { + "$ref": "Option" + } + }, + "sourceContext": { + "$ref": "SourceContext", + "description": "The source context." + }, + "syntax": { + "enum": [ + "SYNTAX_PROTO2", + "SYNTAX_PROTO3" + ], + "description": "The source syntax.", + "type": "string", + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ] + } + }, + "id": "Enum" + }, + "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": { + "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." + ] + } + }, + "id": "LabelDescriptor" + }, + "Type": { + "id": "Type", + "description": "A protocol buffer message type.", + "type": "object", + "properties": { + "options": { + "description": "The protocol buffer options.", + "type": "array", + "items": { + "$ref": "Option" + } + }, + "fields": { + "description": "The list of fields.", + "type": "array", + "items": { + "$ref": "Field" + } + }, + "name": { + "type": "string", + "description": "The fully qualified message name." + }, + "oneofs": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of types appearing in `oneof` definitions in this type." + }, + "syntax": { + "description": "The source syntax.", + "type": "string", + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ], + "enum": [ + "SYNTAX_PROTO2", + "SYNTAX_PROTO3" + ] + }, + "sourceContext": { + "$ref": "SourceContext", + "description": "The source context." + } + } + }, + "Experimental": { + "description": "Experimental service configuration. These configuration options can\nonly be used by whitelisted users.", + "type": "object", + "properties": { + "authorization": { + "$ref": "AuthorizationConfig", + "description": "Authorization configuration." + } + }, + "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.", + "type": "array", + "items": { + "$ref": "BackendRule" + } + } + }, + "id": "Backend" + }, + "AuthorizationConfig": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "The name of the authorization provider, such as\nfirebaserules.googleapis.com." + } + }, + "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" + }, + "ServiceAccountConfig": { + "description": "Describes service account configuration for the tenant project.", + "type": "object", + "properties": { + "tenantProjectRoles": { + "description": "Roles for the service account above on tenant project.", + "type": "array", + "items": { + "type": "string" + } + }, + "accountId": { + "type": "string", + "description": "ID of the IAM service account to be created in tenant project.\nThe email format of the service account will be\n\"\u003caccount-id\u003e@\u003ctenant-project-id\u003e.iam.gserviceaccount.com\".\nThis account id has to be unique within tenant project and producers\nhave to guarantee it." + } + }, + "id": "ServiceAccountConfig" + }, + "DocumentationRule": { + "id": "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" + } + } + }, + "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.", + "type": "array", + "items": { + "type": "string" + } + }, + "requested": { + "description": "A list of full type names of requested contexts.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "ContextRule" + }, + "Billing": { + "id": "Billing", + "description": "Billing related configuration of the service.\n\nThe following example shows how to configure monitored resources and metrics\nfor billing:\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/borrowed_count\n metric_kind: DELTA\n value_type: INT64\n billing:\n consumer_destinations:\n - monitored_resource: library.googleapis.com/branch\n metrics:\n - library.googleapis.com/book/borrowed_count", + "type": "object", + "properties": { + "consumerDestinations": { + "type": "array", + "items": { + "$ref": "BillingDestination" + }, + "description": "Billing configurations for sending metrics to the consumer project.\nThere can be multiple consumer destinations per service, each one must have\na different monitored resource type. A metric can be used in at most\none consumer destination." + } + } + }, + "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": { + "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", + "DELTA", + "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" + }, + "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\".\nThis field is optional but it is recommended to be set for any metrics\nassociated with user-visible concepts, such as Quota.", + "type": "string" + }, + "description": { + "description": "A detailed description of the metric, which can be used in documentation.", + "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.", + "type": "array", + "items": { + "$ref": "LabelDescriptor" + } + }, + "name": { + "description": "The resource name of the metric descriptor.", + "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": { + "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", + "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." + ] + } + }, + "id": "MetricDescriptor" + }, + "SourceContext": { + "id": "SourceContext", + "description": "`SourceContext` represents information about the source of a\nprotobuf 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\nprotobuf element. For example: `\"google/protobuf/source_context.proto\"`.", + "type": "string" + } + } + }, + "ListTenancyUnitsResponse": { + "description": "Response for the list request.", + "type": "object", + "properties": { + "nextPageToken": { + "description": "Pagination token for large results.", + "type": "string" + }, + "tenancyUnits": { + "description": "Tenancy Units matching the request.", + "type": "array", + "items": { + "$ref": "TenancyUnit" + } + } + }, + "id": "ListTenancyUnitsResponse" + }, + "SearchTenancyUnitsResponse": { + "type": "object", + "properties": { + "nextPageToken": { + "description": "Pagination token for large results.", + "type": "string" + }, + "tenancyUnits": { + "description": "Tenancy Units matching the request.", + "type": "array", + "items": { + "$ref": "TenancyUnit" + } + } + }, + "id": "SearchTenancyUnitsResponse", + "description": "Response for the search query." + }, + "Endpoint": { + "id": "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": { + "aliases": { + "description": "DEPRECATED: This field is no longer supported. Instead of using aliases,\nplease specify multiple google.api.Endpoint for each of the intended\naliases.\n\nAdditional names that this endpoint will be hosted on.", + "type": "array", + "items": { + "type": "string" + } + }, + "features": { + "description": "The list of features enabled on this endpoint.", + "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" + }, + "name": { + "description": "The canonical name of this endpoint.", + "type": "string" + }, + "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" + } + } + }, + "OAuthRequirements": { + "id": "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" + } + } + }, + "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" + }, + "Context": { + "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`.", + "type": "object", + "properties": { + "rules": { + "type": "array", + "items": { + "$ref": "ContextRule" + }, + "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." + } + } + }, + "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": { + "description": { + "description": "A human-readable description of this log. This information appears in\nthe documentation and can contain details.", + "type": "string" + }, + "displayName": { + "description": "The human-readable name for this log. This information appears on\nthe user interface and should be concise.", + "type": "string" + }, + "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": { + "type": "string", + "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" + }, + "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": { + "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" + }, + "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" + } + } + }, + "id": "MonitoredResourceDescriptor" + }, + "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": { + "type": "string", + "description": "Selects messages to which this rule applies.\n\nRefer to selector for syntax details." + } + }, + "id": "CustomErrorRule" + }, + "CustomAuthRequirements": { + "id": "CustomAuthRequirements", + "description": "Configuration for a custom authentication provider.", + "type": "object", + "properties": { + "provider": { + "description": "A configuration string containing connection information for the\nauthentication provider, typically formatted as a SmartService string\n(go/smartservice).", + "type": "string" + } + } + }, + "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": { + "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": { + "description": "Optional maximum acceptable size for direct download.\nThe size is specified in bytes.", + "format": "int64", + "type": "string" + }, + "dropzone": { + "description": "Name of the Scotty dropzone to use for the current API.", + "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" + }, + "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" + }, + "MediaUpload": { + "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" + }, + "enabled": { + "description": "Whether upload is enabled.", + "type": "boolean" + }, + "progressNotification": { + "description": "Whether to receive a notification for progress changes of media upload.", + "type": "boolean" + }, + "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" + }, + "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" + } + }, + "id": "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" + }, + "CreateTenancyUnitRequest": { + "type": "object", + "properties": { + "tenancyUnitId": { + "type": "string", + "description": "Optional producer provided identifier of the tenancy unit\nMust be no longer than 40 characters and preferably URI friendly\nIf it is not provided, UID for the tenancy unit will be auto generated\nIt must be unique across a service.\nIf the tenancy unit already exists for the service and consumer pair,\nCreateTenancyUnit will return existing tenancy unit if provided identifier\nis identical or empty, otherwise the call will fail." + } + }, + "id": "CreateTenancyUnitRequest", + "description": "Request to create a tenancy unit for a consumer of a service." + }, + "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": {} + }, + "BillingDestination": { + "id": "BillingDestination", + "description": "Configuration of a specific billing destination (Currently only support\nbill against consumer project).", + "type": "object", + "properties": { + "monitoredResource": { + "description": "The monitored resource type. The type must be defined in\nService.monitored_resources section.", + "type": "string" + }, + "metrics": { + "description": "Names of the metrics to report to this billing destination.\nEach name must be defined in Service.metrics section.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "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": { + "type": "boolean", + "description": "True, if the method should skip service control. If so, no control plane\nfeature (like quota and billing) will be enabled.\nThis flag is used by ESP to allow some Endpoints customers to bypass\nGoogle internal checks." + }, + "allowUnregisteredCalls": { + "type": "boolean", + "description": "True, if the method allows unregistered calls; false otherwise." + } + }, + "id": "UsageRule" + }, + "AuthRequirement": { + "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": "User-defined authentication requirements, including support for\n[JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32)." + }, + "Documentation": { + "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" + }, + "rules": { + "type": "array", + "items": { + "$ref": "DocumentationRule" + }, + "description": "A list of documentation rules that apply to individual API elements.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order." + }, + "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" + } + } + }, + "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." + }, + "AuthenticationRule": { + "id": "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": { + "oauth": { + "description": "The requirements for OAuth credentials.", + "$ref": "OAuthRequirements" + }, + "customAuth": { + "$ref": "CustomAuthRequirements", + "description": "Configuration for custom authentication." + }, + "requirements": { + "description": "Requirements for additional authentication providers.", + "type": "array", + "items": { + "$ref": "AuthRequirement" + } + }, + "selector": { + "type": "string", + "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details." + }, + "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." + } + } + }, + "BackendRule": { + "description": "A backend rule provides configuration for an individual API element.", + "type": "object", + "properties": { + "deadline": { + "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.", + "format": "double", + "type": "number" + }, + "minDeadline": { + "description": "Minimum deadline in seconds needed for this method. Calls having deadline\nvalue lower than this will be rejected.", + "format": "double", + "type": "number" + }, + "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" + } + }, + "id": "BackendRule" + }, + "Api": { + "properties": { + "sourceContext": { + "$ref": "SourceContext", + "description": "Source context for the protocol buffer service represented by this\nmessage." + }, + "syntax": { + "enum": [ + "SYNTAX_PROTO2", + "SYNTAX_PROTO3" + ], + "description": "The source syntax of the service.", + "type": "string", + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ] + }, + "version": { + "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 interfaces. See Mixin.", + "type": "array", + "items": { + "$ref": "Mixin" + } + }, + "options": { + "description": "Any metadata attached to the interface.", + "type": "array", + "items": { + "$ref": "Option" + } + }, + "methods": { + "description": "The methods of this interface, in unspecified order.", + "type": "array", + "items": { + "$ref": "Method" + } + }, + "name": { + "description": "The fully qualified name of this interface, including package name\nfollowed by the interface's simple name.", + "type": "string" + } + }, + "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" + }, + "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": { + "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" + } + }, + "id": "MetricRule" + }, + "CancelOperationRequest": { + "description": "The request message for Operations.CancelOperation.", + "type": "object", + "properties": {}, + "id": "CancelOperationRequest" + }, + "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": { + "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" + } + }, + "providers": { + "description": "Defines a set of authentication providers that a service supports.", + "type": "array", + "items": { + "$ref": "AuthProvider" + } + } + }, + "id": "Authentication" + }, + "TenantProjectPolicy": { + "type": "object", + "properties": { + "policyBindings": { + "description": "Additional policy bindings to be applied on the tenant\nproject.\nAt least one owner must be set in the bindings. Among the list of members\nas owners, at least one of them must be either `user` or `group` based.", + "type": "array", + "items": { + "$ref": "PolicyBinding" + } + } + }, + "id": "TenantProjectPolicy", + "description": "Describes policy settings that need to be applied to a newly\ncreated Tenant Project." + }, + "Operation": { + "id": "Operation", + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "type": "object", + "properties": { + "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": { + "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." + } + } + }, + "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.", + "type": "array", + "items": { + "$ref": "Page" + } + }, + "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": { + "type": "string", + "description": "The Markdown content of the page. You can use \u003ccode\u003e(== include {path} ==)\u003c/code\u003e\nto include content from a Markdown file." + } + }, + "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", + "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.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + } + } + }, + "id": "Status" + }, + "AddTenantProjectRequest": { + "description": "Request to add a newly created and configured tenant project to tenancy\nunit.", + "type": "object", + "properties": { + "projectConfig": { + "description": "Configuration of the new tenant project that will be added to tenancy unit\nresources.", + "$ref": "TenantProjectConfig" + }, + "tag": { + "description": "Tag of the added project. Must be less than 128 characters. Required.", + "type": "string" + } + }, + "id": "AddTenantProjectRequest" + }, + "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": { + "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": { + "description": "The unique identifier of the auth provider. It will be referred to by\n`AuthRequirement.provider_id`.\n\nExample: \"bookstore_auth\".", + "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" + }, + "authorizationUrl": { + "description": "Redirect URL if JWT token is required but no present or is expired.\nImplement authorizationUrl of securityDefinitions in OpenAPI spec.", + "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" + } + }, + "id": "AuthProvider" + }, + "EnumValue": { + "description": "Enum value definition.", + "type": "object", + "properties": { + "name": { + "description": "Enum value name.", + "type": "string" + }, + "options": { + "description": "Protocol buffer options.", + "type": "array", + "items": { + "$ref": "Option" + } + }, + "number": { + "description": "Enum value number.", + "format": "int32", + "type": "integer" + } + }, + "id": "EnumValue" + }, + "Service": { + "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", + "properties": { + "endpoints": { + "type": "array", + "items": { + "$ref": "Endpoint" + }, + "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." + }, + "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" + } + }, + "logs": { + "description": "Defines the logs used by this service.", + "type": "array", + "items": { + "$ref": "LogDescriptor" + } + }, + "types": { + "type": "array", + "items": { + "$ref": "Type" + }, + "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" + }, + "sourceInfo": { + "$ref": "SourceInfo", + "description": "Output only. The source information for this configuration if available." + }, + "http": { + "description": "HTTP configuration.", + "$ref": "Http" + }, + "backend": { + "$ref": "Backend", + "description": "API backend configuration." + }, + "systemParameters": { + "$ref": "SystemParameters", + "description": "System parameter configuration." + }, + "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.", + "type": "array", + "items": { + "$ref": "MonitoredResourceDescriptor" + } + }, + "logging": { + "$ref": "Logging", + "description": "Logging configuration." + }, + "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" + }, + "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": { + "description": "Configuration controlling usage of this service.", + "$ref": "Usage" + }, + "metrics": { + "description": "Defines the metrics used by this service.", + "type": "array", + "items": { + "$ref": "MetricDescriptor" + } + }, + "authentication": { + "$ref": "Authentication", + "description": "Auth configuration." + }, + "experimental": { + "$ref": "Experimental", + "description": "Experimental configuration." + }, + "control": { + "$ref": "Control", + "description": "Configuration for the service control plane." + }, + "configVersion": { + "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`.", + "format": "uint32", + "type": "integer" + }, + "monitoring": { + "$ref": "Monitoring", + "description": "Monitoring configuration." + }, + "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 Google project that owns this service.", + "type": "string" + }, + "visibility": { + "$ref": "Visibility", + "description": "API visibility configuration." + }, + "quota": { + "description": "Quota configuration.", + "$ref": "Quota" + }, + "name": { + "description": "The DNS address at which this service is available,\ne.g. `calendar.googleapis.com`.", + "type": "string" + }, + "billing": { + "description": "Billing configuration.", + "$ref": "Billing" + }, + "customError": { + "description": "Custom error configuration.", + "$ref": "CustomError" + }, + "title": { + "description": "The product title for this service.", + "type": "string" + } + } + }, + "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": { + "type": "string", + "description": "The standard List next-page token." + } + }, + "id": "ListOperationsResponse" + }, + "CustomHttpPattern": { + "type": "object", + "properties": { + "kind": { + "description": "The name of this custom HTTP verb.", + "type": "string" + }, + "path": { + "type": "string", + "description": "The path matched by this custom verb." + } + }, + "id": "CustomHttpPattern", + "description": "A custom pattern is used for defining custom HTTP verb." + }, + "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.", + "type": "array", + "items": { + "$ref": "SystemParameter" + } + }, + "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" + }, + "BillingConfig": { + "id": "BillingConfig", + "description": "Describes billing configuration for new a Tenant Project", + "type": "object", + "properties": { + "billingAccount": { + "description": "Name of the billing account.\nFor example `billingAccounts/012345-567890-ABCDEF`.", + "type": "string" + } + } + }, + "TenantResource": { + "type": "object", + "properties": { + "resource": { + "description": "@OutputOnly Identifier of the tenant resource.\nFor cloud projects it is in the form 'projects/{number}'.\nFor example 'projects/123456'.", + "type": "string" + }, + "status": { + "enumDescriptions": [ + "Unspecified status is the default unset value.", + "Creation of the tenant resource is ongoing.", + "Active resource.", + "Deletion of the resource is ongoing.", + "Tenant resource creation or deletion has failed." + ], + "enum": [ + "STATUS_UNSPECIFIED", + "PENDING_CREATE", + "ACTIVE", + "PENDING_DELETE", + "FAILED" + ], + "description": "Status of tenant resource.", + "type": "string" + }, + "tag": { + "description": "Unique per single tenancy unit.", + "type": "string" + } + }, + "id": "TenantResource", + "description": "Resource constituting the TenancyUnit." + }, + "RemoveTenantProjectRequest": { + "description": "Request message to remove tenant project resource from the tenancy unit.", + "type": "object", + "properties": { + "tag": { + "description": "Tag of the resource within the tenancy unit.", + "type": "string" + } + }, + "id": "RemoveTenantProjectRequest" + }, + "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": { + "put": { + "description": "Used for updating a resource.", + "type": "string" + }, + "authorizations": { + "type": "array", + "items": { + "$ref": "AuthorizationRule" + }, + "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": { + "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" + }, + "restMethodName": { + "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.", + "type": "string" + }, + "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" + } + }, + "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" + } + }, + "id": "HttpRule" + }, + "MonitoringDestination": { + "properties": { + "monitoredResource": { + "description": "The monitored resource type. The type must be defined in\nService.monitored_resources section.", + "type": "string" + }, + "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" + } + } + }, + "id": "MonitoringDestination", + "description": "Configuration of a specific monitoring destination (the producer project\nor the consumer project).", + "type": "object" + }, + "TenancyUnit": { + "type": "object", + "properties": { + "consumer": { + "type": "string", + "description": "@OutputOnly Cloud resource One Platform Name of the consumer of this\nservice. For example 'projects/123456'." + }, + "createTime": { + "type": "string", + "description": "@OutputOnly The time this tenancy unit was created.", + "format": "google-datetime" + }, + "service": { + "description": "@OutputOnly Google Cloud API name of the service owning this tenancy unit.\nFor example 'serviceconsumermanagement.googleapis.com'.", + "type": "string" + }, + "name": { + "type": "string", + "description": "Globally unique identifier of this tenancy unit\n\"services/{service}/{collection id}/{resource id}/tenancyUnits/{unit}\"" + }, + "tenantResources": { + "description": "Resources constituting the tenancy unit.", + "type": "array", + "items": { + "$ref": "TenantResource" + } + } + }, + "id": "TenancyUnit", + "description": "Representation of a tenancy unit." + }, + "Visibility": { + "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.", + "type": "array", + "items": { + "$ref": "VisibilityRule" + } + } + }, + "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." + }, + "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" + } + } + }, + "id": "SystemParameters" + }, + "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.", + "type": "array", + "items": { + "$ref": "QuotaLimit" + } + }, + "metricRules": { + "description": "List of `MetricRule` definitions, each one mapping a selected method to one\nor more metrics.", + "type": "array", + "items": { + "$ref": "MetricRule" + } + } + } + }, + "TenantProjectConfig": { + "description": "This structure defines a tenant project to be added to the specified tenancy\nunit and its initial configuration and properties. A project lien will be\ncreated for the tenant project to prevent the tenant project from being\ndeleted accidentally. The lien will be deleted as part of tenant project\nremoval.", + "type": "object", + "properties": { + "services": { + "description": "Google Cloud API names of services that will be activated on this project\nduring provisioning. If any of these services can not be activated,\naddTenantProject method will fail.\nFor example: 'compute.googleapis.com','cloudfunctions.googleapis.com'", + "type": "array", + "items": { + "type": "string" + } + }, + "billingConfig": { + "$ref": "BillingConfig", + "description": "Billing account properties.\nIt may be specified explicitly, or created from the specified group\nduring provisioning" + }, + "tenantProjectPolicy": { + "$ref": "TenantProjectPolicy", + "description": "Describes ownership and policies for the new tenant project. Required." + }, + "folder": { + "description": "Folder where project in this tenancy unit must be located\nThis folder must have been previously created with proper\npermissions for the caller to create and configure a project in it.\nValid folder resource names have the format `folders/{folder_number}`\n(for example, `folders/123456`).", + "type": "string" + }, + "labels": { + "description": "Labels that will be applied to this project.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "serviceAccountConfig": { + "$ref": "ServiceAccountConfig", + "description": "Configuration for IAM service account on tenant project." + } + }, + "id": "TenantProjectConfig" + }, + "PolicyBinding": { + "description": "Translates to IAM Policy bindings (without auditing at this level)", + "type": "object", + "properties": { + "members": { + "description": "Uses the same format as in IAM policy.\n`member` must include both prefix and id. E.g., `user:{emailId}`,\n`serviceAccount:{emailId}`, `group:{emailId}`.", + "type": "array", + "items": { + "type": "string" + } + }, + "role": { + "description": "Role. (https://cloud.google.com/iam/docs/understanding-roles)\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.", + "type": "string" + } + }, + "id": "PolicyBinding" + }, + "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" + } + }, + "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": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "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.", + "type": "array", + "items": { + "$ref": "LoggingDestination" + } + }, + "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" + } + } + }, + "id": "Logging" + }, + "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.", + "type": "string" + }, + "values": { + "additionalProperties": { + "type": "string", + "format": "int64" + }, + "description": "Tiered limit values. You must specify this as a key:value pair, with an\ninteger value that is the maximum number of requests allowed for the\nspecified unit. 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\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.", + "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": { + "description": "Name of the quota limit.\n\nThe name must be provided, and it must be unique within the service. The\nname can only include alphanumeric characters as well as '-'.\n\nThe maximum length of the limit name is 64 characters.", + "type": "string" + } + }, + "id": "QuotaLimit" + }, + "Method": { + "id": "Method", + "description": "Method represents a method of an API interface.", + "type": "object", + "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": { + "type": "string", + "description": "The URL of the output message type." + }, + "options": { + "description": "Any metadata attached to the method.", + "type": "array", + "items": { + "$ref": "Option" + } + } + } + }, + "Mixin": { + "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 }", + "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" + } + } + } + }, + "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 Consumer Management", + "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/service.management": { + "description": "Manage your Google API service configuration" + } + } + } + }, + "rootUrl": "https://serviceconsumermanagement.googleapis.com/", + "ownerDomain": "google.com", + "name": "serviceconsumermanagement", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Service Consumer Management API", + "ownerName": "Google", + "resources": { + "services": { + "methods": { + "search": { + "response": { + "$ref": "SearchTenancyUnitsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "query": { + "description": "Set a query `{expression}` for querying tenancy units. Your `{expression}`\nmust be in the format: `field_name=literal_string`. The `field_name` is the\nname of the field you want to compare. Supported fields are\n`tenant_resources.tag` and`tenant_resources.resource`.\n\nFor example, to search tenancy units that contain at least one tenant\nresource with given tag 'xyz', use query `tenant_resources.tag=xyz`.\nTo search tenancy units that contain at least one tenant resource with\ngiven resource name 'projects/123456', use query\n`tenant_resources.resource=projects/123456`.\n\nMultiple expressions can be joined with `AND`s. Tenancy units must match\nall expressions to be included in the result set. For example,\n`tenant_resources.tag=xyz AND tenant_resources.resource=projects/123456`\n\nOptional.", + "type": "string", + "location": "query" + }, + "parent": { + "required": true, + "type": "string", + "pattern": "^services/[^/]+$", + "location": "path", + "description": "Service for which search is performed.\nservices/{service}\n{service} the name of a service, for example 'service.googleapis.com'." + }, + "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.\n\nOptional.", + "type": "string", + "location": "query" + }, + "pageSize": { + "type": "integer", + "location": "query", + "description": "The maximum number of results returned by this request. Currently, the\ndefault maximum is set to 1000. If page_size is not provided or provided a\nnumber larger than 1000, it will be automatically set to 1000.\n\nOptional.", + "format": "int32" + } + }, + "flatPath": "v1/services/{servicesId}:search", + "path": "v1/{+parent}:search", + "id": "serviceconsumermanagement.services.search", + "description": "Search tenancy units for a service." + } + }, + "resources": { + "tenancyUnits": { + "methods": { + "create": { + "response": { + "$ref": "TenancyUnit" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "location": "path", + "description": "services/{service}/{collection id}/{resource id}\n{collection id} is the cloud resource collection type representing the\nservice consumer, for example 'projects', or 'organizations'.\n{resource id} is the consumer numeric id, such as project number: '123456'.\n{service} the name of a service, for example 'service.googleapis.com'.\nEnabled service binding using the new tenancy unit.", + "required": true, + "type": "string", + "pattern": "^services/[^/]+/[^/]+/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/services/{servicesId}/{servicesId1}/{servicesId2}/tenancyUnits", + "path": "v1/{+parent}/tenancyUnits", + "id": "serviceconsumermanagement.services.tenancyUnits.create", + "request": { + "$ref": "CreateTenancyUnitRequest" + }, + "description": "Creates a tenancy unit with no tenant resources." + }, + "removeProject": { + "description": "Removes specified project resource identified by tenant resource tag.\nIt will remove project lien with 'TenantManager' origin if that was added.\nIt will then attempt to delete the project.\nIf that operation fails, this method fails.\nOperation\u003cresponse: Empty\u003e.", + "request": { + "$ref": "RemoveTenantProjectRequest" + }, + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^services/[^/]+/[^/]+/[^/]+/tenancyUnits/[^/]+$", + "location": "path", + "description": "Name of the tenancy unit.\nSuch as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/services/{servicesId}/{servicesId1}/{servicesId2}/tenancyUnits/{tenancyUnitsId}:removeProject", + "id": "serviceconsumermanagement.services.tenancyUnits.removeProject", + "path": "v1/{+name}:removeProject" + }, + "delete": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^services/[^/]+/[^/]+/[^/]+/tenancyUnits/[^/]+$", + "location": "path", + "description": "Name of the tenancy unit to be deleted." + } + }, + "flatPath": "v1/services/{servicesId}/{servicesId1}/{servicesId2}/tenancyUnits/{tenancyUnitsId}", + "path": "v1/{+name}", + "id": "serviceconsumermanagement.services.tenancyUnits.delete", + "description": "Delete tenancy unit. Before the tenancy unit is deleted, there should be\nno tenant resource in it.\nOperation\u003cresponse: Empty\u003e." + }, + "addProject": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "description": "Name of the tenancy unit.", + "required": true, + "type": "string", + "pattern": "^services/[^/]+/[^/]+/[^/]+/tenancyUnits/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/services/{servicesId}/{servicesId1}/{servicesId2}/tenancyUnits/{tenancyUnitsId}:addProject", + "path": "v1/{+parent}:addProject", + "id": "serviceconsumermanagement.services.tenancyUnits.addProject", + "request": { + "$ref": "AddTenantProjectRequest" + }, + "description": "Add a new tenant project to the tenancy unit.\nIf there are previously failed AddTenantProject calls, you might need to\ncall RemoveTenantProject first to clean them before you can make another\nAddTenantProject with the same tag.\nOperation\u003cresponse: Empty\u003e." + }, + "list": { + "parameters": { + "pageSize": { + "type": "integer", + "location": "query", + "description": "The maximum number of results returned by this request.", + "format": "int32" + }, + "parent": { + "pattern": "^services/[^/]+/[^/]+/[^/]+$", + "location": "path", + "description": "Service and consumer. Required.\nservices/{service}/{collection id}/{resource id}\n{collection id} is the cloud resource collection type representing the\nservice consumer, for example 'projects', or 'organizations'.\n{resource id} is the consumer numeric id, such as project number: '123456'.\n{service} the name of a service, for example 'service.googleapis.com'.", + "required": true, + "type": "string" + }, + "filter": { + "description": "Filter expression over tenancy resources field. Optional.", + "type": "string", + "location": "query" + }, + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/services/{servicesId}/{servicesId1}/{servicesId2}/tenancyUnits", + "path": "v1/{+parent}/tenancyUnits", + "id": "serviceconsumermanagement.services.tenancyUnits.list", + "description": "Find tenancy unit for a service and consumer.\nThis method should not be used in producers' runtime path, e.g. finding\nthe tenant project number when creating VMs. Producers should persist\nthe tenant project information after the project is created.", + "response": { + "$ref": "ListTenancyUnitsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET" + } + } + } + } + }, + "operations": { + "methods": { + "cancel": { + "flatPath": "v1/operations/{operationsId}:cancel", + "id": "serviceconsumermanagement.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" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be cancelled.", + "required": true, + "type": "string", + "pattern": "^operations/.+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ] + }, + "delete": { + "path": "v1/{+name}", + "id": "serviceconsumermanagement.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`.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "required": true, + "type": "string", + "pattern": "^operations/.+$", + "location": "path" + } + }, + "flatPath": "v1/operations/{operationsId}" + }, + "list": { + "flatPath": "v1/operations", + "path": "v1/{+name}", + "id": "serviceconsumermanagement.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": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "name": { + "location": "path", + "description": "The name of the operation's parent resource.", + "required": true, + "type": "string", + "pattern": "^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" + } + }, + "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": { + "location": "path", + "description": "The name of the operation resource.", + "required": true, + "type": "string", + "pattern": "^operations/[^/]+$" + } + }, + "flatPath": "v1/operations/{operationsId}", + "path": "v1/{+name}", + "id": "serviceconsumermanagement.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": { + "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": { + "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": { + "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": { + "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" + }, + "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" + } + } +} diff --git a/etc/api/servicecontrol/v1/servicecontrol-api.json b/etc/api/servicecontrol/v1/servicecontrol-api.json index 8e0eb2fd82..569a673e3f 100644 --- a/etc/api/servicecontrol/v1/servicecontrol-api.json +++ b/etc/api/servicecontrol/v1/servicecontrol-api.json @@ -9,10 +9,6 @@ "services": { "methods": { "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" }, @@ -26,17 +22,23 @@ ], "parameters": { "serviceName": { - "type": "string", + "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, - "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", + "location": "path" } }, "flatPath": "v1/services/{serviceName}:endReconciliation", + "path": "v1/services/{serviceName}:endReconciliation", "id": "servicecontrol.services.endReconciliation", - "path": "v1/services/{serviceName}:endReconciliation" + "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).", + "request": { + "$ref": "EndReconciliationRequest" + } }, "report": { + "path": "v1/services/{serviceName}:report", + "id": "servicecontrol.services.report", "request": { "$ref": "ReportRequest" }, @@ -48,51 +50,34 @@ "serviceName" ], "httpMethod": "POST", + "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.", + "required": true, + "type": "string", + "location": "path" + } + }, "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" + "flatPath": "v1/services/{serviceName}:report" }, "allocateQuota": { + "path": "v1/services/{serviceName}:allocateQuota", + "id": "servicecontrol.services.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" + "parameterOrder": [ + "serviceName" ], - "flatPath": "v1/services/{serviceName}:allocateQuota", - "path": "v1/services/{serviceName}:allocateQuota", - "id": "servicecontrol.services.allocateQuota" - }, - "startReconciliation": { + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/servicecontrol" @@ -100,31 +85,42 @@ "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, + "type": "string", "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).", + "flatPath": "v1/services/{serviceName}:allocateQuota" + }, + "startReconciliation": { "response": { "$ref": "StartReconciliationResponse" }, "parameterOrder": [ "serviceName" ], - "httpMethod": "POST" + "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.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/services/{serviceName}:startReconciliation", + "path": "v1/services/{serviceName}:startReconciliation", + "id": "servicecontrol.services.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" + } }, "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" }, @@ -136,8 +132,8 @@ "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 + "required": true, + "type": "string" } }, "scopes": [ @@ -145,17 +141,14 @@ "https://www.googleapis.com/auth/servicecontrol" ], "flatPath": "v1/services/{serviceName}:check", + "path": "v1/services/{serviceName}:check", "id": "servicecontrol.services.check", - "path": "v1/services/{serviceName}:check" + "request": { + "$ref": "CheckRequest" + }, + "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)." }, "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" }, @@ -171,25 +164,53 @@ "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 + "required": true, + "type": "string" } + }, + "flatPath": "v1/services/{serviceName}:releaseQuota", + "path": "v1/services/{serviceName}:releaseQuota", + "id": "servicecontrol.services.releaseQuota", + "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.", + "request": { + "$ref": "ReleaseQuotaRequest" } } } } }, "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": { + "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": { - "location": "query", "description": "Returns response with indentations and line breaks.", + "type": "boolean", "default": "true", - "type": "boolean" + "location": "query" }, "uploadType": { "location": "query", @@ -197,9 +218,9 @@ "type": "string" }, "fields": { - "location": "query", "description": "Selector specifying which fields to include in a partial response.", - "type": "string" + "type": "string", + "location": "query" }, "callback": { "location": "query", @@ -207,19 +228,25 @@ "type": "string" }, "$.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" + "type": "string" }, "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -227,43 +254,16 @@ ], "location": "query", "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "type": "string" - }, - "access_token": { - "type": "string", - "location": "query", - "description": "OAuth access token." + "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" - }, - "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." + "location": "query" }, - "bearer_token": { + "access_token": { "location": "query", - "description": "OAuth bearer token.", + "description": "OAuth access token.", "type": "string" } }, @@ -273,14 +273,752 @@ "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/", + "revision": "20171202", "discoveryVersion": "v1", "version_module": true, "schemas": { + "AllocateInfo": { + "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.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "AllocateInfo", + "type": "object" + }, + "ReportRequest": { + "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", + "description": "Request message for the Report method.", + "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" + }, + "LogEntry": { + "properties": { + "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": { + "description": "Required. The log to which this log entry belongs. Examples: `\"syslog\"`,\n`\"book_log\"`.", + "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" + }, + "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" + }, + "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": { + "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" + } + }, + "id": "LogEntry", + "description": "An individual log entry.", + "type": "object" + }, + "AuditLog": { + "description": "Common audit log format for Google Cloud Platform API operations.\n\n", + "type": "object", + "properties": { + "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": { + "description": "The number of items returned from a List or Query API method,\nif applicable.", + "format": "int64", + "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" + }, + "requestMetadata": { + "description": "Metadata about the operation.", + "$ref": "RequestMetadata" + }, + "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": { + "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": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Other service-specific data about the request, response, and other\ninformation associated with the current audited event.", + "type": "object" + }, + "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" + }, + "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" + } + }, + "id": "AuditLog" + }, + "MetricValue": { + "description": "Represents a single metric value.", + "type": "object", + "properties": { + "int64Value": { + "description": "A signed 64-bit integer value.", + "format": "int64", + "type": "string" + }, + "distributionValue": { + "description": "A distribution value.", + "$ref": "Distribution" + }, + "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" + }, + "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" + }, + "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" + }, + "stringValue": { + "description": "A text string value.", + "type": "string" + }, + "doubleValue": { + "description": "A double precision floating point value.", + "format": "double", + "type": "number" + } + }, + "id": "MetricValue" + }, + "Money": { + "properties": { + "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" + }, + "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" + } + }, + "id": "Money", + "description": "Represents an amount of money with its currency type.", + "type": "object" + }, + "EndReconciliationResponse": { + "description": "Response message for QuotaController.EndReconciliation.", + "type": "object", + "properties": { + "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" + } + }, + "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" + } + }, + "id": "EndReconciliationResponse" + }, + "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", + "type": "array", + "items": { + "format": "double", + "type": "number" + } + } + }, + "id": "ExplicitBuckets" + }, + "Distribution": { + "properties": { + "explicitBuckets": { + "description": "Buckets with arbitrary user-provided width.", + "$ref": "ExplicitBuckets" + }, + "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": { + "description": "Buckets with exponentially growing width.", + "$ref": "ExponentialBuckets" + }, + "linearBuckets": { + "$ref": "LinearBuckets", + "description": "Buckets with constant width." + }, + "minimum": { + "description": "The minimum of the population of values. Ignored if `count` is zero.", + "format": "double", + "type": "number" + }, + "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" + }, + "count": { + "description": "The total number of samples in the distribution. Must be \u003e= 0.", + "format": "int64", + "type": "string" + }, + "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", + "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" + }, + "ExponentialBuckets": { + "description": "Describing buckets with exponentially growing width.", + "type": "object", + "properties": { + "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" + }, + "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" + } + }, + "id": "ExponentialBuckets" + }, + "AuthorizationInfo": { + "description": "Authorization information for the operation.", + "type": "object", + "properties": { + "granted": { + "description": "Whether or not authorization for `resource` and `permission`\nwas granted.", + "type": "boolean" + }, + "permission": { + "description": "The required IAM permission.", + "type": "string" + }, + "resource": { + "description": "The resource being accessed, as a REST-style string. For example:\n\n bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID", + "type": "string" + } + }, + "id": "AuthorizationInfo" + }, + "ResourceInfo": { + "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" + } + }, + "id": "ResourceInfo", + "description": "Describes a resource associated with this operation.", + "type": "object" + }, + "StartReconciliationResponse": { + "description": "Response message for QuotaController.StartReconciliation.", + "type": "object", + "properties": { + "operationId": { + "description": "The same operation_id value used in the StartReconciliationRequest. Used\nfor logging and diagnostics purposes.", + "type": "string" + }, + "reconciliationErrors": { + "description": "Indicates the decision of the reconciliation start.", + "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 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" + } + } + }, + "id": "StartReconciliationResponse" + }, + "QuotaProperties": { + "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" + } + }, + "id": "QuotaProperties", + "description": "Represents the properties needed for quota operations.", + "type": "object" + }, + "LinearBuckets": { + "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", + "description": "Describing buckets with constant width.", + "type": "object" + }, + "AuthenticationInfo": { + "description": "Authentication information for the operation.", + "type": "object", + "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": { + "description": "Properties of the object.", + "type": "any" + }, + "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" + }, + "AllocateQuotaResponse": { + "description": "Response message for the AllocateQuota method.", + "type": "object", + "properties": { + "operationId": { + "description": "The same operation_id value used in the AllocateQuotaRequest. Used for\nlogging and diagnostics purposes.", + "type": "string" + }, + "serviceConfigId": { + "description": "ID of the actual config used to process the request.", + "type": "string" + }, + "allocateInfo": { + "$ref": "AllocateInfo", + "description": "WARNING: DO NOT use this field until this warning message is removed." + }, + "allocateErrors": { + "description": "Indicates the decision of the allocate.", + "type": "array", + "items": { + "$ref": "QuotaError" + } + }, + "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. Per quota group or per quota metric incremental usage will be specified\nusing the following delta metric :\n \"serviceruntime.googleapis.com/api/consumer/quota_used_count\"\n\n2. The quota limit reached condition will be specified using the following\nboolean metric :\n \"serviceruntime.googleapis.com/quota/exceeded\"", + "type": "array", + "items": { + "$ref": "MetricValueSet" + } + } + }, + "id": "AllocateQuotaResponse" + }, + "ReleaseQuotaRequest": { + "properties": { + "releaseOperation": { + "$ref": "QuotaOperation", + "description": "Operation that describes the quota release." + }, + "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": "ReleaseQuotaRequest", + "description": "Request message for the ReleaseQuota method.", + "type": "object" + }, + "RequestMetadata": { + "properties": { + "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" + }, + "callerNetwork": { + "description": "The network of the caller.\nSet only if the network host project is part of the same GCP organization\n(or project) as the accessed resource.\nSee https://cloud.google.com/compute/docs/vpc/ for more information.\nThis is a scheme-less URI full resource name. For example:\n\n \"//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID\"", + "type": "string" + }, + "callerIp": { + "description": "The IP address of the caller.\nFor caller from internet, this will be public IPv4 or IPv6 address.\nFor caller from a Compute Engine VM with external IP address, this\nwill be the VM's external IP address. For caller from a Compute\nEngine VM without external IP address, if the VM is in the same\norganization (or project) as the accessed resource, `caller_ip` will\nbe the VM's internal IPv4 address, otherwise the `caller_ip` will be\nredacted to \"gce-internal-ip\".\nSee https://cloud.google.com/compute/docs/vpc/ for more information.", + "type": "string" + } + }, + "id": "RequestMetadata", + "description": "Metadata about the request.", + "type": "object" + }, + "QuotaError": { + "description": "Represents error information for QuotaOperation.", + "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": { + "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.", + "type": "string" + } + }, + "id": "QuotaError" + }, + "CheckInfo": { + "description": "Contains additional information about the check operation.", + "type": "object", + "properties": { + "consumerInfo": { + "$ref": "ConsumerInfo", + "description": "Consumer info of this check." + }, + "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" + }, + "AllocateQuotaRequest": { + "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" + }, + "allocateOperation": { + "description": "Operation that describes the quota allocation.", + "$ref": "QuotaOperation" + } + }, + "id": "AllocateQuotaRequest", + "description": "Request message for the AllocateQuota method.", + "type": "object" + }, + "ReleaseQuotaResponse": { + "description": "Response message for the ReleaseQuota method.", + "type": "object", + "properties": { + "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" + } + }, + "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" + } + } + }, + "id": "ReleaseQuotaResponse" + }, + "MetricValueSet": { + "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", + "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" + }, + "ReportError": { + "description": "Represents the processing error of one Operation in the request.", + "type": "object", + "properties": { + "operationId": { + "description": "The Operation.operation_id value from the request.", + "type": "string" + }, + "status": { + "$ref": "Status", + "description": "Details of the error when processing the Operation." + } + }, + "id": "ReportError" + }, "CheckError": { - "id": "CheckError", "description": "Defines the errors to be returned in\ngoogle.api.servicecontrol.v1.CheckResponse.check_errors.", "type": "object", "properties": { @@ -360,22 +1098,23 @@ "description": "The error code.", "type": "string" } - } + }, + "id": "CheckError" }, "StartReconciliationRequest": { - "description": "Request message for QuotaController.StartReconciliation.", - "type": "object", "properties": { + "reconciliationOperation": { + "description": "Operation that describes the quota reconciliation.", + "$ref": "QuotaOperation" + }, "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" + "id": "StartReconciliationRequest", + "description": "Request message for QuotaController.StartReconciliation.", + "type": "object" }, "QuotaInfo": { "description": "Contains the quota information for a quota check response.", @@ -391,59 +1130,57 @@ }, "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\"", + "type": "array", "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.", + "type": "array", "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.", + "format": "int64", "type": "string" } }, - "id": "ConsumerInfo" + "id": "ConsumerInfo", + "description": "`ConsumerInfo` provides information about the consumer project.", + "type": "object" }, "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." + }, + "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" } }, "id": "CheckRequest" }, "QuotaOperation": { - "description": "Represents information regarding a quota operation.", - "type": "object", "properties": { "labels": { "additionalProperties": { @@ -460,35 +1197,37 @@ "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." + "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.", + "The operation allocates quota for the amount specified in the service\nconfiguration or specified using the quota metrics. If the amount is\nhigher than the available quota, request does not fail but all available\nquota will be allocated.", + "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." ], "enum": [ "UNSPECIFIED", "NORMAL", "BEST_EFFORT", "CHECK_ONLY" - ] + ], + "description": "Quota mode for this operation.", + "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.\n\nThis field should not be set if any of the following is true:\n(1) the quota operation is performed on non-API resources.\n(2) quota_metrics is set because the caller is doing quota override.\n\nExample of an RPC method name:\n google.example.library.v1.LibraryService.CreateShelf", + "type": "string" }, "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.", + "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.\n\nThis field is mutually exclusive with method_name.", + "type": "array", "items": { "$ref": "MetricValueSet" - }, - "type": "array" + } } }, - "id": "QuotaOperation" + "id": "QuotaOperation", + "description": "Represents information regarding a quota operation.", + "type": "object" }, "EndReconciliationRequest": { "description": "Request message for QuotaController.EndReconciliation.", @@ -506,9 +1245,6 @@ "id": "EndReconciliationRequest" }, "ReportInfo": { - "id": "ReportInfo", - "description": "Contains additional info about the report operation.", - "type": "object", "properties": { "operationId": { "description": "The Operation.operation_id value from the request.", @@ -518,36 +1254,12 @@ "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" + "id": "ReportInfo", + "description": "Contains additional info about the report operation.", + "type": "object" }, "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.", @@ -562,53 +1274,53 @@ "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.", + "format": "google-datetime", "type": "string" }, "startTime": { - "format": "google-datetime", "description": "Required. Start time of the operation.", + "format": "google-datetime", "type": "string" }, "importance": { + "enum": [ + "LOW", + "HIGH", + "DEBUG" + ], "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”" + "description": "DO NOT USE. This field is deprecated, use \"resources\" field instead.\nThe 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" }, "labels": { - "type": "object", "additionalProperties": { "type": "string" }, - "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)." + "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" }, "resources": { "description": "The resources that are involved in the operation.", + "type": "array", "items": { "$ref": "ResourceInfo" - }, - "type": "array" + } }, "logEntries": { "description": "Represents information to be logged.", + "type": "array", "items": { "$ref": "LogEntry" - }, - "type": "array" + } }, "userLabels": { "additionalProperties": { @@ -619,791 +1331,73 @@ }, "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" - }, - "type": "array" + } }, "quotaProperties": { "$ref": "QuotaProperties", - "description": "Represents the properties needed for quota check. Applicable only if this\noperation is for a quota check request." + "description": "Represents the properties needed for quota check. Applicable only if this\noperation is for a quota check request. If this is not specified, no quota\ncheck will be performed." } }, - "id": "Operation" + "id": "Operation", + "description": "Represents information regarding an operation.", + "type": "object" }, - "CheckResponse": { - "description": "Response message for the Check method.", + "ReportResponse": { + "description": "Response message for the Report 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.", + "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": "CheckError" - }, - "type": "array" + "$ref": "ReportError" + } }, - "operationId": { - "description": "The same operation_id value used in the CheckRequest.\nUsed for logging and diagnostics purposes.", - "type": "string" + "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" + } }, "serviceConfigId": { "description": "The actual config id used to process the request.", "type": "string" + } + }, + "id": "ReportResponse" + }, + "CheckResponse": { + "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" - } - }, - "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.", + "description": "The actual config id used to process the request.", "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.", + "id": "CheckResponse", + "description": "Response message for the Check method.", "type": "object" } }, @@ -1416,11 +1410,11 @@ "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/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" } } } diff --git a/etc/api/servicemanagement/v1/servicemanagement-api.json b/etc/api/servicemanagement/v1/servicemanagement-api.json index b9cb4858b6..485e971a8b 100644 --- a/etc/api/servicemanagement/v1/servicemanagement-api.json +++ b/etc/api/servicemanagement/v1/servicemanagement-api.json @@ -1,169 +1,973 @@ { + "fullyEncodeReservedExpansion": true, + "title": "Google Service Management API", + "ownerName": "Google", + "resources": { + "services": { + "methods": { + "get": { + "response": { + "$ref": "ManagedService" + }, + "parameterOrder": [ + "serviceName" + ], + "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 `ServiceManager` overview for naming\nrequirements. For example: `example.googleapis.com`.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/services/{serviceName}", + "path": "v1/services/{serviceName}", + "id": "servicemanagement.services.get", + "description": "Gets a managed service. Authentication is required unless the service is\npublic." + }, + "testIamPermissions": { + "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.", + "required": true, + "type": "string", + "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", + "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": { + "flatPath": "v1/services/{serviceName}/config", + "path": "v1/services/{serviceName}/config", + "id": "servicemanagement.services.getConfig", + "description": "Gets a service configuration (version) for a managed service.", + "response": { + "$ref": "Service" + }, + "parameterOrder": [ + "serviceName" + ], + "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" + }, + "configId": { + "description": "The id of the service configuration resource.", + "type": "string", + "location": "query" + }, + "view": { + "description": "Specifies which parts of the Service Config should be returned in the\nresponse.", + "type": "string", + "location": "query", + "enum": [ + "BASIC", + "FULL" + ] + } + } + }, + "delete": { + "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}", + "path": "v1/services/{serviceName}", + "id": "servicemanagement.services.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" + }, + "enable": { + "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" + }, + "parameters": { + "serviceName": { + "required": true, + "type": "string", + "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" + ] + }, + "setIamPolicy": { + "id": "servicemanagement.services.setIamPolicy", + "path": "v1/{+resource}: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" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "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.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/services/{servicesId}:setIamPolicy" + }, + "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" + }, + "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": "Name of the service to disable. Specifying an unknown service name\nwill cause the request to fail.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1/services/{serviceName}:disable" + }, + "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" + }, + "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": { + "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.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/services/{servicesId}:getIamPolicy" + }, + "undelete": { + "path": "v1/services/{serviceName}:undelete", + "id": "servicemanagement.services.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": { + "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}:undelete" + }, + "list": { + "response": { + "$ref": "ListServicesResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "consumerId": { + "location": "query", + "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" + }, + "pageToken": { + "location": "query", + "description": "Token identifying which result to start with; returned by a previous list\ncall.", + "type": "string" + }, + "pageSize": { + "location": "query", + "description": "Requested size of the next page of data.", + "format": "int32", + "type": "integer" + }, + "producerProjectId": { + "location": "query", + "description": "Include services produced by the specified project.", + "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", + "path": "v1/services", + "id": "servicemanagement.services.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}\"." + }, + "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", + "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" + }, + "generateConfigReport": { + "flatPath": "v1/services:generateConfigReport", + "path": "v1/services:generateConfigReport", + "id": "servicemanagement.services.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" + }, + "response": { + "$ref": "GenerateConfigReportResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "parameters": {} + } + }, + "resources": { + "configs": { + "methods": { + "list": { + "response": { + "$ref": "ListServiceConfigsResponse" + }, + "parameterOrder": [ + "serviceName" + ], + "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": { + "pageSize": { + "description": "The max number of items to include in the response list.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "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": { + "type": "string", + "location": "query", + "description": "The token of the page to retrieve." + } + }, + "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": { + "view": { + "description": "Specifies which parts of the Service Config should be returned in the\nresponse.", + "type": "string", + "location": "query", + "enum": [ + "BASIC", + "FULL" + ] + }, + "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" + } + }, + "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." + }, + "create": { + "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.", + "response": { + "$ref": "Service" + }, + "parameterOrder": [ + "serviceName" + ], + "httpMethod": "POST", + "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", + "path": "v1/services/{serviceName}/configs", + "id": "servicemanagement.services.configs.create" + }, + "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`.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "flatPath": "v1/services/{serviceName}/configs:submit", + "id": "servicemanagement.services.configs.submit", + "path": "v1/services/{serviceName}/configs:submit", + "request": { + "$ref": "SubmitConfigSourceRequest" + }, + "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" + } + } + }, + "consumers": { + "methods": { + "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" + }, + "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.", + "required": true, + "type": "string", + "pattern": "^services/[^/]+/consumers/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/services/{servicesId}/consumers/{consumersId}:setIamPolicy", + "id": "servicemanagement.services.consumers.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy" + }, + "testIamPermissions": { + "path": "v1/{+resource}:testIamPermissions", + "id": "servicemanagement.services.consumers.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.", + "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", + "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}:testIamPermissions" + }, + "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.", + "httpMethod": "POST", + "parameterOrder": [ + "resource" + ], + "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.", + "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" + } + } + }, + "rollouts": { + "methods": { + "list": { + "response": { + "$ref": "ListServiceRolloutsResponse" + }, + "parameterOrder": [ + "serviceName" + ], + "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": { + "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" + }, + "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": { + "description": "The max number of items to include in the response list.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "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." + }, + "get": { + "response": { + "$ref": "Rollout" + }, + "parameterOrder": [ + "serviceName", + "rolloutId" + ], + "httpMethod": "GET", + "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" + }, + "rolloutId": { + "location": "path", + "description": "The id of the rollout resource.", + "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/{serviceName}/rollouts/{rolloutId}", + "path": "v1/services/{serviceName}/rollouts/{rolloutId}", + "id": "servicemanagement.services.rollouts.get", + "description": "Gets a service configuration rollout." + }, + "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", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "serviceName" + ], + "httpMethod": "POST", + "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}/rollouts", + "path": "v1/services/{serviceName}/rollouts", + "id": "servicemanagement.services.rollouts.create" + } + } + } + } + }, + "operations": { + "methods": { + "list": { + "parameters": { + "name": { + "location": "query", + "description": "Not used.", + "type": "string" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "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" + }, + "filter": { + "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", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/service.management" + ], + "flatPath": "v1/operations", + "id": "servicemanagement.operations.list", + "path": "v1/operations", + "description": "Lists service operations that match the specified filter in the request.", + "httpMethod": "GET", + "parameterOrder": [], + "response": { + "$ref": "ListOperationsResponse" + } + }, + "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/service.management" + ], + "flatPath": "v1/operations/{operationsId}", + "path": "v1/{+name}", + "id": "servicemanagement.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": { + "$.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" + ] + }, + "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": { + "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" + }, + "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": { + "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": { + "description": "Selector specifying which fields to include in a partial response.", + "type": "string", + "location": "query" + } + }, + "version": "v1", + "baseUrl": "https://servicemanagement.googleapis.com/", + "kind": "discovery#restDescription", + "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.", + "servicePath": "", + "basePath": "", + "revision": "20171201", "documentationLink": "https://cloud.google.com/service-management/", - "revision": "20170916", "id": "servicemanagement:v1", "discoveryVersion": "v1", "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" - }, - "type": "array" - } - }, - "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" - }, - "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." - }, - "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" - }, - "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" - }, - "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" - }, - "GetIamPolicyRequest": { - "properties": {}, - "id": "GetIamPolicyRequest", - "description": "Request message for `GetIamPolicy` method.", - "type": "object" - }, "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.", + "type": "array", "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'.", + "type": "array", + "items": { + "type": "string" + } } }, - "id": "Usage" + "id": "Usage", + "description": "Configuration controlling usage of a service." + }, + "GetIamPolicyRequest": { + "type": "object", + "properties": {}, + "id": "GetIamPolicyRequest", + "description": "Request message for `GetIamPolicy` method." + }, + "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" + } + } + } }, "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" + "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." } }, "id": "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": { - "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": { + "description": "The human-readable name for this log. This information appears on\nthe user interface and should be concise.", + "type": "string" + }, "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" }, - "type": "array" + "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." }, "name": { - "type": "string", - "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 [/_-.]." + "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" } }, - "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" + "id": "LogDescriptor" }, "ConfigFile": { "id": "ConfigFile", "description": "Generic specification of a source configuration file", "type": "object", "properties": { + "filePath": { + "description": "The file name of the configuration file (full or relative path).", + "type": "string" + }, "fileType": { + "enumDescriptions": [ + "Unknown file type.", + "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", + "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." + ], "enum": [ "FILE_TYPE_UNSPECIFIED", "SERVICE_CONFIG_YAML", @@ -173,58 +977,18 @@ "PROTO_FILE" ], "description": "The type of configuration file this represents.", - "type": "string", - "enumDescriptions": [ - "Unknown file type.", - "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", - "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).", + "fileContents": { + "description": "The bytes that constitute the file.", + "format": "byte", "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": "MonitoredResourceDescriptor" - }, "CustomErrorRule": { + "id": "CustomErrorRule", + "description": "A custom error rule.", "type": "object", "properties": { "isErrorType": { @@ -235,11 +999,40 @@ "description": "Selects messages to which this rule applies.\n\nRefer to selector for syntax details.", "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\"`.", + "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": "CustomErrorRule", - "description": "A custom error rule." + "id": "MonitoredResourceDescriptor" }, "MediaDownload": { + "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", "properties": { @@ -260,18 +1053,18 @@ "type": "string" }, "maxDirectDownloadSize": { - "format": "int64", "description": "Optional maximum acceptable size for direct download.\nThe size is specified in bytes.", + "format": "int64", "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" + } }, "CustomAuthRequirements": { + "id": "CustomAuthRequirements", "description": "Configuration for a custom authentication provider.", "type": "object", "properties": { @@ -279,22 +1072,21 @@ "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": { + "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.", + "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.", - "type": "object" + } }, "DisableServiceRequest": { "properties": { @@ -308,86 +1100,105 @@ "type": "object" }, "SubmitConfigSourceResponse": { + "description": "Response message for SubmitConfigSource method.", "type": "object", "properties": { "serviceConfig": { - "$ref": "Service", - "description": "The generated service configuration." + "description": "The generated service configuration.", + "$ref": "Service" } }, - "id": "SubmitConfigSourceResponse", - "description": "Response message for SubmitConfigSource method." + "id": "SubmitConfigSourceResponse" }, "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": { - "enabled": { - "description": "Whether upload is enabled.", + "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" + }, + "maxSize": { + "description": "Optional maximum acceptable size for an upload.\nThe size is specified in bytes.", + "format": "int64", + "type": "string" + }, + "mimeTypes": { + "description": "An array of mimetype patterns. Esf will only accept uploads that match one\nof the given patterns.", + "type": "array", + "items": { + "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.", "type": "boolean" }, "progressNotification": { "description": "Whether to receive a notification for progress changes of media upload.", "type": "boolean" }, - "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" }, "dropzone": { - "type": "string", - "description": "Name of the Scotty dropzone to use for the current API." + "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": { - "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" }, + "BillingDestination": { + "description": "Configuration of a specific billing destination (Currently only support\nbill against consumer project).", + "type": "object", + "properties": { + "monitoredResource": { + "description": "The monitored resource type. The type must be defined in\nService.monitored_resources section.", + "type": "string" + }, + "metrics": { + "description": "Names of the metrics to report to this billing destination.\nEach name must be defined in Service.metrics section.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "BillingDestination" + }, "Advice": { "description": "Generated advice about this change, used for providing more\ninformation about how a change will affect the existing service.", "type": "object", "properties": { "description": { - "type": "string", - "description": "Useful description for why this advice was applied and what actions should\nbe taken to mitigate any implied risks." + "description": "Useful description for why this advice was applied and what actions should\nbe taken to mitigate any implied risks.", + "type": "string" } }, "id": "Advice" }, "ManagedService": { + "description": "The full representation of a Service that is managed by\nGoogle Service Management.", "type": "object", "properties": { - "producerProjectId": { - "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" + }, + "producerProjectId": { + "type": "string", + "description": "ID of the project that produces and owns this service." } }, - "id": "ManagedService", - "description": "The full representation of a Service that is managed by\nGoogle Service Management." + "id": "ManagedService" }, "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": { @@ -395,7 +1206,7 @@ "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.", + "description": "True, if the method should skip service control. If so, no control plane\nfeature (like quota and billing) will be enabled.\nThis flag is used by ESP to allow some Endpoints customers to bypass\nGoogle internal checks.", "type": "boolean" }, "allowUnregisteredCalls": { @@ -403,84 +1214,83 @@ "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" - }, - "TrafficPercentStrategy": { - "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": { - "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." - } - }, - "id": "TrafficPercentStrategy" + "id": "UsageRule" }, "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" + "type": "string", + "description": "id from authentication provider.\n\nExample:\n\n provider_id: bookstore_auth" }, "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" + "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", + "type": "string" } - } + }, + "id": "AuthRequirement" + }, + "TrafficPercentStrategy": { + "properties": { + "percentages": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "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" + } + }, + "id": "TrafficPercentStrategy", + "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" }, "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.", "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" }, "documentationRootUrl": { - "description": "The URL to the root of documentation.", + "type": "string", + "description": "The URL to the root of documentation." + }, + "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" + } } - }, - "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": { + "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", "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", @@ -488,91 +1298,126 @@ "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" - ] + "type": "string" + }, + "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" + } } - }, - "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": { "files": { "description": "Set of source configuration files that are used to generate a service\nconfiguration (`google.api.Service`).", + "type": "array", "items": { "$ref": "ConfigFile" - }, - "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": { - "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": { - "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" - } - }, - "id": "BackendRule" + } }, "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": { - "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": { - "type": "string", - "description": "Selects the methods to which this rule applies.\n\nRefer to selector for syntax details." + "oauth": { + "$ref": "OAuthRequirements", + "description": "The requirements for OAuth credentials." }, "customAuth": { "$ref": "CustomAuthRequirements", "description": "Configuration for custom authentication." }, - "oauth": { - "description": "The requirements for OAuth credentials.", - "$ref": "OAuthRequirements" - }, "requirements": { + "description": "Requirements for additional authentication providers.", + "type": "array", "items": { "$ref": "AuthRequirement" - }, - "type": "array", - "description": "Requirements for additional authentication providers." + } + }, + "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" } }, "id": "AuthenticationRule" }, + "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.", + "format": "double", + "type": "number" + }, + "address": { + "type": "string", + "description": "The address of the API backend." + }, + "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 default\ndeadline for gRPC is infinite (no deadline) and HTTP requests is 5 seconds.", + "format": "double", + "type": "number" + } + }, + "id": "BackendRule" + }, + "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": { + "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" + } + }, + "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", + "type": "string" + }, + "version": { + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32", + "type": "integer" + }, + "auditConfigs": { + "description": "Specifies cloud audit logging configuration for this policy.", + "type": "array", + "items": { + "$ref": "AuditConfig" + } + } + } + }, "UndeleteServiceResponse": { + "description": "Response message for UndeleteService method.", "type": "object", "properties": { "service": { @@ -580,52 +1425,35 @@ "description": "Revived service resource." } }, - "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": { - "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" - }, - "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" - } - }, - "id": "Policy" + "id": "UndeleteServiceResponse" }, "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": { + "version": { + "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 interfaces. See Mixin.", + "type": "array", + "items": { + "$ref": "Mixin" + } + }, + "options": { + "description": "Any metadata attached to the interface.", + "type": "array", + "items": { + "$ref": "Option" + } + }, "methods": { + "type": "array", "items": { "$ref": "Method" }, - "type": "array", "description": "The methods of this interface, in unspecified order." }, "name": { @@ -645,26 +1473,8 @@ "type": "string" }, "sourceContext": { - "description": "Source context for the protocol buffer service represented by this\nmessage.", - "$ref": "SourceContext" - }, - "version": { - "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 interfaces. See Mixin.", - "items": { - "$ref": "Mixin" - }, - "type": "array" - }, - "options": { - "description": "Any metadata attached to the interface.", - "items": { - "$ref": "Option" - }, - "type": "array" + "$ref": "SourceContext", + "description": "Source context for the protocol buffer service represented by this\nmessage." } }, "id": "Api" @@ -674,72 +1484,72 @@ "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": { - "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" + }, + "metricCosts": { + "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", + "additionalProperties": { + "format": "int64", + "type": "string" + } } } }, "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": { + "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" + "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", + "type": "object" }, "Operation": { "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", "type": "object", "properties": { - "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." - }, - "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" + "$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": "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": { + "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" } }, "id": "Operation" @@ -749,11 +1559,11 @@ "type": "object", "properties": { "subpages": { - "description": "Subpages of this page. The order of subpages specified here will be\nhonored in the generated docset.", + "type": "array", "items": { "$ref": "Page" }, - "type": "array" + "description": "Subpages of this page. The order of subpages specified here will be\nhonored in the generated docset." }, "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`.", @@ -770,25 +1580,25 @@ "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.", + "type": "array", "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", + "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" @@ -797,20 +1607,20 @@ "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", + "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" @@ -820,16 +1630,16 @@ "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.", + "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" }, "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\".", + "authorizationUrl": { + "description": "Redirect URL if JWT token is required but no present or is expired.\nImplement authorizationUrl of securityDefinitions in OpenAPI spec.", "type": "string" }, "jwksUri": { @@ -842,61 +1652,115 @@ } } }, + "EnumValue": { + "description": "Enum value definition.", + "type": "object", + "properties": { + "name": { + "description": "Enum value name.", + "type": "string" + }, + "options": { + "description": "Protocol buffer options.", + "type": "array", + "items": { + "$ref": "Option" + } + }, + "number": { + "description": "Enum value number.", + "format": "int32", + "type": "integer" + } + }, + "id": "EnumValue" + }, "Service": { + "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", "properties": { + "monitoredResources": { + "description": "Defines the monitored resources used by this service. This is required\nby the Service.monitoring and Service.logging configurations.", + "type": "array", + "items": { + "$ref": "MonitoredResourceDescriptor" + } + }, + "logging": { + "description": "Logging configuration.", + "$ref": "Logging" + }, + "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" + }, + "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": { - "description": "Configuration controlling usage of this service.", - "$ref": "Usage" + "$ref": "Usage", + "description": "Configuration controlling usage of this service." }, "metrics": { "description": "Defines the metrics used by this service.", + "type": "array", "items": { "$ref": "MetricDescriptor" - }, - "type": "array" + } }, "authentication": { "$ref": "Authentication", "description": "Auth configuration." }, "experimental": { - "description": "Experimental configuration.", - "$ref": "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`.", + "format": "uint32", "type": "integer" }, "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" - }, - "type": "array" + } + }, + "producerProjectId": { + "description": "The Google project that owns this service.", + "type": "string" }, "visibility": { - "description": "API visibility configuration.", - "$ref": "Visibility" + "$ref": "Visibility", + "description": "API visibility configuration." }, "quota": { "$ref": "Quota", "description": "Quota configuration." }, + "billing": { + "$ref": "Billing", + "description": "Billing configuration." + }, "name": { "description": "The DNS address at which this service is available,\ne.g. `calendar.googleapis.com`.", "type": "string" @@ -911,31 +1775,31 @@ }, "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" - }, - "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.", + "type": "array", "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": { "$ref": "SourceInfo", @@ -946,155 +1810,144 @@ "description": "HTTP configuration." }, "backend": { - "$ref": "Backend", - "description": "API backend configuration." + "description": "API backend configuration.", + "$ref": "Backend" }, "systemParameters": { - "description": "System parameter configuration.", - "$ref": "SystemParameters" + "$ref": "SystemParameters", + "description": "System parameter configuration." }, "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" - }, - "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" } - }, - "id": "Service" - }, - "EnumValue": { - "description": "Enum value definition.", - "type": "object", - "properties": { - "name": { - "description": "Enum value name.", - "type": "string" - }, - "options": { - "description": "Protocol buffer options.", - "items": { - "$ref": "Option" - }, - "type": "array" - }, - "number": { - "format": "int32", - "description": "Enum value number.", - "type": "integer" - } - }, - "id": "EnumValue" + } }, "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" + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", + "type": "array", + "items": { + "$ref": "Operation" + } } }, "id": "ListOperationsResponse" }, - "CustomHttpPattern": { - "description": "A custom pattern is used for defining custom HTTP verb.", - "type": "object", - "properties": { - "path": { - "type": "string", - "description": "The path matched by this custom verb." - }, - "kind": { - "description": "The name of this custom HTTP verb.", - "type": "string" - } - }, - "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" + "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" - }, - "type": "array" + } }, - "resourceNames": { - "items": { - "type": "string" - }, - "type": "array", - "description": "The full name of the resources that this operation is directly\nassociated with." + "progressPercentage": { + "type": "integer", + "description": "Percentage of completion of this operation, ranging from 0 to 100.", + "format": "int32" + }, + "startTime": { + "type": "string", + "description": "The start time of the operation.", + "format": "google-datetime" } }, "id": "OperationMetadata" }, + "CustomHttpPattern": { + "id": "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" + }, + "kind": { + "description": "The name of this custom HTTP verb.", + "type": "string" + } + } + }, "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.", + "type": "array", + "items": { + "$ref": "SystemParameter" + } + }, "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" - }, - "parameters": { - "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": { + "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": { + "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" + }, + "delete": { + "type": "string", + "description": "Used for deleting a resource." + }, "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" @@ -1108,11 +1961,11 @@ "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" - }, - "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.", @@ -1121,52 +1974,11 @@ "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." - }, - "get": { - "description": "Used for listing and getting information about resources.", - "type": "string" - }, - "patch": { - "description": "Used for updating a resource.", - "type": "string" - }, - "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.", @@ -1174,13 +1986,15 @@ }, "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" + "id": "MonitoringDestination", + "description": "Configuration of a specific monitoring destination (the producer project\nor the consumer project).", + "type": "object" }, "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.", @@ -1188,26 +2002,21 @@ "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.", + "type": "array", "items": { "$ref": "VisibilityRule" - }, - "type": "array" + } } }, "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": { "newValue": { "description": "Value of the changed object in the new Service configuration,\nin JSON format. This field will not be populated if ChangeType == REMOVED.", "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.", @@ -1219,74 +2028,62 @@ "ADDED", "REMOVED", "MODIFIED" - ] + ], + "description": "The type for this change, either ADDED, REMOVED, or MODIFIED.", + "type": "string" }, "element": { "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" }, + "oldValue": { + "description": "Value of the changed object in the old Service configuration,\nin JSON format. This field will not be populated if ChangeType == ADDED.", + "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" }, - "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": "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." + "description": "Collection of advice provided for this change, useful for determining the\npossible impact of this change." } }, - "id": "SystemParameters" + "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" + }, + "SystemParameters": { + "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" + } + } + }, + "id": "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" }, "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" + "$ref": "DeleteServiceStrategy", + "description": "The strategy associated with a rollout to delete a `ManagedService`.\nReadonly." }, "createTime": { - "format": "google-datetime", "description": "Creation time of the rollout. Readonly.", + "format": "google-datetime", "type": "string" }, "status": { - "enumDescriptions": [ - "No status specified.", - "The Rollout is in progress.", - "The Rollout has completed successfully.", - "The Rollout has been cancelled. This can happen if you have overlapping\nRollout pushes, and the previous ones will be cancelled.", - "The Rollout has failed and the rollback attempt has failed too.", - "The Rollout has not started yet and is pending for execution.", - "The Rollout has failed and rolled back to the previous successful\nRollout." - ], "enum": [ "ROLLOUT_STATUS_UNSPECIFIED", "IN_PROGRESS", @@ -1297,37 +2094,55 @@ "FAILED_ROLLED_BACK" ], "description": "The status of this rollout. Readonly. In case of a failed rollout,\nthe system will automatically rollback to the current Rollout\nversion. Readonly.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "No status specified.", + "The Rollout is in progress.", + "The Rollout has completed successfully.", + "The Rollout has been cancelled. This can happen if you have overlapping\nRollout pushes, and the previous ones will be cancelled.", + "The Rollout has failed and the rollback attempt has failed too.", + "The Rollout has not started yet and is pending for execution.", + "The Rollout has failed and rolled back to the previous successful\nRollout." + ] }, "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": { + "description": "Google Service Control selects service configurations based on\ntraffic percentage.", + "$ref": "TrafficPercentStrategy" } }, "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.", + "type": "array", "items": { "$ref": "QuotaLimit" - }, - "type": "array" + } }, "metricRules": { "description": "List of `MetricRule` definitions, each one mapping a selected method to one\nor more metrics.", + "type": "array", "items": { "$ref": "MetricRule" - }, - "type": "array" + } } - } + }, + "id": "Quota" }, "GenerateConfigReportRequest": { + "description": "Request message for GenerateConfigReport method.", "type": "object", "properties": { "oldConfig": { @@ -1347,21 +2162,20 @@ "type": "object" } }, - "id": "GenerateConfigReportRequest", - "description": "Request message for GenerateConfigReport method." + "id": "GenerateConfigReportRequest" }, "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.", + "format": "google-fieldmask", "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" + "$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" @@ -1407,33 +2221,33 @@ "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" + }, + "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" + } } }, "id": "LoggingDestination" }, "Option": { "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": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "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", @@ -1445,27 +2259,96 @@ "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.", + "type": "array", "items": { "$ref": "LoggingDestination" }, - "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." }, "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" - }, - "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" }, + "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": { + "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.", + "type": "string" + }, + "values": { + "additionalProperties": { + "format": "int64", + "type": "string" + }, + "description": "Tiered limit values. You must specify this as a key:value pair, with an\ninteger value that is the maximum number of requests allowed for the\nspecified unit. 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\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.", + "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": { + "description": "Name of the quota limit.\n\nThe name must be provided, and it must be unique within the service. The\nname can only include alphanumeric characters as well as '-'.\n\nThe maximum length of the limit name is 64 characters.", + "type": "string" + }, + "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": { + "type": "string", + "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" + }, + "defaultLimit": { + "type": "string", + "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" + } + }, + "id": "QuotaLimit" + }, "Method": { "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": { + "description": "If true, the response is streamed.", + "type": "boolean" + }, "name": { "description": "The simple name of this method.", "type": "string" @@ -1479,87 +2362,36 @@ "type": "boolean" }, "syntax": { - "type": "string", - "enumDescriptions": [ - "Syntax `proto2`.", - "Syntax `proto3`." - ], "enum": [ "SYNTAX_PROTO2", "SYNTAX_PROTO3" ], - "description": "The source syntax of this method." - }, - "responseTypeUrl": { - "description": "The URL of the output message type.", - "type": "string" - }, - "options": { - "description": "Any metadata attached to the method.", - "items": { - "$ref": "Option" - }, - "type": "array" - }, - "responseStreaming": { - "description": "If true, the response is streamed.", - "type": "boolean" + "description": "The source syntax of this method.", + "type": "string", + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ] } } }, - "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`.", + "ListServiceRolloutsResponse": { "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.", + "nextPageToken": { + "description": "The token of the next page of results.", "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" + "rollouts": { + "description": "The list of rollout resources.", + "type": "array", + "items": { + "$ref": "Rollout" + } } }, - "id": "QuotaLimit" + "id": "ListServiceRolloutsResponse", + "description": "Response message for ListServiceRollouts method." }, "ConfigRef": { "description": "Represents a service configuration with its name and id.", @@ -1572,24 +2404,6 @@ }, "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", @@ -1606,15 +2420,8 @@ "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.", @@ -1629,23 +2436,50 @@ "description": "The state of the operation with respect to cancellation.", "type": "string" }, - "startTime": { + "deadline": { + "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", - "description": "The start time of the operation.", "type": "string" }, + "operationType": { + "description": "Operation type which is a flow type and subtype info as that is missing in\nour datastore otherwise. This maps to the ordinal value of the enum:\njcg/api/tenant/operations/OperationNamespace.java", + "format": "int32", + "type": "integer" + }, + "startTime": { + "description": "The start time of the operation.", + "format": "google-datetime", + "type": "string" + }, + "surface": { + "enumDescriptions": [ + "", + "", + "", + "TenancyUnit, ServiceNetworking fall under this" + ], + "enum": [ + "UNSPECIFIED_OP_SERVICE", + "SERVICE_MANAGEMENT", + "SERVICE_USAGE", + "SERVICE_CONSUMER_MANAGEMENT" + ], + "type": "string" + }, + "flowName": { + "type": "string", + "description": "The name of the top-level flow corresponding to this operation.\nMust be equal to the \"name\" field for a FlowName enum." + }, "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", + "description": "The metadata associated with a long running operation resource." }, "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", @@ -1653,17 +2487,17 @@ "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" @@ -1678,18 +2512,20 @@ }, "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.", + "type": "array", "items": { "$ref": "HttpRule" - }, - "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.", @@ -1697,78 +2533,64 @@ }, "type": "object" }, - "type": "array" + "description": "All files used during config generation." } }, - "id": "SourceInfo", - "description": "Source information used to create a Service Config", - "type": "object" + "id": "SourceInfo" }, "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" + "type": "string", + "description": "The service control environment to use. If empty, no control plane\nfeature (like quota and billing) will be enabled." } }, "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": { - "type": "string", - "description": "Define the name of the parameter, such as \"api_key\" . It is case sensitive." + "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." + "description": "Define the URL query parameter name to use for the parameter. It is case\nsensitive.", + "type": "string" }, "httpHeader": { - "type": "string", - "description": "Define the HTTP header name to use for the parameter. It is case\ninsensitive." + "description": "Define the HTTP header name to use for the parameter. It is case\ninsensitive.", + "type": "string" } }, - "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", - "type": "object", - "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.", - "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.", - "items": { - "$ref": "MonitoringDestination" - }, - "type": "array" - } - }, - "id": "Monitoring" + "id": "SystemParameter" }, "Field": { "description": "A single field of a message type.", "type": "object", "properties": { + "options": { + "description": "The protocol buffer options.", + "type": "array", + "items": { + "$ref": "Option" + } + }, "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.", + "format": "int32", "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", @@ -1776,13 +2598,11 @@ "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." - ] + "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.", @@ -1797,16 +2617,15 @@ "type": "string" }, "number": { - "format": "int32", + "type": "integer", "description": "The field number.", - "type": "integer" + "format": "int32" }, "jsonName": { "description": "The field JSON name.", "type": "string" }, "kind": { - "description": "The field type.", "type": "string", "enumDescriptions": [ "Field type unknown.", @@ -1849,55 +2668,57 @@ "TYPE_SFIXED64", "TYPE_SINT32", "TYPE_SINT64" - ] - }, - "options": { - "description": "The protocol buffer options.", - "items": { - "$ref": "Option" - }, - "type": "array" + ], + "description": "The field type." } }, "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": { + "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" + } + }, + "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" + } + } + }, + "id": "Monitoring" + }, "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" }, "Enum": { + "id": "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" + "sourceContext": { + "$ref": "SourceContext", + "description": "The source context." }, "syntax": { - "description": "The source syntax.", "type": "string", "enumDescriptions": [ "Syntax `proto2`.", @@ -1906,53 +2727,28 @@ "enum": [ "SYNTAX_PROTO2", "SYNTAX_PROTO3" - ] - }, - "sourceContext": { - "$ref": "SourceContext", - "description": "The source context." - } - }, - "id": "Enum", - "description": "Enum type definition." - }, - "EnableServiceRequest": { - "description": "Request message for EnableService method.", - "type": "object", - "properties": { - "consumerId": { - "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" - }, - "Diagnostic": { - "description": "Represents a diagnostic message (error or warning)", - "type": "object", - "properties": { - "message": { - "type": "string", - "description": "Message describing the error or warning." - }, - "location": { - "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.", + "description": "The source syntax." + }, + "name": { + "description": "Enum type name.", "type": "string" + }, + "enumvalue": { + "type": "array", + "items": { + "$ref": "EnumValue" + }, + "description": "Enum value definitions." + }, + "options": { + "type": "array", + "items": { + "$ref": "Option" + }, + "description": "Protocol buffer options." } - }, - "id": "Diagnostic" + } }, "LabelDescriptor": { "description": "A description of a label.", @@ -1967,28 +2763,88 @@ "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", - "enumDescriptions": [ - "A variable-length string. This is the default.", - "Boolean; true or false.", - "A 64-bit signed integer." - ] + "type": "string" } }, "id": "LabelDescriptor" }, + "Diagnostic": { + "description": "Represents a diagnostic message (error or warning)", + "type": "object", + "properties": { + "message": { + "description": "Message describing the error or warning.", + "type": "string" + }, + "location": { + "description": "File name and line number of the error or warning.", + "type": "string" + }, + "kind": { + "description": "The kind of diagnostic information provided.", + "type": "string", + "enumDescriptions": [ + "Warnings and errors", + "Only errors" + ], + "enum": [ + "WARNING", + "ERROR" + ] + } + }, + "id": "Diagnostic" + }, + "EnableServiceRequest": { + "description": "Request message for EnableService method.", + "type": "object", + "properties": { + "consumerId": { + "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" + }, "Type": { - "id": "Type", "description": "A protocol buffer message type.", "type": "object", "properties": { + "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": { + "$ref": "SourceContext", + "description": "The source context." + }, "syntax": { + "type": "string", "enumDescriptions": [ "Syntax `proto2`.", "Syntax `proto3`." @@ -1997,89 +2853,66 @@ "SYNTAX_PROTO2", "SYNTAX_PROTO3" ], - "description": "The source syntax.", - "type": "string" - }, - "sourceContext": { - "$ref": "SourceContext", - "description": "The source context." + "description": "The source syntax." }, "options": { "description": "The protocol buffer options.", + "type": "array", "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" + } } - } + }, + "id": "Type" }, "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" + "type": "string", + "description": "Name of the service this report belongs to." + }, + "changeReports": { + "description": "list of ChangeReport, each corresponding to comparison between two\nservice configurations.", + "type": "array", + "items": { + "$ref": "ChangeReport" + } } - }, - "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": { @@ -2087,79 +2920,69 @@ "$ref": "AuthorizationConfig", "description": "Authorization configuration." } - } + }, + "id": "Experimental" }, "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.", + "type": "array", "items": { "$ref": "BackendRule" - }, - "type": "array" + } } - } + }, + "id": "Backend" }, "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": { - "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" }, "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" + "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." }, "SubmitConfigSourceRequest": { - "description": "Request message for SubmitConfigSource method.", - "type": "object", "properties": { - "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." + }, + "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" } }, - "id": "SubmitConfigSourceRequest" - }, - "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", - "type": "object", - "properties": { - "provider": { - "description": "The name of the authorization provider, such as\nfirebaserules.googleapis.com.", - "type": "string" - } - }, - "id": "AuthorizationConfig" + "id": "SubmitConfigSourceRequest", + "description": "Request message for SubmitConfigSource method.", + "type": "object" }, "DocumentationRule": { "description": "A documentation rule provides information about individual API elements.", "type": "object", "properties": { "description": { - "type": "string", - "description": "Description of the selected API(s)." + "description": "Description of the selected API(s).", + "type": "string" }, "deprecationDescription": { "description": "Deprecation description of the selected element(s). It can be provided if an\nelement is marked as `deprecated`.", @@ -2172,53 +2995,67 @@ }, "id": "DocumentationRule" }, + "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", + "type": "object", + "properties": { + "provider": { + "description": "The name of the authorization provider, such as\nfirebaserules.googleapis.com.", + "type": "string" + } + }, + "id": "AuthorizationConfig" + }, "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.", - "items": { - "type": "string" - }, - "type": "array" - }, "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.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } + }, + "requested": { + "description": "A list of full type names of requested contexts.", + "type": "array", + "items": { + "type": "string" + } } }, "id": "ContextRule" }, + "SourceContext": { + "id": "SourceContext", + "description": "`SourceContext` represents information about the source of a\nprotobuf 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\nprotobuf element. For example: `\"google/protobuf/source_context.proto\"`.", + "type": "string" + } + } + }, "MetricDescriptor": { + "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", "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\"", + "description": "The resource name of the metric descriptor.", "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" + "type": "string", + "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\"" }, "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", @@ -2229,7 +3066,16 @@ "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" + "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." + ] }, "metricKind": { "enumDescriptions": [ @@ -2248,12 +3094,12 @@ "type": "string" }, "description": { - "description": "A detailed description of the metric, which can be used in documentation.", - "type": "string" + "type": "string", + "description": "A detailed description of the metric, which can be used in documentation." }, "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\"." + "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\".\nThis field is optional but it is recommended to be set for any metrics\nassociated with user-visible concepts, such as Quota.", + "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 '}'.", @@ -2261,69 +3107,133 @@ }, "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" - }, - "type": "array" + } } - }, - "id": "MetricDescriptor" + } }, - "SourceContext": { + "Billing": { + "description": "Billing related configuration of the service.\n\nThe following example shows how to configure monitored resources and metrics\nfor billing:\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/borrowed_count\n metric_kind: DELTA\n value_type: INT64\n billing:\n consumer_destinations:\n - monitored_resource: library.googleapis.com/branch\n metrics:\n - library.googleapis.com/book/borrowed_count", "type": "object", "properties": { - "fileName": { - "description": "The path-qualified name of the .proto file that contained the associated\nprotobuf element. For example: `\"google/protobuf/source_context.proto\"`.", - "type": "string" + "consumerDestinations": { + "description": "Billing configurations for sending metrics to the consumer project.\nThere can be multiple consumer destinations per service, each one must have\na different monitored resource type. A metric can be used in at most\none consumer destination.", + "type": "array", + "items": { + "$ref": "BillingDestination" + } } }, - "id": "SourceContext", - "description": "`SourceContext` represents information about the source of a\nprotobuf element, like the file in which it is defined." + "id": "Billing" }, "Expr": { + "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\"", "type": "object", "properties": { "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." + "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." - }, - "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.", + "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" }, "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" + }, + "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" + } + } + }, + "ListServicesResponse": { + "description": "Response message for `ListServices` method.", + "type": "object", + "properties": { + "services": { + "description": "The returned services will only have the name field set.", + "type": "array", + "items": { + "$ref": "ManagedService" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token that can be passed to `ListServices` to resume a paginated query." } }, - "id": "Expr" + "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": { + "aliases": { + "description": "DEPRECATED: This field is no longer supported. Instead of using aliases,\nplease specify multiple google.api.Endpoint for each of the intended\naliases.\n\nAdditional names that this endpoint will be hosted on.", + "type": "array", + "items": { + "type": "string" + } + }, + "features": { + "description": "The list of features enabled on this endpoint.", + "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" + }, + "name": { + "description": "The canonical name of this endpoint.", + "type": "string" + }, + "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" + } + }, + "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" } }, - "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", "canonicalName": "Service Management", "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/service.management.readonly": { + "description": "View your Google API service configuration" + }, "https://www.googleapis.com/auth/cloud-platform": { "description": "View and manage your data across Google Cloud Platform services" }, "https://www.googleapis.com/auth/service.management": { "description": "Manage your Google API service configuration" - }, - "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" } } } @@ -2331,866 +3241,5 @@ "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.", - "kind": "discovery#restDescription", - "basePath": "" + "batchPath": "batch" } diff --git a/etc/api/serviceuser/v1/serviceuser-api.json b/etc/api/serviceuser/v1/serviceuser-api.json index 46bbf94b92..404914aee3 100644 --- a/etc/api/serviceuser/v1/serviceuser-api.json +++ b/etc/api/serviceuser/v1/serviceuser-api.json @@ -10,33 +10,33 @@ "services": { "methods": { "disable": { + "path": "v1/{+name}:disable", + "id": "serviceuser.projects.services.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", + "response": { + "$ref": "Operation" + }, "parameterOrder": [ "name" ], - "response": { - "$ref": "Operation" + "httpMethod": "POST", + "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", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/services/[^/]+$", + "location": "path" + } }, "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" + "flatPath": "v1/projects/{projectsId}/services/{servicesId}:disable" }, "enable": { "response": { @@ -46,63 +46,63 @@ "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" ], + "parameters": { + "name": { + "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", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/services/[^/]+$", + "location": "path" + } + }, "flatPath": "v1/projects/{projectsId}/services/{servicesId}:enable", - "id": "serviceuser.projects.services.enable", "path": "v1/{+name}:enable", + "id": "serviceuser.projects.services.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" ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only" ], "parameters": { + "parent": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "List enabled services for the specified parent.\n\nAn example valid parent would be:\n- projects/my-project", + "required": true, + "type": "string" + }, "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 + "format": "int32", + "type": "integer", + "location": "query" } - } + }, + "flatPath": "v1/projects/{projectsId}/services", + "path": "v1/{+parent}/services", + "id": "serviceuser.projects.services.list", + "description": "List enabled services for the specified consumer." } } } @@ -111,7 +111,6 @@ "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" }, @@ -123,26 +122,57 @@ ], "parameters": { "pageToken": { + "location": "query", "description": "Token identifying which result to start with; returned by a previous list\ncall.", - "type": "string", - "location": "query" + "type": "string" }, "pageSize": { - "format": "int32", "description": "Requested size of the next page of data.", + "format": "int32", "type": "integer", "location": "query" } }, "flatPath": "v1/services:search", + "path": "v1/services:search", "id": "serviceuser.services.search", - "path": "v1/services: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." } } } }, "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", + "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", @@ -154,9 +184,7 @@ "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", @@ -169,25 +197,25 @@ "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" + "type": "boolean", + "default": "true" }, "oauth_token": { + "type": "string", "location": "query", - "description": "OAuth 2.0 token for the current user.", - "type": "string" + "description": "OAuth 2.0 token for the current user." }, "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\").", @@ -195,38 +223,10 @@ "location": "query" }, "prettyPrint": { - "location": "query", "description": "Returns response with indentations and line breaks.", + "type": "boolean", "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", @@ -235,38 +235,251 @@ "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", + "revision": "20171201", "documentationLink": "https://cloud.google.com/service-management/", "id": "serviceuser:v1", "discoveryVersion": "v1", "version_module": true, "schemas": { - "Authentication": { + "BillingDestination": { + "description": "Configuration of a specific billing destination (Currently only support\nbill against consumer project).", "type": "object", "properties": { + "monitoredResource": { + "description": "The monitored resource type. The type must be defined in\nService.monitored_resources section.", + "type": "string" + }, + "metrics": { + "description": "Names of the metrics to report to this billing destination.\nEach name must be defined in Service.metrics section.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "BillingDestination" + }, + "UsageRule": { + "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", + "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.\nThis flag is used by ESP to allow some Endpoints customers to bypass\nGoogle internal checks.", + "type": "boolean" + }, + "allowUnregisteredCalls": { + "type": "boolean", + "description": "True, if the method allows unregistered calls; false otherwise." + } + } + }, + "AuthRequirement": { + "properties": { + "audiences": { + "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", + "type": "string" + }, + "providerId": { + "description": "id from authentication provider.\n\nExample:\n\n provider_id: bookstore_auth", + "type": "string" + } + }, + "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" + }, + "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": { + "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" + } + }, + "summary": { + "description": "A short summary of what the service does. Can only be provided by\nplain text.", + "type": "string" + } + }, + "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": { + "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": { + "description": "The requirements for OAuth credentials.", + "$ref": "OAuthRequirements" + }, + "customAuth": { + "$ref": "CustomAuthRequirements", + "description": "Configuration for custom authentication." + }, + "requirements": { + "description": "Requirements for additional authentication providers.", + "type": "array", + "items": { + "$ref": "AuthRequirement" + } + } + }, + "id": "AuthenticationRule" + }, + "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.", + "format": "double", + "type": "number" + }, + "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": { + "type": "number", + "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.", + "format": "double" + } + }, + "id": "BackendRule" + }, + "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.", + "type": "array", + "items": { + "$ref": "Method" + } + }, + "name": { + "description": "The fully qualified name of this interface, including package name\nfollowed by the interface's simple name.", + "type": "string" + }, + "syntax": { + "type": "string", + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ], + "enum": [ + "SYNTAX_PROTO2", + "SYNTAX_PROTO3" + ], + "description": "The source syntax of the service." + }, + "sourceContext": { + "$ref": "SourceContext", + "description": "Source context for the protocol buffer service represented by this\nmessage." + }, + "version": { + "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 interfaces. See Mixin.", + "type": "array", + "items": { + "$ref": "Mixin" + } + }, + "options": { + "description": "Any metadata attached to the interface.", + "type": "array", + "items": { + "$ref": "Option" + } + } + }, + "id": "Api" + }, + "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": { + "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", + "additionalProperties": { + "format": "int64", + "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": { + "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" + } + }, "providers": { + "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.", - "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" + "id": "Authentication" }, "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": { "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", @@ -280,8 +493,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": { @@ -290,31 +503,29 @@ }, "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", + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call." }, "Page": { "description": "Represents a documentation page. A page can contain subpages to represent\nnested documentation set structure.", "type": "object", "properties": { + "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" }, - "type": "array" + "description": "Subpages of this page. The order of subpages specified here will be\nhonored in the generated docset." }, "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" @@ -323,25 +534,25 @@ "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" - }, - "type": "array" + } }, "code": { - "format": "int32", + "type": "integer", "description": "The status code, which should be an enum value of google.rpc.Code.", - "type": "integer" + "format": "int32" + }, + "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." } }, "id": "Status" @@ -350,54 +561,72 @@ "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" + "type": "string", + "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" }, - "authorizationUrl": { - "description": "Redirect URL if JWT token is required but no present or is expired.\nImplement authorizationUrl of securityDefinitions in OpenAPI spec.", + "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" }, "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\"." + "authorizationUrl": { + "description": "Redirect URL if JWT token is required but no present or is expired.\nImplement authorizationUrl of securityDefinitions in OpenAPI spec.", + "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" } }, "id": "AuthProvider" }, - "EnumValue": { + "Service": { "type": "object", "properties": { - "options": { - "description": "Protocol buffer options.", - "items": { - "$ref": "Option" - }, - "type": "array" + "experimental": { + "description": "Experimental configuration.", + "$ref": "Experimental" }, - "number": { - "format": "int32", - "description": "Enum value number.", + "control": { + "$ref": "Control", + "description": "Configuration for the service control plane." + }, + "configVersion": { + "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`.", + "format": "uint32", "type": "integer" }, - "name": { - "type": "string", - "description": "Enum value name." - } - }, - "id": "EnumValue", - "description": "Enum value definition." - }, - "Service": { - "properties": { + "monitoring": { + "$ref": "Monitoring", + "description": "Monitoring configuration." + }, + "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 Google project that owns this service.", + "type": "string" + }, + "visibility": { + "description": "API visibility configuration.", + "$ref": "Visibility" + }, + "quota": { + "description": "Quota configuration.", + "$ref": "Quota" + }, + "billing": { + "$ref": "Billing", + "description": "Billing configuration." + }, "name": { "description": "The DNS address at which this service is available,\ne.g. `calendar.googleapis.com`.", "type": "string" @@ -412,31 +641,31 @@ }, "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" - }, - "type": "array" + } }, "apis": { + "type": "array", "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.", + "type": "array", "items": { "$ref": "LogDescriptor" }, - "type": "array" + "description": "Defines the logs used by this service." }, "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": { "$ref": "SourceInfo", @@ -447,132 +676,117 @@ "description": "HTTP configuration." }, "backend": { - "description": "API backend configuration.", - "$ref": "Backend" + "$ref": "Backend", + "description": "API backend configuration." }, "systemParameters": { "$ref": "SystemParameters", "description": "System parameter configuration." }, "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.", + "type": "array", + "items": { + "$ref": "MonitoredResourceDescriptor" + } }, "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.", + "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": "MonitoredResourceDescriptor" - }, - "type": "array" + "$ref": "Enum" + } }, "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." + "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." - }, - "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" + "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" + }, + "EnumValue": { + "description": "Enum value definition.", + "type": "object", + "properties": { + "name": { + "description": "Enum value name.", + "type": "string" + }, + "options": { + "description": "Protocol buffer options.", + "type": "array", + "items": { + "$ref": "Option" + } + }, + "number": { + "type": "integer", + "description": "Enum value number.", + "format": "int32" + } + }, + "id": "EnumValue" }, "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" + "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" - }, - "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.", + "format": "int32", "type": "integer" + }, + "startTime": { + "description": "The start time of the operation.", + "format": "google-datetime", + "type": "string" } }, "id": "OperationMetadata" }, "CustomHttpPattern": { - "description": "A custom pattern is used for defining custom HTTP verb.", "type": "object", "properties": { "kind": { @@ -584,22 +798,8 @@ "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" + "id": "CustomHttpPattern", + "description": "A custom pattern is used for defining custom HTTP verb." }, "SystemParameterRule": { "description": "Define a system parameter rule mapping system parameter definitions to\nmethods.", @@ -607,10 +807,10 @@ "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.", + "type": "array", "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.", @@ -619,6 +819,79 @@ }, "id": "SystemParameterRule" }, + "PublishedService": { + "type": "object", + "properties": { + "service": { + "$ref": "Service", + "description": "The service's published configuration." + }, + "name": { + "description": "The resource name of the service.\n\nA valid name would be:\n- services/serviceuser.googleapis.com", + "type": "string" + } + }, + "id": "PublishedService", + "description": "The published version of a Service that is managed by\nGoogle Service Management." + }, + "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": { + "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" + }, + "additionalBindings": { + "type": "array", + "items": { + "$ref": "HttpRule" + }, + "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" + }, + "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." + }, + "get": { + "description": "Used for listing and getting information about resources.", + "type": "string" + }, + "patch": { + "description": "Used for updating a resource.", + "type": "string" + }, + "put": { + "description": "Used for updating a resource.", + "type": "string" + } + }, + "id": "HttpRule" + }, "VisibilityRule": { "description": "A visibility rule provides visibility configuration for an individual API\nelement.", "type": "object", @@ -634,147 +907,75 @@ }, "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." + "description": "The monitored resource type. The type must be defined in\nService.monitored_resources section.", + "type": "string" }, "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" }, "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.", + "type": "array", "items": { "$ref": "VisibilityRule" - }, - "type": "array" + } } - } + }, + "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." }, "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", - "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" + "id": "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." }, "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.", + "type": "array", "items": { "$ref": "QuotaLimit" - }, - "type": "array" + } }, "metricRules": { "description": "List of `MetricRule` definitions, each one mapping a selected method to one\nor more metrics.", + "type": "array", "items": { "$ref": "MetricRule" - }, - "type": "array" + } } }, - "id": "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" }, "Step": { + "id": "Step", "description": "Represents the status of one operation step.", "type": "object", "properties": { @@ -802,8 +1003,7 @@ "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).", @@ -811,10 +1011,10 @@ "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.", @@ -827,101 +1027,103 @@ "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": "Properties of the object. Contains field @type with type URL.", + "type": "any" }, "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": { + "type": "string", + "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\"`." } }, "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.", + "type": "array", "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.", + "type": "array", "items": { "$ref": "LoggingDestination" - }, - "type": "array" + } } }, - "id": "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" }, "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": { + "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\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.", + "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": { + "description": "Name of the quota limit.\n\nThe name must be provided, and it must be unique within the service. The\nname can only include alphanumeric characters as well as '-'.\n\nThe maximum length of the limit name is 64 characters.", + "type": "string" + }, "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.", + "format": "int64", "type": "string" }, "defaultLimit": { - "format": "int64", + "type": "string", "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" + "format": "int64" }, "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": { + "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." + }, "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.", + "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.", "type": "string" }, "values": { + "description": "Tiered limit values. You must specify this as a key:value pair, with an\ninteger value that is the maximum number of requests allowed for the\nspecified unit. Currently only STANDARD is supported.", + "type": "object", "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`." + "id": "QuotaLimit" }, "Method": { + "description": "Method represents a method of an API interface.", + "type": "object", "properties": { "responseStreaming": { - "description": "If true, the response is streamed.", - "type": "boolean" + "type": "boolean", + "description": "If true, the response is streamed." }, "name": { "description": "The simple name of this method.", @@ -936,16 +1138,16 @@ "type": "boolean" }, "syntax": { - "enumDescriptions": [ - "Syntax `proto2`.", - "Syntax `proto3`." - ], "enum": [ "SYNTAX_PROTO2", "SYNTAX_PROTO3" ], "description": "The source syntax of this method.", - "type": "string" + "type": "string", + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ] }, "responseTypeUrl": { "description": "The URL of the output message type.", @@ -953,17 +1155,16 @@ }, "options": { "description": "Any metadata attached to the method.", + "type": "array", "items": { "$ref": "Option" - }, - "type": "array" + } } }, - "id": "Method", - "description": "Method represents a method of an API interface.", - "type": "object" + "id": "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": { @@ -975,93 +1176,113 @@ "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 }" + "id": "Mixin" }, "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", - "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.", + "type": "array", "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": { + "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.", + "type": "array", + "items": { + "$ref": "HttpRule" + } + }, "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" } - } + }, + "id": "Http" }, "SourceInfo": { - "id": "SourceInfo", "description": "Source information used to create a Service Config", "type": "object", "properties": { "sourceFiles": { "description": "All files used during config generation.", + "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" } - }, - "type": "array" + } } - } + }, + "id": "SourceInfo" }, "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" } - } + }, + "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" }, "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": { + "urlQueryParameter": { + "description": "Define the URL query parameter name to use for the parameter. It is case\nsensitive.", + "type": "string" + }, + "httpHeader": { + "type": "string", + "description": "Define the HTTP header name to use for the parameter. It is case\ninsensitive." + }, "name": { "description": "Define the name of the parameter, such as \"api_key\" . It is case sensitive.", "type": "string" + } + }, + "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": { + "id": "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.", + "type": "array", + "items": { + "$ref": "MonitoringDestination" + } }, - "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" + "consumerDestinations": { + "type": "array", + "items": { + "$ref": "MonitoringDestination" + }, + "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." } } }, @@ -1069,20 +1290,26 @@ "description": "A single field of a message type.", "type": "object", "properties": { + "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": { - "format": "int32", "description": "The field number.", + "format": "int32", "type": "integer" }, "jsonName": { - "description": "The field JSON name.", - "type": "string" + "type": "string", + "description": "The field JSON name." }, "kind": { + "description": "The field type.", + "type": "string", "enumDescriptions": [ "Field type unknown.", "Field type double.", @@ -1124,27 +1351,23 @@ "TYPE_SFIXED64", "TYPE_SINT32", "TYPE_SINT64" - ], - "description": "The field type.", - "type": "string" + ] }, "options": { + "description": "The protocol buffer options.", + "type": "array", "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.", + "format": "int32", "type": "integer" }, - "packed": { - "description": "Whether to use alternative packed wire representation.", - "type": "boolean" - }, "cardinality": { + "description": "The field cardinality.", + "type": "string", "enumDescriptions": [ "For fields with unknown cardinality.", "For optional fields.", @@ -1156,84 +1379,69 @@ "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" } }, "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" }, + "enumvalue": { + "description": "Enum value definitions.", + "type": "array", + "items": { + "$ref": "EnumValue" + } + }, "options": { "description": "Protocol buffer options.", + "type": "array", "items": { "$ref": "Option" - }, - "type": "array" + } + }, + "sourceContext": { + "description": "The source context.", + "$ref": "SourceContext" }, "syntax": { + "enumDescriptions": [ + "Syntax `proto2`.", + "Syntax `proto3`." + ], "enum": [ "SYNTAX_PROTO2", "SYNTAX_PROTO3" ], "description": "The source syntax.", - "type": "string", - "enumDescriptions": [ - "Syntax `proto2`.", - "Syntax `proto3`." - ] - }, - "sourceContext": { - "description": "The source context.", - "$ref": "SourceContext" + "type": "string" } }, "id": "Enum" }, + "EnableServiceRequest": { + "description": "Request message for EnableService method.", + "type": "object", + "properties": {}, + "id": "EnableServiceRequest" + }, "LabelDescriptor": { + "description": "A description of a label.", + "type": "object", "properties": { "key": { "description": "The label key.", @@ -1244,6 +1452,7 @@ "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.", @@ -1254,45 +1463,40 @@ "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" + "id": "LabelDescriptor" }, "Type": { + "id": "Type", "description": "A protocol buffer message type.", "type": "object", "properties": { + "options": { + "description": "The protocol buffer options.", + "type": "array", + "items": { + "$ref": "Option" + } + }, "fields": { "description": "The list of fields.", + "type": "array", "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.", + "type": "array", "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.", @@ -1306,23 +1510,19 @@ "SYNTAX_PROTO3" ] }, - "options": { - "description": "The protocol buffer options.", - "items": { - "$ref": "Option" - }, - "type": "array" + "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" + "$ref": "AuthorizationConfig", + "description": "Authorization configuration." } }, "id": "Experimental" @@ -1333,29 +1533,33 @@ "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" - }, - "type": "array" + } } }, "id": "Backend" }, "AuthorizationConfig": { + "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", "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": { + "description": { + "description": "Description of the selected API(s).", + "type": "string" + }, "deprecationDescription": { "description": "Deprecation description of the selected element(s). It can be provided if an\nelement is marked as `deprecated`.", "type": "string" @@ -1363,61 +1567,68 @@ "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": { + "provided": { + "description": "A list of full type names of provided contexts.", + "type": "array", + "items": { + "type": "string" + } + }, + "requested": { + "description": "A list of full type names of requested contexts.", + "type": "array", + "items": { + "type": "string" + } + }, "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." } - } + }, + "id": "ContextRule" }, "SourceContext": { + "id": "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\"`." + "description": "The path-qualified name of the .proto file that contained the associated\nprotobuf 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,\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": { - "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.", "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" + "type": "string", + "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\"" }, "valueType": { "enumDescriptions": [ @@ -1442,8 +1653,6 @@ "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.", @@ -1455,44 +1664,49 @@ "GAUGE", "DELTA", "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" + }, + "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\".\nThis field is optional but it is recommended to be set for any metrics\nassociated with user-visible concepts, such as Quota." }, "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" }, + "Billing": { + "description": "Billing related configuration of the service.\n\nThe following example shows how to configure monitored resources and metrics\nfor billing:\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/borrowed_count\n metric_kind: DELTA\n value_type: INT64\n billing:\n consumer_destinations:\n - monitored_resource: library.googleapis.com/branch\n metrics:\n - library.googleapis.com/book/borrowed_count", + "type": "object", + "properties": { + "consumerDestinations": { + "type": "array", + "items": { + "$ref": "BillingDestination" + }, + "description": "Billing configurations for sending metrics to the consumer project.\nThere can be multiple consumer destinations per service, each one must have\na different monitored resource type. A metric can be used in at most\none consumer destination." + } + }, + "id": "Billing" + }, "ListEnabledServicesResponse": { "description": "Response message for `ListEnabledServices` method.", "type": "object", "properties": { + "services": { + "description": "Services enabled for the specified parent.", + "type": "array", + "items": { + "$ref": "PublishedService" + } + }, "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" @@ -1501,38 +1715,31 @@ "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.", + "aliases": { + "type": "array", "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 intended\naliases.\n\nAdditional names that this endpoint will be hosted on." + }, + "features": { + "description": "The list of features enabled on this endpoint.", + "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": { - "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." + "description": "The canonical name of this endpoint.", + "type": "string" }, "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." + "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" } }, "id": "Endpoint" @@ -1542,8 +1749,8 @@ "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" + "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" @@ -1558,34 +1765,34 @@ }, "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" - }, - "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'.", + "type": "array", "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.", + "type": "array", "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`." + "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" }, "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", @@ -1593,27 +1800,58 @@ "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" - }, - "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" + }, + "displayName": { + "description": "The human-readable name for this log. This information appears on\nthe user interface and should be concise.", + "type": "string" } }, "id": "LogDescriptor" }, + "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": { + "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\"`." + }, + "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" + }, "CustomErrorRule": { + "id": "CustomErrorRule", "description": "A custom error rule.", "type": "object", "properties": { @@ -1625,45 +1863,23 @@ "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.", + "CustomAuthRequirements": { "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.", + "provider": { + "description": "A configuration string containing connection information for the\nauthentication provider, typically formatted as a SmartService string\n(go/smartservice).", "type": "string" } }, - "id": "MonitoredResourceDescriptor" + "id": "CustomAuthRequirements", + "description": "Configuration for a custom authentication provider." }, "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": { - "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" @@ -1676,89 +1892,65 @@ "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.", + }, + "maxDirectDownloadSize": { + "description": "Optional maximum acceptable size for direct download.\nThe size is specified in bytes.", + "format": "int64", "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" + "useDirectDownload": { + "description": "A boolean that determines if direct download from ESF should be used for\ndownload of this media.", + "type": "boolean" } }, - "id": "AuthorizationRule" + "id": "MediaDownload" + }, + "DisableServiceRequest": { + "properties": {}, + "id": "DisableServiceRequest", + "description": "Request message for DisableService method.", + "type": "object" }, "SearchServicesResponse": { + "description": "Response message for SearchServices method.", "type": "object", "properties": { + "services": { + "description": "Services available publicly or available to the authenticated caller.", + "type": "array", + "items": { + "$ref": "PublishedService" + } + }, "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." + "id": "SearchServicesResponse" }, "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.", + "enabled": { + "description": "Whether upload is enabled.", "type": "boolean" }, + "completeNotification": { + "type": "boolean", + "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." + }, "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" + "type": "string", + "description": "Name of the Scotty dropzone to use for the current API." }, "startNotification": { "description": "Whether to receive a notification on the start of media upload.", @@ -1770,230 +1962,37 @@ }, "mimeTypes": { "description": "An array of mimetype patterns. Esf will only accept uploads that match one\nof the given patterns.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "maxSize": { - "format": "int64", "description": "Optional maximum acceptable size for an upload.\nThe size is specified in bytes.", + "format": "int64", "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" }, + "protocol": "rest", "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" + }, + "https://www.googleapis.com/auth/service.management": { + "description": "Manage your Google API service configuration" } } } diff --git a/etc/api/shared.yaml b/etc/api/shared.yaml index 18d1d39f6f..90d15978d5 100644 --- a/etc/api/shared.yaml +++ b/etc/api/shared.yaml @@ -19,6 +19,8 @@ api: - servicecontrol - servicemanagement # defines its own `Option` type + - serviceconsumermanagement + # defines its own `Option` type - serviceuser - language - speech @@ -42,6 +44,8 @@ api: - oauth2 # Recursive type - we don't handle cycles yet it appears - slides + # invalid code generation - syntax error + - poly terms: # how to actually do something with the API action: doit diff --git a/etc/api/sheets/v4/sheets-api.json b/etc/api/sheets/v4/sheets-api.json index 270caf289e..c4eeddb2d0 100644 --- a/etc/api/sheets/v4/sheets-api.json +++ b/etc/api/sheets/v4/sheets-api.json @@ -1,44 +1,63 @@ { + "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/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/spreadsheets": { + "description": "View and manage your spreadsheets in Google Drive" + } + } + } + }, + "rootUrl": "https://sheets.googleapis.com/", + "ownerDomain": "google.com", + "name": "sheets", + "batchPath": "batch", + "title": "Google Sheets API", + "ownerName": "Google", "resources": { "spreadsheets": { "methods": { - "getByDataFilter": { + "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.", + "response": { + "$ref": "Spreadsheet" + }, + "parameterOrder": [ + "spreadsheetId" + ], + "httpMethod": "GET", "parameters": { - "spreadsheetId": { - "description": "The spreadsheet to request.", + "ranges": { + "description": "The ranges to retrieve from the spreadsheet.", "type": "string", + "repeated": true, + "location": "query" + }, + "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, - "location": "path" + "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}: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", @@ -46,64 +65,44 @@ "https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/spreadsheets.readonly" ], + "flatPath": "v4/spreadsheets/{spreadsheetId}", + "path": "v4/spreadsheets/{spreadsheetId}", + "id": "sheets.spreadsheets.get" + }, + "getByDataFilter": { + "flatPath": "v4/spreadsheets/{spreadsheetId}:getByDataFilter", + "path": "v4/spreadsheets/{spreadsheetId}:getByDataFilter", + "id": "sheets.spreadsheets.getByDataFilter", + "request": { + "$ref": "GetSpreadsheetByDataFilterRequest" + }, + "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.", + "response": { + "$ref": "Spreadsheet" + }, + "parameterOrder": [ + "spreadsheetId" + ], + "httpMethod": "POST", "parameters": { "spreadsheetId": { "location": "path", "description": "The spreadsheet to request.", - "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" + "required": true, + "type": "string" } }, - "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": { - "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.", - "httpMethod": "POST", - "parameterOrder": [ - "spreadsheetId" - ], - "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" }, + "description": "Creates a spreadsheet, returning the newly created spreadsheet.", "response": { "$ref": "Spreadsheet" }, @@ -116,143 +115,112 @@ "https://www.googleapis.com/auth/spreadsheets" ], "flatPath": "v4/spreadsheets", - "id": "sheets.spreadsheets.create", - "path": "v4/spreadsheets" + "path": "v4/spreadsheets", + "id": "sheets.spreadsheets.create" + }, + "batchUpdate": { + "response": { + "$ref": "BatchUpdateSpreadsheetResponse" + }, + "parameterOrder": [ + "spreadsheetId" + ], + "httpMethod": "POST", + "parameters": { + "spreadsheetId": { + "location": "path", + "description": "The spreadsheet to apply the updates to.", + "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}: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." } }, "resources": { - "developerMetadata": { + "values": { "methods": { - "search": { + "clear": { + "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.", "response": { - "$ref": "SearchDeveloperMetadataResponse" + "$ref": "ClearValuesResponse" }, "parameterOrder": [ - "spreadsheetId" + "spreadsheetId", + "range" ], "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", + "range": { + "location": "path", + "description": "The A1 notation of the values to clear.", "required": true, + "type": "string" + }, + "spreadsheetId": { + "description": "The ID of the spreadsheet to update.", + "required": true, + "type": "string", "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": { - "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" }, + "parameterOrder": [ + "spreadsheetId" + ], + "httpMethod": "GET", "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" - ] + ], + "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": { + "location": "query", + "description": "The A1 notation of the values to retrieve.", + "type": "string", + "repeated": true }, "majorDimension": { "location": "query", @@ -264,11 +232,11 @@ "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" + "spreadsheetId": { + "location": "path", + "description": "The ID of the spreadsheet to retrieve data from.", + "required": true, + "type": "string" } }, "scopes": [ @@ -282,49 +250,50 @@ "path": "v4/spreadsheets/{spreadsheetId}/values:batchGet", "id": "sheets.spreadsheets.values.batchGet" }, - "clear": { + "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.", + "httpMethod": "POST", + "parameterOrder": [ + "spreadsheetId" + ], + "response": { + "$ref": "BatchClearValuesByDataFilterResponse" + }, + "parameters": { + "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" ], - "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", + "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter", + "id": "sheets.spreadsheets.values.batchClearByDataFilter", + "path": "v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter" + }, + "append": { + "flatPath": "v4/spreadsheets/{spreadsheetId}/values/{range}: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": "ClearValuesRequest" + "$ref": "ValueRange" }, - "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" + "$ref": "AppendValuesResponse" }, "parameterOrder": [ "spreadsheetId", "range" ], - "httpMethod": "POST" - }, - "batchClearByDataFilter": { - "response": { - "$ref": "BatchClearValuesByDataFilterResponse" - }, - "parameterOrder": [ - "spreadsheetId" - ], "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/drive", @@ -332,49 +301,6 @@ "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: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, - "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": { "location": "query", "enum": [ @@ -386,107 +312,115 @@ "type": "string" }, "insertDataOption": { + "description": "How the input data should be inserted.", + "type": "string", "location": "query", "enum": [ "OVERWRITE", "INSERT_ROWS" - ], - "description": "How the input data should be inserted.", - "type": "string" + ] }, "valueInputOption": { + "description": "How the input data should be interpreted.", + "type": "string", "location": "query", "enum": [ "INPUT_VALUE_OPTION_UNSPECIFIED", "RAW", "USER_ENTERED" - ], - "description": "How the input data should be interpreted.", + ] + }, + "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.", + "required": true, + "type": "string", + "location": "path" + }, + "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" + }, + "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}: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" - }, - "httpMethod": "POST", - "parameterOrder": [ - "spreadsheetId", - "range" - ], - "response": { - "$ref": "AppendValuesResponse" } }, "batchGetByDataFilter": { + "flatPath": "v4/spreadsheets/{spreadsheetId}/values: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", + "description": "Returns one or more ranges of values that match the specified data filters.\nThe caller must specify the spreadsheet ID and one or more\nDataFilters. Ranges that match any of the data filters in\nthe request will be returned.", + "response": { + "$ref": "BatchGetValuesByDataFilterResponse" + }, "parameterOrder": [ "spreadsheetId" ], - "response": { - "$ref": "BatchGetValuesByDataFilterResponse" + "httpMethod": "POST", + "parameters": { + "spreadsheetId": { + "description": "The ID of the spreadsheet to retrieve data from.", + "required": true, + "type": "string", + "location": "path" + } }, "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 retrieve data from.", - "type": "string", - "required": true - } - }, - "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter" + ] }, "batchClear": { + "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchClear", "path": "v4/spreadsheets/{spreadsheetId}/values:batchClear", "id": "sheets.spreadsheets.values.batchClear", "request": { "$ref": "BatchClearValuesRequest" }, "description": "Clears one or more ranges of values from a spreadsheet.\nThe caller must specify the spreadsheet ID and one or more ranges.\nOnly values are cleared -- all other properties of the cell (such as\nformatting, data validation, etc..) are kept.", - "httpMethod": "POST", + "response": { + "$ref": "BatchClearValuesResponse" + }, "parameterOrder": [ "spreadsheetId" ], - "response": { - "$ref": "BatchClearValuesResponse" + "httpMethod": "POST", + "parameters": { + "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" - ], - "parameters": { - "spreadsheetId": { - "location": "path", - "description": "The ID of the spreadsheet to update.", - "type": "string", - "required": true - } - }, - "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchClear" + ] }, "get": { + "flatPath": "v4/spreadsheets/{spreadsheetId}/values/{range}", + "path": "v4/spreadsheets/{spreadsheetId}/values/{range}", + "id": "sheets.spreadsheets.values.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" }, @@ -494,25 +428,39 @@ "spreadsheetId", "range" ], - "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" - ], + "httpMethod": "GET", "parameters": { - "spreadsheetId": { - "location": "path", - "description": "The ID of the spreadsheet to retrieve data from.", + "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 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", - "required": true + "location": "query", + "enum": [ + "DIMENSION_UNSPECIFIED", + "ROWS", + "COLUMNS" + ] + }, + "spreadsheetId": { + "description": "The ID of the spreadsheet to retrieve data from.", + "required": true, + "type": "string", + "location": "path" }, "range": { "location": "path", "description": "The A1 notation of the values to retrieve.", + "required": true, + "type": "string" + }, + "valueRenderOption": { + "description": "How values should be represented in the output.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", "type": "string", - "required": true + "location": "query", + "enum": [ + "FORMATTED_VALUE", + "UNFORMATTED_VALUE", + "FORMULA" + ] }, "dateTimeRenderOption": { "location": "query", @@ -522,69 +470,35 @@ ], "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": { - "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" - }, - "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" } }, - "flatPath": "v4/spreadsheets/{spreadsheetId}/values/{range}", - "path": "v4/spreadsheets/{spreadsheetId}/values/{range}", - "id": "sheets.spreadsheets.values.get" - }, - "update": { - "path": "v4/spreadsheets/{spreadsheetId}/values/{range}", - "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", - "range" - ], - "response": { - "$ref": "UpdateValuesResponse" - }, "scopes": [ "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", - "https://www.googleapis.com/auth/spreadsheets" + "https://www.googleapis.com/auth/drive.readonly", + "https://www.googleapis.com/auth/spreadsheets", + "https://www.googleapis.com/auth/spreadsheets.readonly" + ] + }, + "update": { + "request": { + "$ref": "ValueRange" + }, + "description": "Sets values in a range of a spreadsheet.\nThe caller must specify the spreadsheet ID, range, and\na valueInputOption.", + "response": { + "$ref": "UpdateValuesResponse" + }, + "parameterOrder": [ + "spreadsheetId", + "range" ], + "httpMethod": "PUT", "parameters": { - "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.", + "required": true, "type": "string", - "required": true + "location": "path" }, "responseValueRenderOption": { "location": "query", @@ -597,14 +511,14 @@ "type": "string" }, "valueInputOption": { + "description": "How the input data should be interpreted.", + "type": "string", "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].", @@ -614,11 +528,36 @@ "SERIAL_NUMBER", "FORMATTED_STRING" ] + }, + "range": { + "location": "path", + "description": "The A1 notation of the values to update.", + "required": true, + "type": "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" } }, - "flatPath": "v4/spreadsheets/{spreadsheetId}/values/{range}" + "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}", + "path": "v4/spreadsheets/{spreadsheetId}/values/{range}", + "id": "sheets.spreadsheets.values.update" }, "batchUpdateByDataFilter": { + "response": { + "$ref": "BatchUpdateValuesByDataFilterResponse" + }, + "parameterOrder": [ + "spreadsheetId" + ], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", @@ -626,36 +565,58 @@ ], "parameters": { "spreadsheetId": { - "location": "path", "description": "The ID of the spreadsheet to update.", + "required": true, "type": "string", - "required": true + "location": "path" } }, "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter", "path": "v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter", "id": "sheets.spreadsheets.values.batchUpdateByDataFilter", + "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.", "request": { "$ref": "BatchUpdateValuesByDataFilterRequest" + } + }, + "batchUpdate": { + "flatPath": "v4/spreadsheets/{spreadsheetId}/values:batchUpdate", + "path": "v4/spreadsheets/{spreadsheetId}/values:batchUpdate", + "id": "sheets.spreadsheets.values.batchUpdate", + "request": { + "$ref": "BatchUpdateValuesRequest" + }, + "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.", + "response": { + "$ref": "BatchUpdateValuesResponse" }, - "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" ], - "response": { - "$ref": "BatchUpdateValuesByDataFilterResponse" - } + "httpMethod": "POST", + "parameters": { + "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" + ] } } }, "sheets": { "methods": { "copyTo": { + "description": "Copies a single sheet from a spreadsheet to another spreadsheet.\nReturns the properties of the newly created sheet.", "request": { "$ref": "CopySheetToAnotherSpreadsheetRequest" }, - "description": "Copies a single sheet from a spreadsheet to another spreadsheet.\nReturns the properties of the newly created sheet.", "response": { "$ref": "SheetProperties" }, @@ -671,22 +632,89 @@ ], "parameters": { "sheetId": { - "location": "path", - "format": "int32", "description": "The ID of the sheet to copy.", + "format": "int32", + "required": true, "type": "integer", - "required": true + "location": "path" }, "spreadsheetId": { "location": "path", "description": "The ID of the spreadsheet containing the sheet to copy.", - "type": "string", - "required": true + "required": true, + "type": "string" } }, "flatPath": "v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo", - "id": "sheets.spreadsheets.sheets.copyTo", - "path": "v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo" + "path": "v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo", + "id": "sheets.spreadsheets.sheets.copyTo" + } + } + }, + "developerMetadata": { + "methods": { + "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.", + "httpMethod": "POST", + "parameterOrder": [ + "spreadsheetId" + ], + "response": { + "$ref": "SearchDeveloperMetadataResponse" + }, + "parameters": { + "spreadsheetId": { + "description": "The ID of the spreadsheet to retrieve metadata from.", + "required": true, + "type": "string", + "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}/developerMetadata:search", + "id": "sheets.spreadsheets.developerMetadata.search", + "path": "v4/spreadsheets/{spreadsheetId}/developerMetadata:search" + }, + "get": { + "description": "Returns the developer metadata with the specified ID.\nThe caller must specify the spreadsheet ID and the developer metadata's\nunique metadataId.", + "response": { + "$ref": "DeveloperMetadata" + }, + "parameterOrder": [ + "spreadsheetId", + "metadataId" + ], + "httpMethod": "GET", + "parameters": { + "metadataId": { + "description": "The ID of the developer metadata to retrieve.", + "format": "int32", + "required": true, + "type": "integer", + "location": "path" + }, + "spreadsheetId": { + "location": "path", + "description": "The ID of the spreadsheet to retrieve metadata from.", + "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}/developerMetadata/{metadataId}", + "path": "v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}", + "id": "sheets.spreadsheets.developerMetadata.get" } } } @@ -694,23 +722,61 @@ } }, "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": { + "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": { + "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" + "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" }, - "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" @@ -719,9 +785,7 @@ "enum": [ "1", "2" - ], - "description": "V1 error format.", - "type": "string" + ] }, "callback": { "description": "JSONP", @@ -729,11 +793,6 @@ "location": "query" }, "alt": { - "enum": [ - "json", - "media", - "proto" - ], "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", @@ -742,70 +801,1836 @@ ], "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" - }, - "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": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", - "type": "string", - "location": "query" + "default": "json", + "enum": [ + "json", + "media", + "proto" + ] } }, "version": "v4", "baseUrl": "https://sheets.googleapis.com/", - "kind": "discovery#restDescription", "description": "Reads and writes Google Sheets.", + "kind": "discovery#restDescription", "servicePath": "", "basePath": "", - "revision": "20170922", + "revision": "20171208", "documentationLink": "https://developers.google.com/sheets/", "id": "sheets:v4", "discoveryVersion": "v1", "version_module": true, "schemas": { + "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.)", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "BatchClearValuesByDataFilterResponse" + }, + "CandlestickData": { + "description": "The Candlestick chart data, each containing the low, open, close, and high\nvalues for a series.", + "type": "object", + "properties": { + "lowSeries": { + "$ref": "CandlestickSeries", + "description": "The range data (vertical axis) for the low/minimum value for each candle.\nThis is the bottom of the candle's center line." + }, + "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." + }, + "openSeries": { + "$ref": "CandlestickSeries", + "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." + }, + "highSeries": { + "$ref": "CandlestickSeries", + "description": "The range data (vertical axis) for the high/maximum value for each\ncandle. This is the top of the candle's center line." + } + }, + "id": "CandlestickData" + }, + "EmbeddedObjectPosition": { + "description": "The position of an embedded object such as a chart.", + "type": "object", + "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.", + "format": "int32", + "type": "integer" + }, + "overlayPosition": { + "$ref": "OverlayPosition", + "description": "The position at which the object is overlaid on top of a grid." + } + }, + "id": "EmbeddedObjectPosition" + }, + "DeleteProtectedRangeRequest": { + "description": "Deletes the protected range with the given ID.", + "type": "object", + "properties": { + "protectedRangeId": { + "description": "The ID of the protected range to delete.", + "format": "int32", + "type": "integer" + } + }, + "id": "DeleteProtectedRangeRequest" + }, + "DeveloperMetadataLookup": { + "description": "Selects DeveloperMetadata that matches all of the specified fields. For\nexample, if only a metadata ID is specified this considers the\nDeveloperMetadata with that particular unique ID. If a metadata key is\nspecified, this considers all developer metadata with that key. If a\nkey, visibility, and location type are all specified, this considers all\ndeveloper metadata with that key and visibility that are associated with a\nlocation of that type. 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": { + "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 is matched. If this field is specified to INTERSECTING,\ndeveloper metadata associated on intersecting locations is also\nmatched. If left unspecified, this field assumes a default value of\nINTERSECTING.\nIf this field is specified, a metadataLocation\nmust also be specified.", + "type": "string" + }, + "metadataLocation": { + "$ref": "DeveloperMetadataLocation", + "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." + }, + "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, when this\nfield is specified as ROW this lookup\nonly considers developer metadata associated on rows. If the field is left\nunspecified, all location types are considered. This field cannot be\nspecified as SPREADSHEET when\nthe locationMatchingStrategy\nis specified 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\nthe locationMatchingStrategy\nis specified 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 is 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": { + "description": "Limits the selected developer metadata to that which has a matching\nDeveloperMetadata.metadata_id.", + "format": "int32", + "type": "integer" + }, + "metadataValue": { + "description": "Limits the selected developer metadata to that which has a matching\nDeveloperMetadata.metadata_value.", + "type": "string" + } + }, + "id": "DeveloperMetadataLookup" + }, + "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": { + "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": { + "midpoint": { + "$ref": "InterpolationPoint", + "description": "An optional midway interpolation point." + }, + "minpoint": { + "description": "The starting interpolation point.", + "$ref": "InterpolationPoint" + }, + "maxpoint": { + "$ref": "InterpolationPoint", + "description": "The final interpolation point." + } + }, + "id": "GradientRule" + }, + "SetBasicFilterRequest": { + "description": "Sets the basic filter associated with a sheet.", + "type": "object", + "properties": { + "filter": { + "description": "The filter to set.", + "$ref": "BasicFilter" + } + }, + "id": "SetBasicFilterRequest" + }, + "ClearValuesRequest": { + "description": "The request for clearing a range of values in a spreadsheet.", + "type": "object", + "properties": {}, + "id": "ClearValuesRequest" + }, + "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.", + "type": "array", + "items": { + "$ref": "DataFilter" + } + } + }, + "id": "BatchClearValuesByDataFilterRequest" + }, + "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": { + "description": "How the value should be interpreted.", + "type": "string", + "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" + ] + }, + "value": { + "description": "The value this interpolation point uses. May be a formula.\nUnused if type is MIN or\nMAX.", + "type": "string" + } + }, + "id": "InterpolationPoint" + }, + "GetSpreadsheetByDataFilterRequest": { + "description": "The request for retrieving a Spreadsheet.", + "type": "object", + "properties": { + "dataFilters": { + "description": "The DataFilters used to select which ranges to retrieve from\nthe spreadsheet.", + "type": "array", + "items": { + "$ref": "DataFilter" + } + }, + "includeGridData": { + "description": "True if grid data should be returned.\nThis parameter is ignored if a field mask was set in the request.", + "type": "boolean" + } + }, + "id": "GetSpreadsheetByDataFilterRequest" + }, + "FindReplaceResponse": { + "description": "The result of the find/replace.", + "type": "object", + "properties": { + "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" + }, + "rowsChanged": { + "description": "The number of rows changed.", + "format": "int32", + "type": "integer" + }, + "sheetsChanged": { + "description": "The number of sheets changed.", + "format": "int32", + "type": "integer" + }, + "formulasChanged": { + "description": "The number of formula cells changed.", + "format": "int32", + "type": "integer" + }, + "valuesChanged": { + "description": "The number of non-formula cells changed.", + "format": "int32", + "type": "integer" + } + }, + "id": "FindReplaceResponse" + }, + "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" + }, + "UpdateValuesByDataFilterResponse": { + "description": "The response when updating a range of values by a data filter in a\nspreadsheet.", + "type": "object", + "properties": { + "updatedColumns": { + "description": "The number of columns where at least one cell in the column was updated.", + "format": "int32", + "type": "integer" + }, + "updatedRange": { + "description": "The range (in A1 notation) that updates were applied to.", + "type": "string" + }, + "updatedCells": { + "description": "The number of cells updated.", + "format": "int32", + "type": "integer" + }, + "dataFilter": { + "description": "The data filter that selected the range that was updated.", + "$ref": "DataFilter" + }, + "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 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`." + } + }, + "id": "UpdateValuesByDataFilterResponse" + }, + "DuplicateFilterViewRequest": { + "description": "Duplicates a particular filter view.", + "type": "object", + "properties": { + "filterId": { + "description": "The ID of the filter being duplicated.", + "format": "int32", + "type": "integer" + } + }, + "id": "DuplicateFilterViewRequest" + }, + "DeleteSheetRequest": { + "description": "Deletes the requested sheet.", + "type": "object", + "properties": { + "sheetId": { + "description": "The ID of the sheet to delete.", + "format": "int32", + "type": "integer" + } + }, + "id": "DeleteSheetRequest" + }, + "DeveloperMetadataLocation": { + "description": "A location where metadata may be associated in a spreadsheet.", + "type": "object", + "properties": { + "locationType": { + "description": "The type of location this object represents. This field is read-only.", + "type": "string", + "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" + ] + }, + "dimensionRange": { + "$ref": "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." + }, + "spreadsheet": { + "description": "True when metadata is associated with an entire spreadsheet.", + "type": "boolean" + }, + "sheetId": { + "description": "The ID of the sheet when metadata is associated with an entire sheet.", + "format": "int32", + "type": "integer" + } + }, + "id": "DeveloperMetadataLocation" + }, + "MatchedValueRange": { + "description": "A value range that was matched by one or more data filers.", + "type": "object", + "properties": { + "valueRange": { + "$ref": "ValueRange", + "description": "The values matched by the DataFilter." + }, + "dataFilters": { + "description": "The DataFilters from the request that matched the range of\nvalues.", + "type": "array", + "items": { + "$ref": "DataFilter" + } + } + }, + "id": "MatchedValueRange" + }, + "UpdateConditionalFormatRuleResponse": { + "description": "The result of updating a conditional format rule.", + "type": "object", + "properties": { + "oldRule": { + "$ref": "ConditionalFormatRule", + "description": "The old (deleted) rule. Not set if a rule was moved\n(because it is the same as new_rule)." + }, + "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" + } + }, + "id": "UpdateConditionalFormatRuleResponse" + }, + "DuplicateSheetRequest": { + "description": "Duplicates the contents of a sheet.", + "type": "object", + "properties": { + "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": { + "description": "The name of the new sheet. If empty, a new name is chosen for you.", + "type": "string" + }, + "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" + } + }, + "id": "DuplicateSheetRequest" + }, + "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": { + "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" + }, + "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." + } + }, + "id": "ExtendedValue" + }, + "BandedRange": { + "description": "A banded (alternating colors) range in a sheet.", + "type": "object", + "properties": { + "rowProperties": { + "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.", + "$ref": "BandingProperties" + }, + "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" + }, + "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": { + "$ref": "ChartData", + "description": "The data for this histogram series." + } + }, + "id": "HistogramSeries" + }, + "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" + }, + "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.)" + } + }, + "id": "AddChartRequest" + }, + "Spreadsheet": { + "description": "Resource that represents a spreadsheet.", + "type": "object", + "properties": { + "sheets": { + "description": "The sheets that are part of a spreadsheet.", + "type": "array", + "items": { + "$ref": "Sheet" + } + }, + "spreadsheetUrl": { + "description": "The url of the spreadsheet.\nThis field is read-only.", + "type": "string" + }, + "properties": { + "description": "Overall properties of a spreadsheet.", + "$ref": "SpreadsheetProperties" + }, + "spreadsheetId": { + "description": "The ID of the spreadsheet.\nThis field is read-only.", + "type": "string" + }, + "namedRanges": { + "description": "The named ranges defined in a spreadsheet.", + "type": "array", + "items": { + "$ref": "NamedRange" + } + }, + "developerMetadata": { + "description": "The developer metadata associated with a spreadsheet.", + "type": "array", + "items": { + "$ref": "DeveloperMetadata" + } + } + }, + "id": "Spreadsheet" + }, + "UpdateProtectedRangeRequest": { + "description": "Updates an existing protected range with the specified\nprotectedRangeId.", + "type": "object", + "properties": { + "protectedRange": { + "description": "The protected range to update with the new properties.", + "$ref": "ProtectedRange" + }, + "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" + }, + "DataFilter": { + "description": "Filter that describes what data should be selected or returned from a\nrequest.", + "type": "object", + "properties": { + "gridRange": { + "$ref": "GridRange", + "description": "Selects data that matches the range described by the GridRange." + }, + "developerMetadataLookup": { + "description": "Selects data associated with the developer metadata matching the criteria\ndescribed by this DeveloperMetadataLookup.", + "$ref": "DeveloperMetadataLookup" + }, + "a1Range": { + "description": "Selects data that matches the specified A1 range.", + "type": "string" + } + }, + "id": "DataFilter" + }, + "TextFormat": { + "description": "The format of a run of text in a cell.\nAbsent values indicate that the field isn't specified.", + "type": "object", + "properties": { + "bold": { + "description": "True if the text is bold.", + "type": "boolean" + }, + "foregroundColor": { + "$ref": "Color", + "description": "The foreground color of the text." + }, + "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": { + "description": "The size of the font.", + "format": "int32", + "type": "integer" + }, + "underline": { + "description": "True if the text is underlined.", + "type": "boolean" + } + }, + "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": { + "description": "The result of adding a filter view.", + "type": "object", + "properties": { + "filter": { + "description": "The newly added filter view.", + "$ref": "FilterView" + } + }, + "id": "AddFilterViewResponse" + }, + "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" + }, + "OverlayPosition": { + "description": "The location an object is overlaid on top of a grid.", + "type": "object", + "properties": { + "anchorCell": { + "description": "The cell the object is anchored to.", + "$ref": "GridCoordinate" + }, + "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": { + "description": "The horizontal offset, in pixels, that the object is offset\nfrom the anchor cell.", + "format": "int32", + "type": "integer" + } + }, + "id": "OverlayPosition" + }, + "SpreadsheetProperties": { + "description": "Properties of a spreadsheet.", + "type": "object", + "properties": { + "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" + }, + "autoRecalc": { + "description": "The amount of time to wait before volatile functions are recalculated.", + "type": "string", + "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" + ] + }, + "defaultFormat": { + "$ref": "CellFormat", + "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." + }, + "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" + } + }, + "id": "SpreadsheetProperties" + }, + "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": { + "description": "The data to write.", + "$ref": "CellData" + }, + "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" + } + }, + "id": "RepeatCellRequest" + }, + "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": { + "description": "Inserts rows or columns in a sheet at a particular index.", + "type": "object", + "properties": { + "range": { + "$ref": "DimensionRange", + "description": "The dimensions to insert. Both the start and end indexes must be bounded." + }, + "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" + } + }, + "id": "InsertDimensionRequest" + }, + "UpdateSpreadsheetPropertiesRequest": { + "description": "Updates properties of a spreadsheet.", + "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", + "type": "string" + }, + "properties": { + "$ref": "SpreadsheetProperties", + "description": "The properties to update." + } + }, + "id": "UpdateSpreadsheetPropertiesRequest" + }, + "ProtectedRange": { + "description": "A protected range.", + "type": "object", + "properties": { + "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": { + "$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": { + "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.", + "$ref": "Editors" + }, + "description": { + "description": "The description of this protected range.", + "type": "string" + }, + "unprotectedRanges": { + "description": "The list of unprotected ranges within a protected sheet.\nUnprotected ranges are only supported on protected sheets.", + "type": "array", + "items": { + "$ref": "GridRange" + } + } + }, + "id": "ProtectedRange" + }, + "BatchUpdateValuesRequest": { + "description": "The request for updating more than one range of values in a spreadsheet.", + "type": "object", + "properties": { + "responseValueRenderOption": { + "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" + ], + "description": "Determines how values in the response should be rendered.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", + "type": "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. 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\nDateTimeRenderOption.SERIAL_NUMBER.", + "type": "string" + } + }, + "id": "BatchUpdateValuesRequest" + }, + "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" + }, + "developerMetadata": { + "description": "The developer metadata associated with a single row or column.", + "type": "array", + "items": { + "$ref": "DeveloperMetadata" + } + } + }, + "id": "DimensionProperties" + }, + "NamedRange": { + "description": "A named range.", + "type": "object", + "properties": { + "namedRangeId": { + "description": "The ID of the named range.", + "type": "string" + }, + "range": { + "$ref": "GridRange", + "description": "The range this represents." + }, + "name": { + "description": "The name of the named range.", + "type": "string" + } + }, + "id": "NamedRange" + }, + "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": { + "description": "The start (inclusive) of the span, or not set if unbounded.", + "format": "int32", + "type": "integer" + }, + "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": { + "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" + ] + } + }, + "id": "DimensionRange" + }, + "CutPasteRequest": { + "description": "Moves data from the source to the destination.", + "type": "object", + "properties": { + "source": { + "$ref": "GridRange", + "description": "The source data to cut." + }, + "pasteType": { + "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." + ], + "enum": [ + "PASTE_NORMAL", + "PASTE_VALUES", + "PASTE_FORMAT", + "PASTE_NO_BORDERS", + "PASTE_FORMULA", + "PASTE_DATA_VALIDATION", + "PASTE_CONDITIONAL_FORMATTING" + ] + }, + "destination": { + "$ref": "GridCoordinate", + "description": "The top-left coordinate where the data should be pasted." + } + }, + "id": "CutPasteRequest" + }, + "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": { + "series": { + "description": "The data being visualized in this chart series.", + "$ref": "ChartData" + }, + "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.", + "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 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" + }, + "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" + } + }, + "id": "BasicChartSeries" + }, + "Borders": { + "description": "The borders of the cell.", + "type": "object", + "properties": { + "top": { + "$ref": "Border", + "description": "The top border of the cell." + }, + "left": { + "$ref": "Border", + "description": "The left border of the cell." + }, + "right": { + "$ref": "Border", + "description": "The right border of the cell." + }, + "bottom": { + "$ref": "Border", + "description": "The bottom border of the cell." + } + }, + "id": "Borders" + }, + "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." + } + }, + "id": "AutoResizeDimensionsRequest" + }, + "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": { + "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" + }, + "right": { + "description": "The border to put at the right of the range.", + "$ref": "Border" + }, + "range": { + "description": "The range whose borders should be updated.", + "$ref": "GridRange" + }, + "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" + } + }, + "id": "UpdateBordersRequest" + }, + "CellFormat": { + "description": "The format of a cell.", + "type": "object", + "properties": { + "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" + }, + "textRotation": { + "$ref": "TextRotation", + "description": "The rotation applied to text in a cell" + }, + "numberFormat": { + "description": "A format describing how number values should be represented to the user.", + "$ref": "NumberFormat" + }, + "hyperlinkDisplayType": { + "description": "How a hyperlink, if it exists, should be displayed in the cell.", + "type": "string", + "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" + ] + }, + "horizontalAlignment": { + "description": "The horizontal alignment of the value in the cell.", + "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" + ] + }, + "textFormat": { + "$ref": "TextFormat", + "description": "The format of the text in the cell (unless overridden by a format run)." + }, + "backgroundColor": { + "description": "The background color of the cell.", + "$ref": "Color" + }, + "padding": { + "$ref": "Padding", + "description": "The padding of the cell." + }, + "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": { + "description": "The borders of the cell.", + "$ref": "Borders" + }, + "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" + }, + "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": { + "index": { + "description": "The zero-based index of the rule to be deleted.", + "format": "int32", + "type": "integer" + }, + "sheetId": { + "description": "The sheet the rule is being deleted from.", + "format": "int32", + "type": "integer" + } + }, + "id": "DeleteConditionalFormatRuleRequest" + }, + "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" + }, + "AddBandingResponse": { + "description": "The result of adding a banded range.", + "type": "object", + "properties": { + "bandedRange": { + "$ref": "BandedRange", + "description": "The banded range that was added." + } + }, + "id": "AddBandingResponse" + }, + "ChartData": { + "description": "The data included in a domain or series.", + "type": "object", + "properties": { + "sourceRange": { + "description": "The source ranges of the data.", + "$ref": "ChartSourceRange" + } + }, + "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": { + "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": { + "description": "The banded range to update with the new properties.", + "$ref": "BandedRange" + } + }, + "id": "UpdateBandingRequest" + }, + "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": { + "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" + }, + "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": { + "valueBucket": { + "$ref": "PivotGroupSortValueBucket", + "description": "The bucket of the opposite pivot group to sort by.\nIf not specified, sorting is alphabetical by this group's values." + }, + "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" + } + }, + "sortOrder": { + "enumDescriptions": [ + "Default value, do not use this.", + "Sort ascending.", + "Sort descending." + ], + "enum": [ + "SORT_ORDER_UNSPECIFIED", + "ASCENDING", + "DESCENDING" + ], + "description": "The order the values in this group should be sorted.", + "type": "string" + } + }, + "id": "PivotGroup" + }, + "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.", + "type": "array", + "items": { + "$ref": "PivotGroup" + } + }, + "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" + ] + }, + "source": { + "description": "The range the pivot table is reading data from.", + "$ref": "GridRange" + }, + "columns": { + "description": "Each column grouping in the pivot table.", + "type": "array", + "items": { + "$ref": "PivotGroup" + } + }, + "values": { + "description": "A list of values to include in the pivot table.", + "type": "array", + "items": { + "$ref": "PivotValue" + } + } + }, + "id": "PivotTable" + }, + "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", + "type": "array", + "items": { + "$ref": "GridRange" + } + } + }, + "id": "ChartSourceRange" + }, + "SearchDeveloperMetadataResponse": { + "description": "A reply to a developer metadata search request.", + "type": "object", + "properties": { + "matchedDeveloperMetadata": { + "description": "The metadata matching the criteria of the search request.", + "type": "array", + "items": { + "$ref": "MatchedDeveloperMetadata" + } + } + }, + "id": "SearchDeveloperMetadataResponse" + }, + "ValueRange": { + "description": "Data within a range of the spreadsheet.", + "type": "object", + "properties": { + "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" + }, + "majorDimension": { + "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", + "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" + ] + }, + "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" + } + } + } + }, + "id": "ValueRange" + }, + "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" + }, + "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" + } + }, + "id": "AddBandingRequest" + }, + "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" + }, + "createDeveloperMetadata": { + "description": "A reply from creating a developer metadata entry.", + "$ref": "CreateDeveloperMetadataResponse" + }, + "addNamedRange": { + "description": "A reply from adding a named range.", + "$ref": "AddNamedRangeResponse" + }, + "deleteDeveloperMetadata": { + "$ref": "DeleteDeveloperMetadataResponse", + "description": "A reply from deleting a developer metadata entry." + }, + "addFilterView": { + "description": "A reply from adding a filter view.", + "$ref": "AddFilterViewResponse" + }, + "addBanding": { + "description": "A reply from adding a banded range.", + "$ref": "AddBandingResponse" + }, + "addProtectedRange": { + "$ref": "AddProtectedRangeResponse", + "description": "A reply from adding a protected range." + }, + "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": { + "description": "A reply from duplicating a filter view.", + "$ref": "DuplicateFilterViewResponse" + }, + "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." + } + }, + "id": "Response" + }, + "EmbeddedChart": { + "description": "A chart embedded in a sheet.", + "type": "object", + "properties": { + "chartId": { + "description": "The ID of the chart.", + "format": "int32", + "type": "integer" + }, + "position": { + "$ref": "EmbeddedObjectPosition", + "description": "The position of the chart." + }, + "spec": { + "description": "The specification of the chart.", + "$ref": "ChartSpec" + } + }, + "id": "EmbeddedChart" + }, + "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.", + "format": "int32", + "type": "integer" + } + }, + "id": "TextFormatRun" + }, + "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": { + "$ref": "GridRange", + "description": "The range to insert new cells into." + } + }, + "id": "InsertRangeRequest" + }, + "AddNamedRangeResponse": { + "description": "The result of adding a named range.", + "type": "object", + "properties": { + "namedRange": { + "$ref": "NamedRange", + "description": "The named range to add." + } + }, + "id": "AddNamedRangeResponse" + }, "BatchUpdateValuesByDataFilterResponse": { - "id": "BatchUpdateValuesByDataFilterResponse", "description": "The response when updating a range of values in a spreadsheet.", "type": "object", "properties": { - "totalUpdatedCells": { + "totalUpdatedSheets": { + "description": "The total number of sheets where at least one cell in the sheet was\nupdated.", "format": "int32", + "type": "integer" + }, + "totalUpdatedCells": { "description": "The total number of cells updated.", + "format": "int32", "type": "integer" }, "totalUpdatedColumns": { - "format": "int32", "description": "The total number of columns where at least one cell in the column was\nupdated.", + "format": "int32", "type": "integer" }, "spreadsheetId": { @@ -813,44 +2638,41 @@ "type": "string" }, "totalUpdatedRows": { - "format": "int32", "description": "The total number of rows where at least one cell in the row was updated.", + "format": "int32", "type": "integer" }, "responses": { "description": "The response for each range updated.", + "type": "array", "items": { "$ref": "UpdateValuesByDataFilterResponse" - }, - "type": "array" - }, - "totalUpdatedSheets": { - "format": "int32", - "description": "The total number of sheets where at least one cell in the sheet was\nupdated.", - "type": "integer" + } } - } + }, + "id": "BatchUpdateValuesByDataFilterResponse" }, "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": { "style": { + "description": "The style of the border.", + "type": "string", "enumDescriptions": [ "The style is not specified. Do not use this.", "The border is dotted.", @@ -870,61 +2692,59 @@ "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.", + "format": "int32", "type": "integer" } - } + }, + "id": "Border" }, "GridData": { - "id": "GridData", "description": "Data in the grid, as well as metadata about the dimensions.", "type": "object", "properties": { + "startRow": { + "description": "The first row this GridData refers to, zero-based.", + "format": "int32", + "type": "integer" + }, "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": { - "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": { - "format": "int32", - "description": "The first row this GridData refers to, zero-based.", - "type": "integer" + } } - } + }, + "id": "GridData" }, "UpdateNamedRangeRequest": { - "id": "UpdateNamedRangeRequest", "description": "Updates properties of the named range with the specified\nnamedRangeId.", "type": "object", "properties": { @@ -933,29 +2753,17 @@ "description": "The named range to update with the new properties." }, "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.", + "format": "google-fieldmask", "type": "string" } - } + }, + "id": "UpdateNamedRangeRequest" }, "FindReplaceRequest": { "description": "Finds and replaces data in cells over a range, sheet, or all sheets.", "type": "object", "properties": { - "sheetId": { - "format": "int32", - "description": "The sheet to find/replace over.", - "type": "integer" - }, - "allSheets": { - "description": "True to find/replace over all sheets.", - "type": "boolean" - }, - "matchCase": { - "description": "True if the search is case sensitive.", - "type": "boolean" - }, "includeFormulas": { "description": "True if the search should include cells with formulas.\nFalse to skip cells with formulas.", "type": "boolean" @@ -979,6 +2787,19 @@ "range": { "$ref": "GridRange", "description": "The range to find/replace over." + }, + "sheetId": { + "description": "The sheet to find/replace over.", + "format": "int32", + "type": "integer" + }, + "matchCase": { + "description": "True if the search is case sensitive.", + "type": "boolean" + }, + "allSheets": { + "description": "True to find/replace over all sheets.", + "type": "boolean" } }, "id": "FindReplaceRequest" @@ -995,31 +2816,31 @@ "id": "AddSheetRequest" }, "UpdateCellsRequest": { - "id": "UpdateCellsRequest", "description": "Updates all cells in a range with new data.", "type": "object", "properties": { "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" + "$ref": "GridRange", + "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." }, "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." + "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" } - } + }, + "id": "UpdateCellsRequest" }, "RandomizeRangeRequest": { "description": "Randomizes the order of the rows in a range.", @@ -1033,7 +2854,6 @@ "id": "RandomizeRangeRequest" }, "DeleteConditionalFormatRuleResponse": { - "id": "DeleteConditionalFormatRuleResponse", "description": "The result of deleting a conditional format rule.", "type": "object", "properties": { @@ -1041,7 +2861,8 @@ "description": "The rule that was deleted.", "$ref": "ConditionalFormatRule" } - } + }, + "id": "DeleteConditionalFormatRuleResponse" }, "DeleteRangeRequest": { "description": "Deletes a range of cells, shifting other cells into the deleted area.", @@ -1062,103 +2883,104 @@ ] }, "range": { - "description": "The range of cells to delete.", - "$ref": "GridRange" + "$ref": "GridRange", + "description": "The range of cells to delete." } }, "id": "DeleteRangeRequest" }, "GridCoordinate": { - "id": "GridCoordinate", "description": "A coordinate in a sheet.\nAll indexes are zero-based.", "type": "object", "properties": { - "sheetId": { + "rowIndex": { + "description": "The row index of the coordinate.", "format": "int32", - "description": "The sheet this coordinate is on.", "type": "integer" }, "columnIndex": { - "format": "int32", "description": "The column index of the coordinate.", + "format": "int32", "type": "integer" }, - "rowIndex": { + "sheetId": { + "description": "The sheet this coordinate is on.", "format": "int32", - "description": "The row index of the coordinate.", "type": "integer" } - } + }, + "id": "GridCoordinate" }, "UpdateSheetPropertiesRequest": { "description": "Updates properties of the sheet with the specified\nsheetId.", "type": "object", "properties": { "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.", + "format": "google-fieldmask", "type": "string" }, "properties": { - "description": "The properties to update.", - "$ref": "SheetProperties" + "$ref": "SheetProperties", + "description": "The properties to update." } }, "id": "UpdateSheetPropertiesRequest" }, "GridProperties": { - "id": "GridProperties", "description": "Properties of a grid.", "type": "object", "properties": { "rowCount": { - "format": "int32", "description": "The number of rows in the grid.", + "format": "int32", + "type": "integer" + }, + "frozenRowCount": { + "description": "The number of rows that are frozen in the grid.", + "format": "int32", "type": "integer" }, "hideGridlines": { "description": "True if the grid isn't showing gridlines in the UI.", "type": "boolean" }, - "frozenRowCount": { + "columnCount": { + "description": "The number of columns in the grid.", "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" } - } + }, + "id": "GridProperties" }, "UnmergeCellsRequest": { "description": "Unmerges cells in the given range.", "type": "object", "properties": { "range": { - "$ref": "GridRange", - "description": "The range within which all cells should be unmerged.\nIf the range spans multiple merges, all will be unmerged.\nThe range must not partially span any merge." + "description": "The range within which all cells should be unmerged.\nIf the range spans multiple merges, all will be unmerged.\nThe range must not partially span any merge.", + "$ref": "GridRange" } }, "id": "UnmergeCellsRequest" }, "SortSpec": { - "id": "SortSpec", "description": "A sort order associated with a specific column or row.", "type": "object", "properties": { "dimensionIndex": { - "format": "int32", "description": "The dimension the sort should be applied to.", + "format": "int32", "type": "integer" }, "sortOrder": { + "description": "The order data should be sorted.", + "type": "string", "enumDescriptions": [ "Default value, do not use this.", "Sort ascending.", @@ -1168,11 +2990,10 @@ "SORT_ORDER_UNSPECIFIED", "ASCENDING", "DESCENDING" - ], - "description": "The order data should be sorted.", - "type": "string" + ] } - } + }, + "id": "SortSpec" }, "Sheet": { "description": "A sheet in a spreadsheet.", @@ -1180,10 +3001,10 @@ "properties": { "bandedRanges": { "description": "The banded (i.e. alternating colors) ranges on this sheet.", + "type": "array", "items": { "$ref": "BandedRange" - }, - "type": "array" + } }, "properties": { "$ref": "SheetProperties", @@ -1191,38 +3012,38 @@ }, "charts": { "description": "The specifications of every chart on this sheet.", + "type": "array", "items": { "$ref": "EmbeddedChart" - }, - "type": "array" + } }, "filterViews": { "description": "The filter views in this sheet.", + "type": "array", "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.", + "type": "array", "items": { "$ref": "DeveloperMetadata" - }, - "type": "array" + } + }, + "protectedRanges": { + "description": "The protected ranges in this sheet.", + "type": "array", + "items": { + "$ref": "ProtectedRange" + } + }, + "conditionalFormats": { + "description": "The conditional format rules in this sheet.", + "type": "array", + "items": { + "$ref": "ConditionalFormatRule" + } }, "basicFilter": { "description": "The filter on this sheet, if any.", @@ -1230,17 +3051,17 @@ }, "merges": { "description": "The ranges that are merged together.", + "type": "array", "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).", + "type": "array", "items": { "$ref": "GridData" - }, - "type": "array" + } } }, "id": "Sheet" @@ -1257,99 +3078,99 @@ "id": "UpdateEmbeddedObjectPositionResponse" }, "BooleanRule": { - "id": "BooleanRule", "description": "A rule that may or may not match, depending on the condition.", "type": "object", "properties": { "format": { - "description": "The format to apply.\nConditional formatting can only apply a subset of formatting:\nbold, italic,\nstrikethrough,\nforeground color &\nbackground color.", - "$ref": "CellFormat" + "$ref": "CellFormat", + "description": "The format to apply.\nConditional formatting can only apply a subset of formatting:\nbold, italic,\nstrikethrough,\nforeground color &\nbackground color." }, "condition": { - "description": "The condition of the rule. If the condition evaluates to true,\nthe format will be applied.", - "$ref": "BooleanCondition" + "$ref": "BooleanCondition", + "description": "The condition of the rule. If the condition evaluates to true,\nthe format will be applied." } - } + }, + "id": "BooleanRule" }, "FilterCriteria": { "description": "Criteria for showing/hiding rows in a filter or filter view.", "type": "object", "properties": { + "hiddenValues": { + "description": "Values that should be hidden.", + "type": "array", + "items": { + "type": "string" + } + }, "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": { "value": { - "description": "The calculated value the metadata corresponds to.\n(Note that formulaValue is not valid,\n because the values will be calculated.)", - "$ref": "ExtendedValue" + "$ref": "ExtendedValue", + "description": "The calculated value the metadata corresponds to.\n(Note that formulaValue is not valid,\n because the values will be calculated.)" }, "collapsed": { "description": "True if the data corresponding to the value is collapsed.", "type": "boolean" } - } + }, + "id": "PivotGroupValueMetadata" }, "Editors": { - "id": "Editors", "description": "The editors of a protected range.", "type": "object", "properties": { "users": { "description": "The email addresses of users with edit access to the protected range.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } + }, + "groups": { + "description": "The email addresses of groups with edit access to the protected range.", + "type": "array", + "items": { + "type": "string" + } }, "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" }, "UpdateConditionalFormatRuleRequest": { "description": "Updates a conditional format rule at the given index,\nor moves a conditional format rule to another index.", "type": "object", "properties": { - "sheetId": { + "rule": { + "description": "The rule that should replace the rule at the given index.", + "$ref": "ConditionalFormatRule" + }, + "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", "type": "integer" }, "newIndex": { - "format": "int32", "description": "The zero-based new index the rule should end up at.", - "type": "integer" - }, - "rule": { - "$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" } }, @@ -1359,13 +3180,13 @@ "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" + }, + "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" @@ -1374,14 +3195,6 @@ "description": "A data validation rule.", "type": "object", "properties": { - "inputMessage": { - "description": "A message to show the user when adding data to the cell.", - "type": "string" - }, - "condition": { - "$ref": "BooleanCondition", - "description": "The condition that data in the cell must match." - }, "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" @@ -1389,6 +3202,14 @@ "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" + }, + "condition": { + "description": "The condition that data in the cell must match.", + "$ref": "BooleanCondition" } }, "id": "DataValidationRule" @@ -1397,21 +3218,7 @@ "description": "Inserts data into the spreadsheet starting at the specified coordinate.", "type": "object", "properties": { - "coordinate": { - "$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.", @@ -1429,11 +3236,25 @@ "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" + }, + "coordinate": { + "$ref": "GridCoordinate", + "description": "The coordinate at which the data should start being inserted." + }, + "data": { + "description": "The data to insert.", + "type": "string" + }, + "delimiter": { + "description": "The delimiter in the data.", + "type": "string" } }, "id": "PasteDataRequest" @@ -1444,25 +3265,31 @@ "properties": { "developerMetadata": { "description": "The updated developer metadata.", + "type": "array", "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": { + "length": { + "description": "The number of rows or columns to append.", "format": "int32", + "type": "integer" + }, + "sheetId": { "description": "The sheet to append rows or columns to.", + "format": "int32", "type": "integer" }, "dimension": { + "description": "Whether rows or columns should be appended.", + "type": "string", "enumDescriptions": [ "The default value, do not use.", "Operates on the rows of a sheet.", @@ -1472,16 +3299,10 @@ "DIMENSION_UNSPECIFIED", "ROWS", "COLUMNS" - ], - "description": "Whether rows or columns should be appended.", - "type": "string" - }, - "length": { - "format": "int32", - "description": "The number of rows or columns to append.", - "type": "integer" + ] } - } + }, + "id": "AppendDimensionRequest" }, "AddNamedRangeRequest": { "description": "Adds a named range to the spreadsheet.", @@ -1499,8 +3320,8 @@ "type": "object", "properties": { "developerMetadata": { - "$ref": "DeveloperMetadata", - "description": "The developer metadata that was created." + "description": "The developer metadata that was created.", + "$ref": "DeveloperMetadata" } }, "id": "CreateDeveloperMetadataResponse" @@ -1509,60 +3330,46 @@ "description": "Update an embedded object's position (such as a moving or resizing a\nchart or image).", "type": "object", "properties": { + "objectId": { + "description": "The ID of the object to moved.", + "format": "int32", + "type": "integer" + }, "newPosition": { - "$ref": "EmbeddedObjectPosition", - "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." + "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.", + "$ref": "EmbeddedObjectPosition" }, "fields": { - "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.", + "format": "google-fieldmask", "type": "string" - }, - "objectId": { - "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": { - "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", + "format": "int32", "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" }, "PieChartSpec": { - "id": "PieChartSpec", "description": "A \u003ca href=\"/chart/interactive/docs/gallery/piechart\"\u003epie chart\u003c/a\u003e.", "type": "object", "properties": { - "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" + "description": "The data that covers the one and only series of the pie chart.", + "$ref": "ChartData" }, "legendPosition": { "enumDescriptions": [ @@ -1585,28 +3392,42 @@ ], "description": "Where the legend of the pie chart should be drawn.", "type": "string" + }, + "pieHole": { + "description": "The size of the hole in the pie chart.", + "format": "double", + "type": "number" + }, + "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" } - } + }, + "id": "PieChartSpec" }, "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": { + "dataFilters": { + "description": "The filters matching the developer metadata entries to update.", + "type": "array", + "items": { + "$ref": "DataFilter" + } + }, + "fields": { + "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.", + "format": "google-fieldmask", + "type": "string" + }, "developerMetadata": { "$ref": "DeveloperMetadata", "description": "The value that all metadata matched by the data filters will be updated to." - }, - "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": "UpdateDeveloperMetadataRequest" @@ -1620,39 +3441,43 @@ "$ref": "FilterView" }, "fields": { - "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.", + "format": "google-fieldmask", "type": "string" } }, "id": "UpdateFilterViewRequest" }, "ConditionalFormatRule": { - "id": "ConditionalFormatRule", "description": "A rule describing a conditional format.", "type": "object", "properties": { - "ranges": { - "description": "The ranges that will be formatted if the condition is true.\nAll the ranges must be on the same grid.", - "items": { - "$ref": "GridRange" - }, - "type": "array" - }, - "gradientRule": { - "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." + }, + "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" + } + }, + "gradientRule": { + "$ref": "GradientRule", + "description": "The formatting will vary based on the gradients in the rule." } - } + }, + "id": "ConditionalFormatRule" }, "CopyPasteRequest": { "description": "Copies data from the source to the destination.", "type": "object", "properties": { + "source": { + "description": "The source range to copy.", + "$ref": "GridRange" + }, "pasteType": { "description": "What kind of data to paste.", "type": "string", @@ -1675,10 +3500,6 @@ "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" @@ -1698,239 +3519,11 @@ }, "id": "CopyPasteRequest" }, - "Request": { - "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" - }, - "deleteBanding": { - "$ref": "DeleteBandingRequest", - "description": "Removes a banded range" - }, - "addFilterView": { - "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." - }, - "deleteConditionalFormatRule": { - "$ref": "DeleteConditionalFormatRuleRequest", - "description": "Deletes an existing conditional format rule." - }, - "clearBasicFilter": { - "description": "Clears the basic filter on a sheet.", - "$ref": "ClearBasicFilterRequest" - }, - "repeatCell": { - "description": "Repeats a single cell across a range.", - "$ref": "RepeatCellRequest" - }, - "appendDimension": { - "$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": { - "$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", - "$ref": "UpdateBandingRequest" - }, - "addProtectedRange": { - "$ref": "AddProtectedRangeRequest", - "description": "Adds a protected range." - }, - "deleteNamedRange": { - "description": "Deletes a named range.", - "$ref": "DeleteNamedRangeRequest" - }, - "duplicateSheet": { - "description": "Duplicates a sheet.", - "$ref": "DuplicateSheetRequest" - }, - "deleteSheet": { - "description": "Deletes a sheet.", - "$ref": "DeleteSheetRequest" - }, - "unmergeCells": { - "$ref": "UnmergeCellsRequest", - "description": "Unmerges merged cells." - }, - "updateEmbeddedObjectPosition": { - "description": "Updates an embedded object's (e.g. chart, image) position.", - "$ref": "UpdateEmbeddedObjectPositionRequest" - }, - "updateDimensionProperties": { - "description": "Updates dimensions' properties.", - "$ref": "UpdateDimensionPropertiesRequest" - }, - "updateDeveloperMetadata": { - "$ref": "UpdateDeveloperMetadataRequest", - "description": "Updates an existing developer metadata entry" - }, - "pasteData": { - "$ref": "PasteDataRequest", - "description": "Pastes data (HTML or delimited) into a sheet." - }, - "setBasicFilter": { - "$ref": "SetBasicFilterRequest", - "description": "Sets the basic filter on a sheet." - }, - "addConditionalFormatRule": { - "$ref": "AddConditionalFormatRuleRequest", - "description": "Adds a new conditional format rule." - }, - "updateCells": { - "$ref": "UpdateCellsRequest", - "description": "Updates many cells at once." - }, - "addNamedRange": { - "$ref": "AddNamedRangeRequest", - "description": "Adds a named range." - }, - "updateSpreadsheetProperties": { - "$ref": "UpdateSpreadsheetPropertiesRequest", - "description": "Updates the spreadsheet's properties." - }, - "deleteEmbeddedObject": { - "$ref": "DeleteEmbeddedObjectRequest", - "description": "Deletes an embedded object (e.g, chart, image) in a sheet." - }, - "updateFilterView": { - "$ref": "UpdateFilterViewRequest", - "description": "Updates the properties of a filter view." - }, - "addBanding": { - "description": "Adds a new banded range", - "$ref": "AddBandingRequest" - }, - "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": { - "description": "Cuts data from one area and pastes it to another.", - "$ref": "CutPasteRequest" - }, - "mergeCells": { - "$ref": "MergeCellsRequest", - "description": "Merges cells together." - }, - "updateNamedRange": { - "$ref": "UpdateNamedRangeRequest", - "description": "Updates a named range." - }, - "updateSheetProperties": { - "$ref": "UpdateSheetPropertiesRequest", - "description": "Updates a sheet's properties." - }, - "autoFill": { - "description": "Automatically fills in more data based on existing data.", - "$ref": "AutoFillRequest" - }, - "deleteDimension": { - "description": "Deletes rows or columns in a sheet.", - "$ref": "DeleteDimensionRequest" - }, - "sortRange": { - "$ref": "SortRangeRequest", - "description": "Sorts data in a range." - }, - "deleteProtectedRange": { - "$ref": "DeleteProtectedRangeRequest", - "description": "Deletes a protected range." - } - }, - "id": "Request" - }, "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", "enumDescriptions": [ "The default value, do not use.", "The cell's value must be greater than the condition's value.\nSupported by data validation, conditional formatting and filters.\nRequires a single ConditionValue.", @@ -1992,38 +3585,266 @@ "BLANK", "NOT_BLANK", "CUSTOM_FORMULA" - ] + ], + "description": "The type of condition.", + "type": "string" + }, + "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.", + "type": "array", + "items": { + "$ref": "ConditionValue" + } } }, "id": "BooleanCondition" }, + "Request": { + "description": "A single kind of update to apply to a spreadsheet.", + "type": "object", + "properties": { + "addChart": { + "description": "Adds a chart.", + "$ref": "AddChartRequest" + }, + "findReplace": { + "description": "Finds and replaces occurrences of some text with other text.", + "$ref": "FindReplaceRequest" + }, + "textToColumns": { + "$ref": "TextToColumnsRequest", + "description": "Converts a column of text into many columns of text." + }, + "updateChartSpec": { + "description": "Updates a chart's specifications.", + "$ref": "UpdateChartSpecRequest" + }, + "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": { + "$ref": "CopyPasteRequest", + "description": "Copies data from one area and pastes it to another." + }, + "insertDimension": { + "$ref": "InsertDimensionRequest", + "description": "Inserts new rows or columns in a sheet." + }, + "deleteRange": { + "$ref": "DeleteRangeRequest", + "description": "Deletes a range of cells from a sheet, shifting the remaining cells." + }, + "deleteBanding": { + "description": "Removes a banded range", + "$ref": "DeleteBandingRequest" + }, + "addFilterView": { + "description": "Adds a filter view.", + "$ref": "AddFilterViewRequest" + }, + "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": { + "$ref": "DeleteConditionalFormatRuleRequest", + "description": "Deletes an existing conditional format rule." + }, + "repeatCell": { + "description": "Repeats a single cell across a range.", + "$ref": "RepeatCellRequest" + }, + "clearBasicFilter": { + "description": "Clears the basic filter on a sheet.", + "$ref": "ClearBasicFilterRequest" + }, + "appendDimension": { + "description": "Appends dimensions to the end of a sheet.", + "$ref": "AppendDimensionRequest" + }, + "createDeveloperMetadata": { + "description": "Creates new developer metadata", + "$ref": "CreateDeveloperMetadataRequest" + }, + "updateConditionalFormatRule": { + "$ref": "UpdateConditionalFormatRuleRequest", + "description": "Updates an existing conditional format rule." + }, + "insertRange": { + "$ref": "InsertRangeRequest", + "description": "Inserts new cells in a sheet, shifting the existing cells." + }, + "deleteDeveloperMetadata": { + "$ref": "DeleteDeveloperMetadataRequest", + "description": "Deletes developer metadata" + }, + "moveDimension": { + "$ref": "MoveDimensionRequest", + "description": "Moves rows or columns to another location in a sheet." + }, + "randomizeRange": { + "$ref": "RandomizeRangeRequest", + "description": "Randomizes the order of the rows in a range." + }, + "updateBanding": { + "$ref": "UpdateBandingRequest", + "description": "Updates a banded range" + }, + "addProtectedRange": { + "description": "Adds a protected range.", + "$ref": "AddProtectedRangeRequest" + }, + "deleteNamedRange": { + "description": "Deletes a named range.", + "$ref": "DeleteNamedRangeRequest" + }, + "duplicateSheet": { + "$ref": "DuplicateSheetRequest", + "description": "Duplicates a sheet." + }, + "deleteSheet": { + "$ref": "DeleteSheetRequest", + "description": "Deletes a sheet." + }, + "unmergeCells": { + "description": "Unmerges merged cells.", + "$ref": "UnmergeCellsRequest" + }, + "updateEmbeddedObjectPosition": { + "$ref": "UpdateEmbeddedObjectPositionRequest", + "description": "Updates an embedded object's (e.g. chart, image) position." + }, + "updateDimensionProperties": { + "description": "Updates dimensions' properties.", + "$ref": "UpdateDimensionPropertiesRequest" + }, + "updateDeveloperMetadata": { + "$ref": "UpdateDeveloperMetadataRequest", + "description": "Updates an existing developer metadata entry" + }, + "pasteData": { + "$ref": "PasteDataRequest", + "description": "Pastes data (HTML or delimited) into a sheet." + }, + "setBasicFilter": { + "$ref": "SetBasicFilterRequest", + "description": "Sets the basic filter on a sheet." + }, + "addConditionalFormatRule": { + "$ref": "AddConditionalFormatRuleRequest", + "description": "Adds a new conditional format rule." + }, + "updateCells": { + "$ref": "UpdateCellsRequest", + "description": "Updates many cells at once." + }, + "addNamedRange": { + "$ref": "AddNamedRangeRequest", + "description": "Adds a named range." + }, + "updateSpreadsheetProperties": { + "$ref": "UpdateSpreadsheetPropertiesRequest", + "description": "Updates the spreadsheet's properties." + }, + "deleteEmbeddedObject": { + "$ref": "DeleteEmbeddedObjectRequest", + "description": "Deletes an embedded object (e.g, chart, image) in a sheet." + }, + "updateFilterView": { + "description": "Updates the properties of a filter view.", + "$ref": "UpdateFilterViewRequest" + }, + "addBanding": { + "description": "Adds a new banded range", + "$ref": "AddBandingRequest" + }, + "appendCells": { + "$ref": "AppendCellsRequest", + "description": "Appends cells after the last row with data in a sheet." + }, + "autoResizeDimensions": { + "description": "Automatically resizes one or more dimensions based on the contents\nof the cells in that dimension.", + "$ref": "AutoResizeDimensionsRequest" + }, + "cutPaste": { + "$ref": "CutPasteRequest", + "description": "Cuts data from one area and pastes it to another." + }, + "mergeCells": { + "$ref": "MergeCellsRequest", + "description": "Merges cells together." + }, + "updateNamedRange": { + "$ref": "UpdateNamedRangeRequest", + "description": "Updates a named range." + }, + "updateSheetProperties": { + "description": "Updates a sheet's properties.", + "$ref": "UpdateSheetPropertiesRequest" + }, + "deleteDimension": { + "$ref": "DeleteDimensionRequest", + "description": "Deletes rows or columns in a sheet." + }, + "autoFill": { + "$ref": "AutoFillRequest", + "description": "Automatically fills in more data based on existing data." + }, + "sortRange": { + "$ref": "SortRangeRequest", + "description": "Sorts data in a range." + }, + "deleteProtectedRange": { + "$ref": "DeleteProtectedRangeRequest", + "description": "Deletes a protected range." + }, + "duplicateFilterView": { + "description": "Duplicates a filter view.", + "$ref": "DuplicateFilterViewRequest" + } + }, + "id": "Request" + }, "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": { - "startRowIndex": { + "endRowIndex": { + "description": "The end row (exclusive) 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": { - "format": "int32", - "description": "The start column (inclusive) of the range, or not set if unbounded.", - "type": "integer" - }, - "sheetId": { - "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.", + "format": "int32", "type": "integer" }, - "endRowIndex": { + "startRowIndex": { + "description": "The start row (inclusive) of the range, or not set if unbounded.", + "format": "int32", + "type": "integer" + }, + "startColumnIndex": { + "description": "The start column (inclusive) of the range, or not set if unbounded.", + "format": "int32", + "type": "integer" + }, + "sheetId": { + "description": "The sheet this range is on.", "format": "int32", - "description": "The end row (exclusive) of the range, or not set if unbounded.", "type": "integer" } }, @@ -2033,23 +3854,39 @@ "description": "The specification for a basic chart. See BasicChartType for the list\nof charts this supports.", "type": "object", "properties": { + "compareMode": { + "description": "The behavior of tooltips and data highlighting when hovering on data and\nchart area.", + "type": "string", + "enumDescriptions": [ + "Default value, do not use.", + "Only the focused data element is highlighted and shown in the tooltip.", + "All data elements with the same category (e.g., domain value) are\nhighlighted and shown in the tooltip." + ], + "enum": [ + "BASIC_CHART_COMPARE_MODE_UNSPECIFIED", + "DATUM", + "CATEGORY" + ] + }, "domains": { "description": "The domain of data this is charting.\nOnly a single domain is supported.", + "type": "array", "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": { - "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.)", + "format": "int32", "type": "integer" }, "stackedType": { + "description": "The stacked type for charts that support vertical stacking.\nApplies to Area, Bar, Column, and Stepped Area charts.", + "type": "string", "enumDescriptions": [ "Default value, do not use.", "Series are not stacked.", @@ -2061,21 +3898,19 @@ "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" + ] + }, + "axis": { + "description": "The axis on the chart.", + "type": "array", + "items": { + "$ref": "BasicChartAxis" + } }, "threeDimensional": { "description": "True to make the chart 3D.\nApplies to Bar and Column charts.", "type": "boolean" }, - "axis": { - "description": "The axis on the chart.", - "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" @@ -2106,14 +3941,12 @@ }, "series": { "description": "The data this chart is visualizing.", + "type": "array", "items": { "$ref": "BasicChartSeries" - }, - "type": "array" + } }, "legendPosition": { - "description": "The position of the chart legend.", - "type": "string", "enumDescriptions": [ "Default value, do not use.", "The legend is rendered on the bottom of the chart.", @@ -2129,30 +3962,44 @@ "RIGHT_LEGEND", "TOP_LEGEND", "NO_LEGEND" - ] + ], + "description": "The position of the chart legend.", + "type": "string" } }, "id": "BasicChartSpec" }, + "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": { + "$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": { + "description": "The range the data validation rule should apply to.", + "$ref": "GridRange" + } + }, + "id": "SetDataValidationRequest" + }, "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.", + "format": "int32", "type": "integer" }, "series": { - "$ref": "ChartData", - "description": "The data contianing the bubble y-values. These values locate the bubbles\nin the chart vertically." + "description": "The data contianing the bubble y-values. These values locate the bubbles\nin the chart vertically.", + "$ref": "ChartData" }, "legendPosition": { + "description": "Where the legend of the chart should be drawn.", + "type": "string", "enumDescriptions": [ "Default value, do not use.", "The legend is rendered on the bottom of the chart.", @@ -2170,26 +4017,24 @@ "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.", + "description": "The data containing the bubble x-values. These values locate the bubbles\nin the chart horizontally.", "$ref": "ChartData" }, + "bubbleSizes": { + "$ref": "ChartData", + "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." + }, "bubbleOpacity": { - "format": "float", "description": "The opacity of the bubbles between 0 and 1.0.\n0 is fully transparent and 1 is fully opaque.", + "format": "float", "type": "number" }, "bubbleBorderColor": { - "description": "The bubble border color.", - "$ref": "Color" + "$ref": "Color", + "description": "The bubble border color." }, "bubbleTextStyle": { "$ref": "TextFormat", @@ -2202,52 +4047,26 @@ "bubbleLabels": { "$ref": "ChartData", "description": "The data containing the bubble labels. These do not need to be unique." + }, + "bubbleMinRadiusSize": { + "description": "The minimum radius size of the bubbles, in pixels.\nIf specific, the field must be a positive value.", + "format": "int32", + "type": "integer" } }, "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": { - "$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", - "description": "The range the data validation rule should apply to." - } - }, - "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": { "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": { - "description": "The format the user entered for the cell.\n\nWhen writing, the new format will be merged with the existing format.", - "$ref": "CellFormat" + "$ref": "CellFormat", + "description": "The format the user entered for the cell.\n\nWhen writing, the new format will be merged with the existing format." }, "effectiveFormat": { "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.", @@ -2257,22 +4076,37 @@ "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": { "$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" + "$ref": "ExtendedValue", + "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." + }, + "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", + "items": { + "$ref": "TextFormatRun" + } + }, + "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" + }, + "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" } - } + }, + "id": "CellData" }, "BatchUpdateValuesByDataFilterRequest": { - "id": "BatchUpdateValuesByDataFilterRequest", "description": "The request for updating more than one range of values in a spreadsheet.", "type": "object", "properties": { @@ -2294,13 +4128,6 @@ "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": "DataFilterValueRange" - }, - "type": "array" - }, "valueInputOption": { "enumDescriptions": [ "Default input value. This value must not be used.", @@ -2315,6 +4142,13 @@ "description": "How the input data should be interpreted.", "type": "string" }, + "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 those ranges.", + "type": "array", + "items": { + "$ref": "DataFilterValueRange" + } + }, "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.", @@ -2327,46 +4161,92 @@ "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": "BatchUpdateValuesByDataFilterRequest" + }, + "TextPosition": { + "description": "Position settings for text.", + "type": "object", + "properties": { + "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": "Horizontal alignment setting for the piece of text.", + "type": "string" + } + }, + "id": "TextPosition" }, "BatchUpdateSpreadsheetRequest": { "description": "The request for updating any aspect of a spreadsheet.", "type": "object", "properties": { - "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": { - "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", + "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" + }, "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", "items": { "$ref": "Request" - }, - "type": "array" + } } }, "id": "BatchUpdateSpreadsheetRequest" }, + "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", + "type": "integer" + }, + "left": { + "description": "The left padding of the cell.", + "format": "int32", + "type": "integer" + }, + "right": { + "description": "The right padding of the cell.", + "format": "int32", + "type": "integer" + }, + "bottom": { + "description": "The bottom padding of the cell.", + "format": "int32", + "type": "integer" + } + }, + "id": "Padding" + }, "BasicChartAxis": { - "id": "BasicChartAxis", "description": "An axis of the chart.\nA chart may not have more than one axis per\naxis position.", "type": "object", "properties": { - "title": { - "description": "The title of this axis. If set, this overrides any title inferred\nfrom headers of the data.", - "type": "string" - }, "position": { "description": "The position of this axis.", "type": "string", @@ -2383,38 +4263,20 @@ "RIGHT_AXIS" ] }, + "title": { + "description": "The title of this axis. If set, this overrides any title inferred\nfrom headers of the data.", + "type": "string" + }, + "titleTextPosition": { + "description": "The axis title text position.", + "$ref": "TextPosition" + }, "format": { "description": "The format of the title.\nOnly valid if the axis is not associated with the domain.", "$ref": "TextFormat" } - } - }, - "Padding": { - "description": "The amount of padding around the cell, in pixels.\nWhen updating padding, every field must be specified.", - "type": "object", - "properties": { - "top": { - "format": "int32", - "description": "The top padding of the cell.", - "type": "integer" - }, - "left": { - "format": "int32", - "description": "The left padding of the cell.", - "type": "integer" - }, - "right": { - "format": "int32", - "description": "The right padding of the cell.", - "type": "integer" - }, - "bottom": { - "format": "int32", - "description": "The bottom padding of the cell.", - "type": "integer" - } }, - "id": "Padding" + "id": "BasicChartAxis" }, "DeleteDimensionRequest": { "description": "Deletes the dimensions from the sheet.", @@ -2428,28 +4290,28 @@ "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": { - "format": "int32", "description": "The ID of the chart to update.", + "format": "int32", "type": "integer" }, "spec": { - "description": "The specification to apply to the chart.", - "$ref": "ChartSpec" + "$ref": "ChartSpec", + "description": "The specification to apply to the chart." } - } + }, + "id": "UpdateChartSpecRequest" }, "DeleteFilterViewRequest": { "description": "Deletes a particular filter view.", "type": "object", "properties": { "filterId": { - "format": "int32", "description": "The ID of the filter to delete.", + "format": "int32", "type": "integer" } }, @@ -2459,6 +4321,39 @@ "description": "The request for retrieving a range of values in a spreadsheet selected by a\nset of DataFilters.", "type": "object", "properties": { + "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.", + "type": "array", + "items": { + "$ref": "DataFilter" + } + }, + "valueRenderOption": { + "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" + ], + "description": "How values should be represented in the output.\nThe default render option is ValueRenderOption.FORMATTED_VALUE.", + "type": "string" + }, + "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", + "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" + ] + }, "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", @@ -2472,39 +4367,6 @@ "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" @@ -2515,51 +4377,51 @@ "properties": { "deletedDeveloperMetadata": { "description": "The metadata that was deleted.", + "type": "array", "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": { - "format": "int32", "description": "The total number of rows where at least one cell in the row was updated.", + "format": "int32", "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": { - "format": "int32", "description": "The total number of sheets where at least one cell in the sheet was\nupdated.", + "format": "int32", "type": "integer" }, "totalUpdatedCells": { - "format": "int32", "description": "The total number of cells updated.", + "format": "int32", "type": "integer" }, "totalUpdatedColumns": { - "format": "int32", "description": "The total number of columns where at least one cell in the column was\nupdated.", + "format": "int32", "type": "integer" + }, + "spreadsheetId": { + "description": "The spreadsheet the updates were applied to.", + "type": "string" } - } + }, + "id": "BatchUpdateValuesResponse" }, "SortRangeRequest": { "description": "Sorts data in rows based on a sort order per column.", @@ -2571,34 +4433,33 @@ }, "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": { + "dataFilters": { + "description": "All filters matching the returned developer metadata.", + "type": "array", + "items": { + "$ref": "DataFilter" + } + }, "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" } - } + }, + "id": "MatchedDeveloperMetadata" }, "MergeCellsRequest": { - "id": "MergeCellsRequest", "description": "Merges all cells in the range.", "type": "object", "properties": { @@ -2607,6 +4468,8 @@ "$ref": "GridRange" }, "mergeType": { + "description": "How the cells should be merged.", + "type": "string", "enumDescriptions": [ "Create a single merge from the range", "Create a merge for each column in the range", @@ -2616,39 +4479,37 @@ "MERGE_ALL", "MERGE_COLUMNS", "MERGE_ROWS" - ], - "description": "How the cells should be merged.", - "type": "string" + ] } - } + }, + "id": "MergeCellsRequest" }, "AddProtectedRangeRequest": { - "id": "AddProtectedRangeRequest", "description": "Adds a new protected range.", "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" + "$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" }, "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": { @@ -2656,6 +4517,15 @@ "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" }, + "metadataId": { + "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.", + "format": "int32", + "type": "integer" + }, + "location": { + "description": "The location where the metadata is associated.", + "$ref": "DeveloperMetadataLocation" + }, "visibility": { "description": "The metadata visibility. Developer metadata must always have a visibility\nspecified.", "type": "string", @@ -2670,28 +4540,20 @@ "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" } - } + }, + "id": "DeveloperMetadata" }, "DuplicateFilterViewResponse": { "description": "The result of a filter view being duplicated.", "type": "object", "properties": { "filter": { - "$ref": "FilterView", - "description": "The newly created filter." + "description": "The newly created filter.", + "$ref": "FilterView" } }, "id": "DuplicateFilterViewResponse" @@ -2708,21 +4570,29 @@ "id": "DuplicateSheetResponse" }, "ClearBasicFilterRequest": { - "id": "ClearBasicFilterRequest", "description": "Clears the basic filter, if any exists on the sheet.", "type": "object", "properties": { "sheetId": { - "format": "int32", "description": "The sheet ID on which the basic filter should be cleared.", + "format": "int32", "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": { + "$ref": "GridRange", + "description": "The source data range. This must span exactly one column." + }, "delimiterType": { "enumDescriptions": [ "Default value. This value must not be used.", @@ -2742,97 +4612,73 @@ ], "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": { - "format": "int32", "description": "The ID of the banded range to delete.", + "format": "int32", "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": { + "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" }, "updates": { - "$ref": "UpdateValuesResponse", - "description": "Information about the updates that were applied." - }, - "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" + "description": "Information about the updates that were applied.", + "$ref": "UpdateValuesResponse" } }, "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.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } } }, "id": "PivotFilterCriteria" @@ -2842,30 +4688,45 @@ "type": "object", "properties": { "filter": { - "$ref": "FilterView", - "description": "The filter to add. The filterViewId\nfield is optional; if one is not set, an id will be randomly generated. (It\nis an error to specify the ID of a filter that already exists.)" + "description": "The filter to add. The filterViewId\nfield is optional; if one is not set, an id will be randomly generated. (It\nis an error to specify the ID of a filter that already exists.)", + "$ref": "FilterView" } }, "id": "AddFilterViewRequest" }, + "MoveDimensionRequest": { + "description": "Moves one or more rows or columns.", + "type": "object", + "properties": { + "destinationIndex": { + "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", + "type": "integer" + }, + "source": { + "description": "The source dimensions to move.", + "$ref": "DimensionRange" + } + }, + "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": { - "$ref": "ConditionalFormatRule", - "description": "The rule to add." + "description": "The rule to add.", + "$ref": "ConditionalFormatRule" }, "index": { - "format": "int32", "description": "The zero-based index where the rule should be inserted.", + "format": "int32", "type": "integer" } - } + }, + "id": "AddConditionalFormatRuleRequest" }, "CreateDeveloperMetadataRequest": { - "id": "CreateDeveloperMetadataRequest", "description": "A request to create developer metadata.", "type": "object", "properties": { @@ -2873,16 +4734,13 @@ "description": "The developer metadata to create.", "$ref": "DeveloperMetadata" } - } + }, + "id": "CreateDeveloperMetadataRequest" }, "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" @@ -2891,17 +4749,21 @@ "description": "The alternative text that describes the chart. This is often used\nfor accessibility.", "type": "string" }, + "titleTextPosition": { + "$ref": "TextPosition", + "description": "The title text position.\nThis field is optional." + }, "histogramChart": { "$ref": "HistogramChartSpec", "description": "A histogram chart specification." }, "candlestickChart": { - "$ref": "CandlestickChartSpec", - "description": "A candlestick chart specification." + "description": "A candlestick chart specification.", + "$ref": "CandlestickChartSpec" }, "bubbleChart": { - "$ref": "BubbleChartSpec", - "description": "A bubble chart specification." + "description": "A bubble chart specification.", + "$ref": "BubbleChartSpec" }, "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.", @@ -2929,48 +4791,66 @@ "SHOW_ALL" ] }, + "subtitleTextFormat": { + "$ref": "TextFormat", + "description": "The subtitle text format.\nStrikethrough and underline are not supported." + }, + "subtitle": { + "description": "The subtitle of the chart.", + "type": "string" + }, "backgroundColor": { "description": "The background color of the entire chart.\nNot applicable to Org charts.", "$ref": "Color" }, + "subtitleTextPosition": { + "$ref": "TextPosition", + "description": "The subtitle text position.\nThis field is optional." + }, "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." + "description": "An org chart specification.", + "$ref": "OrgChartSpec" }, "pieChart": { - "$ref": "PieChartSpec", - "description": "A pie chart specification." + "description": "A pie chart specification.", + "$ref": "PieChartSpec" + }, + "titleTextFormat": { + "description": "The title text format.\nStrikethrough and underline are not supported.", + "$ref": "TextFormat" } }, "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": { + "valueRanges": { + "description": "The requested values with the list of data filters that matched them.", + "type": "array", + "items": { + "$ref": "MatchedValueRange" + } + }, "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" } - } + }, + "id": "BatchGetValuesByDataFilterResponse" }, "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`", @@ -2992,9 +4872,7 @@ "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.", @@ -3007,23 +4885,7 @@ "description": "A range of values whose location is specified by a DataFilter.", "type": "object", "properties": { - "dataFilter": { - "description": "The data filter describing the location of the values in the spreadsheet.", - "$ref": "DataFilter" - }, - "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" - }, "majorDimension": { - "description": "The major dimension of the values.", - "type": "string", "enumDescriptions": [ "The default value, do not use.", "Operates on the rows of a sheet.", @@ -3033,7 +4895,23 @@ "DIMENSION_UNSPECIFIED", "ROWS", "COLUMNS" - ] + ], + "description": "The major dimension of the values.", + "type": "string" + }, + "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.", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "any" + } + } + }, + "dataFilter": { + "description": "The data filter describing the location of the values in the spreadsheet.", + "$ref": "DataFilter" } }, "id": "DataFilterValueRange" @@ -3042,13 +4920,13 @@ "description": "The domain of a CandlestickChart.", "type": "object", "properties": { + "data": { + "$ref": "ChartData", + "description": "The data of the CandlestickDomain." + }, "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" @@ -3062,17 +4940,17 @@ "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.", + "format": "int32", "type": "integer" }, "tabColor": { - "description": "The color of the tab in the UI.", - "$ref": "Color" + "$ref": "Color", + "description": "The color of the tab in the UI." }, "sheetId": { - "format": "int32", "description": "The ID of the sheet. Must be non-negative.\nThis field cannot be changed once set.", + "format": "int32", "type": "integer" }, "rightToLeft": { @@ -3083,10 +4961,6 @@ "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.", @@ -3100,6 +4974,10 @@ ], "description": "The type of sheet. Defaults to GRID.\nThis field cannot be changed once set.", "type": "string" + }, + "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" } }, "id": "SheetProperties" @@ -3113,12 +4991,12 @@ "description": "Properties to update." }, "range": { - "description": "The rows or columns to update.", - "$ref": "DimensionRange" + "$ref": "DimensionRange", + "description": "The rows or columns 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.", + "format": "google-fieldmask", "type": "string" } }, @@ -3128,6 +5006,10 @@ "description": "A combination of a source range and how to extend that source.", "type": "object", "properties": { + "source": { + "$ref": "GridRange", + "description": "The location of the data to use as the source of the autofill." + }, "dimension": { "enumDescriptions": [ "The default value, do not use.", @@ -3143,13 +5025,9 @@ "type": "string" }, "fillLength": { - "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.", + "format": "int32", "type": "integer" - }, - "source": { - "$ref": "GridRange", - "description": "The location of the data to use as the source of the autofill." } }, "id": "SourceAndDestination" @@ -3158,21 +5036,12 @@ "description": "A filter view.", "type": "object", "properties": { - "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": { + "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" + } }, "title": { "description": "The name of the filter view.", @@ -3184,19 +5053,31 @@ }, "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" + } + }, + "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" } }, "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": { + "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." + }, "selectedNodeColor": { "$ref": "Color", "description": "The color of the selected org chart nodes." @@ -3206,8 +5087,6 @@ "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.", @@ -3219,97 +5098,95 @@ "SMALL", "MEDIUM", "LARGE" - ] + ], + "description": "The size of the org chart nodes.", + "type": "string" }, "labels": { - "$ref": "ChartData", - "description": "The data containing the labels for all the nodes in the chart. Labels\nmust be unique." + "description": "The data containing the labels for all the nodes in the chart. Labels\nmust be unique.", + "$ref": "ChartData" }, "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." } - } + }, + "id": "OrgChartSpec" }, "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.", + "type": "array", "items": { "$ref": "DataFilter" - }, - "type": "array" + } } - } + }, + "id": "SearchDeveloperMetadataRequest" }, "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)" + "description": "The first color that is alternating. (Required)", + "$ref": "Color" }, "secondBandColor": { - "description": "The second color that is alternating. (Required)", - "$ref": "Color" + "$ref": "Color", + "description": "The second color that is alternating. (Required)" }, "footerColor": { - "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" + "$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." } - } + }, + "id": "BandingProperties" }, "AddProtectedRangeResponse": { "description": "The result of adding a new protected range.", "type": "object", "properties": { "protectedRange": { - "description": "The newly added protected range.", - "$ref": "ProtectedRange" + "$ref": "ProtectedRange", + "description": "The newly added protected range." } }, "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" + } } - } + }, + "id": "BasicFilter" }, "CandlestickSeries": { - "id": "CandlestickSeries", "description": "The series of a CandlestickData.", "type": "object", "properties": { @@ -3317,20 +5194,21 @@ "$ref": "ChartData", "description": "The data of the CandlestickSeries." } - } + }, + "id": "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.", + "format": "double", "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.", + "format": "double", "type": "number" }, "showItemDividers": { @@ -3339,10 +5217,10 @@ }, "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.", + "type": "array", "items": { "$ref": "HistogramSeries" - }, - "type": "array" + } }, "legendPosition": { "enumDescriptions": [ @@ -3373,9 +5251,18 @@ "description": "The response when updating a range of values in a spreadsheet.", "type": "object", "properties": { - "updatedColumns": { + "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`." + }, + "updatedColumns": { "description": "The number of columns where at least one cell in the column was updated.", + "format": "int32", "type": "integer" }, "spreadsheetId": { @@ -3387,17 +5274,8 @@ "type": "string" }, "updatedCells": { - "format": "int32", "description": "The number of cells updated.", - "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" } }, @@ -3443,7 +5321,6 @@ "id": "ErrorValue" }, "PivotValue": { - "id": "PivotValue", "description": "The definition of how a value in a pivot table should be calculated.", "type": "object", "properties": { @@ -3452,6 +5329,8 @@ "type": "string" }, "summarizeFunction": { + "description": "A function to summarize the value.\nIf formula is set, the only supported values are\nSUM and\nCUSTOM.\nIf sourceColumnOffset is set, then `CUSTOM`\nis not supported.", + "type": "string", "enumDescriptions": [ "The default, do not use.", "Corresponds to the `SUM` function.", @@ -3485,20 +5364,19 @@ "VAR", "VARP", "CUSTOM" - ], - "description": "A function to summarize the value.\nIf formula is set, the only supported values are\nSUM and\nCUSTOM.\nIf sourceColumnOffset is set, then `CUSTOM`\nis not supported.", - "type": "string" + ] }, "sourceColumnOffset": { - "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`.", + "format": "int32", "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.", + "description": "A name to use for the value.", "type": "string" } - } + }, + "id": "PivotValue" }, "CopySheetToAnotherSpreadsheetRequest": { "description": "The request to copy a sheet across spreadsheets.", @@ -3516,22 +5394,21 @@ "type": "object", "properties": { "valuesIndex": { - "format": "int32", "description": "The offset in the PivotTable.values list which the values in this\ngrouping should be sorted by.", + "format": "int32", "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" - }, - "type": "array" + } } }, "id": "PivotGroupSortValueBucket" }, "DeleteDeveloperMetadataRequest": { - "id": "DeleteDeveloperMetadataRequest", "description": "A request to delete developer metadata.", "type": "object", "properties": { @@ -3539,1851 +5416,31 @@ "description": "The data filter describing the criteria used to select which developer\nmetadata entry to delete.", "$ref": "DataFilter" } - } + }, + "id": "DeleteDeveloperMetadataRequest" }, "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." + }, + "data": { + "description": "The Candlestick chart data.\nOnly one CandlestickData is supported.", + "type": "array", + "items": { + "$ref": "CandlestickData" + } } }, "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": [ - "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": [ - "BASIC_CHART_TYPE_UNSPECIFIED", - "BAR", - "LINE", - "AREA", - "COLUMN", - "SCATTER", - "COMBO", - "STEPPED_AREA" - ], - "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" - }, - "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": "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" - } - } } }, "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": "Sheets", - "auth": { - "oauth2": { - "scopes": { - "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/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" - } - } - } - }, - "rootUrl": "https://sheets.googleapis.com/", - "ownerDomain": "google.com", - "name": "sheets", - "batchPath": "batch", - "title": "Google Sheets API", - "ownerName": "Google" + "protocol": "rest" } diff --git a/etc/api/slides/v1/slides-api.json b/etc/api/slides/v1/slides-api.json index cc737cafe2..d7984f0397 100644 --- a/etc/api/slides/v1/slides-api.json +++ b/etc/api/slides/v1/slides-api.json @@ -1,813 +1,297 @@ { + "ownerName": "Google", + "resources": { + "presentations": { + "methods": { + "get": { + "response": { + "$ref": "Presentation" + }, + "parameterOrder": [ + "presentationId" + ], + "httpMethod": "GET", + "parameters": { + "presentationId": { + "description": "The ID of the presentation to retrieve.", + "required": true, + "type": "string", + "pattern": "^[^/]+$", + "location": "path" + } + }, + "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/presentations", + "https://www.googleapis.com/auth/presentations.readonly" + ], + "flatPath": "v1/presentations/{presentationsId}", + "path": "v1/presentations/{+presentationId}", + "id": "slides.presentations.get", + "description": "Gets the latest version of the specified presentation." + }, + "create": { + "request": { + "$ref": "Presentation" + }, + "description": "Creates a new presentation using the title given in the request. Other\nfields in the request are ignored.\nReturns the created presentation.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "Presentation" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/presentations" + ], + "flatPath": "v1/presentations", + "id": "slides.presentations.create", + "path": "v1/presentations" + }, + "batchUpdate": { + "flatPath": "v1/presentations/{presentationId}:batchUpdate", + "path": "v1/presentations/{presentationId}:batchUpdate", + "id": "slides.presentations.batchUpdate", + "request": { + "$ref": "BatchUpdatePresentationRequest" + }, + "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.", + "response": { + "$ref": "BatchUpdatePresentationResponse" + }, + "parameterOrder": [ + "presentationId" + ], + "httpMethod": "POST", + "parameters": { + "presentationId": { + "description": "The presentation to apply the updates to.", + "required": true, + "type": "string", + "location": "path" + } + }, + "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/presentations", + "https://www.googleapis.com/auth/spreadsheets", + "https://www.googleapis.com/auth/spreadsheets.readonly" + ] + } + }, + "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.file", + "https://www.googleapis.com/auth/drive.readonly", + "https://www.googleapis.com/auth/presentations", + "https://www.googleapis.com/auth/presentations.readonly" + ], + "parameters": { + "presentationId": { + "location": "path", + "description": "The ID of the presentation to retrieve.", + "required": true, + "type": "string" + }, + "pageObjectId": { + "location": "path", + "description": "The object ID of the page whose thumbnail to retrieve.", + "required": true, + "type": "string" + }, + "thumbnailProperties.mimeType": { + "location": "query", + "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" + }, + "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" + } + }, + "flatPath": "v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail", + "path": "v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail", + "id": "slides.presentations.pages.getThumbnail" + }, + "get": { + "response": { + "$ref": "Page" + }, + "parameterOrder": [ + "presentationId", + "pageObjectId" + ], + "httpMethod": "GET", + "parameters": { + "presentationId": { + "description": "The ID of the presentation to retrieve.", + "required": true, + "type": "string", + "location": "path" + }, + "pageObjectId": { + "required": true, + "type": "string", + "location": "path", + "description": "The object ID of the page to retrieve." + } + }, + "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/presentations", + "https://www.googleapis.com/auth/presentations.readonly" + ], + "flatPath": "v1/presentations/{presentationId}/pages/{pageObjectId}", + "path": "v1/presentations/{presentationId}/pages/{pageObjectId}", + "id": "slides.presentations.pages.get", + "description": "Gets the latest version of the specified page in the presentation." + } + } + } + } + } + }, + "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": { + "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" + }, + "uploadType": { + "type": "string", + "location": "query", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")." + }, + "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": { + "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://slides.googleapis.com/", + "kind": "discovery#restDescription", + "description": "An API for creating and editing Google Slides presentations.", + "servicePath": "", + "basePath": "", + "revision": "20171208", + "documentationLink": "https://developers.google.com/slides/", + "id": "slides:v1", + "discoveryVersion": "v1", + "version_module": true, "schemas": { - "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": { + "description": "Inserts columns into a table.\n\nOther columns in the table will be resized to fit the new column.", "type": "object", "properties": { "number": { - "format": "int32", "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." + "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.", + "$ref": "TableCellLocation" }, "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.", @@ -818,8 +302,28 @@ "type": "string" } }, - "id": "InsertTableColumnsRequest", - "description": "Inserts columns into a table.\n\nOther columns in the table will be resized to fit the new column." + "id": "InsertTableColumnsRequest" + }, + "Thumbnail": { + "description": "The thumbnail of a page.", + "type": "object", + "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" }, "LayoutPlaceholderIdMapping": { "description": "The user-specified ID mapping for a placeholder that will be created on a\nslide from a specified layout.", @@ -840,15 +344,60 @@ }, "id": "LayoutPlaceholderIdMapping" }, + "UpdateTableBorderPropertiesRequest": { + "description": "Updates the properties of the table borders in a Table.", + "type": "object", + "properties": { + "borderPosition": { + "description": "The border position in the table range the updates should apply to. If a\nborder position is not specified, the updates will apply to all borders in\nthe table range.", + "type": "string", + "enumDescriptions": [ + "All borders in the range.", + "Borders at the bottom of the range.", + "Borders on the inside of the range.", + "Horizontal borders on the inside of the range.", + "Vertical borders on the inside of the range.", + "Borders at the left of the range.", + "Borders along the outside of the range.", + "Borders at the right of the range.", + "Borders at the top of the range." + ], + "enum": [ + "ALL", + "BOTTOM", + "INNER", + "INNER_HORIZONTAL", + "INNER_VERTICAL", + "LEFT", + "OUTER", + "RIGHT", + "TOP" + ] + }, + "fields": { + "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `tableBorderProperties` 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 border solid fill color, set\n`fields` to `\"tableBorderFill.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" + }, + "tableBorderProperties": { + "description": "The table border properties to update.", + "$ref": "TableBorderProperties" + } + }, + "id": "UpdateTableBorderPropertiesRequest" + }, "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" @@ -856,20 +405,53 @@ "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": { + "description": "A PageElement kind representing\nword art.", + "type": "object", "properties": { "renderedText": { "description": "The text rendered as word art.", "type": "string" } }, - "id": "WordArt", - "description": "A PageElement kind representing\nword art.", - "type": "object" + "id": "WordArt" + }, + "UpdateTableColumnPropertiesRequest": { + "type": "object", + "properties": { + "objectId": { + "description": "The object ID of the table.", + "type": "string" + }, + "columnIndices": { + "type": "array", + "items": { + "format": "int32", + "type": "integer" + }, + "description": "The list of zero-based indices specifying which columns to update. If no\nindices are provided, all columns in the table will be updated." + }, + "tableColumnProperties": { + "$ref": "TableColumnProperties", + "description": "The table column properties to update.\n\nIf the value of `table_column_properties#column_width` in the request is\nless than 406,400 EMU (32 points), a 400 bad request error is returned." + }, + "fields": { + "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `tableColumnProperties` 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 column width, set `fields` to `\"column_width\"`.\n\nIf '\"column_width\"' is included in the field mask but the property is left\nunset, the column width will default to 406,400 EMU (32 points).", + "format": "google-fieldmask", + "type": "string" + } + }, + "id": "UpdateTableColumnPropertiesRequest", + "description": "Updates the properties of a Table column." }, "Recolor": { "description": "A recolor effect applied on an image.", @@ -877,10 +459,10 @@ "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" - }, - "type": "array" + } }, "name": { "enumDescriptions": [ @@ -944,22 +526,18 @@ "id": "Recolor" }, "Link": { + "description": "A hypertext 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" + "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" + }, + "url": { + "type": "string", + "description": "If set, indicates this is a link to the external web page at this URL." }, "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.", @@ -967,37 +545,41 @@ "A link to the previous slide.", "A link to the first slide in the presentation.", "A link to the last slide in the presentation." - ] + ], + "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." }, - "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" + "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" } }, - "id": "Link", - "description": "A hypertext link." + "id": "Link" }, "RgbColor": { "description": "An RGB color.", "type": "object", "properties": { - "red": { + "green": { + "description": "The green component of the color, from 0.0 to 1.0.", "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.", + "format": "float", "type": "number" }, - "green": { + "red": { + "description": "The red component of the color, from 0.0 to 1.0.", "format": "float", - "description": "The green component of the color, from 0.0 to 1.0.", "type": "number" } }, @@ -1015,16 +597,17 @@ "id": "CreateShapeResponse" }, "CreateLineRequest": { + "id": "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": { + "description": "The category of line to be created.", + "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.", @@ -1034,14 +617,13 @@ "STRAIGHT", "BENT", "CURVED" - ], - "description": "The category of line to be created.", + ] + }, + "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" } - }, - "id": "CreateLineRequest", - "description": "Creates a line.", - "type": "object" + } }, "CreateSlideResponse": { "description": "The result of creating a slide.", @@ -1055,9 +637,14 @@ "id": "CreateSlideResponse" }, "CreateShapeRequest": { + "description": "Creates a new shape.", + "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": { - "type": "string", "enumDescriptions": [ "The shape type that is not predefined.", "Text box shape.", @@ -1348,26 +935,20 @@ "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.", + "description": "The shape type.", "type": "string" }, "elementProperties": { - "$ref": "PageElementProperties", - "description": "The element properties for the shape." + "description": "The element properties for the shape.", + "$ref": "PageElementProperties" } }, - "id": "CreateShapeRequest", - "description": "Creates a new shape.", - "type": "object" + "id": "CreateShapeRequest" }, "Video": { - "description": "A PageElement kind representing a\nvideo.", - "type": "object", "properties": { "source": { + "type": "string", "enumDescriptions": [ "The video source is unspecified.", "The video source is YouTube." @@ -1376,38 +957,68 @@ "SOURCE_UNSPECIFIED", "YOUTUBE" ], - "description": "The video source.", + "description": "The video source." + }, + "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" }, - "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" + "id": "Video", + "description": "A PageElement kind representing a\nvideo.", + "type": "object" }, "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." + }, + "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." } }, "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." + "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.", + "type": "object" + }, + "TableCell": { + "type": "object", + "properties": { + "location": { + "description": "The location of the cell within the table.", + "$ref": "TableCellLocation" + }, + "rowSpan": { + "description": "Row span of the cell.", + "format": "int32", + "type": "integer" + }, + "columnSpan": { + "description": "Column span of the cell.", + "format": "int32", + "type": "integer" + }, + "text": { + "$ref": "TextContent", + "description": "The text content of the cell." + }, + "tableCellProperties": { + "$ref": "TableCellProperties", + "description": "The properties of the table cell." + } + }, + "id": "TableCell", + "description": "Properties and contents of each table cell." }, "NestingLevel": { "properties": { @@ -1420,51 +1031,22 @@ "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" + "type": "string", + "description": "The object ID of the line the update is applied to." }, "lineProperties": { "description": "The line properties to update.", "$ref": "LineProperties" }, "fields": { - "type": "string", + "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", - "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." + "type": "string" } }, "id": "UpdateLinePropertiesRequest" @@ -1475,14 +1057,14 @@ "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.", + "type": "array", "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.", + "format": "int32", "type": "integer" } }, @@ -1492,9 +1074,11 @@ "description": "The table cell background fill.", "type": "object", "properties": { + "solidFill": { + "$ref": "SolidFill", + "description": "Solid color fill." + }, "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.", @@ -1504,11 +1088,9 @@ "RENDERED", "NOT_RENDERED", "INHERIT" - ] - }, - "solidFill": { - "$ref": "SolidFill", - "description": "Solid color fill." + ], + "description": "The background fill property state.\n\nUpdating 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" } }, "id": "TableCellBackgroundFill" @@ -1518,44 +1100,40 @@ "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.", + "format": "google-fieldmask", "type": "string" }, + "objectId": { + "type": "string", + "description": "The object ID of the page the update is applied to." + }, "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.", + "type": "array", "items": { "$ref": "PageElement" - }, - "type": "array" + } } - } + }, + "id": "Group" }, "Placeholder": { + "id": "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.", @@ -1601,12 +1179,15 @@ "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" + }, + "index": { + "description": "The index of the placeholder. If the same placeholder types are present in\nthe same page, they would have different index values.", + "format": "int32", + "type": "integer" } - }, - "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": { @@ -1621,53 +1202,62 @@ "type": "object" } }, - "id": "DuplicateObjectRequest" + "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." }, "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" + }, + "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.", + "type": "array", + "items": { + "type": "string" + } + }, + "containsText": { + "description": "Finds text in a shape matching this substring.", + "$ref": "SubstringMatchCriteria" } }, "id": "ReplaceAllTextRequest" }, + "UnmergeTableCellsRequest": { + "properties": { + "objectId": { + "description": "The object ID of the table.", + "type": "string" + }, + "tableRange": { + "$ref": "TableRange", + "description": "The table range specifying which cells of the table to unmerge.\n\nAll merged cells in this range will be unmerged, and cells that are already\nunmerged will not be affected. If the range has no merged cells, the\nrequest will do nothing. If there is text in any of the merged cells, the\ntext will remain in the upper-left (\"head\") cell of the resulting block of\nunmerged cells." + } + }, + "id": "UnmergeTableCellsRequest", + "description": "Unmerges cells in a Table.", + "type": "object" + }, "Page": { "description": "A page in a presentation.", "type": "object", "properties": { "layoutProperties": { - "$ref": "LayoutProperties", - "description": "Layout specific properties. Only set if page_type = LAYOUT." + "description": "Layout specific properties. Only set if page_type = LAYOUT.", + "$ref": "LayoutProperties" }, "pageElements": { "description": "The page elements rendered on the page.", + "type": "array", "items": { "$ref": "PageElement" - }, - "type": "array" + } }, "pageType": { - "enum": [ - "SLIDE", - "MASTER", - "LAYOUT", - "NOTES", - "NOTES_MASTER" - ], "description": "The type of the page.", "type": "string", "enumDescriptions": [ @@ -1676,23 +1266,30 @@ "A layout page.", "A notes page.", "A notes master page." + ], + "enum": [ + "SLIDE", + "MASTER", + "LAYOUT", + "NOTES", + "NOTES_MASTER" ] }, "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" }, + "pageProperties": { + "$ref": "PageProperties", + "description": "The properties of the page." + }, "masterProperties": { - "$ref": "MasterProperties", - "description": "Master specific properties. Only set if page_type = MASTER." + "description": "Master specific properties. Only set if page_type = MASTER.", + "$ref": "MasterProperties" }, "objectId": { "description": "The object ID for this page. Object IDs used by\nPage and\nPageElement share the same namespace.", @@ -1706,113 +1303,134 @@ "id": "Page" }, "ShapeBackgroundFill": { - "description": "The shape background fill.", "type": "object", "properties": { - "solidFill": { - "$ref": "SolidFill", - "description": "Solid color fill." - }, "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 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." - ] + "description": "The background fill property state.\n\nUpdating 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" + }, + "solidFill": { + "$ref": "SolidFill", + "description": "Solid color fill." } }, - "id": "ShapeBackgroundFill" + "id": "ShapeBackgroundFill", + "description": "The shape 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": { - "angle": { + "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": { "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." + "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" }, "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.", + "format": "float", "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." + "type": "number" } }, - "id": "CropProperties" + "id": "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" }, "ReplaceAllShapesWithSheetsChartRequest": { + "type": "object", "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" + "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": { "$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." + }, + "chartId": { + "description": "The ID of the specific chart in the Google Sheets spreadsheet.", + "format": "int32", + "type": "integer" + }, + "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.", + "type": "array", + "items": { + "type": "string" + } } }, "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" + "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." + }, + "ColorStop": { + "description": "A color and position in a gradient band.", + "type": "object", + "properties": { + "alpha": { + "type": "number", + "description": "The alpha value of this color in the gradient band. Defaults to 1.0,\nfully opaque.", + "format": "float" + }, + "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", + "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": { - "endIndex": { + "startIndex": { + "description": "The optional zero-based index of the beginning of the collection.\nRequired for `FIXED_RANGE` and `FROM_START_INDEX` ranges.", "format": "int32", - "description": "The optional zero-based index of the end of the collection.\nRequired for `FIXED_RANGE` ranges.", "type": "integer" }, - "startIndex": { + "endIndex": { + "description": "The optional zero-based index of the end of the collection.\nRequired for `FIXED_RANGE` ranges.", "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": { @@ -1834,33 +1452,15 @@ }, "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": { + "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": { - "type": "string", "enumDescriptions": [ "The video source is unspecified.", "The video source is YouTube." @@ -1869,15 +1469,12 @@ "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.", + "description": "The video source.", "type": "string" }, "elementProperties": { "$ref": "PageElementProperties", - "description": "The element properties for the video." + "description": "The element properties for the video.\n\nThe PageElementProperties.size property is\noptional. If you don't specify a size, a default size is chosen by the\nserver.\n\nThe PageElementProperties.transform property is\noptional. The transform must not have shear components.\nIf you don't specify a transform, the video will be placed at the top left\ncorner of the page." }, "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.", @@ -1887,6 +1484,7 @@ "id": "CreateVideoRequest" }, "DuplicateObjectResponse": { + "description": "The response of duplicating an object.", "type": "object", "properties": { "objectId": { @@ -1894,56 +1492,64 @@ "type": "string" } }, - "id": "DuplicateObjectResponse", - "description": "The response of duplicating an object." + "id": "DuplicateObjectResponse" }, "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.", + "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 most 2 kB in length.", "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" + "type": "string", + "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." + ] + }, + "containsText": { + "$ref": "SubstringMatchCriteria", + "description": "If set, this request will replace all of the shapes that contain the\ngiven text." + }, + "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.", + "type": "array", + "items": { + "type": "string" + } } }, - "id": "ReplaceAllShapesWithImageRequest" + "id": "ReplaceAllShapesWithImageRequest", + "description": "Replaces all shapes that match the given criteria with the provided image." + }, + "MergeTableCellsRequest": { + "properties": { + "objectId": { + "description": "The object ID of the table.", + "type": "string" + }, + "tableRange": { + "$ref": "TableRange", + "description": "The table range specifying which cells of the table to merge.\n\nAny text in the cells being merged will be concatenated and stored in the\nupper-left (\"head\") cell of the range. If the range is non-rectangular\n(which can occur in some cases where the range covers cells that are\nalready merged), a 400 bad request error is returned." + } + }, + "id": "MergeTableCellsRequest", + "description": "Merges cells in a Table.", + "type": "object" }, "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": { + "description": "The type of the shadow.", + "type": "string", "enumDescriptions": [ "Unspecified shadow type.", "Outer shadow." @@ -1951,11 +1557,25 @@ "enum": [ "SHADOW_TYPE_UNSPECIFIED", "OUTER" - ], - "description": "The type of the shadow.", - "type": "string" + ] + }, + "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", @@ -1969,23 +1589,11 @@ "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." - ] + "type": "string" }, "alpha": { - "format": "float", "description": "The alpha of the shadow's color, from 0.0 to 1.0.", + "format": "float", "type": "number" }, "color": { @@ -1997,7 +1605,6 @@ "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.", @@ -2008,30 +1615,58 @@ "RENDERED", "NOT_RENDERED", "INHERIT" - ] + ], + "description": "The shadow property state.\n\nUpdating the shadow on a page element will implicitly update this field to\n`RENDERED`, unless another value is specified in the same request. To have\nno 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." + }, + "blurRadius": { + "$ref": "Dimension", + "description": "The radius of the shadow blur. The larger the radius, the more diffuse the\nshadow becomes." } }, "id": "Shadow" }, + "UngroupObjectsRequest": { + "description": "Ungroups objects, such as groups.", + "type": "object", + "properties": { + "objectIds": { + "description": "The object IDs of the objects to ungroup.\n\nOnly groups that are not inside other\ngroups can be ungrouped. All the groups\nshould be on the same page. The group itself is deleted. The visual sizes\nand positions of all the children are preserved.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "UngroupObjectsRequest" + }, "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" + "$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" + "type": "string", + "description": "The table to delete rows from." } - } + }, + "id": "DeleteTableRowRequest" }, "Bullet": { "description": "Describes the bullet of a paragraph.", "type": "object", "properties": { + "nestingLevel": { + "type": "integer", + "description": "The nesting level of this paragraph in the list.", + "format": "int32" + }, + "bulletStyle": { + "description": "The paragraph specific text style applied to this bullet.", + "$ref": "TextStyle" + }, "listId": { "description": "The ID of the list this paragraph belongs to.", "type": "string" @@ -2039,42 +1674,33 @@ "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" + "$ref": "SolidFill", + "description": "Solid color fill." } }, - "id": "OutlineFill" + "id": "OutlineFill", + "description": "The fill of the outline.", + "type": "object" }, "TableCellLocation": { "description": "A location of a single table cell within a table.", "type": "object", "properties": { - "columnIndex": { + "rowIndex": { + "description": "The 0-based row index.", "format": "int32", - "description": "The 0-based column index.", "type": "integer" }, - "rowIndex": { + "columnIndex": { + "description": "The 0-based column index.", "format": "int32", - "description": "The 0-based row index.", "type": "integer" } }, @@ -2096,69 +1722,217 @@ "type": "object", "properties": { "occurrencesChanged": { - "format": "int32", "description": "The number of occurrences changed by replacing all text.", + "format": "int32", "type": "integer" } }, "id": "ReplaceAllTextResponse" }, + "TableBorderFill": { + "description": "The fill of the border.", + "type": "object", + "properties": { + "solidFill": { + "description": "Solid fill.", + "$ref": "SolidFill" + } + }, + "id": "TableBorderFill" + }, "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." + "textRange": { + "description": "The range of text containing the paragraph(s) to style.", + "$ref": "Range" }, "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" }, + "style": { + "description": "The paragraph's style.", + "$ref": "ParagraphStyle" + }, "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.", + "format": "google-fieldmask", "type": "string" } }, "id": "UpdateParagraphStyleRequest" }, "ColorScheme": { + "id": "ColorScheme", "description": "The palette of predefined colors for a page.", "type": "object", "properties": { "colors": { + "description": "The ThemeColorType and corresponding concrete color pairs.", + "type": "array", "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": { + "enumDescriptions": [ + "The shape type that is not predefined.", + "Text box shape.", + "Rectangle shape. Corresponds to ECMA-376 ST_ShapeType 'rect'.", + "Round corner rectangle shape. Corresponds to ECMA-376 ST_ShapeType\n'roundRect'", + "Ellipse shape. Corresponds to ECMA-376 ST_ShapeType 'ellipse'", + "Curved arc shape. Corresponds to ECMA-376 ST_ShapeType 'arc'", + "Bent arrow shape. Corresponds to ECMA-376 ST_ShapeType 'bentArrow'", + "Bent up arrow shape. Corresponds to ECMA-376 ST_ShapeType 'bentUpArrow'", + "Bevel shape. Corresponds to ECMA-376 ST_ShapeType 'bevel'", + "Block arc shape. Corresponds to ECMA-376 ST_ShapeType 'blockArc'", + "Brace pair shape. Corresponds to ECMA-376 ST_ShapeType 'bracePair'", + "Bracket pair shape. Corresponds to ECMA-376 ST_ShapeType 'bracketPair'", + "Can shape. Corresponds to ECMA-376 ST_ShapeType 'can'", + "Chevron shape. Corresponds to ECMA-376 ST_ShapeType 'chevron'", + "Chord shape. Corresponds to ECMA-376 ST_ShapeType 'chord'", + "Cloud shape. Corresponds to ECMA-376 ST_ShapeType 'cloud'", + "Corner shape. Corresponds to ECMA-376 ST_ShapeType 'corner'", + "Cube shape. Corresponds to ECMA-376 ST_ShapeType 'cube'", + "Curved down arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'curvedDownArrow'", + "Curved left arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'curvedLeftArrow'", + "Curved right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'curvedRightArrow'", + "Curved up arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'curvedUpArrow'", + "Decagon shape. Corresponds to ECMA-376 ST_ShapeType 'decagon'", + "Diagonal stripe shape. Corresponds to ECMA-376 ST_ShapeType 'diagStripe'", + "Diamond shape. Corresponds to ECMA-376 ST_ShapeType 'diamond'", + "Dodecagon shape. Corresponds to ECMA-376 ST_ShapeType 'dodecagon'", + "Donut shape. Corresponds to ECMA-376 ST_ShapeType 'donut'", + "Double wave shape. Corresponds to ECMA-376 ST_ShapeType 'doubleWave'", + "Down arrow shape. Corresponds to ECMA-376 ST_ShapeType 'downArrow'", + "Callout down arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'downArrowCallout'", + "Folded corner shape. Corresponds to ECMA-376 ST_ShapeType 'foldedCorner'", + "Frame shape. Corresponds to ECMA-376 ST_ShapeType 'frame'", + "Half frame shape. Corresponds to ECMA-376 ST_ShapeType 'halfFrame'", + "Heart shape. Corresponds to ECMA-376 ST_ShapeType 'heart'", + "Heptagon shape. Corresponds to ECMA-376 ST_ShapeType 'heptagon'", + "Hexagon shape. Corresponds to ECMA-376 ST_ShapeType 'hexagon'", + "Home plate shape. Corresponds to ECMA-376 ST_ShapeType 'homePlate'", + "Horizontal scroll shape. Corresponds to ECMA-376 ST_ShapeType\n'horizontalScroll'", + "Irregular seal 1 shape. Corresponds to ECMA-376 ST_ShapeType\n'irregularSeal1'", + "Irregular seal 2 shape. Corresponds to ECMA-376 ST_ShapeType\n'irregularSeal2'", + "Left arrow shape. Corresponds to ECMA-376 ST_ShapeType 'leftArrow'", + "Callout left arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'leftArrowCallout'", + "Left brace shape. Corresponds to ECMA-376 ST_ShapeType 'leftBrace'", + "Left bracket shape. Corresponds to ECMA-376 ST_ShapeType 'leftBracket'", + "Left right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'leftRightArrow'", + "Callout left right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'leftRightArrowCallout'", + "Left right up arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'leftRightUpArrow'", + "Left up arrow shape. Corresponds to ECMA-376 ST_ShapeType 'leftUpArrow'", + "Lightning bolt shape. Corresponds to ECMA-376 ST_ShapeType\n'lightningBolt'", + "Divide math shape. Corresponds to ECMA-376 ST_ShapeType 'mathDivide'", + "Equal math shape. Corresponds to ECMA-376 ST_ShapeType 'mathEqual'", + "Minus math shape. Corresponds to ECMA-376 ST_ShapeType 'mathMinus'", + "Multiply math shape. Corresponds to ECMA-376 ST_ShapeType 'mathMultiply'", + "Not equal math shape. Corresponds to ECMA-376 ST_ShapeType 'mathNotEqual'", + "Plus math shape. Corresponds to ECMA-376 ST_ShapeType 'mathPlus'", + "Moon shape. Corresponds to ECMA-376 ST_ShapeType 'moon'", + "No smoking shape. Corresponds to ECMA-376 ST_ShapeType 'noSmoking'", + "Notched right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'notchedRightArrow'", + "Octagon shape. Corresponds to ECMA-376 ST_ShapeType 'octagon'", + "Parallelogram shape. Corresponds to ECMA-376 ST_ShapeType 'parallelogram'", + "Pentagon shape. Corresponds to ECMA-376 ST_ShapeType 'pentagon'", + "Pie shape. Corresponds to ECMA-376 ST_ShapeType 'pie'", + "Plaque shape. Corresponds to ECMA-376 ST_ShapeType 'plaque'", + "Plus shape. Corresponds to ECMA-376 ST_ShapeType 'plus'", + "Quad-arrow shape. Corresponds to ECMA-376 ST_ShapeType 'quadArrow'", + "Callout quad-arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'quadArrowCallout'", + "Ribbon shape. Corresponds to ECMA-376 ST_ShapeType 'ribbon'", + "Ribbon 2 shape. Corresponds to ECMA-376 ST_ShapeType 'ribbon2'", + "Right arrow shape. Corresponds to ECMA-376 ST_ShapeType 'rightArrow'", + "Callout right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'rightArrowCallout'", + "Right brace shape. Corresponds to ECMA-376 ST_ShapeType 'rightBrace'", + "Right bracket shape. Corresponds to ECMA-376 ST_ShapeType 'rightBracket'", + "One round corner rectangle shape. Corresponds to ECMA-376 ST_ShapeType\n'round1Rect'", + "Two diagonal round corner rectangle shape. Corresponds to ECMA-376\nST_ShapeType 'round2DiagRect'", + "Two same-side round corner rectangle shape. Corresponds to ECMA-376\nST_ShapeType 'round2SameRect'", + "Right triangle shape. Corresponds to ECMA-376 ST_ShapeType 'rtTriangle'", + "Smiley face shape. Corresponds to ECMA-376 ST_ShapeType 'smileyFace'", + "One snip corner rectangle shape. Corresponds to ECMA-376 ST_ShapeType\n'snip1Rect'", + "Two diagonal snip corner rectangle shape. Corresponds to ECMA-376\nST_ShapeType 'snip2DiagRect'", + "Two same-side snip corner rectangle shape. Corresponds to ECMA-376\nST_ShapeType 'snip2SameRect'", + "One snip one round corner rectangle shape. Corresponds to ECMA-376\nST_ShapeType 'snipRoundRect'", + "Ten pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star10'", + "Twelve pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star12'", + "Sixteen pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star16'", + "Twenty four pointed star shape. Corresponds to ECMA-376 ST_ShapeType\n'star24'", + "Thirty two pointed star shape. Corresponds to ECMA-376 ST_ShapeType\n'star32'", + "Four pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star4'", + "Five pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star5'", + "Six pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star6'", + "Seven pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star7'", + "Eight pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star8'", + "Striped right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'stripedRightArrow'", + "Sun shape. Corresponds to ECMA-376 ST_ShapeType 'sun'", + "Trapezoid shape. Corresponds to ECMA-376 ST_ShapeType 'trapezoid'", + "Triangle shape. Corresponds to ECMA-376 ST_ShapeType 'triangle'", + "Up arrow shape. Corresponds to ECMA-376 ST_ShapeType 'upArrow'", + "Callout up arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'upArrowCallout'", + "Up down arrow shape. Corresponds to ECMA-376 ST_ShapeType 'upDownArrow'", + "U-turn arrow shape. Corresponds to ECMA-376 ST_ShapeType 'uturnArrow'", + "Vertical scroll shape. Corresponds to ECMA-376 ST_ShapeType\n'verticalScroll'", + "Wave shape. Corresponds to ECMA-376 ST_ShapeType 'wave'", + "Callout wedge ellipse shape. Corresponds to ECMA-376 ST_ShapeType\n'wedgeEllipseCallout'", + "Callout wedge rectangle shape. Corresponds to ECMA-376 ST_ShapeType\n'wedgeRectCallout'", + "Callout wedge round rectangle shape. Corresponds to ECMA-376 ST_ShapeType\n'wedgeRoundRectCallout'", + "Alternate process flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartAlternateProcess'", + "Collate flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartCollate'", + "Connector flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartConnector'", + "Decision flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartDecision'", + "Delay flow shape. Corresponds to ECMA-376 ST_ShapeType 'flowChartDelay'", + "Display flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartDisplay'", + "Document flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartDocument'", + "Extract flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartExtract'", + "Input output flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartInputOutput'", + "Internal storage flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartInternalStorage'", + "Magnetic disk flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartMagneticDisk'", + "Magnetic drum flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartMagneticDrum'", + "Magnetic tape flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartMagneticTape'", + "Manual input flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartManualInput'", + "Manual operation flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartManualOperation'", + "Merge flow shape. Corresponds to ECMA-376 ST_ShapeType 'flowChartMerge'", + "Multi-document flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartMultidocument'", + "Offline storage flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartOfflineStorage'", + "Off-page connector flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartOffpageConnector'", + "Online storage flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartOnlineStorage'", + "Or flow shape. Corresponds to ECMA-376 ST_ShapeType 'flowChartOr'", + "Predefined process flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartPredefinedProcess'", + "Preparation flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartPreparation'", + "Process flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartProcess'", + "Punched card flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartPunchedCard'", + "Punched tape flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartPunchedTape'", + "Sort flow shape. Corresponds to ECMA-376 ST_ShapeType 'flowChartSort'", + "Summing junction flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartSummingJunction'", + "Terminator flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartTerminator'", + "East arrow shape.", + "Northeast arrow shape.", + "North arrow shape.", + "Speech shape.", + "Star burst shape.", + "Teardrop shape. Corresponds to ECMA-376 ST_ShapeType 'teardrop'", + "Ellipse ribbon shape. Corresponds to ECMA-376 ST_ShapeType\n'ellipseRibbon'", + "Ellipse ribbon 2 shape. Corresponds to ECMA-376 ST_ShapeType\n'ellipseRibbon2'", + "Callout cloud shape. Corresponds to ECMA-376 ST_ShapeType 'cloudCallout'", + "Custom shape." + ], "enum": [ "TYPE_UNSPECIFIED", "TEXT_BOX", @@ -2305,152 +2079,15 @@ "CUSTOM" ], "description": "The type of the shape.", - "type": "string", - "enumDescriptions": [ - "The shape type that is not predefined.", - "Text box shape.", - "Rectangle shape. Corresponds to ECMA-376 ST_ShapeType 'rect'.", - "Round corner rectangle shape. Corresponds to ECMA-376 ST_ShapeType\n'roundRect'", - "Ellipse shape. Corresponds to ECMA-376 ST_ShapeType 'ellipse'", - "Curved arc shape. Corresponds to ECMA-376 ST_ShapeType 'arc'", - "Bent arrow shape. Corresponds to ECMA-376 ST_ShapeType 'bentArrow'", - "Bent up arrow shape. Corresponds to ECMA-376 ST_ShapeType 'bentUpArrow'", - "Bevel shape. Corresponds to ECMA-376 ST_ShapeType 'bevel'", - "Block arc shape. Corresponds to ECMA-376 ST_ShapeType 'blockArc'", - "Brace pair shape. Corresponds to ECMA-376 ST_ShapeType 'bracePair'", - "Bracket pair shape. Corresponds to ECMA-376 ST_ShapeType 'bracketPair'", - "Can shape. Corresponds to ECMA-376 ST_ShapeType 'can'", - "Chevron shape. Corresponds to ECMA-376 ST_ShapeType 'chevron'", - "Chord shape. Corresponds to ECMA-376 ST_ShapeType 'chord'", - "Cloud shape. Corresponds to ECMA-376 ST_ShapeType 'cloud'", - "Corner shape. Corresponds to ECMA-376 ST_ShapeType 'corner'", - "Cube shape. Corresponds to ECMA-376 ST_ShapeType 'cube'", - "Curved down arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'curvedDownArrow'", - "Curved left arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'curvedLeftArrow'", - "Curved right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'curvedRightArrow'", - "Curved up arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'curvedUpArrow'", - "Decagon shape. Corresponds to ECMA-376 ST_ShapeType 'decagon'", - "Diagonal stripe shape. Corresponds to ECMA-376 ST_ShapeType 'diagStripe'", - "Diamond shape. Corresponds to ECMA-376 ST_ShapeType 'diamond'", - "Dodecagon shape. Corresponds to ECMA-376 ST_ShapeType 'dodecagon'", - "Donut shape. Corresponds to ECMA-376 ST_ShapeType 'donut'", - "Double wave shape. Corresponds to ECMA-376 ST_ShapeType 'doubleWave'", - "Down arrow shape. Corresponds to ECMA-376 ST_ShapeType 'downArrow'", - "Callout down arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'downArrowCallout'", - "Folded corner shape. Corresponds to ECMA-376 ST_ShapeType 'foldedCorner'", - "Frame shape. Corresponds to ECMA-376 ST_ShapeType 'frame'", - "Half frame shape. Corresponds to ECMA-376 ST_ShapeType 'halfFrame'", - "Heart shape. Corresponds to ECMA-376 ST_ShapeType 'heart'", - "Heptagon shape. Corresponds to ECMA-376 ST_ShapeType 'heptagon'", - "Hexagon shape. Corresponds to ECMA-376 ST_ShapeType 'hexagon'", - "Home plate shape. Corresponds to ECMA-376 ST_ShapeType 'homePlate'", - "Horizontal scroll shape. Corresponds to ECMA-376 ST_ShapeType\n'horizontalScroll'", - "Irregular seal 1 shape. Corresponds to ECMA-376 ST_ShapeType\n'irregularSeal1'", - "Irregular seal 2 shape. Corresponds to ECMA-376 ST_ShapeType\n'irregularSeal2'", - "Left arrow shape. Corresponds to ECMA-376 ST_ShapeType 'leftArrow'", - "Callout left arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'leftArrowCallout'", - "Left brace shape. Corresponds to ECMA-376 ST_ShapeType 'leftBrace'", - "Left bracket shape. Corresponds to ECMA-376 ST_ShapeType 'leftBracket'", - "Left right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'leftRightArrow'", - "Callout left right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'leftRightArrowCallout'", - "Left right up arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'leftRightUpArrow'", - "Left up arrow shape. Corresponds to ECMA-376 ST_ShapeType 'leftUpArrow'", - "Lightning bolt shape. Corresponds to ECMA-376 ST_ShapeType\n'lightningBolt'", - "Divide math shape. Corresponds to ECMA-376 ST_ShapeType 'mathDivide'", - "Equal math shape. Corresponds to ECMA-376 ST_ShapeType 'mathEqual'", - "Minus math shape. Corresponds to ECMA-376 ST_ShapeType 'mathMinus'", - "Multiply math shape. Corresponds to ECMA-376 ST_ShapeType 'mathMultiply'", - "Not equal math shape. Corresponds to ECMA-376 ST_ShapeType 'mathNotEqual'", - "Plus math shape. Corresponds to ECMA-376 ST_ShapeType 'mathPlus'", - "Moon shape. Corresponds to ECMA-376 ST_ShapeType 'moon'", - "No smoking shape. Corresponds to ECMA-376 ST_ShapeType 'noSmoking'", - "Notched right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'notchedRightArrow'", - "Octagon shape. Corresponds to ECMA-376 ST_ShapeType 'octagon'", - "Parallelogram shape. Corresponds to ECMA-376 ST_ShapeType 'parallelogram'", - "Pentagon shape. Corresponds to ECMA-376 ST_ShapeType 'pentagon'", - "Pie shape. Corresponds to ECMA-376 ST_ShapeType 'pie'", - "Plaque shape. Corresponds to ECMA-376 ST_ShapeType 'plaque'", - "Plus shape. Corresponds to ECMA-376 ST_ShapeType 'plus'", - "Quad-arrow shape. Corresponds to ECMA-376 ST_ShapeType 'quadArrow'", - "Callout quad-arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'quadArrowCallout'", - "Ribbon shape. Corresponds to ECMA-376 ST_ShapeType 'ribbon'", - "Ribbon 2 shape. Corresponds to ECMA-376 ST_ShapeType 'ribbon2'", - "Right arrow shape. Corresponds to ECMA-376 ST_ShapeType 'rightArrow'", - "Callout right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'rightArrowCallout'", - "Right brace shape. Corresponds to ECMA-376 ST_ShapeType 'rightBrace'", - "Right bracket shape. Corresponds to ECMA-376 ST_ShapeType 'rightBracket'", - "One round corner rectangle shape. Corresponds to ECMA-376 ST_ShapeType\n'round1Rect'", - "Two diagonal round corner rectangle shape. Corresponds to ECMA-376\nST_ShapeType 'round2DiagRect'", - "Two same-side round corner rectangle shape. Corresponds to ECMA-376\nST_ShapeType 'round2SameRect'", - "Right triangle shape. Corresponds to ECMA-376 ST_ShapeType 'rtTriangle'", - "Smiley face shape. Corresponds to ECMA-376 ST_ShapeType 'smileyFace'", - "One snip corner rectangle shape. Corresponds to ECMA-376 ST_ShapeType\n'snip1Rect'", - "Two diagonal snip corner rectangle shape. Corresponds to ECMA-376\nST_ShapeType 'snip2DiagRect'", - "Two same-side snip corner rectangle shape. Corresponds to ECMA-376\nST_ShapeType 'snip2SameRect'", - "One snip one round corner rectangle shape. Corresponds to ECMA-376\nST_ShapeType 'snipRoundRect'", - "Ten pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star10'", - "Twelve pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star12'", - "Sixteen pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star16'", - "Twenty four pointed star shape. Corresponds to ECMA-376 ST_ShapeType\n'star24'", - "Thirty two pointed star shape. Corresponds to ECMA-376 ST_ShapeType\n'star32'", - "Four pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star4'", - "Five pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star5'", - "Six pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star6'", - "Seven pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star7'", - "Eight pointed star shape. Corresponds to ECMA-376 ST_ShapeType 'star8'", - "Striped right arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'stripedRightArrow'", - "Sun shape. Corresponds to ECMA-376 ST_ShapeType 'sun'", - "Trapezoid shape. Corresponds to ECMA-376 ST_ShapeType 'trapezoid'", - "Triangle shape. Corresponds to ECMA-376 ST_ShapeType 'triangle'", - "Up arrow shape. Corresponds to ECMA-376 ST_ShapeType 'upArrow'", - "Callout up arrow shape. Corresponds to ECMA-376 ST_ShapeType\n'upArrowCallout'", - "Up down arrow shape. Corresponds to ECMA-376 ST_ShapeType 'upDownArrow'", - "U-turn arrow shape. Corresponds to ECMA-376 ST_ShapeType 'uturnArrow'", - "Vertical scroll shape. Corresponds to ECMA-376 ST_ShapeType\n'verticalScroll'", - "Wave shape. Corresponds to ECMA-376 ST_ShapeType 'wave'", - "Callout wedge ellipse shape. Corresponds to ECMA-376 ST_ShapeType\n'wedgeEllipseCallout'", - "Callout wedge rectangle shape. Corresponds to ECMA-376 ST_ShapeType\n'wedgeRectCallout'", - "Callout wedge round rectangle shape. Corresponds to ECMA-376 ST_ShapeType\n'wedgeRoundRectCallout'", - "Alternate process flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartAlternateProcess'", - "Collate flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartCollate'", - "Connector flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartConnector'", - "Decision flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartDecision'", - "Delay flow shape. Corresponds to ECMA-376 ST_ShapeType 'flowChartDelay'", - "Display flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartDisplay'", - "Document flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartDocument'", - "Extract flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartExtract'", - "Input output flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartInputOutput'", - "Internal storage flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartInternalStorage'", - "Magnetic disk flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartMagneticDisk'", - "Magnetic drum flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartMagneticDrum'", - "Magnetic tape flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartMagneticTape'", - "Manual input flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartManualInput'", - "Manual operation flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartManualOperation'", - "Merge flow shape. Corresponds to ECMA-376 ST_ShapeType 'flowChartMerge'", - "Multi-document flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartMultidocument'", - "Offline storage flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartOfflineStorage'", - "Off-page connector flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartOffpageConnector'", - "Online storage flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartOnlineStorage'", - "Or flow shape. Corresponds to ECMA-376 ST_ShapeType 'flowChartOr'", - "Predefined process flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartPredefinedProcess'", - "Preparation flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartPreparation'", - "Process flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartProcess'", - "Punched card flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartPunchedCard'", - "Punched tape flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartPunchedTape'", - "Sort flow shape. Corresponds to ECMA-376 ST_ShapeType 'flowChartSort'", - "Summing junction flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartSummingJunction'", - "Terminator flow shape. Corresponds to ECMA-376 ST_ShapeType\n'flowChartTerminator'", - "East arrow shape.", - "Northeast arrow shape.", - "North arrow shape.", - "Speech shape.", - "Star burst shape.", - "Teardrop shape. Corresponds to ECMA-376 ST_ShapeType 'teardrop'", - "Ellipse ribbon shape. Corresponds to ECMA-376 ST_ShapeType\n'ellipseRibbon'", - "Ellipse ribbon 2 shape. Corresponds to ECMA-376 ST_ShapeType\n'ellipseRibbon2'", - "Callout cloud shape. Corresponds to ECMA-376 ST_ShapeType 'cloudCallout'", - "Custom shape." - ] + "type": "string" + }, + "text": { + "$ref": "TextContent", + "description": "The text content of the shape." + }, + "placeholder": { + "$ref": "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." }, "shapeProperties": { "$ref": "ShapeProperties", @@ -2462,113 +2099,113 @@ "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" + }, + "imageProperties": { + "$ref": "ImageProperties", + "description": "The properties of the image." } }, "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.", + "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": { + "type": "object", + "properties": { + "scaleX": { + "description": "The X coordinate scaling element.", + "format": "double", + "type": "number" + }, + "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" + }, + "translateX": { + "description": "The X coordinate translation element.", + "format": "double", + "type": "number" + }, + "shearY": { + "description": "The Y coordinate shearing element.", + "format": "double", + "type": "number" + }, "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." + "description": "The units for translate elements.", + "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": "InsertTextRequest", - "description": "Inserts text into a shape or a table cell.", - "type": "object" + "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." }, "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", "SLIDE_NUMBER" ], "description": "The type of this auto text.", + "type": "string", + "enumDescriptions": [ + "An unspecified autotext type.", + "Type for autotext that represents the current 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", @@ -2580,27 +2217,44 @@ "type": "object", "properties": { "objectId": { - "description": "The object ID of the created video.", - "type": "string" + "type": "string", + "description": "The object ID of the created video." } }, "id": "CreateVideoResponse" }, + "DeleteTextRequest": { + "description": "Deletes text from a shape or a table cell.", + "type": "object", + "properties": { + "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." + }, + "objectId": { + "description": "The object ID of the shape or table from which the text will be deleted.", + "type": "string" + }, + "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" + } + }, + "id": "DeleteTextRequest" + }, "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": { - "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" }, + "transform": { + "$ref": "AffineTransform", + "description": "The input transform matrix used to update the page element." + }, "applyMode": { - "type": "string", "enumDescriptions": [ "Unspecified mode.", "Applies the new AffineTransform matrix to the existing one, and\nreplaces the existing one with the resulting concatenation.", @@ -2611,76 +2265,30 @@ "RELATIVE", "ABSOLUTE" ], - "description": "The apply mode of the transform update." - } - } - }, - "DeleteTextRequest": { - "id": "DeleteTextRequest", - "description": "Deletes text from a shape or a table cell.", - "type": "object", - "properties": { - "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 shape or table from which the text will be deleted.", + "description": "The apply mode of the transform update.", "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": "UpdatePageElementTransformRequest" }, "DeleteObjectRequest": { - "id": "DeleteObjectRequest", "description": "Deletes an object, either pages or\npage elements, from the\npresentation.", "type": "object", "properties": { "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." + "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" } - } - }, - "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" - }, - "startIndex": { - "format": "int32", - "description": "The zero-based start index of this text element, in Unicode code units.", - "type": "integer" - } - } + }, + "id": "DeleteObjectRequest" }, "Dimension": { "description": "A magnitude in a single direction in the specified units.", "type": "object", "properties": { "magnitude": { - "format": "double", "description": "The magnitude.", + "format": "double", "type": "number" }, "unit": { @@ -2700,6 +2308,35 @@ }, "id": "Dimension" }, + "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." + }, + "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" + }, "LineFill": { "description": "The fill of the line.", "type": "object", @@ -2712,27 +2349,28 @@ "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" + "id": "VideoProperties", + "description": "The properties of the Video.", + "type": "object" }, "InsertTableRowsRequest": { + "description": "Inserts rows into a table.", "type": "object", "properties": { "number": { - "format": "int32", "description": "The number of rows to be inserted. Maximum 20 per request.", + "format": "int32", "type": "integer" }, "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" + "$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." }, "tableObjectId": { "description": "The table to insert rows into.", @@ -2743,17 +2381,13 @@ "type": "boolean" } }, - "id": "InsertTableRowsRequest", - "description": "Inserts rows into a table." + "id": "InsertTableRowsRequest" }, "LayoutProperties": { + "id": "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" @@ -2761,23 +2395,31 @@ "displayName": { "description": "The human-readable name of the layout.", "type": "string" + }, + "masterObjectId": { + "type": "string", + "description": "The object ID of the master that this layout is based on." } - }, - "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." + "link": { + "description": "The hyperlink destination of the line. If unset, there is no link.", + "$ref": "Link" }, "dashStyle": { + "enum": [ + "DASH_STYLE_UNSPECIFIED", + "SOLID", + "DOT", + "DASH", + "DASH_DOT", + "LONG_DASH", + "LONG_DASH_DOT" + ], "description": "The dash style of the line.", "type": "string", "enumDescriptions": [ @@ -2788,52 +2430,10 @@ "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" ] }, - "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.", @@ -2860,63 +2460,100 @@ "OPEN_CIRCLE", "OPEN_SQUARE", "OPEN_DIAMOND" + ] + }, + "endArrow": { + "description": "The style of the arrow at the end of the line.", + "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." ], - "description": "The style of the arrow at the end of the line." + "enum": [ + "ARROW_STYLE_UNSPECIFIED", + "NONE", + "STEALTH_ARROW", + "FILL_ARROW", + "FILL_CIRCLE", + "FILL_SQUARE", + "FILL_DIAMOND", + "OPEN_ARROW", + "OPEN_CIRCLE", + "OPEN_SQUARE", + "OPEN_DIAMOND" + ] + }, + "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." } }, "id": "LineProperties" }, "Presentation": { - "description": "A Google Slides presentation.", - "type": "object", "properties": { + "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" + } + }, + "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.", - "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.", + "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" - }, - "type": "array" + } + }, + "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" + } }, "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" + "description": "The size of pages in the presentation.", + "$ref": "Size" } }, - "id": "Presentation" + "id": "Presentation", + "description": "A Google Slides presentation.", + "type": "object" }, "OpaqueColor": { "description": "A themeable solid color value.", @@ -2927,25 +2564,6 @@ "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": [ @@ -2966,60 +2584,79 @@ "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" ] } }, "id": "OpaqueColor" }, "ImageProperties": { - "description": "The properties of the Image.", - "type": "object", "properties": { + "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": { "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." + "description": "The hyperlink destination of the image. If unset, there is no link.", + "$ref": "Link" }, - "recolor": { - "description": "The recolor effect of the image. If not set, the image is not recolored.\nThis property is read-only.", - "$ref": "Recolor" + "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" }, "cropProperties": { "$ref": "CropProperties", "description": "The crop properties of the image. If not set, the image is not cropped.\nThis property is read-only." }, + "recolor": { + "$ref": "Recolor", + "description": "The recolor effect of the image. If not set, the image is not recolored.\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." + "description": "The outline of the image. If not set, the image has no outline.", + "$ref": "Outline" } }, - "id": "ImageProperties" + "id": "ImageProperties", + "description": "The properties of the Image.", + "type": "object" }, "ReplaceAllShapesWithImageResponse": { "description": "The result of replacing shapes with an image.", "type": "object", "properties": { "occurrencesChanged": { - "format": "int32", "description": "The number of shapes replaced with images.", + "format": "int32", "type": "integer" } }, @@ -3030,6 +2667,8 @@ "type": "object", "properties": { "lineType": { + "description": "The type of the line.", + "type": "string", "enumDescriptions": [ "An unspecified line type.", "Straight connector 1 form. Corresponds to ECMA-376 ST_ShapeType\n'straightConnector1'.", @@ -3053,13 +2692,11 @@ "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." + "description": "The properties of the line.", + "$ref": "LineProperties" } }, "id": "Line" @@ -3074,23 +2711,31 @@ }, "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" - }, - "type": "array" + } } }, "id": "BatchUpdatePresentationResponse" }, "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", "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": { + "type": "string", + "description": "The ID of the Google Sheets spreadsheet that contains the chart." + }, "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.", @@ -3099,24 +2744,16 @@ "enum": [ "NOT_LINKED_IMAGE", "LINKED" - ] - }, - "spreadsheetId": { - "description": "The ID of the Google Sheets spreadsheet that contains the chart.", - "type": "string" + ], + "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." }, "chartId": { - "type": "integer", + "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." - }, - "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" + "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." + "id": "CreateSheetsChartRequest" }, "CreateImageResponse": { "description": "The result of creating an image.", @@ -3133,24 +2770,49 @@ "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." + "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" }, - "layoutObjectId": { - "description": "The object ID of the layout that this slide is based on.", - "type": "string" + "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." } }, "id": "SlideProperties" }, "Response": { + "description": "A single response from an update.", "type": "object", "properties": { + "replaceAllShapesWithImage": { + "$ref": "ReplaceAllShapesWithImageResponse", + "description": "The result of replacing all shapes matching some criteria with an\nimage." + }, + "createTable": { + "description": "The result of creating a table.", + "$ref": "CreateTableResponse" + }, + "replaceAllText": { + "$ref": "ReplaceAllTextResponse", + "description": "The result of replacing text." + }, + "createSlide": { + "$ref": "CreateSlideResponse", + "description": "The result of creating a slide." + }, + "duplicateObject": { + "$ref": "DuplicateObjectResponse", + "description": "The result of duplicating an object." + }, + "createLine": { + "description": "The result of creating a line.", + "$ref": "CreateLineResponse" + }, "createImage": { "$ref": "CreateImageResponse", "description": "The result of creating an image." @@ -3164,40 +2826,19 @@ "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." + "description": "The result of creating a Google Sheets chart.", + "$ref": "CreateSheetsChartResponse" }, - "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" + "groupObjects": { + "$ref": "GroupObjectsResponse", + "description": "The result of grouping objects." }, "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." + "id": "Response" }, "MasterProperties": { "description": "The properties of Page that are only\nrelevant for pages with page_type MASTER.", @@ -3211,41 +2852,25 @@ "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" + "type": "string", + "description": "The text of this run." }, "style": { - "$ref": "TextStyle", - "description": "The styling applied to this run." + "description": "The styling applied to this run.", + "$ref": "TextStyle" } - } + }, + "id": "TextRun" }, "LayoutReference": { + "description": "Slide layout reference. This may reference either:\n\n- A predefined layout\n- One of the layouts in the presentation.", + "type": "object", "properties": { - "layoutId": { - "description": "Layout ID: the object ID of one of the layouts in the presentation.", - "type": "string" - }, "predefinedLayout": { - "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", @@ -3261,157 +2886,211 @@ "BIG_NUMBER" ], "description": "Predefined layout.", + "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." + ] + }, + "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.", - "type": "object" + "id": "LayoutReference" }, "SubstringMatchCriteria": { + "id": "SubstringMatchCriteria", + "description": "A criteria that matches a specific string of text in a shape or table.", "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" + }, + "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." + } }, "TableRange": { + "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", "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": { + "rowSpan": { + "description": "The row span of the table range.", "format": "int32", + "type": "integer" + }, + "columnSpan": { "description": "The column span of the table range.", + "format": "int32", "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" + "id": "CreateTableResponse", + "description": "The result of creating a table.", + "type": "object" }, "CreateTableRequest": { "description": "Creates a new table.", "type": "object", "properties": { - "columns": { + "rows": { + "description": "Number of rows in the table.", "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": { + "columns": { + "description": "Number of columns in the table.", "format": "int32", - "description": "Number of rows in the table.", "type": "integer" + }, + "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" } }, "id": "CreateTableRequest" }, + "GroupObjectsRequest": { + "description": "Groups objects to create an object group. For example, groups PageElements to create a Group on the same page as all the children.", + "type": "object", + "properties": { + "groupObjectId": { + "description": "A user-supplied object ID for the group to be created.\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" + }, + "childrenObjectIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The object IDs of the objects to group.\n\nOnly page elements can be grouped. There should be at least two page\nelements on the same page that are not already in another group. Some page\nelements, such as videos, tables and placeholder shapes cannot be grouped." + } + }, + "id": "GroupObjectsRequest" + }, "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.", + "type": "array", "items": { "$ref": "TableColumnProperties" - }, - "type": "array" + } }, "columns": { - "format": "int32", "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" + } + }, + "horizontalBorderRows": { + "type": "array", + "items": { + "$ref": "TableBorderRow" }, - "type": "array" + "description": "Properties of horizontal cell borders.\n\nA table's horizontal cell borders are represented as a grid. The grid has\none more row than the number of rows in the table and the same number of\ncolumns as the table. For example, if the table is 3 x 3, its horizontal\nborders will be represented as a grid with 4 rows and 3 columns." + }, + "verticalBorderRows": { + "description": "Properties of vertical cell borders.\n\nA table's vertical cell borders are represented as a grid. The grid has the\nsame number of rows as the table and one more column than the number of\ncolumns in the table. For example, if the table is 3 x 3, its vertical\nborders will be represented as a grid with 3 rows and 4 columns.", + "type": "array", + "items": { + "$ref": "TableBorderRow" + } + }, + "rows": { + "description": "Number of rows in the table.", + "format": "int32", + "type": "integer" } }, "id": "Table" }, + "TableBorderRow": { + "description": "Contents of each border row in a table.", + "type": "object", + "properties": { + "tableBorderCells": { + "description": "Properties of each border cell. When a border's adjacent table cells are\nmerged, it is not included in the response.", + "type": "array", + "items": { + "$ref": "TableBorderCell" + } + } + }, + "id": "TableBorderRow" + }, "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 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" + "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." + ] }, "stretchedPictureFill": { "$ref": "StretchedPictureFill", "description": "Stretched picture fill." }, "solidFill": { - "$ref": "SolidFill", - "description": "Solid color fill." + "description": "Solid color fill.", + "$ref": "SolidFill" } }, - "id": "PageBackgroundFill", - "description": "The page background 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": { - "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." @@ -3419,56 +3098,39 @@ "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" + }, + "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" } }, - "id": "SheetsChart", - "description": "A PageElement kind representing\na linked chart embedded from Google Sheets." + "id": "SheetsChart" }, "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": { - "format": "float", + "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.", - "type": "number" + "format": "float" }, "color": { - "$ref": "OpaqueColor", - "description": "The color value of the solid fill." + "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": { - "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." - ], "enum": [ "THEME_COLOR_TYPE_UNSPECIFIED", "DARK1", @@ -3488,23 +3150,50 @@ "TEXT2", "BACKGROUND2" ], - "description": "The type of the theme color." + "description": "The type of the 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." + ] + }, + "color": { + "$ref": "RgbColor", + "description": "The concrete color corresponding to the theme color type above." } }, - "id": "ThemeColorPair" + "id": "ThemeColorPair", + "description": "A pair mapping a theme color type to the concrete color it represents." }, "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." + "description": "If set, this will be used as an opaque color. If unset, this represents\na transparent color.", + "$ref": "OpaqueColor" } }, "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": { "pageObjectId": { "description": "The object ID of the page where the element is located.", @@ -3519,60 +3208,58 @@ "description": "The transform for the element." } }, - "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" + "id": "PageElementProperties" }, "SheetsChartProperties": { + "description": "The properties of the SheetsChart.", "type": "object", "properties": { "chartImageProperties": { - "$ref": "ImageProperties", - "description": "The properties of the embedded chart image." + "description": "The properties of the embedded chart image.", + "$ref": "ImageProperties" } }, - "id": "SheetsChartProperties", - "description": "The properties of the SheetsChart." + "id": "SheetsChartProperties" }, "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" + "$ref": "Size", + "description": "The original size of the picture fill. This field is read-only." + }, + "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 most 2 kB in length.", + "type": "string" } }, - "id": "StretchedPictureFill" + "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": { "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 shape or table with the text to be styled." + "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." }, - "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", + "type": "string", "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" + }, + "objectId": { + "description": "The object ID of the shape or table with the text to be styled.", "type": "string" + }, + "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" } }, "id": "UpdateTextStyleRequest" @@ -3582,8 +3269,8 @@ "type": "object", "properties": { "cellLocation": { - "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" + "$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": { "description": "The table to delete columns from.", @@ -3593,29 +3280,975 @@ "id": "DeleteTableColumnRequest" }, "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" - }, - "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" + "id": "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." + }, + "WeightedFontFamily": { + "description": "Represents a font family and weight used to style a TextRun.", + "type": "object", + "properties": { + "fontFamily": { + "type": "string", + "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`." + }, + "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" + }, + "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": { + "$ref": "SheetsChart", + "description": "A linked chart embedded from Google Sheets. Unlinked charts are\nrepresented as images." + }, + "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." + }, + "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." + }, + "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" + }, + "shape": { + "description": "A generic shape.", + "$ref": "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": { + "description": "A collection of page elements joined as a single unit.", + "$ref": "Group" + }, + "image": { + "description": "An image page element.", + "$ref": "Image" + }, + "size": { + "$ref": "Size", + "description": "The size of the page element." + } + }, + "id": "PageElement" + }, + "CreateImageRequest": { + "description": "Creates an image.", + "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." + }, + "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.\n\nThe PageElementProperties.size property is\noptional. If you don't specify the size, the default size of the image is\nused.\n\nThe PageElementProperties.transform property is\noptional. If you don't specify a transform, the image will be placed at the\ntop left corner of the page.", + "$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 most 2 kB in length.", + "type": "string" + } + }, + "id": "CreateImageRequest" + }, + "CreateParagraphBulletsRequest": { + "properties": { + "objectId": { + "type": "string", + "description": "The object ID of the shape or table containing the text to add bullets to." + }, + "textRange": { + "$ref": "Range", + "description": "The range of text to apply the bullet presets to, based on TextElement indexes." + }, + "bulletPreset": { + "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" + ], + "description": "The kinds of bullet glyphs to be used. Defaults to the\n`BULLET_DISC_CIRCLE_SQUARE` preset." + }, + "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": "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": { + "description": "A width and height.", + "type": "object", + "properties": { + "height": { + "$ref": "Dimension", + "description": "The height of the object." + }, + "width": { + "$ref": "Dimension", + "description": "The width of the object." + } + }, + "id": "Size" + }, + "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": { + "smallCaps": { + "description": "Whether or not the text is in small capital letters.", + "type": "boolean" + }, + "backgroundColor": { + "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.", + "$ref": "OptionalColor" + }, + "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": { + "type": "boolean", + "description": "Whether or not the text is underlined." + }, + "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" + }, + "bold": { + "description": "Whether or not the text is rendered as bold.", + "type": "boolean" + }, + "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" + }, + "strikethrough": { + "type": "boolean", + "description": "Whether or not the text is struck through." + }, + "italic": { + "description": "Whether or not the text is italicized.", + "type": "boolean" + }, + "fontSize": { + "$ref": "Dimension", + "description": "The size of the text's font. When read, the `font_size` will specified in\npoints." + }, + "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." + } + }, + "id": "TextStyle" + }, + "UpdateVideoPropertiesRequest": { + "type": "object", + "properties": { + "objectId": { + "description": "The object ID of the video the updates are applied to.", + "type": "string" + }, + "videoProperties": { + "$ref": "VideoProperties", + "description": "The video properties to update." + }, + "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" + } + }, + "id": "UpdateVideoPropertiesRequest", + "description": "Update the properties of a Video." + }, + "Request": { + "properties": { + "deleteText": { + "description": "Deletes text from a shape or a table cell.", + "$ref": "DeleteTextRequest" + }, + "updatePageProperties": { + "$ref": "UpdatePagePropertiesRequest", + "description": "Updates the properties of a Page." + }, + "deleteParagraphBullets": { + "description": "Deletes bullets from paragraphs.", + "$ref": "DeleteParagraphBulletsRequest" + }, + "createShape": { + "description": "Creates a new shape.", + "$ref": "CreateShapeRequest" + }, + "updateTableBorderProperties": { + "description": "Updates the properties of the table borders in a Table.", + "$ref": "UpdateTableBorderPropertiesRequest" + }, + "insertTableColumns": { + "$ref": "InsertTableColumnsRequest", + "description": "Inserts columns into a table." + }, + "mergeTableCells": { + "$ref": "MergeTableCellsRequest", + "description": "Merges cells in a Table." + }, + "refreshSheetsChart": { + "$ref": "RefreshSheetsChartRequest", + "description": "Refreshes a Google Sheets chart." + }, + "createTable": { + "$ref": "CreateTableRequest", + "description": "Creates a new table." + }, + "updateTableCellProperties": { + "description": "Updates the properties of a TableCell.", + "$ref": "UpdateTableCellPropertiesRequest" + }, + "deleteObject": { + "description": "Deletes a page or page element from the presentation.", + "$ref": "DeleteObjectRequest" + }, + "updateParagraphStyle": { + "$ref": "UpdateParagraphStyleRequest", + "description": "Updates the styling of paragraphs within a Shape or Table." + }, + "deleteTableColumn": { + "$ref": "DeleteTableColumnRequest", + "description": "Deletes a column from a table." + }, + "duplicateObject": { + "$ref": "DuplicateObjectRequest", + "description": "Duplicates a slide or page element." + }, + "updateVideoProperties": { + "$ref": "UpdateVideoPropertiesRequest", + "description": "Updates the properties of a Video." + }, + "createLine": { + "description": "Creates a line.", + "$ref": "CreateLineRequest" + }, + "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" + }, + "unmergeTableCells": { + "$ref": "UnmergeTableCellsRequest", + "description": "Unmerges cells in a Table." + }, + "updatePageElementTransform": { + "description": "Updates the transform of a page element.", + "$ref": "UpdatePageElementTransformRequest" + }, + "updateTextStyle": { + "description": "Updates the styling of text within a Shape or Table.", + "$ref": "UpdateTextStyleRequest" + }, + "updateTableRowProperties": { + "description": "Updates the properties of a Table row.", + "$ref": "UpdateTableRowPropertiesRequest" + }, + "replaceAllShapesWithImage": { + "$ref": "ReplaceAllShapesWithImageRequest", + "description": "Replaces all shapes matching some criteria with an image." + }, + "replaceAllText": { + "$ref": "ReplaceAllTextRequest", + "description": "Replaces all instances of specified text." + }, + "updateImageProperties": { + "description": "Updates the properties of an Image.", + "$ref": "UpdateImagePropertiesRequest" + }, + "createSlide": { + "description": "Creates a new slide.", + "$ref": "CreateSlideRequest" + }, + "insertTableRows": { + "$ref": "InsertTableRowsRequest", + "description": "Inserts rows into a table." + }, + "updateLineProperties": { + "description": "Updates the properties of a Line.", + "$ref": "UpdateLinePropertiesRequest" + }, + "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": { + "description": "Updates the properties of a Shape.", + "$ref": "UpdateShapePropertiesRequest" + }, + "groupObjects": { + "description": "Groups objects, such as page elements.", + "$ref": "GroupObjectsRequest" + }, + "ungroupObjects": { + "description": "Ungroups objects, such as groups.", + "$ref": "UngroupObjectsRequest" + }, + "insertText": { + "description": "Inserts text into a shape or table cell.", + "$ref": "InsertTextRequest" + }, + "updateTableColumnProperties": { + "description": "Updates the properties of a Table\ncolumn.", + "$ref": "UpdateTableColumnPropertiesRequest" + } + }, + "id": "Request", + "description": "A single kind of update to apply to a presentation.", + "type": "object" + }, + "UpdateImagePropertiesRequest": { + "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": { + "type": "string", + "description": "The object ID of the image the updates are applied to." + } + }, + "id": "UpdateImagePropertiesRequest", + "description": "Update the properties of an Image." + }, + "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": { + "spacingMode": { + "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." + ], + "enum": [ + "SPACING_MODE_UNSPECIFIED", + "NEVER_COLLAPSE", + "COLLAPSE_LISTS" + ] + }, + "indentEnd": { + "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.", + "$ref": "Dimension" + }, + "indentStart": { + "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.", + "$ref": "Dimension" + }, + "spaceAbove": { + "$ref": "Dimension", + "description": "The amount of extra space above the paragraph. If unset, the value is\ninherited from the parent." + }, + "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." + ] + }, + "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" + }, + "indentFirstLine": { + "$ref": "Dimension", + "description": "The amount of indentation for the start of the first line of the paragraph.\nIf unset, the value is inherited from the parent." + }, + "spaceBelow": { + "$ref": "Dimension", + "description": "The amount of extra space above the paragraph. If unset, the value is\ninherited from the parent." + }, + "direction": { + "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" + ], + "description": "The text direction of this paragraph. If unset, the value defaults to\nLEFT_TO_RIGHT since\ntext direction is not inherited.", + "type": "string" + } + }, + "id": "ParagraphStyle" + }, + "UpdateTableRowPropertiesRequest": { + "properties": { + "fields": { + "description": "The fields that should be updated.\n\nAt least one field must be specified. The root `tableRowProperties` 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 minimum row height, set `fields` to\n`\"min_row_height\"`.\n\nIf '\"min_row_height\"' is included in the field mask but the property is\nleft unset, the minimum row height will default to 0.", + "format": "google-fieldmask", + "type": "string" + }, + "tableRowProperties": { + "$ref": "TableRowProperties", + "description": "The table row properties to update." + }, + "objectId": { + "description": "The object ID of the table.", + "type": "string" + }, + "rowIndices": { + "type": "array", + "items": { + "format": "int32", + "type": "integer" + }, + "description": "The list of zero-based indices specifying which rows to update. If no\nindices are provided, all rows in the table will be updated." + } + }, + "id": "UpdateTableRowPropertiesRequest", + "description": "Updates the properties of a Table row.", + "type": "object" + }, + "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": { + "id": "TableCellProperties", + "description": "The properties of the TableCell.", + "type": "object", + "properties": { + "tableCellBackgroundFill": { + "description": "The background fill of the table cell. The default fill matches the fill\nfor newly created table cells in the Slides editor.", + "$ref": "TableCellBackgroundFill" + }, + "contentAlignment": { + "enum": [ + "CONTENT_ALIGNMENT_UNSPECIFIED", + "CONTENT_ALIGNMENT_UNSUPPORTED", + "TOP", + "MIDDLE", + "BOTTOM" + ], + "description": "The alignment of the content in the table cell. The default alignment\nmatches the alignment for newly created table cells in the Slides editor.", + "type": "string", + "enumDescriptions": [ + "An unspecified content alignment. The content alignment is inherited from\nthe parent if it exists.", + "An unsupported content alignment.", + "An alignment that aligns the content to the top of the content holder.\nCorresponds to ECMA-376 ST_TextAnchoringType 't'.", + "An alignment that aligns the content to the middle of the content\nholder. Corresponds to ECMA-376 ST_TextAnchoringType 'ctr'.", + "An alignment that aligns the content to the bottom of the content\nholder. Corresponds to ECMA-376 ST_TextAnchoringType 'b'." + ] + } + } + }, + "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" + }, + "Outline": { + "type": "object", + "properties": { + "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": { + "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 outline on a page element will implicitly update this field\nto `RENDERED`, unless another value is specified in the same request. To\nhave 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" + }, + "outlineFill": { + "description": "The fill of the outline.", + "$ref": "OutlineFill" + }, + "weight": { + "$ref": "Dimension", + "description": "The thickness 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." + }, + "NotesProperties": { + "description": "The properties of Page that are only\nrelevant for pages with page_type NOTES.", + "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" + }, + "TableColumnProperties": { + "description": "Properties of each column in a table.", + "type": "object", + "properties": { + "columnWidth": { + "$ref": "Dimension", + "description": "Width of a column." + } + }, + "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": { + "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.", + "$ref": "Outline" + }, + "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." + }, + "contentAlignment": { + "description": "The alignment of the content in the shape. If unspecified,\nthe alignment is inherited from a parent placeholder if it exists. If the\nshape has no parent, the default alignment matches the alignment for new\nshapes created in the Slides editor.", + "type": "string", + "enumDescriptions": [ + "An unspecified content alignment. The content alignment is inherited from\nthe parent if it exists.", + "An unsupported content alignment.", + "An alignment that aligns the content to the top of the content holder.\nCorresponds to ECMA-376 ST_TextAnchoringType 't'.", + "An alignment that aligns the content to the middle of the content\nholder. Corresponds to ECMA-376 ST_TextAnchoringType 'ctr'.", + "An alignment that aligns the content to the bottom of the content\nholder. Corresponds to ECMA-376 ST_TextAnchoringType 'b'." + ], + "enum": [ + "CONTENT_ALIGNMENT_UNSPECIFIED", + "CONTENT_ALIGNMENT_UNSUPPORTED", + "TOP", + "MIDDLE", + "BOTTOM" + ] + }, + "link": { + "$ref": "Link", + "description": "The hyperlink destination of the shape. If unset, there is no link. Links\nare not inherited from parent placeholders." + } + }, + "id": "ShapeProperties" + }, + "TableRow": { + "description": "Properties and contents of each row in a table.", + "type": "object", + "properties": { + "tableRowProperties": { + "$ref": "TableRowProperties", + "description": "Properties of the row." + }, + "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": { + "tableCellProperties": { + "$ref": "TableCellProperties", + "description": "The table cell properties to update." + }, + "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": { + "$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." + } + }, + "id": "UpdateTableCellPropertiesRequest" + }, + "CreateSlideRequest": { + "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" + }, + "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" + } + }, + "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" + } + }, + "id": "CreateSlideRequest", + "description": "Creates a new slide.", + "type": "object" + }, + "BatchUpdatePresentationRequest": { + "description": "Request message for PresentationsService.BatchUpdatePresentation.", + "type": "object", + "properties": { + "writeControl": { + "$ref": "WriteControl", + "description": "Provides control over how write requests are executed." + }, + "requests": { + "description": "A list of updates to apply to the presentation.", + "type": "array", + "items": { + "$ref": "Request" + } + } + }, + "id": "BatchUpdatePresentationRequest" + }, + "TableRowProperties": { + "description": "Properties of each row in a table.", + "type": "object", + "properties": { + "minRowHeight": { + "$ref": "Dimension", + "description": "Minimum height of the row. The row will be rendered in the Slides editor at\na height equal to or greater than this value in order to show all the text\nin the row's cell(s)." + } + }, + "id": "TableRowProperties" + }, + "GroupObjectsResponse": { + "description": "The result of grouping objects.", + "type": "object", + "properties": { + "objectId": { + "description": "The object ID of the created group.", + "type": "string" + } + }, + "id": "GroupObjectsResponse" + }, + "TableBorderProperties": { + "id": "TableBorderProperties", + "description": "The border styling properties of the\nTableBorderCell.", + "type": "object", + "properties": { + "weight": { + "description": "The thickness of the border.", + "$ref": "Dimension" + }, + "tableBorderFill": { + "$ref": "TableBorderFill", + "description": "The fill of the table border." + }, + "dashStyle": { + "enum": [ + "DASH_STYLE_UNSPECIFIED", + "SOLID", + "DOT", + "DASH", + "DASH_DOT", + "LONG_DASH", + "LONG_DASH_DOT" + ], + "description": "The dash style of the border.", + "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'." + ] + } + } + }, + "TableBorderCell": { + "type": "object", + "properties": { + "location": { + "$ref": "TableCellLocation", + "description": "The location of the border within the border table." + }, + "tableBorderProperties": { + "description": "The border properties.", + "$ref": "TableBorderProperties" + } + }, + "id": "TableBorderCell", + "description": "The properties of each border cell." + }, + "TextContent": { + "properties": { + "lists": { + "description": "The bulleted lists contained in this text, keyed by list ID.", + "type": "object", + "additionalProperties": { + "$ref": "List" + } + }, + "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": { + "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", + "description": "Provides control over how write requests are executed." + }, + "DeleteParagraphBulletsRequest": { + "properties": { + "objectId": { + "description": "The object ID of the shape or table containing the text to delete bullets\nfrom.", + "type": "string" + }, + "textRange": { + "description": "The range of text to delete bullets from, based on TextElement indexes.", + "$ref": "Range" + }, + "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", + "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" + } + } } }, - "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": "Slides", "auth": { "oauth2": { @@ -3626,15 +4259,18 @@ "https://www.googleapis.com/auth/presentations.readonly": { "description": "View your Google Slides presentations" }, + "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.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/drive.readonly": { - "description": "View the files in your Google Drive" - }, "https://www.googleapis.com/auth/spreadsheets": { "description": "View and manage your spreadsheets in Google Drive" } @@ -3645,280 +4281,5 @@ "ownerDomain": "google.com", "name": "slides", "batchPath": "batch", - "title": "Google Slides API", - "ownerName": "Google", - "resources": { - "presentations": { - "methods": { - "get": { - "path": "v1/presentations/{+presentationId}", - "id": "slides.presentations.get", - "description": "Gets the latest version of the specified presentation.", - "httpMethod": "GET", - "response": { - "$ref": "Presentation" - }, - "parameterOrder": [ - "presentationId" - ], - "parameters": { - "presentationId": { - "location": "path", - "description": "The ID of the presentation to retrieve.", - "type": "string", - "required": true, - "pattern": "^[^/]+$" - } - }, - "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" - ], - "flatPath": "v1/presentations/{presentationsId}" - }, - "batchUpdate": { - "response": { - "$ref": "BatchUpdatePresentationResponse" - }, - "parameterOrder": [ - "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", - "https://www.googleapis.com/auth/presentations", - "https://www.googleapis.com/auth/spreadsheets", - "https://www.googleapis.com/auth/spreadsheets.readonly" - ], - "flatPath": "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": { - "response": { - "$ref": "Page" - }, - "parameterOrder": [ - "presentationId", - "pageObjectId" - ], - "httpMethod": "GET", - "parameters": { - "pageObjectId": { - "location": "path", - "description": "The object ID of the page to retrieve.", - "type": "string", - "required": true - }, - "presentationId": { - "description": "The ID of the presentation to retrieve.", - "type": "string", - "required": true, - "location": "path" - } - }, - "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" - ], - "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." - } - } - } - } - } - }, - "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": { - "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": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" - }, - "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": { - "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://slides.googleapis.com/", - "description": "An API for creating and editing Google Slides presentations.", - "kind": "discovery#restDescription", - "servicePath": "", - "basePath": "", - "revision": "20170926", - "documentationLink": "https://developers.google.com/slides/", - "id": "slides:v1", - "discoveryVersion": "v1", - "version_module": true + "title": "Google Slides API" } diff --git a/etc/api/sourcerepo/v1/sourcerepo-api.json b/etc/api/sourcerepo/v1/sourcerepo-api.json index e8f562e476..d4dc78a784 100644 --- a/etc/api/sourcerepo/v1/sourcerepo-api.json +++ b/etc/api/sourcerepo/v1/sourcerepo-api.json @@ -1,284 +1,4 @@ { - "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": { @@ -286,18 +6,18 @@ "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", + "delete": { + "flatPath": "v1/projects/{projectsId}/repos/{reposId}", + "path": "v1/{+name}", + "id": "sourcerepo.projects.repos.delete", + "description": "Deletes a repo.", + "response": { + "$ref": "Empty" + }, "parameterOrder": [ "name" ], - "response": { - "$ref": "ListReposResponse" - }, + "httpMethod": "DELETE", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/source.full_control", @@ -305,34 +25,66 @@ "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`.", + "required": true, "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." + "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`." } } }, - "setIamPolicy": { + "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.", "response": { - "$ref": "Policy" + "$ref": "ListReposResponse" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "The project ID whose repos should be listed. Values are of the form\n`projects/\u003cproject\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + }, + "pageToken": { + "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", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "Maximum number of repositories to return; between 1 and 500.\nIf not set or zero, defaults to 100 at the server.", + "format": "int32", + "type": "integer" + } + }, + "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", + "path": "v1/{+name}/repos", + "id": "sourcerepo.projects.repos.list" + }, + "setIamPolicy": { + "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "httpMethod": "POST", "parameterOrder": [ "resource" ], - "httpMethod": "POST", + "response": { + "$ref": "Policy" + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/source.full_control", @@ -343,24 +95,20 @@ "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, + "type": "string", "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." + "path": "v1/{+resource}:setIamPolicy" }, "create": { + "description": "Creates a repo in the given project with the given name.\n\nIf the named repository already exists, `CreateRepo` returns\n`ALREADY_EXISTS`.", "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" }, @@ -376,25 +124,25 @@ ], "parameters": { "parent": { - "description": "The project in which to create the repo. Values are of the form\n`projects/\u003cproject\u003e`.", - "type": "string", "required": true, + "type": "string", "pattern": "^projects/[^/]+$", - "location": "path" + "location": "path", + "description": "The project in which to create the repo. Values are of the form\n`projects/\u003cproject\u003e`." } }, "flatPath": "v1/projects/{projectsId}/repos", - "id": "sourcerepo.projects.repos.create", - "path": "v1/{+parent}/repos" + "path": "v1/{+parent}/repos", + "id": "sourcerepo.projects.repos.create" }, "getIamPolicy": { - "httpMethod": "GET", "response": { "$ref": "Policy" }, "parameterOrder": [ "resource" ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/source.full_control", @@ -405,8 +153,8 @@ "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, + "type": "string", "pattern": "^projects/[^/]+/repos/.+$" } }, @@ -416,9 +164,6 @@ "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" }, @@ -435,29 +180,36 @@ "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, + "type": "string", "pattern": "^projects/[^/]+/repos/.+$", "location": "path" } }, - "flatPath": "v1/projects/{projectsId}/repos/{reposId}" + "flatPath": "v1/projects/{projectsId}/repos/{reposId}", + "path": "v1/{+name}", + "id": "sourcerepo.projects.repos.get", + "description": "Returns information about a repo." }, "testIamPermissions": { - "response": { - "$ref": "TestIamPermissionsResponse" + "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.", + "httpMethod": "POST", "parameterOrder": [ "resource" ], - "httpMethod": "POST", + "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.", - "type": "string", - "required": true, "pattern": "^projects/[^/]+/repos/.+$", - "location": "path" + "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": [ @@ -468,39 +220,7 @@ ], "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`." - } - } + "path": "v1/{+resource}:testIamPermissions" } } } @@ -508,13 +228,25 @@ } }, "parameters": { - "alt": { + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, + "$.xgafv": { + "description": "V1 error format.", "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" + "v1 error format", + "v2 error format" ], + "location": "query", + "enum": [ + "1", + "2" + ] + }, + "alt": { "location": "query", "description": "Data format for response.", "default": "json", @@ -522,6 +254,12 @@ "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": { @@ -535,69 +273,331 @@ "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" + "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" + "type": "boolean", + "default": "true" }, "bearer_token": { "location": "query", "description": "OAuth bearer token.", "type": "string" }, - "upload_protocol": { + "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" + "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" + "type": "boolean", + "default": "true" }, "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.", + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "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": "" + "kind": "discovery#restDescription", + "servicePath": "", + "basePath": "", + "revision": "20171110", + "documentationLink": "https://cloud.google.com/source-repositories/docs/apis", + "id": "sourcerepo:v1", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "SetIamPolicyRequest": { + "description": "Request message for `SetIamPolicy` method.", + "type": "object", + "properties": { + "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" + }, + "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" + }, + "Binding": { + "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", + "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`." + }, + "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" + }, + "MirrorConfig": { + "description": "Configuration to automatically mirror a repository from another\nhosting service, for example GitHub or BitBucket.", + "type": "object", + "properties": { + "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" + }, + "url": { + "description": "URL of the main repository at the other hosting service.", + "type": "string" + }, + "webhookId": { + "description": "ID of the webhook listening to updates to trigger mirroring.\nRemoving this webhook from the other hosting service will stop\nGoogle Cloud Source Repositories from receiving notifications,\nand thereby disabling mirroring.", + "type": "string" + } + }, + "id": "MirrorConfig" + }, + "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": { + "title": { + "type": "string", + "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." + }, + "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" + }, + "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" + } + }, + "id": "Expr" + }, + "Repo": { + "description": "A repository (or repo) is a Git repository storing versioned source content.", + "type": "object", + "properties": { + "name": { + "type": "string", + "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`" + }, + "mirrorConfig": { + "description": "How this repository mirrors a repository managed by another service.\nRead-only field.", + "$ref": "MirrorConfig" + }, + "url": { + "description": "URL to clone the repository from Google Cloud Source Repositories.\nRead-only field.", + "type": "string" + }, + "size": { + "description": "The disk usage of the repo, in bytes. Read-only field. Size is only\nreturned by GetRepo.", + "format": "int64", + "type": "string" + } + }, + "id": "Repo" + }, + "ListReposResponse": { + "description": "Response for ListRepos. The size is not set in the returned repositories.", + "type": "object", + "properties": { + "repos": { + "description": "The listed repos.", + "type": "array", + "items": { + "$ref": "Repo" + } + }, + "nextPageToken": { + "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.", + "type": "string" + } + }, + "id": "ListReposResponse" + }, + "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" + }, + "AuditLogConfig": { + "properties": { + "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" + ] + }, + "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." + } + }, + "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": { + "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", + "description": "Request message for `TestIamPermissions` method." + }, + "Policy": { + "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": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + }, + "auditConfigs": { + "type": "array", + "items": { + "$ref": "AuditConfig" + }, + "description": "Specifies cloud audit logging configuration for this policy." + }, + "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" + } + }, + "iamOwned": { + "type": "boolean" + } + }, + "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" + }, + "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": { + "type": "array", + "items": { + "type": "string" + } + }, + "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" + } + }, + "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/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/source.full_control": { + "description": "Manage your source code repositories" + }, + "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" } diff --git a/etc/api/spanner/v1/spanner-api.json b/etc/api/spanner/v1/spanner-api.json index 7f2f503b71..751b06cf7c 100644 --- a/etc/api/spanner/v1/spanner-api.json +++ b/etc/api/spanner/v1/spanner-api.json @@ -1,279 +1,1293 @@ { + "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.", + "response": { + "$ref": "ListInstanceConfigsResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "If non-empty, `page_token` should contain a\nnext_page_token\nfrom a previous ListInstanceConfigsResponse.", + "type": "string" + }, + "pageSize": { + "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", + "type": "integer" + }, + "parent": { + "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`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/instanceConfigs", + "path": "v1/{+parent}/instanceConfigs", + "id": "spanner.projects.instanceConfigs.list" + }, + "get": { + "description": "Gets information about a particular instance configuration.", + "response": { + "$ref": "InstanceConfig" + }, + "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 instance configuration. Values are of\nthe form `projects/\u003cproject\u003e/instanceConfigs/\u003cconfig\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instanceConfigs/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/instanceConfigs/{instanceConfigsId}", + "path": "v1/{+name}", + "id": "spanner.projects.instanceConfigs.get" + } + } + }, + "instances": { + "methods": { + "patch": { + "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.", + "request": { + "$ref": "UpdateInstanceRequest" + }, + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "PATCH", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "parameters": { + "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.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.patch" + }, + "get": { + "description": "Gets information about a particular instance.", + "response": { + "$ref": "Instance" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "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/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.get" + }, + "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.", + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "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/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}:testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "id": "spanner.projects.instances.testIamPermissions" + }, + "delete": { + "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.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "DELETE", + "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 instance to be deleted. 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}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.delete" + }, + "list": { + "flatPath": "v1/projects/{projectsId}/instances", + "id": "spanner.projects.instances.list", + "path": "v1/{+parent}/instances", + "description": "Lists all instances in the given project.", + "httpMethod": "GET", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "ListInstancesResponse" + }, + "parameters": { + "pageSize": { + "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", + "type": "integer" + }, + "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" + }, + "pageToken": { + "location": "query", + "description": "If non-empty, `page_token` should contain a\nnext_page_token from a\nprevious ListInstancesResponse.", + "type": "string" + } + }, + "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", + "description": "Sets the access control policy on an instance resource. Replaces any\nexisting policy.\n\nAuthorization requires `spanner.instances.setIamPolicy` on\nresource.", + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "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" + } + } + }, + "create": { + "flatPath": "v1/projects/{projectsId}/instances", + "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": { + "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", + "pattern": "^projects/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ] + }, + "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.", + "response": { + "$ref": "Policy" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "parameters": { + "resource": { + "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/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}:getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "id": "spanner.projects.instances.getIamPolicy" + } + }, + "resources": { + "databases": { + "methods": { + "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": { + "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/[^/]+/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}:getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "id": "spanner.projects.instances.databases.getIamPolicy" + }, + "get": { + "description": "Gets the state of a Cloud Spanner database.", + "response": { + "$ref": "Database" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "location": "path", + "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/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.databases.get" + }, + "dropDatabase": { + "description": "Drops (aka deletes) a Cloud Spanner database.", + "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}" + }, + "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.", + "httpMethod": "PATCH", + "parameterOrder": [ + "database" + ], + "response": { + "$ref": "Operation" + }, + "parameters": { + "database": { + "location": "path", + "description": "Required. The database to update.", + "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.updateDdl", + "path": "v1/{+database}/ddl" + }, + "testIamPermissions": { + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "parameterOrder": [ + "resource" + ], + "httpMethod": "POST", + "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." + }, + "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.", + "response": { + "$ref": "GetDatabaseDdlResponse" + }, + "parameterOrder": [ + "database" + ], + "httpMethod": "GET", + "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", + "path": "v1/{+database}/ddl", + "id": "spanner.projects.instances.databases.getDdl" + }, + "list": { + "description": "Lists Cloud Spanner databases.", + "response": { + "$ref": "ListDatabasesResponse" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "parameters": { + "pageToken": { + "location": "query", + "description": "If non-empty, `page_token` should contain a\nnext_page_token from a\nprevious ListDatabasesResponse.", + "type": "string" + }, + "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": { + "location": "path", + "description": "Required. The instance whose databases should be listed.\nValues are of the form `projects/\u003cproject\u003e/instances/\u003cinstance\u003e`.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases", + "path": "v1/{+parent}/databases", + "id": "spanner.projects.instances.databases.list" + }, + "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": { + "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/[^/]+/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}:setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "id": "spanner.projects.instances.databases.setIamPolicy" + }, + "create": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "parent" + ], + "httpMethod": "POST", + "parameters": { + "parent": { + "location": "path", + "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/[^/]+$" + } + }, + "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.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." + } + }, + "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`.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "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 to be cancelled.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/operations/{operationsId}:cancel", + "path": "v1/{+name}:cancel", + "id": "spanner.projects.instances.databases.operations.cancel" + }, + "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": { + "location": "path", + "description": "The name of the operation resource to be deleted.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+$" + } + }, + "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}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.databases.operations.delete" + }, + "list": { + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/operations", + "id": "spanner.projects.instances.databases.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.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "parameters": { + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "name": { + "location": "path", + "description": "The name of the operation's parent resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ] + }, + "get": { + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/operations/{operationsId}", + "id": "spanner.projects.instances.databases.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", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "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": { + "executeSql": { + "response": { + "$ref": "ResultSet" + }, + "parameterOrder": [ + "session" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ], + "parameters": { + "session": { + "location": "path", + "description": "Required. The session in which the SQL query should be performed.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}:executeSql", + "path": "v1/{+session}:executeSql", + "id": "spanner.projects.instances.databases.sessions.executeSql", + "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.", + "request": { + "$ref": "ExecuteSqlRequest" + } + }, + "list": { + "response": { + "$ref": "ListSessionsResponse" + }, + "parameterOrder": [ + "database" + ], + "httpMethod": "GET", + "parameters": { + "filter": { + "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", + "location": "query" + }, + "pageToken": { + "description": "If non-empty, `page_token` should contain a\nnext_page_token from a previous\nListSessionsResponse.", + "type": "string", + "location": "query" + }, + "pageSize": { + "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", + "location": "query" + }, + "database": { + "location": "path", + "description": "Required. The database in which to list sessions.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+$" + } + }, + "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", + "description": "Lists all sessions in a given database." + }, + "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" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}:streamingRead", + "path": "v1/{+session}:streamingRead", + "id": "spanner.projects.instances.databases.sessions.streamingRead" + }, + "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": { + "location": "path", + "description": "Required. The session in which the transaction to roll back is running.", + "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}:rollback", + "path": "v1/{+session}:rollback", + "id": "spanner.projects.instances.databases.sessions.rollback" + }, + "create": { + "response": { + "$ref": "Session" + }, + "parameterOrder": [ + "database" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ], + "parameters": { + "database": { + "location": "path", + "description": "Required. The database in which the new session is created.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+$" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions", + "path": "v1/{+database}/sessions", + "id": "spanner.projects.instances.databases.sessions.create", + "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\"`.", + "request": { + "$ref": "CreateSessionRequest" + } + }, + "read": { + "request": { + "$ref": "ReadRequest" + }, + "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.", + "httpMethod": "POST", + "parameterOrder": [ + "session" + ], + "response": { + "$ref": "ResultSet" + }, + "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" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}:read", + "id": "spanner.projects.instances.databases.sessions.read", + "path": "v1/{+session}:read" + }, + "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": { + "location": "path", + "description": "Required. The name of the session to retrieve.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/databases/[^/]+/sessions/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ] + }, + "commit": { + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}/sessions/{sessionsId}:commit", + "id": "spanner.projects.instances.databases.sessions.commit", + "path": "v1/{+session}: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.", + "httpMethod": "POST", + "parameterOrder": [ + "session" + ], + "response": { + "$ref": "CommitResponse" + }, + "parameters": { + "session": { + "description": "Required. The session in which the transaction to be committed is running.", + "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" + ] + }, + "beginTransaction": { + "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", + "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." + }, + "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": { + "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", + "description": "Ends a session, releasing server resources associated with it." + } + } + } + } + }, + "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" + }, + "parameters": { + "name": { + "description": "The name of the operation resource to be cancelled.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/operations/[^/]+$", + "location": "path" + } + }, + "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" + }, + "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", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "parameters": { + "name": { + "description": "The name of the operation resource to be deleted.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/operations/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/operations/{operationsId}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.operations.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 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": { + "filter": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + }, + "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" + }, + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "type": "integer", + "location": "query" + } + }, + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/operations", + "path": "v1/{+name}", + "id": "spanner.projects.instances.operations.list" + }, + "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": { + "location": "path", + "description": "The name of the operation resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/instances/[^/]+/operations/[^/]+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ], + "flatPath": "v1/projects/{projectsId}/instances/{instancesId}/operations/{operationsId}", + "path": "v1/{+name}", + "id": "spanner.projects.instances.operations.get" + } + } + } + } + } + } + } + }, + "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" + }, + "$.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" + }, + "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" + } + }, + "version": "v1", + "baseUrl": "https://spanner.googleapis.com/", + "kind": "discovery#restDescription", + "description": "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service.", + "servicePath": "", + "basePath": "", + "id": "spanner:v1", + "documentationLink": "https://cloud.google.com/spanner/", + "revision": "20171204", "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" + "type": "object", + "properties": {}, + "id": "Empty" }, "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`.", @@ -284,29 +1298,29 @@ "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" + "$ref": "ReadOnly", + "description": "Transaction will not write.\n\nAuthorization to begin a read-only transaction requires\n`spanner.databases.beginReadOnlyTransaction` permission\non the `session` resource." } }, "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": { + "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.", "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." + } + }, + "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" } - } + }, + "id": "CreateDatabaseRequest" }, "CreateInstanceRequest": { "description": "The request for CreateInstance.", @@ -333,13 +1347,13 @@ "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.", + "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.\n\nA timestamp in RFC3339 UTC \\\"Zulu\\\" format, accurate to nanoseconds.\nExample: `\"2014-10-02T15:01:23.045123456Z\"`.", "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." + "description": "If true, the Cloud Spanner-selected read timestamp is included in\nthe Transaction message that describes the transaction.", + "type": "boolean" }, "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`.", @@ -351,15 +1365,29 @@ "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" + "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.\n\nA timestamp in RFC3339 UTC \\\"Zulu\\\" format, accurate to nanoseconds.\nExample: `\"2014-10-02T15:01:23.045123456Z\"`.", + "format": "google-datetime", + "type": "string" } }, "id": "ReadOnly" }, "ExecuteSqlRequest": { + "description": "The request for ExecuteSql and\nExecuteStreamingSql.", + "type": "object", "properties": { + "sql": { + "description": "Required. The SQL query string.", + "type": "string" + }, + "params": { + "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.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + } + }, "queryMode": { "enumDescriptions": [ "The default mode where only the query result, without any information\nabout the query plan is returned.", @@ -389,28 +1417,19 @@ "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" + "id": "ExecuteSqlRequest" }, "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", @@ -422,11 +1441,6 @@ "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" @@ -435,8 +1449,28 @@ "description": "The request for Read and\nStreamingRead.", "type": "object", "properties": { + "columns": { + "description": "The columns of table to be returned for each row matching\nthis request.", + "type": "array", + "items": { + "type": "string" + } + }, + "transaction": { + "description": "The transaction to use. If none is provided, the default is a\ntemporary read-only transaction with strong concurrency.", + "$ref": "TransactionSelector" + }, + "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" + }, "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.", + "description": "If greater than zero, only the first `limit` rows are yielded. If `limit`\nis zero, the default is no limit.", "format": "int64", "type": "string" }, @@ -447,26 +1481,6 @@ "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" @@ -506,6 +1520,7 @@ "id": "ReadWrite" }, "Operation": { + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", "type": "object", "properties": { "done": { @@ -513,12 +1528,12 @@ "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" + "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`.", @@ -537,30 +1552,29 @@ "type": "object" } }, - "id": "Operation", - "description": "This resource represents a long-running operation that is the result of a\nnetwork API call." + "id": "Operation" }, "ResultSet": { "description": "Results from Read or\nExecuteSql.", "type": "object", "properties": { "metadata": { - "$ref": "ResultSetMetadata", - "description": "Metadata about the result set, such as row type information." + "description": "Metadata about the result set, such as row type information.", + "$ref": "ResultSetMetadata" }, "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": { + "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.", "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" @@ -569,25 +1583,25 @@ "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": { + "type": "object", "additionalProperties": { - "type": "any", - "description": "Properties of the object. Contains field @type with type URL." - }, - "type": "object" + "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" @@ -597,8 +1611,8 @@ "type": "object", "properties": { "session": { - "$ref": "Session", - "description": "The session to create." + "description": "The session to create.", + "$ref": "Session" } }, "id": "CreateSessionRequest" @@ -607,16 +1621,16 @@ "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" } + }, + "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" } }, "id": "UpdateDatabaseDdlRequest" @@ -626,11 +1640,11 @@ "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" - }, - "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", @@ -659,9 +1673,9 @@ } }, "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" + "format": "byte", + "type": "string" }, "stats": { "$ref": "ResultSetStats", @@ -670,26 +1684,7 @@ }, "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": { @@ -704,18 +1699,36 @@ "type": "string" }, "instance": { - "$ref": "Instance", - "description": "The desired end state of the update." + "description": "The desired end state of the update.", + "$ref": "Instance" }, "startTime": { "description": "The time at which UpdateInstance\nrequest was received.", "format": "google-datetime", "type": "string" } - } + }, + "id": "UpdateInstanceMetadata" + }, + "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" }, "ResultSetMetadata": { - "id": "ResultSetMetadata", "description": "Metadata about a ResultSet or PartialResultSet.", "type": "object", "properties": { @@ -727,19 +1740,20 @@ "$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 ]" } - } + }, + "id": "ResultSetMetadata" }, "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." + "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.", + "$ref": "TransactionOptions" }, "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" + "$ref": "TransactionOptions", + "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." }, "id": { "description": "Execute the read or SQL query in a previously-started transaction.", @@ -753,13 +1767,17 @@ "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": { + "delete": { + "$ref": "Delete", + "description": "Delete rows from a table. Succeeds whether or not the named\nrows were present." + }, "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." + "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.", + "$ref": "Write" }, "update": { "$ref": "Write", @@ -768,10 +1786,6 @@ "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" @@ -819,7 +1833,6 @@ "id": "GetDatabaseDdlResponse" }, "Database": { - "id": "Database", "description": "A Cloud Spanner database.", "type": "object", "properties": { @@ -841,7 +1854,37 @@ "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" } - } + }, + "id": "Database" + }, + "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" + }, + "ListDatabasesResponse": { + "description": "The response for ListDatabases.", + "type": "object", + "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" }, "Instance": { "description": "An isolated set of Cloud Spanner resources on which databases can be hosted.", @@ -852,16 +1895,16 @@ "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.", + "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\nSee [the documentation](https://cloud.google.com/spanner/docs/instances#node_count)\nfor more information about nodes.", "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." + "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.", + "type": "object" }, "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.", @@ -888,36 +1931,9 @@ }, "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": { + "description": "The request for Rollback.", + "type": "object", "properties": { "transactionId": { "description": "Required. The transaction to roll back.", @@ -925,16 +1941,14 @@ "type": "string" } }, - "id": "RollbackRequest", - "description": "The request for Rollback.", - "type": "object" + "id": "RollbackRequest" }, "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.", + "description": "For snapshot read-only transactions, the read timestamp chosen\nfor the transaction. Not returned by default: see\nTransactionOptions.ReadOnly.return_read_timestamp.\n\nA timestamp in RFC3339 UTC \\\"Zulu\\\" format, accurate to nanoseconds.\nExample: `\"2014-10-02T15:01:23.045123456Z\"`.", "format": "google-datetime", "type": "string" }, @@ -947,17 +1961,9 @@ "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", @@ -969,8 +1975,30 @@ "database": { "description": "The database being modified.", "type": "string" + }, + "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" + } } - } + }, + "id": "UpdateDatabaseDdlMetadata" + }, + "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" + } + } + }, + "id": "QueryPlan" }, "StructType": { "description": "`StructType` defines the fields of a STRUCT type.", @@ -986,31 +2014,17 @@ }, "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." + }, + "name": { + "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": "string" } }, "id": "Field" @@ -1033,6 +2047,10 @@ "description": "Additional statistics about a ResultSet or PartialResultSet.", "type": "object", "properties": { + "queryPlan": { + "$ref": "QueryPlan", + "description": "QueryPlan for the query associated with this result." + }, "queryStats": { "additionalProperties": { "description": "Properties of the object.", @@ -1040,10 +2058,6 @@ }, "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" @@ -1064,7 +2078,27 @@ "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": { + "structType": { + "$ref": "StructType", + "description": "If code == STRUCT, then `struct_type`\nprovides type information for the struct's fields." + }, + "arrayElementType": { + "description": "If code == ARRAY, then `array_element_type`\nis the type of the array elements.", + "$ref": "Type" + }, "code": { + "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]." + ], "enum": [ "TYPE_CODE_UNSPECIFIED", "BOOL", @@ -1078,27 +2112,7 @@ "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." + "type": "string" } }, "id": "Type" @@ -1107,23 +2121,27 @@ "description": "Node information for nodes appearing in a QueryPlan.plan_nodes.", "type": "object", "properties": { + "shortRepresentation": { + "description": "Condensed representation for SCALAR nodes.", + "$ref": "ShortRepresentation" + }, "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." + ], + "enum": [ + "KIND_UNSPECIFIED", + "RELATIONAL", + "SCALAR" ] }, "displayName": { @@ -1138,29 +2156,26 @@ } }, "metadata": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, "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" + }, + "executionStats": { + "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", "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": { + "description": "Metadata type for the operation returned by\nCreateInstance.", "type": "object", "properties": { "cancelTime": { @@ -1174,8 +2189,8 @@ "type": "string" }, "instance": { - "description": "The instance being created.", - "$ref": "Instance" + "$ref": "Instance", + "description": "The instance being created." }, "startTime": { "description": "The time at which the\nCreateInstance request was\nreceived.", @@ -1183,1294 +2198,279 @@ "type": "string" } }, - "id": "CreateInstanceMetadata", - "description": "Metadata type for the operation returned by\nCreateInstance." + "id": "CreateInstanceMetadata" + }, + "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": { + "description": "Arguments to delete operations.", + "type": "object", + "properties": { + "table": { + "description": "Required. The table whose rows will be deleted.", + "type": "string" + }, + "keySet": { + "description": "Required. The primary keys of the rows within table to delete.", + "$ref": "KeySet" + } + }, + "id": "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": { + "description": "The request for BeginTransaction.", + "type": "object", + "properties": { + "options": { + "description": "Required. Options for the new transaction.", + "$ref": "TransactionOptions" + } + }, + "id": "BeginTransactionRequest" + }, + "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": { + "description": "Request message for `GetIamPolicy` method.", + "type": "object", + "properties": {}, + "id": "GetIamPolicyRequest" + }, + "CreateDatabaseMetadata": { + "description": "Metadata type for the operation returned by\nCreateDatabase.", + "type": "object", + "properties": { + "database": { + "description": "The database being created.", + "type": "string" + } + }, + "id": "CreateDatabaseMetadata" + }, + "ListSessionsResponse": { + "description": "The response for ListSessions.", + "type": "object", + "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" + }, + "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 64 labels can be associated with a given session.\n\nSee https://goo.gl/xmQnxf for more information on and examples of labels.", + "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. This is always system-assigned; values provided\nwhen creating a session are ignored.", + "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" + }, + "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" + }, + "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" + }, + "ShortRepresentation": { + "description": "Condensed representation of a node and its subtree. Only present for\n`SCALAR` PlanNode(s).", + "type": "object", + "properties": { + "description": { + "description": "A string representation of the expression subtree rooted at this node.", + "type": "string" + }, + "subqueries": { + "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", + "additionalProperties": { + "format": "int32", + "type": "integer" + } + } + }, + "id": "ShortRepresentation" + }, + "InstanceConfig": { + "description": "A possible configuration for a Cloud Spanner instance. Configurations\ndefine the geographic placement of nodes and their replication.", + "type": "object", + "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" + }, + "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" } }, "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" + "protocol": "rest" } diff --git a/etc/api/speech/v1/speech-api.json b/etc/api/speech/v1/speech-api.json index f1801bbe0b..b868ed92df 100644 --- a/etc/api/speech/v1/speech-api.json +++ b/etc/api/speech/v1/speech-api.json @@ -1,15 +1,4 @@ { - "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", @@ -18,35 +7,103 @@ "resources": { "operations": { "methods": { - "cancel": { + "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": { + "name": { + "description": "The name of the operation's parent resource.", + "type": "string", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "The standard list page token.", + "type": "string" + }, + "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/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" + ], + "flatPath": "v1/operations", + "id": "speech.operations.list", + "path": "v1/operations" + }, + "get": { + "parameters": { + "name": { + "pattern": "^[^/]+$", + "location": "path", + "description": "The name of the operation resource.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" + ], + "flatPath": "v1/operations/{operationsId}", + "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.", + "httpMethod": "GET", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ] + }, + "cancel": { + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" ], "parameters": { "name": { - "description": "The name of the operation resource to be cancelled.", - "type": "string", "required": true, + "type": "string", "pattern": "^[^/]+$", - "location": "path" + "location": "path", + "description": "The name of the operation resource to be cancelled." } }, "flatPath": "v1/operations/{operationsId}:cancel", "path": "v1/operations/{+name}:cancel", "id": "speech.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`.", "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": { + "flatPath": "v1/operations/{operationsId}", + "path": "v1/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`.", "response": { "$ref": "Empty" @@ -55,199 +112,108 @@ "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" + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" ], "parameters": { "name": { "location": "path", - "description": "The name of the operation resource.", - "type": "string", + "description": "The name of the operation resource to be deleted.", "required": true, + "type": "string", "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": { + "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.", "response": { "$ref": "Operation" }, "parameterOrder": [], "httpMethod": "POST", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" + ], "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." + "id": "speech.speech.longrunningrecognize" }, "recognize": { + "path": "v1/speech:recognize", + "id": "speech.speech.recognize", + "description": "Performs synchronous speech recognition: receive results after all audio\nhas been sent and processed.", "request": { "$ref": "RecognizeRequest" }, - "description": "Performs synchronous speech recognition: receive results after all audio\nhas been sent and processed.", - "httpMethod": "POST", - "parameterOrder": [], "response": { "$ref": "RecognizeResponse" }, + "parameterOrder": [], + "httpMethod": "POST", "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" ], "parameters": {}, - "flatPath": "v1/speech:recognize", - "path": "v1/speech:recognize", - "id": "speech.speech.recognize" + "flatPath": "v1/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" + "type": "string", + "location": "query" }, "prettyPrint": { "location": "query", "description": "Returns response with indentations and line breaks.", - "default": "true", - "type": "boolean" + "type": "boolean", + "default": "true" + }, + "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" - }, "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" - ] + "location": "query" }, "alt": { + "description": "Data format for response.", + "default": "json", "enum": [ "json", "media", @@ -259,9 +225,38 @@ "Media download with context-dependent Content-Type", "Responses with Content-Type of application/x-protobuf" ], + "location": "query" + }, + "access_token": { "location": "query", - "description": "Data format for response.", - "default": "json" + "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.", + "type": "boolean", + "default": "true" + }, + "bearer_token": { + "location": "query", + "description": "OAuth bearer token.", + "type": "string" + }, + "oauth_token": { + "type": "string", + "location": "query", + "description": "OAuth 2.0 token for the current user." } }, "version": "v1", @@ -270,89 +265,20 @@ "description": "Converts audio to text by applying powerful neural network models.", "servicePath": "", "basePath": "", - "id": "speech:v1", + "revision": "20171205", "documentationLink": "https://cloud.google.com/speech/", - "revision": "20170918", + "id": "speech:v1", "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", + "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": { "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).", @@ -365,13 +291,13 @@ "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" + "$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": "LongRunningRecognizeRequest" @@ -381,37 +307,30 @@ "type": "object", "properties": { "results": { - "description": "*Output-only* Sequential list of transcription results corresponding to\nsequential portions of audio.", + "type": "array", "items": { "$ref": "SpeechRecognitionResult" }, - "type": "array" + "description": "*Output-only* Sequential list of transcription results corresponding to\nsequential portions of audio." } }, "id": "RecognizeResponse" }, "CancelOperationRequest": { + "id": "CancelOperationRequest", "description": "The request message for Operations.CancelOperation.", "type": "object", - "properties": {}, - "id": "CancelOperationRequest" + "properties": {} }, "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" - } + "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`.", @@ -422,22 +341,29 @@ "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" - }, - "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", + "description": "This resource represents a long-running operation that is the result of a\nnetwork API call.", + "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).", + "format": "int32", "type": "integer" }, "enableWordTimeOffsets": { @@ -445,16 +371,19 @@ "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.", + "format": "int32", "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" }, + "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" + }, "encoding": { - "type": "string", "enumDescriptions": [ "Not specified. Will return result google.rpc.Code.INVALID_ARGUMENT.", "Uncompressed 16-bit signed little-endian samples (Linear PCM).", @@ -475,50 +404,48 @@ "OGG_OPUS", "SPEEX_WITH_HEADER_BYTE" ], - "description": "*Required* Encoding of audio data sent in all `RecognitionAudio` messages." + "description": "*Required* Encoding of audio data sent in all `RecognitionAudio` messages.", + "type": "string" }, "speechContexts": { "description": "*Optional* A means to provide context to assist the speech recognition.", + "type": "array", "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.", + "word": { + "description": "*Output-only* The word corresponding to this set of information.", "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.", + "format": "google-duration", + "type": "string" + }, + "startTime": { + "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.", + "format": "google-duration", "type": "string" } }, - "id": "WordInfo" + "id": "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`." }, "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.", + "format": "int32", "type": "integer" }, "message": { @@ -527,17 +454,16 @@ }, "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" - }, - "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 `{}`.", @@ -546,24 +472,112 @@ "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" + "type": "object", + "properties": { + "config": { + "description": "*Required* Provides information to the recognizer that specifies how to\nprocess the request.", + "$ref": "RecognitionConfig" + }, + "audio": { + "$ref": "RecognitionAudio", + "description": "*Required* The audio data to be recognized." + } + } + }, + "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).", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "SpeechContext" + }, + "ListOperationsResponse": { + "id": "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" + } + } + } + }, + "SpeechRecognitionAlternative": { + "type": "object", + "properties": { + "confidence": { + "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" + }, + "words": { + "description": "*Output-only* A list of word-specific information for each recognized word.", + "type": "array", + "items": { + "$ref": "WordInfo" + } + } + }, + "id": "SpeechRecognitionAlternative", + "description": "Alternative hypotheses (a.k.a. n-best list)." + }, + "SpeechRecognitionResult": { + "description": "A speech recognition result corresponding to a portion of the audio.", + "type": "object", + "properties": { + "channelTag": { + "description": "For multi-channel audio, this is the channel number corresponding to the\nrecognized result for the audio from that channel.\nFor audio_channel_count = N, its output values can range from '0' to 'N-1'.", + "format": "int32", + "type": "integer" + }, + "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.", + "type": "array", + "items": { + "$ref": "SpeechRecognitionAlternative" + } + } + }, + "id": "SpeechRecognitionResult" } }, - "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", + "canonicalName": "Speech", + "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-speech": { + "description": "Convert speech to text using Google speech recognition technology" + } + } + } + }, + "rootUrl": "https://speech.googleapis.com/" } diff --git a/etc/api/speech/v1beta1/speech-api.json b/etc/api/speech/v1beta1/speech-api.json index 26c1a97ae6..1eab0b2e79 100644 --- a/etc/api/speech/v1beta1/speech-api.json +++ b/etc/api/speech/v1beta1/speech-api.json @@ -3,10 +3,28 @@ "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": {} + "properties": {}, + "id": "Empty" + }, + "ListOperationsResponse": { + "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.", + "type": "object" }, "SpeechContext": { "description": "Provides \"hints\" to the speech recognizer to favor specific words and phrases\nin the results.", @@ -14,39 +32,21 @@ "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" - }, - "type": "array" + } } }, "id": "SpeechContext" }, - "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" - }, "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 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": { @@ -57,26 +57,25 @@ "id": "SpeechRecognitionAlternative" }, "SpeechRecognitionResult": { - "description": "A speech recognition result corresponding to a portion of the audio.", - "type": "object", "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" + "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": { - "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.", + "format": "byte", "type": "string" }, "uri": { @@ -84,19 +83,20 @@ "type": "string" } }, - "id": "RecognitionAudio" + "id": "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)." }, "AsyncRecognizeRequest": { "description": "The top-level message sent by the client for the `AsyncRecognize` method.", "type": "object", "properties": { - "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." + }, + "audio": { + "$ref": "RecognitionAudio", + "description": "*Required* The audio data to be recognized." } }, "id": "AsyncRecognizeRequest" @@ -130,30 +130,37 @@ "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" + "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`." } }, "id": "Operation" }, "RecognitionConfig": { + "description": "Provides information to the recognizer that specifies how to process the\nrequest.", "type": "object", "properties": { "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.", + "format": "int32", "type": "integer" }, "sampleRate": { - "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).", + "format": "int32", "type": "integer" }, "languageCode": { "description": "*Optional* The language of the supplied audio as a BCP-47 language tag.\nExample: \"en-GB\" https://www.rfc-editor.org/rfc/bcp/bcp47.txt\nIf omitted, defaults to \"en-US\". See\n[Language Support](https://cloud.google.com/speech/docs/languages)\nfor a list of the currently supported language codes.", "type": "string" }, + "speechContext": { + "$ref": "SpeechContext", + "description": "*Optional* A means to provide context to assist the speech recognition." + }, "encoding": { + "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`.", @@ -169,77 +176,70 @@ "MULAW", "AMR", "AMR_WB" - ], - "description": "*Required* Encoding of audio data sent in all `RecognitionAudio` messages.", - "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": { - "$ref": "SpeechContext", - "description": "*Optional* A means to provide context to assist the speech recognition." } }, - "id": "RecognitionConfig", - "description": "Provides information to the recognizer that specifies how to process the\nrequest." + "id": "RecognitionConfig" }, "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" + }, + "SyncRecognizeResponse": { + "properties": { + "results": { + "description": "*Output-only* Sequential list of transcription results corresponding to\nsequential portions of audio.", + "type": "array", + "items": { + "$ref": "SpeechRecognitionResult" + } + } + }, + "id": "SyncRecognizeResponse", + "description": "The only message returned to the client by `SyncRecognize`. method. It\ncontains the result as zero or more sequential `SpeechRecognitionResult`\nmessages.", + "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": { - "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.", + "type": "array", "items": { "type": "object", "additionalProperties": { "description": "Properties of the object. Contains field @type with type URL.", "type": "any" } - }, - "type": "array" + } + }, + "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" - }, - "SyncRecognizeResponse": { - "description": "The only message returned to the client by `SyncRecognize`. 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": "SyncRecognizeResponse" } }, "icons": { @@ -253,6 +253,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-speech": { + "description": "Convert speech to text using Google speech recognition technology" } } } @@ -267,6 +270,9 @@ "operations": { "methods": { "cancel": { + "path": "v1beta1/operations/{+name}:cancel", + "id": "speech.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": "Empty" }, @@ -274,95 +280,68 @@ "name" ], "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" + ], "parameters": { "name": { - "type": "string", "required": true, + "type": "string", "pattern": "^[^/]+$", "location": "path", "description": "The name of the operation resource to be cancelled." } }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/operations/{operationsId}:cancel", - "id": "speech.operations.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`." + "flatPath": "v1beta1/operations/{operationsId}:cancel" }, "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": { - "location": "path", - "description": "The name of the operation resource to be deleted.", - "type": "string", - "required": true, - "pattern": "^[^/]+$" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1beta1/operations/{operationsId}", - "path": "v1beta1/operations/{+name}", - "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": "Operation" - }, - "httpMethod": "GET", "parameterOrder": [ "name" ], + "httpMethod": "DELETE", "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" ], "parameters": { "name": { - "description": "The name of the operation resource.", - "type": "string", + "description": "The name of the operation resource to be deleted.", "required": true, + "type": "string", "pattern": "^[^/]+$", "location": "path" } }, "flatPath": "v1beta1/operations/{operationsId}", - "id": "speech.operations.get", - "path": "v1beta1/operations/{+name}" + "path": "v1beta1/operations/{+name}", + "id": "speech.operations.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 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": { + "name": { + "description": "The name of the operation's parent resource.", + "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.", + "format": "int32", "type": "integer" }, "filter": { @@ -372,11 +351,39 @@ } }, "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" ], "flatPath": "v1beta1/operations", + "id": "speech.operations.list", "path": "v1beta1/operations", - "id": "speech.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." + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "required": true, + "type": "string", + "pattern": "^[^/]+$", + "location": "path", + "description": "The name of the operation resource." + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" + ], + "flatPath": "v1beta1/operations/{operationsId}", + "id": "speech.operations.get", + "path": "v1beta1/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." } } }, @@ -389,16 +396,17 @@ "parameterOrder": [], "httpMethod": "POST", "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" ], "parameters": {}, "flatPath": "v1beta1/speech:asyncrecognize", - "id": "speech.speech.asyncrecognize", "path": "v1beta1/speech:asyncrecognize", + "id": "speech.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" - }, - "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", @@ -408,20 +416,70 @@ "$ref": "SyncRecognizeRequest" }, "description": "Performs synchronous speech recognition: receive results after all audio\nhas been sent and processed.", - "httpMethod": "POST", - "parameterOrder": [], "response": { "$ref": "SyncRecognizeResponse" }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": {} + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-speech" + ] } } } }, "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" + }, + "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" + }, + "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", @@ -439,83 +497,34 @@ "default": "json" }, "access_token": { + "location": "query", "description": "OAuth access token.", - "type": "string", - "location": "query" + "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": { - "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": { - "type": "string", - "location": "query", - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." - }, - "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" - }, - "callback": { + "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", - "description": "JSONP" + "location": "query" }, - "$.xgafv": { - "enumDescriptions": [ - "v1 error format", - "v2 error format" - ], - "location": "query", - "enum": [ - "1", - "2" - ], - "description": "V1 error format.", - "type": "string" + "pp": { + "description": "Pretty-print response.", + "type": "boolean", + "default": "true", + "location": "query" } }, "version": "v1beta1", "baseUrl": "https://speech.googleapis.com/", - "servicePath": "", "description": "Converts audio to text by applying powerful neural network models.", "kind": "discovery#restDescription", + "servicePath": "", "basePath": "", - "id": "speech:v1beta1", + "revision": "20171205", "documentationLink": "https://cloud.google.com/speech/", - "revision": "20170918" + "id": "speech:v1beta1" } diff --git a/etc/api/sqladmin/v1beta3/sqladmin-api.json b/etc/api/sqladmin/v1beta3/sqladmin-api.json index 0a1fa96be2..ba076ba603 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/lsRSA9rF-4KQu4xYN0id-kYxBtA\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/7RWofroP1ZyOrHOERSswwKZ-f84\"", "discoveryVersion": "v1", "id": "sqladmin:v1beta3", "name": "sqladmin", "canonicalName": "SQL Admin", "version": "v1beta3", - "revision": "20170807", + "revision": "20171011", "title": "Cloud SQL Administration API", "description": "Creates and configures Cloud SQL instances, which provide fully-managed MySQL databases.", "ownerDomain": "google.com", diff --git a/etc/api/sqladmin/v1beta4/sqladmin-api.json b/etc/api/sqladmin/v1beta4/sqladmin-api.json index e62435bceb..7b4a2f4e9d 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/odbYGRT1izLWfRhfVNwcTacV8sM\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/qGR3q9t_cRz9md0zXxOmhlJ1eX0\"", "discoveryVersion": "v1", "id": "sqladmin:v1beta4", "name": "sqladmin", "canonicalName": "SQL Admin", "version": "v1beta4", - "revision": "20170807", + "revision": "20171011", "title": "Cloud SQL Administration API", "description": "Creates and configures Cloud SQL instances, which provide fully-managed MySQL databases.", "ownerDomain": "google.com", @@ -483,6 +483,74 @@ } } }, + "DemoteMasterConfiguration": { + "id": "DemoteMasterConfiguration", + "type": "object", + "description": "Read-replica configuration for connecting to the on-premises master.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#demoteMasterConfiguration.", + "default": "sql#demoteMasterConfiguration" + }, + "mysqlReplicaConfiguration": { + "$ref": "DemoteMasterMySqlReplicaConfiguration", + "description": "MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory." + } + } + }, + "DemoteMasterContext": { + "id": "DemoteMasterContext", + "type": "object", + "description": "Database instance demote master context.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#demoteMasterContext.", + "default": "sql#demoteMasterContext" + }, + "masterInstanceName": { + "type": "string", + "description": "The name of the instance which will act as on-premises master in the replication setup." + }, + "replicaConfiguration": { + "$ref": "DemoteMasterConfiguration", + "description": "Configuration specific to read-replicas replicating from the on-premises master." + } + } + }, + "DemoteMasterMySqlReplicaConfiguration": { + "id": "DemoteMasterMySqlReplicaConfiguration", + "type": "object", + "description": "Read-replica configuration specific to MySQL databases.", + "properties": { + "caCertificate": { + "type": "string", + "description": "PEM representation of the trusted CA's x509 certificate." + }, + "clientCertificate": { + "type": "string", + "description": "PEM representation of the slave's x509 certificate." + }, + "clientKey": { + "type": "string", + "description": "PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate. The format of the slave's private key can be either PKCS #1 or PKCS #8." + }, + "kind": { + "type": "string", + "description": "This is always sql#demoteMasterMysqlReplicaConfiguration.", + "default": "sql#demoteMasterMysqlReplicaConfiguration" + }, + "password": { + "type": "string", + "description": "The password for the replication connection." + }, + "username": { + "type": "string", + "description": "The username for the replication connection." + } + } + }, "ExportContext": { "id": "ExportContext", "type": "object", @@ -677,6 +745,17 @@ } } }, + "InstancesDemoteMasterRequest": { + "id": "InstancesDemoteMasterRequest", + "type": "object", + "description": "Database demote master request.", + "properties": { + "demoteMasterContext": { + "$ref": "DemoteMasterContext", + "description": "Contains details about the demoteMaster operation." + } + } + }, "InstancesExportRequest": { "id": "InstancesExportRequest", "type": "object", @@ -1933,6 +2012,40 @@ "https://www.googleapis.com/auth/sqlservice.admin" ] }, + "demoteMaster": { + "id": "sql.instances.demoteMaster", + "path": "projects/{project}/instances/{instance}/demoteMaster", + "httpMethod": "POST", + "description": "Demotes the standalone instance to be a read replica Cloud SQL instance of an on-premises master.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL instance name.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "InstancesDemoteMasterRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, "export": { "id": "sql.instances.export", "path": "projects/{project}/instances/{instance}/export", diff --git a/etc/api/storage/v1/storage-api.json b/etc/api/storage/v1/storage-api.json index d5eb39a445..da20386317 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/aAU6-GJtzQTwC546w_DsCPIRIUA\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/x114uLAdo7We9s8BOFRemUcydyU\"", "discoveryVersion": "v1", "id": "storage:v1", "name": "storage", "version": "v1", - "revision": "20170915", + "revision": "20171101", "title": "Cloud Storage JSON API", "description": "Stores and retrieves potentially large, immutable data objects.", "ownerDomain": "google.com", @@ -1090,7 +1090,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1123,7 +1123,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1153,7 +1153,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1185,7 +1185,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1220,7 +1220,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1259,7 +1259,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1308,7 +1308,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1360,7 +1360,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1392,7 +1392,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1477,7 +1477,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request.", "location": "query" } }, @@ -1541,7 +1541,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request.", "location": "query" } }, @@ -1638,7 +1638,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1670,7 +1670,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1710,7 +1710,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1808,7 +1808,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1871,7 +1871,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1904,7 +1904,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1934,7 +1934,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -1978,7 +1978,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2013,7 +2013,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2052,7 +2052,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2095,7 +2095,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2129,7 +2129,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2162,7 +2162,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2195,7 +2195,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2249,7 +2249,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2295,7 +2295,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2338,7 +2338,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2383,7 +2383,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2431,7 +2431,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2483,7 +2483,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2565,7 +2565,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2583,9 +2583,7 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsMediaDownload": true, - "useMediaDownloadService": true + ] }, "copy": { "id": "storage.objects.copy", @@ -2707,7 +2705,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2727,9 +2725,7 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsMediaDownload": true, - "useMediaDownloadService": true + ] }, "delete": { "id": "storage.objects.delete", @@ -2781,7 +2777,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2858,7 +2854,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -2905,7 +2901,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -3011,7 +3007,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -3029,8 +3025,6 @@ "https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_write" ], - "supportsMediaDownload": true, - "useMediaDownloadService": true, "supportsMediaUpload": true, "mediaUpload": { "accept": [ @@ -3098,7 +3092,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" }, "versions": { @@ -3126,7 +3120,7 @@ "id": "storage.objects.patch", "path": "b/{bucket}/o/{object}", "httpMethod": "PATCH", - "description": "Updates an object's metadata. This method supports patch semantics.", + "description": "Patches an object's metadata.", "parameters": { "bucket": { "type": "string", @@ -3361,7 +3355,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -3409,7 +3403,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -3462,7 +3456,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -3566,7 +3560,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" } }, @@ -3583,9 +3577,7 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.full_control" - ], - "supportsMediaDownload": true, - "useMediaDownloadService": true + ] }, "watchAll": { "id": "storage.objects.watchAll", @@ -3637,7 +3629,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" }, "versions": { @@ -3685,7 +3677,7 @@ }, "userProject": { "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", + "description": "The project to be billed for this request.", "location": "query" } }, diff --git a/etc/api/storage/v1beta1/storage-api.json b/etc/api/storage/v1beta1/storage-api.json index 9825027701..cb50e7c06a 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/K2ssca6PgUk66RRox2gYX0iyv40\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/01HYKczP8-CnbVNl6WTkxP9EoGA\"", "discoveryVersion": "v1", "id": "storage:v1beta1", "name": "storage", "version": "v1beta1", - "revision": "20170915", + "revision": "20171101", "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 39f8f5f403..9c0869f4dc 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/qILnY2_dR8engCHgEi0wa_OTh14\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/rZoEfTk9wxBHlvl6BI38wRpJLd0\"", "discoveryVersion": "v1", "id": "storage:v1beta2", "name": "storage", "version": "v1beta2", - "revision": "20170915", + "revision": "20171101", "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/storagetransfer-api.json b/etc/api/storagetransfer/v1/storagetransfer-api.json index 68d027dc1b..ccdc221ad6 100644 --- a/etc/api/storagetransfer/v1/storagetransfer-api.json +++ b/etc/api/storagetransfer/v1/storagetransfer-api.json @@ -1,15 +1,11 @@ { - "rootUrl": "https://storagetransfer.googleapis.com/", - "basePath": "", - "ownerDomain": "google.com", - "name": "storagetransfer", "batchPath": "batch", + "revision": "20171202", "id": "storagetransfer:v1", - "revision": "20170921", "documentationLink": "https://cloud.google.com/storage/transfer", "title": "Google Storage Transfer API", - "ownerName": "Google", "discoveryVersion": "v1", + "ownerName": "Google", "version_module": true, "resources": { "googleServiceAccounts": { @@ -23,138 +19,275 @@ "response": { "$ref": "GoogleServiceAccount" }, + "parameters": { + "projectId": { + "location": "path", + "description": "The ID of the Google Cloud Platform Console project that the Google service\naccount is associated with.\nRequired.", + "required": true, + "type": "string" + } + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], + "flatPath": "v1/googleServiceAccounts/{projectId}", + "id": "storagetransfer.googleServiceAccounts.get", + "path": "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": { - "projectId": { - "description": "The ID of the Google Cloud Platform Console project that the Google service\naccount is associated with.\nRequired.", - "type": "string", + "jobName": { + "location": "path", + "description": "The name of job to update.\nRequired.", "required": true, - "location": "path" + "type": "string", + "pattern": "^transferJobs/.+$" } }, - "flatPath": "v1/googleServiceAccounts/{projectId}", - "path": "v1/googleServiceAccounts/{projectId}", - "id": "storagetransfer.googleServiceAccounts.get" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/transferJobs/{transferJobsId}", + "id": "storagetransfer.transferJobs.patch", + "path": "v1/{+jobName}" + }, + "get": { + "description": "Gets a transfer job.", + "httpMethod": "GET", + "response": { + "$ref": "TransferJob" + }, + "parameterOrder": [ + "jobName" + ], + "parameters": { + "jobName": { + "location": "path", + "description": "The job to get.\nRequired.", + "required": true, + "type": "string", + "pattern": "^transferJobs/.+$" + }, + "projectId": { + "location": "query", + "description": "The ID of the Google Cloud Platform Console project that owns the job.\nRequired.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/transferJobs/{transferJobsId}", + "id": "storagetransfer.transferJobs.get", + "path": "v1/{+jobName}" + }, + "list": { + "response": { + "$ref": "ListTransferJobsResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "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\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", + "location": "query" + }, + "pageToken": { + "description": "The list page token.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/transferJobs", + "path": "v1/transferJobs", + "id": "storagetransfer.transferJobs.list", + "description": "Lists transfer jobs." + }, + "create": { + "response": { + "$ref": "TransferJob" + }, + "parameterOrder": [], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1/transferJobs", + "path": "v1/transferJobs", + "id": "storagetransfer.transferJobs.create", + "description": "Creates a transfer job that runs periodically.", + "request": { + "$ref": "TransferJob" + } } } }, "transferOperations": { "methods": { - "pause": { - "response": { - "$ref": "Empty" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "POST", - "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", - "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": [ - "name" - ], - "response": { - "$ref": "Empty" - }, - "parameters": { - "name": { - "description": "The name of the operation resource to be deleted.", - "type": "string", - "required": true, - "pattern": "^transferOperations/.+$", - "location": "path" - } - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "flatPath": "v1/transferOperations/{transferOperationsId}" - }, - "list": { - "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" - }, + "get": { "httpMethod": "GET", "parameterOrder": [ "name" ], + "response": { + "$ref": "Operation" + }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { - "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.", + "name": { + "description": "The name of the operation resource.", + "required": true, "type": "string", - "location": "query" + "pattern": "^transferOperations/.+$", + "location": "path" + } + }, + "flatPath": "v1/transferOperations/{transferOperationsId}", + "id": "storagetransfer.transferOperations.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." + }, + "pause": { + "request": { + "$ref": "PauseTransferOperationRequest" + }, + "description": "Pauses a transfer operation.", + "httpMethod": "POST", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "parameters": { + "name": { + "description": "The name of the transfer operation.\nRequired.", + "required": true, + "type": "string", + "pattern": "^transferOperations/.+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/transferOperations/{transferOperationsId}:pause", + "id": "storagetransfer.transferOperations.pause", + "path": "v1/{+name}:pause" + }, + "delete": { + "description": "This method is not supported and the server returns `UNIMPLEMENTED`.", + "httpMethod": "DELETE", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "location": "path", + "description": "The name of the operation resource to be deleted.", + "required": true, + "type": "string", + "pattern": "^transferOperations/.+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/transferOperations/{transferOperationsId}", + "id": "storagetransfer.transferOperations.delete", + "path": "v1/{+name}" + }, + "list": { + "response": { + "$ref": "ListOperationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "filter": { + "location": "query", + "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" + }, + "name": { + "description": "The value `transferOperations`.", + "required": true, + "type": "string", + "pattern": "^transferOperations$", + "location": "path" }, "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" + "format": "int32", + "type": "integer", + "location": "query" } }, - "flatPath": "v1/transferOperations" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1/transferOperations", + "path": "v1/{+name}", + "id": "storagetransfer.transferOperations.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." }, "resume": { - "description": "Resumes a transfer operation that is paused.", "request": { "$ref": "ResumeTransferOperationRequest" }, - "httpMethod": "POST", - "parameterOrder": [ - "name" - ], + "description": "Resumes a transfer operation that is paused.", "response": { "$ref": "Empty" }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", "parameters": { "name": { - "pattern": "^transferOperations/.+$", "location": "path", "description": "The name of the transfer operation.\nRequired.", + "required": true, "type": "string", - "required": true + "pattern": "^transferOperations/.+$" } }, "scopes": [ @@ -165,182 +298,34 @@ "id": "storagetransfer.transferOperations.resume" }, "cancel": { - "httpMethod": "POST", + "description": "Cancels a transfer. Use the get method to check whether the cancellation succeeded or whether the operation completed despite cancellation.", "response": { "$ref": "Empty" }, "parameterOrder": [ "name" ], + "httpMethod": "POST", "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ], "parameters": { "name": { - "pattern": "^transferOperations/.+$", "location": "path", "description": "The name of the operation resource to be cancelled.", + "required": true, "type": "string", - "required": true + "pattern": "^transferOperations/.+$" } }, "flatPath": "v1/transferOperations/{transferOperationsId}: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": { - "response": { - "$ref": "Operation" - }, - "parameterOrder": [ - "name" - ], - "httpMethod": "GET", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ], - "parameters": { - "name": { - "description": "The name of the operation resource.", - "type": "string", - "required": true, - "pattern": "^transferOperations/.+$", - "location": "path" - } - }, - "flatPath": "v1/transferOperations/{transferOperationsId}", - "id": "storagetransfer.transferOperations.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." - } - } - }, - "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" + "id": "storagetransfer.transferOperations.cancel" } } } }, "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", @@ -357,25 +342,20 @@ "location": "query" }, "prettyPrint": { + "location": "query", "description": "Returns response with indentations and line breaks.", - "default": "true", "type": "boolean", - "location": "query" + "default": "true" }, "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", - "location": "query" - }, - "callback": { - "description": "JSONP", - "type": "string", - "location": "query" + "type": "string" }, "$.xgafv": { "enumDescriptions": [ @@ -390,13 +370,12 @@ "description": "V1 error format.", "type": "string" }, - "alt": { - "enum": [ - "json", - "media", - "proto" - ], + "callback": { + "description": "JSONP", "type": "string", + "location": "query" + }, + "alt": { "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -404,7 +383,13 @@ ], "location": "query", "description": "Data format for response.", - "default": "json" + "default": "json", + "enum": [ + "json", + "media", + "proto" + ], + "type": "string" }, "access_token": { "description": "OAuth access token.", @@ -415,9 +400,411 @@ "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.", + "type": "boolean", + "default": "true", + "location": "query" } }, "schemas": { + "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 originally returns it. If you use the default HTTP mapping, the `name` should have the format of `transferOperations/some/unique/name`.", + "type": "string" + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "description": "Represents the transfer operation object.", + "type": "object", + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + } + } + }, + "id": "Operation" + }, + "TransferOptions": { + "description": "TransferOptions uses three boolean parameters to define the actions\nto be performed on objects in a transfer.", + "type": "object", + "properties": { + "overwriteObjectsAlreadyExistingInSink": { + "description": "Whether overwriting objects that already exist in the sink is allowed.", + "type": "boolean" + }, + "deleteObjectsFromSourceAfterTransfer": { + "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" + }, + "deleteObjectsUniqueInSink": { + "description": "Whether objects that exist only in the sink should be deleted. Note that\nthis option and `deleteObjectsFromSourceAfterTransfer` are mutually\nexclusive.", + "type": "boolean" + } + }, + "id": "TransferOptions" + }, + "TransferSpec": { + "description": "Configuration for running a transfer.", + "type": "object", + "properties": { + "gcsDataSource": { + "description": "A Google Cloud Storage data source.", + "$ref": "GcsData" + }, + "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": { + "description": "An AWS S3 data source.", + "$ref": "AwsS3Data" + }, + "httpDataSource": { + "$ref": "HttpData", + "description": "An HTTP URL data source." + }, + "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" + } + }, + "id": "TransferSpec" + }, + "ResumeTransferOperationRequest": { + "description": "Request passed to ResumeTransferOperation.", + "type": "object", + "properties": {}, + "id": "ResumeTransferOperationRequest" + }, + "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.", + "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" + }, + "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": { + "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": "TimeOfDay" + }, + "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" + } + } + }, + "id": "ErrorLogEntry" + }, + "TransferJob": { + "description": "This resource represents the configuration of a transfer job that runs\nperiodically.", + "type": "object", + "properties": { + "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." + }, + "status": { + "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." + ], + "enum": [ + "STATUS_UNSPECIFIED", + "ENABLED", + "DISABLED", + "DELETED" + ] + }, + "schedule": { + "description": "Schedule specification.", + "$ref": "Schedule" + }, + "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" + }, + "projectId": { + "description": "The ID of the Google Cloud Platform Console project that owns the job.", + "type": "string" + }, + "lastModificationTime": { + "description": "This field cannot be changed by user requests.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "TransferJob" + }, + "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": { + "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" + }, + "TransferOperation": { + "description": "A description of the execution of a transfer.", + "type": "object", + "properties": { + "endTime": { + "description": "End time of this transfer execution.", + "format": "google-datetime", + "type": "string" + }, + "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" + }, + "status": { + "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." + ], + "enum": [ + "STATUS_UNSPECIFIED", + "IN_PROGRESS", + "PAUSED", + "SUCCESS", + "FAILED", + "ABORTED" + ] + }, + "counters": { + "$ref": "TransferCounters", + "description": "Information about the progress of the transfer operation." + }, + "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" + } + }, + "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": { + "awsAccessKey": { + "$ref": "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." + }, + "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" + } + }, + "id": "AwsS3Data" + }, + "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": { + "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" + }, + "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" + }, "PauseTransferOperationRequest": { "description": "Request passed to PauseTransferOperation.", "type": "object", @@ -428,90 +815,92 @@ "description": "A collection of counters that report the progress of a transfer operation.", "type": "object", "properties": { - "objectsDeletedFromSource": { - "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.", - "type": "string" - }, - "objectsFromSourceSkippedBySync": { - "format": "int64", - "description": "Objects in the data source that are not transferred because they already\nexist in the data sink.", - "type": "string" - }, - "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": { - "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": { - "format": "int64", - "description": "Objects that failed to be deleted from the data sink.", - "type": "string" - }, - "objectsFoundOnlyFromSink": { - "format": "int64", - "description": "Objects found only in the data sink that are scheduled to be deleted.", - "type": "string" - }, - "objectsDeletedFromSink": { - "format": "int64", - "description": "Objects that are deleted from the data sink.", - "type": "string" - }, - "bytesFromSourceSkippedBySync": { - "format": "int64", - "description": "Bytes in the data source that are not transferred because they already\nexist in the data sink.", - "type": "string" - }, "bytesFailedToDeleteFromSink": { - "format": "int64", "description": "Bytes that failed to be deleted from the data sink.", + "format": "int64", "type": "string" }, "bytesDeletedFromSink": { - "format": "int64", "description": "Bytes that are deleted from the data sink.", + "format": "int64", "type": "string" }, "bytesFromSourceFailed": { - "format": "int64", "description": "Bytes in the data source that failed during the transfer.", + "format": "int64", "type": "string" }, "objectsFromSourceFailed": { - "format": "int64", "description": "Objects in the data source that failed during the transfer.", + "format": "int64", "type": "string" }, "objectsCopiedToSink": { - "format": "int64", "description": "Objects that are copied to the data sink.", + "format": "int64", "type": "string" }, "bytesFoundOnlyFromSink": { - "format": "int64", "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", + "type": "string" + }, + "bytesCopiedToSink": { + "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,\nexcluding any that are filtered based on object conditions or skipped due\nto sync.", + "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", + "type": "string" + }, + "bytesDeletedFromSource": { + "description": "Bytes that are deleted from the data source.", + "format": "int64", + "type": "string" + }, + "objectsFoundFromSource": { + "description": "Objects found in the data source that are scheduled to be transferred,\nexcluding any that are filtered based on object conditions or skipped due\nto sync.", + "format": "int64", + "type": "string" + }, + "objectsFailedToDeleteFromSink": { + "description": "Objects that failed to be deleted from the data sink.", + "format": "int64", + "type": "string" + }, + "objectsDeletedFromSink": { + "description": "Objects that are deleted from the data sink.", + "format": "int64", + "type": "string" + }, + "objectsFoundOnlyFromSink": { + "description": "Objects found only in the data sink that are scheduled to be deleted.", + "format": "int64", + "type": "string" + }, + "bytesFromSourceSkippedBySync": { + "description": "Bytes in the data source that are not transferred because they already\nexist in the data sink.", + "format": "int64", "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": { "enumDescriptions": [ @@ -556,21 +945,19 @@ "type": "string" }, "errorCount": { - "format": "int64", "description": "Count of this type of error.\nRequired.", + "format": "int64", "type": "string" }, "errorLogEntries": { "description": "Error samples.", + "type": "array", "items": { "$ref": "ErrorLogEntry" - }, - "type": "array" + } } }, - "id": "ErrorSummary", - "description": "A summary of errors by error code, plus a count and sample error log\nentries.", - "type": "object" + "id": "ErrorSummary" }, "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/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.", @@ -604,10 +991,10 @@ }, "transferJobs": { "description": "A list of transfer jobs.", + "type": "array", "items": { "$ref": "TransferJob" - }, - "type": "array" + } } }, "id": "ListTransferJobsResponse" @@ -616,18 +1003,18 @@ "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": { - "$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" + }, + "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.", + "$ref": "TransferJob" } }, "id": "UpdateTransferJobRequest" @@ -636,423 +1023,32 @@ "description": "Conditions that determine which objects will be transferred.", "type": "object", "properties": { + "maxTimeElapsedSinceLastModification": { + "description": "`maxTimeElapsedSinceLastModification` is the complement to\n`minTimeElapsedSinceLastModification`.", + "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.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } + }, + "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" }, "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" - }, - "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" - }, - "maxTimeElapsedSinceLastModification": { - "format": "google-duration", - "description": "`maxTimeElapsedSinceLastModification` is the complement to\n`minTimeElapsedSinceLastModification`.", - "type": "string" + } } }, "id": "ObjectConditions" - }, - "Operation": { - "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": { - "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 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", - "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. Note that\nthis option and `deleteObjectsFromSourceAfterTransfer` are mutually\nexclusive.", - "type": "boolean" - }, - "overwriteObjectsAlreadyExistingInSink": { - "description": "Whether overwriting objects that already exist in the sink is allowed.", - "type": "boolean" - }, - "deleteObjectsFromSourceAfterTransfer": { - "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" - }, - "ResumeTransferOperationRequest": { - "properties": {}, - "id": "ResumeTransferOperationRequest", - "description": "Request passed to ResumeTransferOperation.", - "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 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" - }, - "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" - }, - "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" } }, "icons": { @@ -1071,7 +1067,11 @@ } } }, - "servicePath": "", + "kind": "discovery#restDescription", "description": "Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets.", - "kind": "discovery#restDescription" + "servicePath": "", + "rootUrl": "https://storagetransfer.googleapis.com/", + "basePath": "", + "ownerDomain": "google.com", + "name": "storagetransfer" } diff --git a/etc/api/streetviewpublish/v1/streetviewpublish-api.json b/etc/api/streetviewpublish/v1/streetviewpublish-api.json index 52d9eed4a8..15fadbde5f 100644 --- a/etc/api/streetviewpublish/v1/streetviewpublish-api.json +++ b/etc/api/streetviewpublish/v1/streetviewpublish-api.json @@ -1,175 +1,6 @@ { - "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", @@ -195,6 +26,33 @@ }, "id": "BatchUpdatePhotosResponse" }, + "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.", + "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" + }, "BatchDeletePhotosResponse": { "description": "Response to batch delete of one or more\nPhotos.", "type": "object", @@ -209,54 +67,27 @@ }, "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": { + "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" + }, "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" } - } + }, + "id": "Level" }, "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": {} + "properties": {}, + "id": "Empty" }, "BatchGetPhotosResponse": { "description": "Response to batch get of Photos.", @@ -273,7 +104,6 @@ "id": "BatchGetPhotosResponse" }, "Place": { - "id": "Place", "description": "Place metadata for an entity.", "type": "object", "properties": { @@ -281,10 +111,10 @@ "description": "Place identifier, as described in\nhttps://developers.google.com/places/place-id.", "type": "string" } - } + }, + "id": "Place" }, "UploadRef": { - "id": "UploadRef", "description": "Upload reference for media files.", "type": "object", "properties": { @@ -292,24 +122,25 @@ "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" } - } + }, + "id": "UploadRef" }, "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)", + "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.", "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" + }, + "longitude": { + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "format": "double", + "type": "number" } - } + }, + "id": "LatLng" }, "BatchDeletePhotosRequest": { "description": "Request to delete multiple Photos.", @@ -324,12 +155,211 @@ } }, "id": "BatchDeletePhotosRequest" + }, + "UpdatePhotoRequest": { + "description": "Request to update the metadata of a\nPhoto. Updating the pixels of a photo\nis not supported.", + "type": "object", + "properties": { + "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" + }, + "photo": { + "$ref": "Photo", + "description": "Required. Photo object containing the\nnew metadata." + } + }, + "id": "UpdatePhotoRequest" + }, + "Pose": { + "description": "Raw pose measurement for an entity.", + "type": "object", + "properties": { + "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 WGS84 ellipsoid.\nNaN indicates an unmeasured quantity.", + "format": "double", + "type": "number" + }, + "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": { + "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.", + "$ref": "LatLng" + }, + "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" + } + }, + "id": "Pose" + }, + "PhotoId": { + "description": "Identifier for a Photo.", + "type": "object", + "properties": { + "id": { + "description": "Required. A unique identifier for a photo.", + "type": "string" + } + }, + "id": "PhotoId" + }, + "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" + } + } + }, + "id": "BatchUpdatePhotosRequest" + }, + "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" + } + }, + "id": "ListPhotosResponse" + }, + "Photo": { + "description": "Photo is used to store 360 photos along with photo metadata.", + "type": "object", + "properties": { + "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" + }, + "places": { + "description": "Places where this photo belongs.", + "type": "array", + "items": { + "$ref": "Place" + } + }, + "connections": { + "description": "Connections to other photos. A connection represents the link from this\nphoto to another photo.", + "type": "array", + "items": { + "$ref": "Connection" + } + }, + "uploadReference": { + "description": "Required when creating a photo. Input only. The resource URL where the\nphoto bytes are uploaded to.", + "$ref": "UploadRef" + }, + "pose": { + "$ref": "Pose", + "description": "Pose of the photo." + }, + "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." + }, + "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" + }, + "viewCount": { + "description": "Output only. View count of the photo.", + "format": "int64", + "type": "string" + } + }, + "id": "Photo" + }, + "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": { + "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": { + "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" + }, + "PhotoResponse": { + "description": "Response payload for a single\nPhoto\nin batch operations including\nBatchGetPhotos\nand\nBatchUpdatePhotos.", + "type": "object", + "properties": { + "status": { + "$ref": "Status", + "description": "The status for the operation to get or update a single photo in the batch\nrequest." + }, + "photo": { + "$ref": "Photo", + "description": "The Photo resource, if the request\nwas successful." + } + }, + "id": "PhotoResponse" } }, "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": "Street View Publish", "auth": { @@ -351,73 +381,65 @@ "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", + "path": "v1/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.", + "httpMethod": "POST", + "parameterOrder": [], "response": { "$ref": "UploadRef" }, - "parameterOrder": [], - "httpMethod": "POST" + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ] }, "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" + "parameterOrder": [ + "photoId" ], - "flatPath": "v1/photo/{photoId}" - }, - "get": { + "httpMethod": "DELETE", "parameters": { "photoId": { "description": "Required. ID of the Photo.", "required": true, "type": "string", "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "flatPath": "v1/photo/{photoId}", + "path": "v1/photo/{photoId}", + "id": "streetviewpublish.photo.delete" + }, + "get": { + "response": { + "$ref": "Photo" + }, + "parameterOrder": [ + "photoId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "parameters": { + "photoId": { + "location": "path", + "description": "Required. ID of the Photo.", + "required": true, + "type": "string" }, "view": { "description": "Specifies if a download URL for the photo bytes should be returned in the\nPhoto response.", @@ -429,28 +451,16 @@ ] } }, - "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" + "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." }, "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" }, + "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.", "response": { "$ref": "Photo" }, @@ -458,29 +468,121 @@ "id" ], "httpMethod": "PUT", + "parameters": { + "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", + "location": "query" + }, + "id": { + "description": "Required. A unique identifier for a photo.", + "required": true, + "type": "string", + "location": "path" + } + }, "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}", + "path": "v1/photo/{id}", + "id": "streetviewpublish.photo.update" + }, + "create": { + "flatPath": "v1/photo", + "path": "v1/photo", + "id": "streetviewpublish.photo.create", + "request": { + "$ref": "Photo" }, - "flatPath": "v1/photo/{id}" + "description": "After the client finishes uploading the photo with the returned\nUploadRef,\nCreatePhoto\npublishes the uploaded Photo to\nStreet View on Google Maps.\n\nCurrently, the only way to set heading, pitch, and roll in CreatePhoto is\nthrough the [Photo Sphere XMP\nmetadata](https://developers.google.com/streetview/spherical-metadata) in\nthe photo bytes. The `pose.heading`, `pose.pitch`, `pose.roll`,\n`pose.altitude`, and `pose.level` fields in Pose are ignored for\nCreatePhoto.\n\nThis method returns the following error codes:\n\n* google.rpc.Code.INVALID_ARGUMENT if the request is malformed or if\nthe uploaded photo is not a 360 photo.\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", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ] } } }, "photos": { "methods": { + "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.", + "response": { + "$ref": "BatchGetPhotosResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "view": { + "location": "query", + "enum": [ + "BASIC", + "INCLUDE_DOWNLOAD_URL" + ], + "description": "Specifies if a download URL for the photo bytes should be returned in the\nPhoto response.", + "type": "string" + }, + "photoIds": { + "location": "query", + "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 + } + }, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "flatPath": "v1/photos:batchGet", + "path": "v1/photos:batchGet", + "id": "streetviewpublish.photos.batchGet" + }, + "list": { + "description": "Lists all the Photos that belong to\nthe user.", + "response": { + "$ref": "ListPhotosResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "filter": { + "description": "The filter expression. For example: `placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw`.\n\nThe only filter supported at the moment is `placeId`.", + "type": "string", + "location": "query" + }, + "pageToken": { + "location": "query", + "description": "The\nnextPageToken\nvalue returned from a previous\nListPhotos\nrequest, if any.", + "type": "string" + }, + "pageSize": { + "location": "query", + "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" + }, + "view": { + "description": "Specifies if a download URL for the photos bytes should be returned in the\nPhotos response.", + "type": "string", + "location": "query", + "enum": [ + "BASIC", + "INCLUDE_DOWNLOAD_URL" + ] + } + }, + "scopes": [ + "https://www.googleapis.com/auth/streetviewpublish" + ], + "flatPath": "v1/photos", + "path": "v1/photos", + "id": "streetviewpublish.photos.list" + }, "batchUpdate": { "request": { "$ref": "BatchUpdatePhotosRequest" @@ -500,13 +602,6 @@ "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" }, @@ -515,126 +610,76 @@ "$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" - } - }, + "httpMethod": "POST", + "parameters": {}, "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" - } + "flatPath": "v1/photos:batchDelete", + "path": "v1/photos:batchDelete", + "id": "streetviewpublish.photos.batchDelete" } } } }, "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.", + "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" }, - "pp": { + "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" + "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" }, - "bearer_token": { + "upload_protocol": { "location": "query", - "description": "OAuth bearer token.", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", "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" - }, - "fields": { - "description": "Selector specifying which fields to include in a partial response.", - "type": "string", - "location": "query" + "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" + }, + "callback": { + "description": "JSONP", + "type": "string", + "location": "query" + }, "$.xgafv": { "enumDescriptions": [ "v1 error format", @@ -648,17 +693,7 @@ "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", @@ -667,22 +702,22 @@ ], "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" + "default": "json", + "enum": [ + "json", + "media", + "proto" + ] } }, "version": "v1", "baseUrl": "https://streetviewpublish.googleapis.com/", - "kind": "discovery#restDescription", + "servicePath": "", "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": "" + "kind": "discovery#restDescription", + "basePath": "", + "id": "streetviewpublish:v1", + "documentationLink": "https://developers.google.com/streetview/publish/", + "revision": "20171211", + "discoveryVersion": "v1" } diff --git a/etc/api/tagmanager/v1/tagmanager-api.json b/etc/api/tagmanager/v1/tagmanager-api.json index 90ae102b78..9d060e3758 100644 --- a/etc/api/tagmanager/v1/tagmanager-api.json +++ b/etc/api/tagmanager/v1/tagmanager-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/rRpL0Yww6KCNEEWca1YtyKw9Y48\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/V5whA3DADpXWbKdtajaJL7JmgE0\"", "discoveryVersion": "v1", "id": "tagmanager:v1", "name": "tagmanager", "canonicalName": "Tag Manager", "version": "v1", - "revision": "20160310", + "revision": "20171108", "title": "Tag Manager API", "description": "Accesses Tag Manager accounts and containers.", "ownerDomain": "google.com", @@ -131,6 +131,7 @@ "enum": [ "delete", "edit", + "editWorkspace", "manage", "publish", "read" @@ -140,6 +141,7 @@ "", "", "", + "", "" ] }, @@ -235,6 +237,26 @@ "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", @@ -249,11 +271,39 @@ "containerVersion", "debugMode", "deviceName", + "elementVisibilityFirstTime", + "elementVisibilityRatio", + "elementVisibilityRecentTime", + "elementVisibilityTime", "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", @@ -275,9 +325,79 @@ "randomNumber", "referrer", "resolution", - "sdkVersion" + "scrollDepthDirection", + "scrollDepthThreshold", + "scrollDepthUnits", + "sdkVersion", + "videoCurrentTime", + "videoDuration", + "videoPercent", + "videoProvider", + "videoStatus", + "videoTitle", + "videoUrl", + "videoVisible" ], "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", "", "", "", @@ -369,6 +489,7 @@ "items": { "type": "string", "enum": [ + "amp", "android", "androidSdk5", "ios", @@ -380,6 +501,7 @@ "", "", "", + "", "" ] }, @@ -408,6 +530,7 @@ "enum": [ "delete", "edit", + "editWorkspace", "manage", "publish", "read" @@ -417,6 +540,7 @@ "", "", "", + "", "" ] } @@ -632,7 +756,8 @@ "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.create", + "tagmanager.accounts.containers.environments.update" ] } }, @@ -684,7 +809,8 @@ "description": "Folder display name.", "annotations": { "required": [ - "tagmanager.accounts.containers.folders.create" + "tagmanager.accounts.containers.folders.create", + "tagmanager.accounts.containers.folders.update" ] } } @@ -1099,7 +1225,8 @@ "description": "Tag display name.", "annotations": { "required": [ - "tagmanager.accounts.containers.tags.create" + "tagmanager.accounts.containers.tags.create", + "tagmanager.accounts.containers.tags.update" ] } }, @@ -1118,6 +1245,10 @@ "type": "string", "description": "Parent folder id." }, + "paused": { + "type": "boolean", + "description": "True if the tag is paused." + }, "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." @@ -1213,6 +1344,10 @@ "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.", @@ -1220,10 +1355,6 @@ "$ref": "Condition" } }, - "enableAllVideos": { - "$ref": "Parameter", - "description": "Reloads the videos in the page that don't already have the YT API enabled. If false, only capture events from videos that already have the API enabled. Only valid for YouTube triggers." - }, "eventName": { "$ref": "Parameter", "description": "Name of the GTM event that is fired. Only valid for Timer triggers." @@ -1239,27 +1370,55 @@ "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.triggers.create" + "tagmanager.accounts.containers.triggers.create", + "tagmanager.accounts.containers.triggers.update" ] } }, + "parameter": { + "type": "array", + "description": "Additional parameters.", + "items": { + "$ref": "Parameter" + } + }, "parentFolderId": { "type": "string", "description": "Parent folder id." }, + "selector": { + "$ref": "Parameter", + "description": "A click trigger CSS selector (i.e. \"a\", \"button\" etc.). Only valid for AMP Click trigger." + }, + "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." @@ -1268,19 +1427,24 @@ "type": "string", "description": "Defines the data layer event that causes this trigger.", "enum": [ - "ajaxSubmission", "always", + "ampClick", + "ampScroll", + "ampTimer", + "ampVisibility", "click", "customEvent", "domReady", + "elementVisibility", "formSubmission", "historyChange", "jsError", "linkClick", "pageview", + "scrollDepth", "timer", "windowLoaded", - "youTube" + "youTubeVideo" ], "enumDescriptions": [ "", @@ -1295,6 +1459,11 @@ "", "", "", + "", + "", + "", + "", + "", "" ], "annotations": { @@ -1307,9 +1476,21 @@ "$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." }, - "videoPercentageList": { + "verticalScrollPercentageList": { "$ref": "Parameter", - "description": "List of integer percentage values. The trigger will fire as each percentage is reached in any instrumented videos. Only valid for YouTube triggers." + "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", @@ -1397,7 +1578,8 @@ "description": "Variable display name.", "annotations": { "required": [ - "tagmanager.accounts.containers.variables.create" + "tagmanager.accounts.containers.variables.create", + "tagmanager.accounts.containers.variables.update" ] } }, diff --git a/etc/api/tagmanager/v2/tagmanager-api.json b/etc/api/tagmanager/v2/tagmanager-api.json index f27315e6a5..e70b5c1ea9 100644 --- a/etc/api/tagmanager/v2/tagmanager-api.json +++ b/etc/api/tagmanager/v2/tagmanager-api.json @@ -1,12 +1,12 @@ { "kind": "discovery#restDescription", - "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/COGKad2GbFNLxJtu8jKqwelYxZ0\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/haw81r2kBgXadQvfFtY6NHfr1P0\"", "discoveryVersion": "v1", "id": "tagmanager:v2", "name": "tagmanager", "canonicalName": "Tag Manager", "version": "v2", - "revision": "20170915", + "revision": "20171108", "title": "Tag Manager API", "description": "Accesses Tag Manager accounts and containers.", "ownerDomain": "google.com", @@ -211,6 +211,10 @@ "containerVersion", "debugMode", "deviceName", + "elementVisibilityFirstTime", + "elementVisibilityRatio", + "elementVisibilityRecentTime", + "elementVisibilityTime", "environmentName", "errorLine", "errorMessage", @@ -261,10 +265,12 @@ "randomNumber", "referrer", "resolution", + "scrollDepthDirection", + "scrollDepthThreshold", + "scrollDepthUnits", "sdkVersion", "videoCurrentTime", "videoDuration", - "videoElapsedTime", "videoPercent", "videoProvider", "videoStatus", @@ -369,6 +375,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ] }, @@ -1476,6 +1488,10 @@ "type": "string", "description": "GTM Tag's API relative path." }, + "paused": { + "type": "boolean", + "description": "Indicates whether the tag is paused, which prevents the tag from firing." + }, "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." @@ -1703,6 +1719,7 @@ "click", "customEvent", "domReady", + "elementVisibility", "eventTypeUnspecified", "firebaseAppException", "firebaseAppUpdate", @@ -1721,6 +1738,7 @@ "jsError", "linkClick", "pageview", + "scrollDepth", "timer", "windowLoaded", "youTubeVideo" @@ -1754,6 +1772,8 @@ "", "", "", + "", + "", "" ], "annotations": { @@ -3304,6 +3324,10 @@ "containerVersion", "debugMode", "deviceName", + "elementVisibilityFirstTime", + "elementVisibilityRatio", + "elementVisibilityRecentTime", + "elementVisibilityTime", "environmentName", "errorLine", "errorMessage", @@ -3354,10 +3378,12 @@ "randomNumber", "referrer", "resolution", + "scrollDepthDirection", + "scrollDepthThreshold", + "scrollDepthUnits", "sdkVersion", "videoCurrentTime", "videoDuration", - "videoElapsedTime", "videoPercent", "videoProvider", "videoStatus", @@ -3462,6 +3488,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ], "repeated": true, @@ -3531,6 +3563,10 @@ "containerVersion", "debugMode", "deviceName", + "elementVisibilityFirstTime", + "elementVisibilityRatio", + "elementVisibilityRecentTime", + "elementVisibilityTime", "environmentName", "errorLine", "errorMessage", @@ -3581,10 +3617,12 @@ "randomNumber", "referrer", "resolution", + "scrollDepthDirection", + "scrollDepthThreshold", + "scrollDepthUnits", "sdkVersion", "videoCurrentTime", "videoDuration", - "videoElapsedTime", "videoPercent", "videoProvider", "videoStatus", @@ -3689,6 +3727,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ], "repeated": true, @@ -3784,6 +3828,10 @@ "containerVersion", "debugMode", "deviceName", + "elementVisibilityFirstTime", + "elementVisibilityRatio", + "elementVisibilityRecentTime", + "elementVisibilityTime", "environmentName", "errorLine", "errorMessage", @@ -3834,10 +3882,12 @@ "randomNumber", "referrer", "resolution", + "scrollDepthDirection", + "scrollDepthThreshold", + "scrollDepthUnits", "sdkVersion", "videoCurrentTime", "videoDuration", - "videoElapsedTime", "videoPercent", "videoProvider", "videoStatus", @@ -3942,6 +3992,12 @@ "", "", "", + "", + "", + "", + "", + "", + "", "" ], "location": "query" diff --git a/etc/api/taskqueue/v1beta2/taskqueue-api.json b/etc/api/taskqueue/v1beta2/taskqueue-api.json index fe121d5f71..dec04c5f7e 100644 --- a/etc/api/taskqueue/v1beta2/taskqueue-api.json +++ b/etc/api/taskqueue/v1beta2/taskqueue-api.json @@ -20,7 +20,7 @@ "basePath": "/taskqueue/v1beta2/projects/", "rootUrl": "https://www.googleapis.com/", "servicePath": "taskqueue/v1beta2/projects/", - "batchPath": "batch", + "batchPath": "batch/taskqueue/v1beta2", "parameters": { "alt": { "type": "string", diff --git a/etc/api/testing/v1/testing-api.json b/etc/api/testing/v1/testing-api.json index 4d3dc8b6e9..8df1412fd4 100644 --- a/etc/api/testing/v1/testing-api.json +++ b/etc/api/testing/v1/testing-api.json @@ -1,16 +1,90 @@ { + "ownerDomain": "google.com", + "name": "testing", + "batchPath": "batch", + "revision": "20171201", + "id": "testing:v1", + "documentationLink": "https://developers.google.com/cloud-test-lab/", + "title": "Google Cloud Testing API", "discoveryVersion": "v1", "ownerName": "Google", "resources": { + "testEnvironmentCatalog": { + "methods": { + "get": { + "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": { + "environmentType": { + "location": "path", + "enum": [ + "ENVIRONMENT_TYPE_UNSPECIFIED", + "ANDROID", + "NETWORK_CONFIGURATION" + ], + "description": "The type of environment that should be listed.\nRequired", + "required": true, + "type": "string" + }, + "projectId": { + "location": "query", + "description": "For authorization, the cloud project requesting the TestEnvironmentCatalog.\nOptional", + "type": "string" + } + }, + "flatPath": "v1/testEnvironmentCatalog/{environmentType}", + "path": "v1/testEnvironmentCatalog/{environmentType}", + "id": "testing.testEnvironmentCatalog.get", + "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" + } + } + }, "projects": { "resources": { "testMatrices": { "methods": { + "create": { + "path": "v1/projects/{projectId}/testMatrices", + "id": "testing.projects.testMatrices.create", + "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", + "request": { + "$ref": "TestMatrix" + }, + "response": { + "$ref": "TestMatrix" + }, + "parameterOrder": [ + "projectId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "projectId": { + "location": "path", + "description": "The GCE project under which this job will run.", + "required": true, + "type": "string" + }, + "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" + }, "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" }, @@ -19,26 +93,29 @@ "testMatrixId" ], "httpMethod": "POST", + "parameters": { + "projectId": { + "location": "path", + "description": "Cloud project that owns the test.", + "required": true, + "type": "string" + }, + "testMatrixId": { + "location": "path", + "description": "Test matrix that will be canceled.", + "required": true, + "type": "string" + } + }, "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" - } - } + "flatPath": "v1/projects/{projectId}/testMatrices/{testMatrixId}:cancel", + "path": "v1/projects/{projectId}/testMatrices/{testMatrixId}:cancel", + "id": "testing.projects.testMatrices.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" }, "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" }, @@ -52,93 +129,23 @@ "https://www.googleapis.com/auth/cloud-platform.read-only" ], "parameters": { - "projectId": { - "description": "Cloud project that owns the test matrix.", - "type": "string", + "testMatrixId": { + "description": "Unique test matrix id which was assigned by the service.", "required": true, + "type": "string", "location": "path" }, - "testMatrixId": { + "projectId": { "location": "path", - "description": "Unique test matrix id which was assigned by the service.", - "type": "string", - "required": true + "description": "Cloud project that owns the test matrix.", + "required": true, + "type": "string" } }, "flatPath": "v1/projects/{projectId}/testMatrices/{testMatrixId}", + "path": "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" + "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" } } } @@ -146,16 +153,10 @@ } }, "parameters": { - "pp": { - "location": "query", - "description": "Pretty-print response.", - "default": "true", - "type": "boolean" - }, "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.", @@ -163,43 +164,43 @@ "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.", - "default": "true", "type": "boolean", + "default": "true", "location": "query" }, "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", + "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": { - "location": "query", - "description": "JSONP", - "type": "string" + "location": "query" }, "alt": { "enum": [ @@ -217,97 +218,254 @@ "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" + }, + "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" } }, "schemas": { - "AndroidDeviceCatalog": { - "description": "The currently supported Android devices.", - "type": "object", + "ToolResultsExecution": { "properties": { - "runtimeConfiguration": { - "description": "The set of supported runtime configurations.\n@OutputOnly", - "$ref": "AndroidRuntimeConfiguration" + "executionId": { + "description": "A tool results execution ID.\n@OutputOnly", + "type": "string" }, - "versions": { - "description": "The set of supported Android OS versions.\n@OutputOnly", - "items": { - "$ref": "AndroidVersion" - }, - "type": "array" + "projectId": { + "description": "The cloud project that owns the tool results execution.\n@OutputOnly", + "type": "string" }, - "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", + "historyId": { + "description": "A tool results history ID.\n@OutputOnly", "type": "string" } }, - "id": "ClientInfo" + "id": "ToolResultsExecution", + "description": "Represents a tool results execution resource.\n\nThis has the results of a TestMatrix.", + "type": "object" + }, + "Distribution": { + "properties": { + "marketShare": { + "description": "The estimated fraction (0-1) of the total market with this configuration.\n@OutputOnly", + "format": "double", + "type": "number" + }, + "measurementTime": { + "description": "The time this distribution was measured.\n@OutputOnly", + "format": "google-datetime", + "type": "string" + } + }, + "id": "Distribution", + "description": "Data about the relative number of devices running a\ngiven configuration of the Android platform.", + "type": "object" + }, + "AndroidRoboTest": { + "properties": { + "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", + "type": "array", + "items": { + "$ref": "RoboDirective" + } + }, + "maxDepth": { + "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", + "format": "int32", + "type": "integer" + }, + "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" + }, + "appInitialActivity": { + "description": "The initial activity that should be used to start the app.\nOptional", + "type": "string" + }, + "maxSteps": { + "description": "The max number of steps Robo can execute.\nDefault is no limit.\nOptional", + "format": "int32", + "type": "integer" + } + }, + "id": "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" + }, + "ToolResultsHistory": { + "description": "Represents a tool results history resource.", + "type": "object", + "properties": { + "projectId": { + "description": "The cloud project that owns the tool results history.\nRequired", + "type": "string" + }, + "historyId": { + "description": "A tool results history ID.\nRequired", + "type": "string" + } + }, + "id": "ToolResultsHistory" + }, + "Orientation": { + "description": "Screen orientation of the device.", + "type": "object", + "properties": { + "name": { + "description": "A human-friendly name for this orientation.\nExample: \"portrait\"\n@OutputOnly", + "type": "string" + }, + "id": { + "description": "The id for this orientation.\nExample: \"portrait\"\n@OutputOnly", + "type": "string" + }, + "tags": { + "description": "Tags for this dimension.\nExamples: \"default\"", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "Orientation" + }, + "NetworkConfigurationCatalog": { + "properties": { + "configurations": { + "type": "array", + "items": { + "$ref": "NetworkConfiguration" + } + } + }, + "id": "NetworkConfigurationCatalog", + "type": "object" + }, + "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", + "properties": { + "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" + }, + "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.", + "type": "array", + "items": { + "format": "int32", + "type": "integer" + } + }, + "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.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "id": "AndroidTestLoop" + }, + "GoogleAuto": { + "properties": {}, + "id": "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" + }, + "AndroidDeviceCatalog": { + "properties": { + "versions": { + "description": "The set of supported Android OS versions.\n@OutputOnly", + "type": "array", + "items": { + "$ref": "AndroidVersion" + } + }, + "runtimeConfiguration": { + "$ref": "AndroidRuntimeConfiguration", + "description": "The set of supported runtime configurations.\n@OutputOnly" + }, + "models": { + "description": "The set of supported Android device models.\n@OutputOnly", + "type": "array", + "items": { + "$ref": "AndroidModel" + } + } + }, + "id": "AndroidDeviceCatalog", + "description": "The currently supported Android devices.", + "type": "object" + }, + "AndroidDeviceList": { + "properties": { + "androidDevices": { + "description": "A list of Android devices\nRequired", + "type": "array", + "items": { + "$ref": "AndroidDevice" + } + } + }, + "id": "AndroidDeviceList", + "description": "A list of Android device configurations in which the test is to be executed.", + "type": "object" + }, + "ClientInfo": { + "properties": { + "name": { + "description": "Client name, such as gcloud.\nRequired", + "type": "string" + }, + "clientInfoDetails": { + "description": "The list of detailed information about client.", + "type": "array", + "items": { + "$ref": "ClientInfoDetail" + } + } + }, + "id": "ClientInfo", + "description": "Information about the client which invoked the test.", + "type": "object" }, "EnvironmentMatrix": { "description": "The matrix of environments in which the test is to be executed.", "type": "object", "properties": { + "androidMatrix": { + "$ref": "AndroidMatrix", + "description": "A matrix of Android devices." + }, "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" @@ -350,49 +508,49 @@ "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": { + "year": { + "description": "Year of date. Must be from 1 to 9999, or 0 if specifying a date without\na year.", "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.", + "format": "int32", "type": "integer" }, - "year": { + "month": { + "description": "Month of year. Must be from 1 to 12.", "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" + "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" }, "Account": { - "description": "Identifies an account and how to log into it", - "type": "object", "properties": { "googleAuto": { - "description": "An automatic google login account", - "$ref": "GoogleAuto" + "$ref": "GoogleAuto", + "description": "An automatic google login account" } }, - "id": "Account" + "id": "Account", + "description": "Identifies an account and how to log into it", + "type": "object" }, "TestEnvironmentCatalog": { "description": "A description of a test environment.", "type": "object", "properties": { "androidDeviceCatalog": { - "$ref": "AndroidDeviceCatalog", - "description": "Android devices suitable for running Android Instrumentation Tests." + "description": "Android devices suitable for running Android Instrumentation Tests.", + "$ref": "AndroidDeviceCatalog" }, "networkConfigurationCatalog": { - "$ref": "NetworkConfigurationCatalog", - "description": "Supported network configurations" + "description": "Supported network configurations", + "$ref": "NetworkConfigurationCatalog" } }, "id": "TestEnvironmentCatalog" @@ -401,19 +559,19 @@ "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" }, + "tags": { + "description": "Tags for this dimension.\nExamples: \"default\"", + "type": "array", + "items": { + "type": "string" + } + }, "region": { - "description": "A human-friendy string representing the region for this locale.\nExample: \"United States\"\nNot present for every locale.\n@OutputOnly", + "description": "A human-friendly string representing the region for this locale.\nExample: \"United States\"\nNot present for every locale.\n@OutputOnly", "type": "string" }, "name": { @@ -444,51 +602,47 @@ "properties": { "orientations": { "description": "The set of available orientations.\n@OutputOnly", + "type": "array", "items": { "$ref": "Orientation" - }, - "type": "array" + } }, "locales": { "description": "The set of available locales.\n@OutputOnly", + "type": "array", "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", + "locale": { + "description": "The locale the test device used for testing.\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" }, + "androidVersionId": { + "description": "The id of the Android OS version 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" + "id": "AndroidDevice", + "description": "A single Android device.", + "type": "object" }, "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" @@ -496,58 +650,62 @@ "upRule": { "$ref": "TrafficRule", "description": "The emulation rule applying to the upload traffic" + }, + "downRule": { + "description": "The emulation rule applying to the download traffic", + "$ref": "TrafficRule" } }, "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", + "executionId": { + "description": "A tool results execution ID.\n@OutputOnly", "type": "string" }, - "historyId": { - "description": "A tool results history ID.\n@OutputOnly", + "stepId": { + "description": "A tool results step 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", + "historyId": { + "description": "A tool results history ID.\n@OutputOnly", "type": "string" } }, - "id": "ToolResultsStep" + "id": "ToolResultsStep", + "description": "Represents a tool results step resource.\n\nThis has the results of a TestExecution.", + "type": "object" }, "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", + "format": "float", "type": "number" }, "bandwidth": { - "format": "float", "description": "Bandwidth in kbits/second", + "format": "float", "type": "number" }, "packetDuplicationRatio": { - "format": "float", "description": "Packet duplication ratio (0.0 - 1.0)", + "format": "float", + "type": "number" + }, + "delay": { + "description": "Packet delay, must be \u003e= 0", + "format": "google-duration", + "type": "string" + }, + "packetLossRatio": { + "description": "Packet loss ratio (0.0 - 1.0)", + "format": "float", "type": "number" } }, @@ -559,16 +717,9 @@ "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" + "description": "The APK containing the test code to be executed.\nRequired", + "$ref": "FileReference" }, "testRunnerClass": { "description": "The InstrumentationTestRunner class.\nOptional, default is determined by examining the application's manifest.", @@ -579,8 +730,8 @@ "type": "string" }, "appApk": { - "description": "The APK for the application under test.\nRequired", - "$ref": "FileReference" + "$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.", @@ -599,6 +750,13 @@ ], "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" + }, + "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.", + "type": "array", + "items": { + "type": "string" + } } }, "id": "AndroidInstrumentationTest" @@ -608,8 +766,8 @@ "type": "object", "properties": { "obbFile": { - "$ref": "ObbFile", - "description": "A reference to an opaque binary blob file" + "description": "A reference to an opaque binary blob file", + "$ref": "ObbFile" } }, "id": "DeviceFile" @@ -633,13 +791,13 @@ "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" + }, + "value": { + "description": "Value for the environment variable", + "type": "string" } }, "id": "EnvironmentVariable" @@ -655,34 +813,24 @@ }, "id": "Environment" }, - "TestExecution": { - "description": "Specifies a single test to be executed in a single environment.", + "GoogleCloudStorage": { + "description": "A storage location within Google cloud storage (GCS).", "type": "object", "properties": { - "id": { - "description": "Unique id set by the backend.\n@OutputOnly", + "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" - }, - "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" - }, + } + }, + "id": "GoogleCloudStorage" + }, + "TestExecution": { + "properties": { "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.", @@ -708,121 +856,111 @@ "INCOMPATIBLE_ARCHITECTURE", "CANCELLED", "INVALID" - ] + ], + "description": "Indicates the current progress of the test execution (e.g., FINISHED).\n@OutputOnly", + "type": "string" }, "toolResultsStep": { - "description": "Where the results for this execution are written.\n@OutputOnly", - "$ref": "ToolResultsStep" + "$ref": "ToolResultsStep", + "description": "Where the results for this execution are written.\n@OutputOnly" + }, + "testSpecification": { + "$ref": "TestSpecification", + "description": "How to run the test.\n@OutputOnly" }, "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", + "id": { + "description": "Unique id set by the backend.\n@OutputOnly", + "type": "string" + }, + "timestamp": { + "description": "The time this test execution was initially created.\n@OutputOnly", + "format": "google-datetime", + "type": "string" + }, + "testDetails": { + "description": "Additional details about the running test.\n@OutputOnly", + "$ref": "TestDetails" + }, + "matrixId": { + "description": "Id of the containing TestMatrix.\n@OutputOnly", "type": "string" } }, - "id": "GoogleCloudStorage" + "id": "TestExecution", + "description": "Specifies a single test to be executed in a single environment.", + "type": "object" }, "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": { + "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" + }, + "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" + }, "actionType": { + "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." + ], "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", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "orientations": { "description": "The set of orientations to test with.\nUse the EnvironmentDiscoveryService to get supported options.\nRequired", + "type": "array", "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", + "type": "array", + "items": { + "type": "string" + } + }, + "locales": { + "description": "The set of locales the test device will enable for testing.\nUse the EnvironmentDiscoveryService to get supported options.\nRequired", + "type": "array", + "items": { + "type": "string" + } } }, - "id": "AndroidMatrix" + "id": "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" }, "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", @@ -832,26 +970,28 @@ "DEVICE_FORM_UNSPECIFIED", "VIRTUAL", "PHYSICAL" - ] + ], + "description": "Whether this device is virtual or physical.\n@OutputOnly", + "type": "string" }, "screenDensity": { - "format": "int32", "description": "Screen density in DPI.\nThis corresponds to ro.sf.lcd_density\n@OutputOnly", + "format": "int32", "type": "integer" }, "supportedVersionIds": { "description": "The set of Android versions this device supports.\n@OutputOnly", + "type": "array", "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", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "name": { "description": "The human-readable marketing name for this device model.\nExamples: \"Nexus 5\", \"Galaxy S5\"\n@OutputOnly", @@ -863,14 +1003,32 @@ }, "tags": { "description": "Tags for this dimension.\nExamples: \"default\", \"preview\", \"deprecated\"", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } }, "manufacturer": { "description": "The manufacturer of this device.\n@OutputOnly", "type": "string" + }, + "brand": { + "description": "The company that this device is branded with.\nExample: \"Google\", \"Samsung\"\n@OutputOnly", + "type": "string" + }, + "screenX": { + "description": "Screen size in the horizontal (X) dimension measured in pixels.\n@OutputOnly", + "format": "int32", + "type": "integer" + }, + "codename": { + "description": "The name of the industrial design.\nThis corresponds to android.os.Build.DEVICE\n@OutputOnly", + "type": "string" + }, + "screenY": { + "description": "Screen size in the vertical (Y) dimension measured in pixels.\n@OutputOnly", + "format": "int32", + "type": "integer" } }, "id": "AndroidModel", @@ -881,34 +1039,34 @@ "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).", + "type": "array", "items": { "$ref": "EnvironmentVariable" - }, - "type": "array" + } + }, + "account": { + "$ref": "Account", + "description": "The device will be logged in on this account for the duration of the test.\nOptional" + }, + "directoriesToPull": { + "description": "List of directories on the device to upload to GCS at the end of the test;\nthey must be absolute paths under /sdcard or /data/local/tmp.\nPath names are restricted to characters a-z A-Z 0-9 _ - . + and /\n\nNote: The paths /sdcard and /data will be made available and treated as\nimplicit path substitutions. E.g. if /sdcard on a particular device does\nnot map to external storage, the system will replace it with the external\nstorage path prefix for that device.\n\nOptional", + "type": "array", + "items": { + "type": "string" + } + }, + "filesToPush": { + "description": "List of files to push to the device before starting the test.\n\nOptional", + "type": "array", + "items": { + "$ref": "DeviceFile" + } } }, "id": "TestSetup" @@ -916,8 +1074,8 @@ "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.", + "format": "google-duration", "type": "string" }, "autoGoogleLogin": { @@ -925,16 +1083,16 @@ "type": "boolean" }, "androidTestLoop": { - "$ref": "AndroidTestLoop", - "description": "An Android Application with a Test Loop" - }, - "androidRoboTest": { - "description": "An Android robo test.", - "$ref": "AndroidRoboTest" + "description": "An Android Application with a Test Loop", + "$ref": "AndroidTestLoop" }, "testSetup": { - "description": "Test setup requirements e.g. files to install, bootstrap scripts\nOptional", - "$ref": "TestSetup" + "$ref": "TestSetup", + "description": "Test setup requirements e.g. files to install, bootstrap scripts\nOptional" + }, + "androidRoboTest": { + "$ref": "AndroidRoboTest", + "description": "An Android robo test." }, "androidInstrumentationTest": { "description": "An Android instrumentation test.", @@ -953,42 +1111,59 @@ "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": { + "clientInfo": { + "$ref": "ClientInfo", + "description": "Information about the client which invoked the test.\nOptional" + }, + "testExecutions": { + "description": "The list of test executions that the service creates for this matrix.\n@OutputOnly", + "type": "array", + "items": { + "$ref": "TestExecution" + } + }, + "timestamp": { + "description": "The time this test matrix was initially created.\n@OutputOnly", + "format": "google-datetime", + "type": "string" + }, "environmentMatrix": { - "description": "How the host machine(s) are configured.\nRequired", - "$ref": "EnvironmentMatrix" + "$ref": "EnvironmentMatrix", + "description": "How the host machine(s) are configured.\nRequired" }, "resultStorage": { - "description": "Where the results for the matrix are written.\nRequired", - "$ref": "ResultStorage" + "$ref": "ResultStorage", + "description": "Where the results for the matrix are written.\nRequired" }, "testMatrixId": { "description": "Unique id set by the service.\n@OutputOnly", "type": "string" }, "invalidMatrixDetails": { + "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\"." + ], "enum": [ "INVALID_MATRIX_DETAILS_UNSPECIFIED", "DETAILS_UNAVAILABLE", @@ -1012,29 +1187,7 @@ "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\"." - ] + "type": "string" }, "state": { "enumDescriptions": [ @@ -1066,71 +1219,37 @@ "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", + "projectId": { + "description": "The cloud project that owns the test matrix.\n@OutputOnly", "type": "string" } }, - "id": "TestMatrix" + "id": "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" }, - "AndroidVersion": { - "description": "A version of the Android OS", + "ResultStorage": { + "description": "Locations where the results of running the test are stored.", "type": "object", "properties": { - "releaseDate": { - "$ref": "Date", - "description": "The date this Android version became available in the market.\n@OutputOnly" + "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" }, - "id": { - "description": "An opaque id for this Android version.\nUse this id to invoke the TestExecutionService.\n@OutputOnly", - "type": "string" + "googleCloudStorage": { + "description": "Required.", + "$ref": "GoogleCloudStorage" }, - "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" + "toolResultsExecution": { + "$ref": "ToolResultsExecution", + "description": "The tool results execution that results are written to.\n@OutputOnly" } }, - "id": "AndroidVersion" + "id": "ResultStorage" }, "FileReference": { "description": "A reference to a file, used for user inputs.", @@ -1143,6 +1262,45 @@ }, "id": "FileReference" }, + "AndroidVersion": { + "description": "A version of the Android OS", + "type": "object", + "properties": { + "apiLevel": { + "description": "The API level for this Android version.\nExamples: 18, 19\n@OutputOnly", + "format": "int32", + "type": "integer" + }, + "distribution": { + "description": "Market share for this version.\n@OutputOnly", + "$ref": "Distribution" + }, + "releaseDate": { + "description": "The date this Android version became available in the market.\n@OutputOnly", + "$ref": "Date" + }, + "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\"", + "type": "array", + "items": { + "type": "string" + } + }, + "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" + } + }, + "id": "AndroidVersion" + }, "TestDetails": { "description": "Additional details about the progress of the running test.", "type": "object", @@ -1153,164 +1311,13 @@ }, "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", + "type": "array", "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": { @@ -1323,25 +1330,18 @@ "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/cloud-platform.read-only": { + "description": "View 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", + "description": "Allows developers to run automated tests for their mobile applications on Google infrastructure.", + "servicePath": "", "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" + "basePath": "" } diff --git a/etc/api/toolresults/v1beta3/toolresults-api.json b/etc/api/toolresults/v1beta3/toolresults-api.json index f4160d5062..bc3faa56c3 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/LjX4DQyEaiPzYt4A5I3k4P7otfY\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/Yf3Z0mLn7GU4E3aNY8w0QjeYwBA\"", "discoveryVersion": "v1", "id": "toolresults:v1beta3", "name": "toolresults", "canonicalName": "Tool Results", "version": "v1beta3", - "revision": "20170926", + "revision": "20171211", "title": "Cloud Tool Results API", "description": "Reads and publishes results from Firebase Test Lab.", "ownerDomain": "google.com", @@ -122,7 +122,7 @@ }, "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." + "description": "The flag indicates whether Android Test Orchestrator will be used to run test or not." } } }, @@ -185,7 +185,7 @@ "properties": { "typeUrl": { "type": "string", - "description": "A URL/resource name whose content describes the type of the serialized protocol buffer message.\n\nFor URLs which use the scheme `http`, `https`, or no scheme, the following restrictions and interpretations apply:\n\n* If no scheme is provided, `https` is assumed. * The last segment of the URL's path must represent the fully qualified name of the type (as in `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted). * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.)\n\nSchemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics." + "description": "A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. The last segment of the URL's path must represent the fully qualified name of the type (as in `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme `http`, `https`, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.)\n\nNote: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics." }, "value": { "type": "string", @@ -431,6 +431,91 @@ } } }, + "GraphicsStats": { + "id": "GraphicsStats", + "type": "object", + "description": "Graphics statistics for the App. The information is collected from 'adb shell dumpsys graphicsstats'. For more info see: https://developer.android.com/training/testing/performance.html Statistics will only be present for API 23+.", + "properties": { + "buckets": { + "type": "array", + "description": "Histogram of frame render times. There should be 154 buckets ranging from [5ms, 6ms) to [4950ms, infinity)", + "items": { + "$ref": "GraphicsStatsBucket" + } + }, + "highInputLatencyCount": { + "type": "string", + "description": "Total \"high input latency\" events.", + "format": "int64" + }, + "jankyFrames": { + "type": "string", + "description": "Total frames with slow render time. Should be \u003c= total_frames.", + "format": "int64" + }, + "missedVsyncCount": { + "type": "string", + "description": "Total \"missed vsync\" events.", + "format": "int64" + }, + "p50Millis": { + "type": "string", + "description": "50th percentile frame render time in milliseconds.", + "format": "int64" + }, + "p90Millis": { + "type": "string", + "description": "90th percentile frame render time in milliseconds.", + "format": "int64" + }, + "p95Millis": { + "type": "string", + "description": "95th percentile frame render time in milliseconds.", + "format": "int64" + }, + "p99Millis": { + "type": "string", + "description": "99th percentile frame render time in milliseconds.", + "format": "int64" + }, + "slowBitmapUploadCount": { + "type": "string", + "description": "Total \"slow bitmap upload\" events.", + "format": "int64" + }, + "slowDrawCount": { + "type": "string", + "description": "Total \"slow draw\" events.", + "format": "int64" + }, + "slowUiThreadCount": { + "type": "string", + "description": "Total \"slow UI thread\" events.", + "format": "int64" + }, + "totalFrames": { + "type": "string", + "description": "Total frames rendered by package.", + "format": "int64" + } + } + }, + "GraphicsStatsBucket": { + "id": "GraphicsStatsBucket", + "type": "object", + "properties": { + "frameCount": { + "type": "string", + "description": "Number of frames in the bucket.", + "format": "int64" + }, + "renderMillis": { + "type": "string", + "description": "Lower bound of render time in milliseconds.", + "format": "int64" + } + } + }, "History": { "id": "History", "type": "object", @@ -684,6 +769,10 @@ "type": "string", "description": "A tool results execution ID." }, + "graphicsStats": { + "$ref": "GraphicsStats", + "description": "Graphics statistics for the entire run. Statistics are reset at the beginning of the run and collected at the end of the run." + }, "historyId": { "type": "string", "description": "A tool results history ID." @@ -1114,11 +1203,19 @@ "description": "Type of issue. Required.", "enum": [ "anr", + "compatibleWithOrchestrator", "fatalException", + "launcherActivityNotFound", "nativeCrash", - "unspecifiedType" + "startActivityNotFound", + "unspecifiedType", + "unusedRoboDirective" ], "enumDescriptions": [ + "", + "", + "", + "", "", "", "", @@ -1127,7 +1224,7 @@ }, "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." + "description": "Warning message with additional details of the issue. Should always be a message from com.google.devtools.toolresults.v1.warnings" } } }, @@ -1206,7 +1303,7 @@ "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.", + "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 currently 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://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- ) to obtain a formatter capable of generating timestamps in this format.", "properties": { "nanos": { "type": "integer", diff --git a/etc/api/tpu/v1alpha1/tpu-api.json b/etc/api/tpu/v1alpha1/tpu-api.json new file mode 100644 index 0000000000..b093b5f6d0 --- /dev/null +++ b/etc/api/tpu/v1alpha1/tpu-api.json @@ -0,0 +1,805 @@ +{ + "parameters": { + "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": { + "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": { + "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": { + "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.", + "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" + }, + "upload_protocol": { + "location": "query", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string" + } + }, + "version": "v1alpha1", + "baseUrl": "https://tpu.googleapis.com/", + "servicePath": "", + "description": "TPU API provides customers with access to Google TPU technology.", + "kind": "discovery#restDescription", + "basePath": "", + "id": "tpu:v1alpha1", + "documentationLink": "https://cloud.google.com/tpu/", + "revision": "20171121", + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "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" + } + } + }, + "ListNodesResponse": { + "description": "Response for ListNodes.", + "type": "object", + "properties": { + "nodes": { + "description": "The listed nodes.", + "type": "array", + "items": { + "$ref": "Node" + } + }, + "nextPageToken": { + "description": "The next page token or empty if none.", + "type": "string" + } + }, + "id": "ListNodesResponse" + }, + "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": { + "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 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" + } + } + } + }, + "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": {} + }, + "ReimageNodeRequest": { + "id": "ReimageNodeRequest", + "description": "Request for ReimageNode.", + "type": "object", + "properties": { + "tensorflowVersion": { + "description": "The version for reimage to create.", + "type": "string" + } + } + }, + "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.\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" + } + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Cross-service attributes for the location. For example\n\n {\"cloud.googleapis.com/region\": \"us-east1\"}", + "type": "object" + } + } + }, + "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" + }, + "OperationMetadata": { + "id": "OperationMetadata", + "description": "Represents the metadata of the long-running operation.", + "type": "object", + "properties": { + "verb": { + "description": "[Output only] Name of the verb executed by the operation.", + "type": "string" + }, + "createTime": { + "description": "[Output only] The time the operation was created.", + "format": "google-datetime", + "type": "string" + }, + "statusDetail": { + "description": "[Output only] Human-readable status of the operation, if any.", + "type": "string" + }, + "apiVersion": { + "description": "[Output only] API version used to start the operation.", + "type": "string" + }, + "target": { + "description": "[Output only] Server-defined resource path for the target of the operation.", + "type": "string" + }, + "endTime": { + "description": "[Output only] The time the operation finished running.", + "format": "google-datetime", + "type": "string" + }, + "cancelRequested": { + "description": "[Output only] Identifies whether the user has requested cancellation\nof the operation. Operations that have successfully been cancelled\nhave Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", + "type": "boolean" + } + } + }, + "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.", + "type": "array", + "items": { + "$ref": "Location" + } + }, + "nextPageToken": { + "description": "The standard List next-page token.", + "type": "string" + } + }, + "id": "ListLocationsResponse" + }, + "ResetNodeRequest": { + "description": "Request for ResetNode.", + "type": "object", + "properties": {}, + "id": "ResetNodeRequest" + }, + "Node": { + "description": "A TPU instance.", + "type": "object", + "properties": { + "port": { + "description": "Output only.\nDEPRECATED! Use network_endpoints instead.\nThe network port for the TPU Node as visible to GCE instances.", + "type": "string" + }, + "serviceAccount": { + "description": "The service account used to run the tensor flow services within the node.\nTo share resources, including Google Cloud Storage data, with the\nTensorflow job running in the Node, this account must have permissions to\nthat data.\nOutput only.", + "type": "string" + }, + "healthDescription": { + "description": "If this field is populated, it contains a description of why the TPU Node\nis unhealthy.\nOutput only.", + "type": "string" + }, + "network": { + "description": "The name of a network they wish to peer the TPU node to. It must be a\npreexisting GCE network inside of the project on which this API has been\nactivated. If none is provided, \"default\" will be used.", + "type": "string" + }, + "ipAddress": { + "description": "Output only.\nDEPRECATED! Use network_endpoints instead.\nThe network address for the TPU Node as visible to GCE instances.", + "type": "string" + }, + "cidrBlock": { + "description": "The CIDR block that the TPU node will use when selecting //an IP address.\nThis CIDR block must be a /29 block; the GCE networks API forbids a smaller\nblock, and using a larger block would be wasteful (a node can only consume\none IP address). Errors will occur if the CIDR block has already been used\nfor a currently existing TPU node, the CIDR block conflicts with any\nsubnetworks in the user's provided network, or the provided network is\npeered with another network that is using that CIDR block.\nRequired.", + "type": "string" + }, + "createTime": { + "description": "The time when the node was created.\nOutput only.", + "format": "google-datetime", + "type": "string" + }, + "tensorflowVersion": { + "description": "The version of Tensorflow running in the Node.\nRequired.", + "type": "string" + }, + "description": { + "description": "The user-supplied description of the TPU. Maximum of 512 characters.", + "type": "string" + }, + "networkEndpoints": { + "description": "Output only. The network endpoints where TPU workers can be accessed and sent work.\nIt is recommended that Tensorflow clients of the node reach out to the 0th\nentry in this map first.", + "type": "array", + "items": { + "$ref": "NetworkEndpoint" + } + }, + "state": { + "description": "The current state for the TPU Node.\nOutput only.", + "type": "string", + "enumDescriptions": [ + "TPU node state is not known/set.", + "TPU node is being created.", + "TPU node has been created and is fully usable.", + "TPU node is restarting.", + "TPU node is undergoing reimaging.", + "TPU node is being deleted.", + "TPU node is being repaired and may be unusable. Details can be\nfound in the `help_description` field." + ], + "enum": [ + "STATE_UNSPECIFIED", + "CREATING", + "READY", + "RESTARTING", + "REIMAGING", + "DELETING", + "REPAIRING" + ] + }, + "acceleratorType": { + "description": "The type of hardware accelerators associated with this node.\nRequired.", + "type": "string" + }, + "name": { + "description": "The immutable name of the TPU", + "type": "string" + } + }, + "id": "Node" + }, + "NetworkEndpoint": { + "description": "A network endpoint over which a TPU worker can be reached.", + "type": "object", + "properties": { + "ipAddress": { + "description": "The IP address of this network endpoint.", + "type": "string" + }, + "port": { + "description": "The port of this network endpoint.", + "format": "int32", + "type": "integer" + } + }, + "id": "NetworkEndpoint" + } + }, + "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": "TPU", + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "rootUrl": "https://tpu.googleapis.com/", + "ownerDomain": "google.com", + "name": "tpu", + "batchPath": "batch", + "fullyEncodeReservedExpansion": true, + "title": "Cloud TPU API", + "ownerName": "Google", + "resources": { + "projects": { + "resources": { + "locations": { + "methods": { + "list": { + "parameters": { + "name": { + "pattern": "^projects/[^/]+$", + "location": "path", + "description": "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": { + "location": "query", + "description": "The standard list filter.", + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha1/projects/{projectsId}/locations", + "path": "v1alpha1/{+name}/locations", + "id": "tpu.projects.locations.list", + "description": "Lists information about the supported locations for this service.", + "response": { + "$ref": "ListLocationsResponse" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET" + }, + "get": { + "path": "v1alpha1/{+name}", + "id": "tpu.projects.locations.get", + "description": "Get information about a location.", + "response": { + "$ref": "Location" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "GET", + "parameters": { + "name": { + "description": "Resource name for the location.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}" + } + }, + "resources": { + "nodes": { + "methods": { + "create": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "The parent resource name.", + "required": true, + "type": "string" + }, + "nodeId": { + "location": "query", + "description": "The unqualified resource name.", + "type": "string" + } + }, + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/nodes", + "id": "tpu.projects.locations.nodes.create", + "path": "v1alpha1/{+parent}/nodes", + "description": "Creates a node.", + "request": { + "$ref": "Node" + }, + "httpMethod": "POST", + "parameterOrder": [ + "parent" + ], + "response": { + "$ref": "Operation" + } + }, + "reimage": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The resource name.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/nodes/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/nodes/{nodesId}:reimage", + "path": "v1alpha1/{+name}:reimage", + "id": "tpu.projects.locations.nodes.reimage", + "description": "Reimage a node's OS.", + "request": { + "$ref": "ReimageNodeRequest" + } + }, + "get": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The resource name.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/nodes/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/nodes/{nodesId}", + "id": "tpu.projects.locations.nodes.get", + "path": "v1alpha1/{+name}", + "description": "Gets the details of a node.", + "httpMethod": "GET", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Node" + } + }, + "delete": { + "httpMethod": "DELETE", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The resource name.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/nodes/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/nodes/{nodesId}", + "id": "tpu.projects.locations.nodes.delete", + "path": "v1alpha1/{+name}", + "description": "Deletes a node." + }, + "reset": { + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "description": "The resource name.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/nodes/[^/]+$", + "location": "path" + } + }, + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/nodes/{nodesId}:reset", + "path": "v1alpha1/{+name}:reset", + "id": "tpu.projects.locations.nodes.reset", + "description": "Resets a node, which stops and starts the VM.", + "request": { + "$ref": "ResetNodeRequest" + } + }, + "list": { + "id": "tpu.projects.locations.nodes.list", + "path": "v1alpha1/{+parent}/nodes", + "description": "Lists nodes.", + "httpMethod": "GET", + "response": { + "$ref": "ListNodesResponse" + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "The parent resource name.", + "required": true, + "type": "string" + }, + "pageToken": { + "description": "The next_page_token value returned from a previous List request, if any.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "The maximum number of items to return.", + "format": "int32", + "type": "integer" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/nodes" + } + } + }, + "operations": { + "methods": { + "delete": { + "httpMethod": "DELETE", + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", + "location": "path", + "description": "The name of the operation resource to be deleted.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", + "id": "tpu.projects.locations.operations.delete", + "path": "v1alpha1/{+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": "v1alpha1/{+name}/operations", + "id": "tpu.projects.locations.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": { + "filter": { + "description": "The standard list filter.", + "type": "string", + "location": "query" + }, + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+$", + "location": "path", + "description": "The name of the operation's parent resource.", + "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" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/operations" + }, + "get": { + "httpMethod": "GET", + "response": { + "$ref": "Operation" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "required": true, + "type": "string", + "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", + "location": "path" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", + "id": "tpu.projects.locations.operations.get", + "path": "v1alpha1/{+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." + }, + "cancel": { + "id": "tpu.projects.locations.operations.cancel", + "path": "v1alpha1/{+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`.", + "httpMethod": "POST", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "pattern": "^projects/[^/]+/locations/[^/]+/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" + ], + "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel" + } + } + } + } + } + } + } + } +} diff --git a/etc/api/translate/v2/translate-api.json b/etc/api/translate/v2/translate-api.json index 74c5863688..6523ac8073 100644 --- a/etc/api/translate/v2/translate-api.json +++ b/etc/api/translate/v2/translate-api.json @@ -1,34 +1,38 @@ { + "revision": "20170525", + "documentationLink": "https://code.google.com/apis/language/translate/v2/getting_started.html", + "id": "translate:v2", "discoveryVersion": "v1", "schemas": { "LanguagesResource": { + "id": "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" + }, + "name": { + "description": "Human readable name of the language localized to the target language.", + "type": "string" } - }, - "id": "LanguagesResource" + } }, "DetectionsListResponse": { + "type": "object", "properties": { "detections": { "description": "A detections contains detection results of several text", + "type": "array", "items": { "$ref": "DetectionsResource" - }, - "type": "array" + } } }, - "id": "DetectionsListResponse", - "type": "object" + "id": "DetectionsListResponse" }, "GetSupportedLanguagesRequest": { + "id": "GetSupportedLanguagesRequest", "description": "The request message for discovering supported languages.", "type": "object", "properties": { @@ -36,24 +40,29 @@ "description": "The language to use to return localized, human readable names of supported\nlanguages.", "type": "string" } - }, - "id": "GetSupportedLanguagesRequest" + } }, "LanguagesListResponse": { + "id": "LanguagesListResponse", + "type": "object", "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.", + "type": "array", "items": { "$ref": "LanguagesResource" - }, - "type": "array" + } } - }, - "id": "LanguagesListResponse", - "type": "object" + } }, "TranslationsResource": { + "id": "TranslationsResource", + "type": "object", "properties": { + "translatedText": { + "description": "Text translated into the target language.", + "type": "string" + }, "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" @@ -61,95 +70,89 @@ "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.", + "type": "array", "items": { "type": "object", "properties": { "confidence": { - "format": "float", "description": "The confidence of the detection result of this language.", + "format": "float", "type": "number" }, - "language": { - "description": "The language we detected.", - "type": "string" - }, "isReliable": { "description": "A boolean to indicate is the language detection result reliable.", "type": "boolean" + }, + "language": { + "description": "The language we detected.", + "type": "string" } } }, - "type": "array", "id": "DetectionsResource" }, "TranslationsListResponse": { + "description": "The main language translation response message.", + "type": "object", "properties": { "translations": { "description": "Translations contains list of translation results of given text", + "type": "array", "items": { "$ref": "TranslationsResource" - }, - "type": "array" + } } }, - "id": "TranslationsListResponse", - "description": "The main language translation response message.", - "type": "object" + "id": "TranslationsListResponse" }, "TranslateTextRequest": { + "id": "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" }, + "q": { + "description": "The input text to translate. Repeat this parameter to perform translation\noperations on multiple text inputs.", + "type": "array", + "items": { + "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" + }, + "model": { + "description": "The `model` type requested for this translation. Valid values are\nlisted in public documentation.", + "type": "string" } - }, - "id": "TranslateTextRequest" + } }, "DetectLanguageRequest": { + "description": "The request message for language detection.", + "type": "object", "properties": { "q": { "description": "The input text upon which to perform language detection. Repeat this\nparameter to perform language detection on multiple text inputs.", + "type": "array", "items": { "type": "string" - }, - "type": "array" + } } }, - "id": "DetectLanguageRequest", - "description": "The request message for language detection.", - "type": "object" + "id": "DetectLanguageRequest" } }, "icons": { @@ -161,11 +164,11 @@ "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" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" } } } @@ -174,40 +177,22 @@ "ownerDomain": "google.com", "name": "translate", "batchPath": "batch/translate", - "title": "Google Cloud Translation API", "features": [ "dataWrapper" ], + "title": "Google Cloud Translation API", "ownerName": "Google", "resources": { "detections": { "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" ], + "httpMethod": "GET", "scopes": [ "https://www.googleapis.com/auth/cloud-translation", "https://www.googleapis.com/auth/cloud-platform" @@ -215,8 +200,8 @@ "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", + "required": true, "repeated": true, "location": "query" } @@ -224,16 +209,41 @@ "path": "v2/detect", "id": "language.detections.list", "description": "Detects the language of text within a request." + }, + "detect": { + "scopes": [ + "https://www.googleapis.com/auth/cloud-translation", + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "id": "language.detections.detect", + "path": "v2/detect", + "request": { + "$ref": "DetectLanguageRequest" + }, + "description": "Detects the language of text within a request.", + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "DetectionsListResponse" + } } } }, "languages": { "methods": { "list": { + "id": "language.languages.list", + "path": "v2/languages", + "description": "Returns a list of supported languages for translation.", "response": { "$ref": "LanguagesListResponse" }, "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/cloud-translation", + "https://www.googleapis.com/auth/cloud-platform" + ], "parameters": { "target": { "description": "The language to use to return localized, human readable names of supported\nlanguages.", @@ -245,20 +255,32 @@ "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." + } } } }, "translations": { "methods": { + "translate": { + "path": "v2", + "id": "language.translations.translate", + "description": "Translates input text, returning translated text.", + "request": { + "$ref": "TranslateTextRequest" + }, + "response": { + "$ref": "TranslationsListResponse" + }, + "parameterOrder": [], + "httpMethod": "POST", + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-translation", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "list": { + "description": "Translates input text, returning translated text.", "response": { "$ref": "TranslationsListResponse" }, @@ -272,23 +294,6 @@ "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", @@ -297,8 +302,8 @@ }, "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", + "required": true, "location": "query" }, "format": { @@ -313,63 +318,88 @@ ], "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" + }, + "model": { + "location": "query", + "description": "The `model` type requested for this translation. Valid values are\nlisted in public documentation.", + "type": "string" + }, + "q": { + "repeated": true, + "location": "query", + "description": "The input text to translate. Repeat this parameter to perform translation\noperations on multiple text inputs.", + "type": "string", + "required": true + }, + "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" } }, - "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" - } + "id": "language.translations.list" } } } }, "parameters": { - "uploadType": { - "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "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": { + "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": { - "enum": [ - "1", - "2" - ], "description": "V1 error format.", "type": "string", "enumDescriptions": [ "v1 error format", "v2 error format" ], - "location": "query" + "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", @@ -377,64 +407,34 @@ ], "location": "query", "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], - "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" - }, - "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. Overrides userIp if both are provided.", "type": "string" }, "pp": { - "location": "query", "description": "Pretty-print response.", + "type": "boolean", "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" } }, "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" + "description": "The Google Cloud Translation API lets websites and programs integrate with\n Google Translate programmatically.", + "servicePath": "language/translate/", + "basePath": "/language/translate/" } diff --git a/etc/api/urlshortener/v1/urlshortener-api.json b/etc/api/urlshortener/v1/urlshortener-api.json index 8e63e62d24..9102c62975 100644 --- a/etc/api/urlshortener/v1/urlshortener-api.json +++ b/etc/api/urlshortener/v1/urlshortener-api.json @@ -20,7 +20,7 @@ "basePath": "/urlshortener/v1/", "rootUrl": "https://www.googleapis.com/", "servicePath": "urlshortener/v1/", - "batchPath": "batch", + "batchPath": "batch/urlshortener/v1", "parameters": { "alt": { "type": "string", diff --git a/etc/api/vault/v1/vault-api.json b/etc/api/vault/v1/vault-api.json index b6f7f537f5..ea3f50fa84 100644 --- a/etc/api/vault/v1/vault-api.json +++ b/etc/api/vault/v1/vault-api.json @@ -1,151 +1,7 @@ { - "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", @@ -158,7 +14,6 @@ "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": { @@ -167,22 +22,24 @@ "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" + "type": "string", + "enumDescriptions": [ + "No role assigned.", + "A collaborator to the matter.", + "The owner of the matter." + ] } - } + }, + "id": "MatterPermission" }, "ListMattersResponse": { + "description": "Provides the list of matters.", "type": "object", "properties": { "nextPageToken": { @@ -190,49 +47,70 @@ "type": "string" }, "matters": { + "description": "List of matters.", + "type": "array", "items": { "$ref": "Matter" - }, - "type": "array", - "description": "List of matters." + } } }, - "id": "ListMattersResponse", - "description": "Provides the list of matters." + "id": "ListMattersResponse" }, "HeldMailQuery": { - "description": "Query options for mail holds.", - "type": "object", "properties": { + "endTime": { + "description": "The end time range for the search query. These timestamps are in GMT and\nrounded down to the start of the given date.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "The start time range for the search query. These timestamps are in GMT and\nrounded down to the start of the given date.", + "format": "google-datetime", + "type": "string" + }, + "terms": { + "description": "The search terms for the hold.", + "type": "string" + } + }, + "id": "HeldMailQuery", + "description": "Query options for mail holds.", + "type": "object" + }, + "CloseMatterResponse": { + "properties": { + "matter": { + "description": "The updated matter, with state CLOSED.", + "$ref": "Matter" + } + }, + "id": "CloseMatterResponse", + "description": "Response to a CloseMatterRequest.", + "type": "object" + }, + "HeldGroupsQuery": { + "properties": { + "startTime": { + "description": "The start time range for the search query. These timestamps are in GMT and\nrounded down to the start of the given date.", + "format": "google-datetime", + "type": "string" + }, "terms": { "description": "The search terms for the hold.", "type": "string" }, "endTime": { - "type": "string", + "description": "The end time range for the search query. These timestamps are in GMT and\nrounded down to the start of the given date.", "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." + "id": "HeldGroupsQuery", + "description": "Query options for group holds.", + "type": "object" }, "HeldDriveQuery": { + "description": "Query options for drive holds.", "type": "object", "properties": { "includeTeamDriveFiles": { @@ -240,32 +118,9 @@ "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." + "id": "HeldDriveQuery" }, "HeldOrgUnit": { - "id": "HeldOrgUnit", "description": "A organizational unit being held in a particular hold.\nThis structure is immutable.", "type": "object", "properties": { @@ -274,16 +129,19 @@ "type": "string" }, "holdTime": { - "format": "google-datetime", "description": "When the org unit was put on hold. This property is immutable.", + "format": "google-datetime", "type": "string" } - } + }, + "id": "HeldOrgUnit" }, "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": { + "matterPermission": { + "$ref": "MatterPermission", + "description": "The MatterPermission to add." + }, "ccMe": { "description": "Only relevant if send_emails is true.\nTrue to CC requestor in the email message.\nFalse to not CC requestor.", "type": "boolean" @@ -291,16 +149,13 @@ "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" + "id": "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" }, "Matter": { - "id": "Matter", "description": "Represents a matter.", "type": "object", "properties": { @@ -320,42 +175,180 @@ "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" }, + "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.", + "type": "array", + "items": { + "$ref": "MatterPermission" + } + }, "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." + "description": "The matter ID which is generated by the server.\nShould be blank when creating a new matter.", + "type": "string" } - } + }, + "id": "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." + "description": "The account's ID as provided by the\n\u003ca href=\"https://developers.google.com/admin-sdk/\"\u003eAdmin SDK\u003c/a\u003e.", + "type": "string" }, "holdTime": { - "format": "google-datetime", "description": "When the account was put on hold.", + "format": "google-datetime", "type": "string" } }, "id": "HeldAccount" + }, + "ReopenMatterResponse": { + "description": "Response to a ReopenMatterRequest.", + "type": "object", + "properties": { + "matter": { + "$ref": "Matter", + "description": "The updated matter, with state OPEN." + } + }, + "id": "ReopenMatterResponse" + }, + "CorpusQuery": { + "description": "Corpus specific queries.", + "type": "object", + "properties": { + "mailQuery": { + "description": "Details pertaining to mail holds. If set, corpus must be mail.", + "$ref": "HeldMailQuery" + }, + "groupsQuery": { + "$ref": "HeldGroupsQuery", + "description": "Details pertaining to Groups holds. If set, corpus must be Groups." + }, + "driveQuery": { + "$ref": "HeldDriveQuery", + "description": "Details pertaining to Drive holds. If set, corpus must be Drive." + } + }, + "id": "CorpusQuery" + }, + "Hold": { + "properties": { + "accounts": { + "description": "If set, the hold applies to the enumerated accounts and org_unit must be\nempty.", + "type": "array", + "items": { + "$ref": "HeldAccount" + } + }, + "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" + }, + "query": { + "description": "The corpus-specific query. If set, the corpusQuery must match corpus\ntype.", + "$ref": "CorpusQuery" + }, + "corpus": { + "enumDescriptions": [ + "No corpus specified.", + "Drive.", + "Mail.", + "Groups." + ], + "enum": [ + "CORPUS_TYPE_UNSPECIFIED", + "DRIVE", + "MAIL", + "GROUPS" + ], + "description": "The corpus to be searched.", + "type": "string" + }, + "updateTime": { + "description": "The last time this hold was modified.", + "format": "google-datetime", + "type": "string" + }, + "holdId": { + "description": "The unique immutable ID of the hold. Assigned during creation.", + "type": "string" + }, + "name": { + "description": "The name of the hold.", + "type": "string" + } + }, + "id": "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" + }, + "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.", + "type": "array", + "items": { + "$ref": "Hold" + } + } + }, + "id": "ListHoldsResponse" + }, + "UndeleteMatterRequest": { + "properties": {}, + "id": "UndeleteMatterRequest", + "description": "Undelete a matter by ID.", + "type": "object" + }, + "ListHeldAccountsResponse": { + "properties": { + "accounts": { + "description": "The held accounts on a hold.", + "type": "array", + "items": { + "$ref": "HeldAccount" + } + } + }, + "id": "ListHeldAccountsResponse", + "description": "Returns a list of held accounts for a hold.", + "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" + }, + "CloseMatterRequest": { + "description": "Close a matter by ID.", + "type": "object", + "properties": {}, + "id": "CloseMatterRequest" + }, + "ReopenMatterRequest": { + "properties": {}, + "id": "ReopenMatterRequest", + "description": "Reopen a matter by ID.", + "type": "object" } }, "protocol": "rest", @@ -386,43 +379,119 @@ "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.", + "update": { "response": { "$ref": "Matter" }, "parameterOrder": [ "matterId" ], - "httpMethod": "DELETE" - }, - "addPermissions": { - "httpMethod": "POST", - "parameterOrder": [ - "matterId" + "httpMethod": "PUT", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" ], - "response": { - "$ref": "MatterPermission" - }, "parameters": { "matterId": { "description": "The matter ID.", - "type": "string", "required": true, + "type": "string", + "location": "path" + } + }, + "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" + } + }, + "delete": { + "response": { + "$ref": "Matter" + }, + "parameterOrder": [ + "matterId" + ], + "httpMethod": "DELETE", + "parameters": { + "matterId": { + "location": "path", + "description": "The matter ID", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "flatPath": "v1/matters/{matterId}", + "path": "v1/matters/{matterId}", + "id": "vault.matters.delete", + "description": "Deletes the specified matter. Returns matter with updated state." + }, + "list": { + "path": "v1/matters", + "id": "vault.matters.list", + "description": "Lists matters the user has access to.", + "response": { + "$ref": "ListMattersResponse" + }, + "parameterOrder": [], + "httpMethod": "GET", + "parameters": { + "state": { + "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", + "location": "query" + }, + "pageToken": { + "description": "The pagination token as returned in the response.", + "type": "string", + "location": "query" + }, + "pageSize": { + "location": "query", + "description": "The number of matters to return in the response.\nDefault and maximum are 100.", + "format": "int32", + "type": "integer" + }, + "view": { + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ], + "description": "Specifies which parts of the matter to return in response.", + "type": "string", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery", + "https://www.googleapis.com/auth/ediscovery.readonly" + ], + "flatPath": "v1/matters" + }, + "addPermissions": { + "response": { + "$ref": "MatterPermission" + }, + "parameterOrder": [ + "matterId" + ], + "httpMethod": "POST", + "parameters": { + "matterId": { + "description": "The matter ID.", + "required": true, + "type": "string", "location": "path" } }, @@ -432,70 +501,21 @@ "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" + "description": "Adds an account as a matter collaborator." }, "create": { + "httpMethod": "POST", + "parameterOrder": [], "response": { "$ref": "Matter" }, - "parameterOrder": [], - "httpMethod": "POST", + "parameters": {}, "scopes": [ "https://www.googleapis.com/auth/ediscovery" ], - "parameters": {}, "flatPath": "v1/matters", "id": "vault.matters.create", "path": "v1/matters", @@ -505,24 +525,24 @@ "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" + "parameterOrder": [ + "matterId" ], + "httpMethod": "POST", "parameters": { "matterId": { "location": "path", "description": "The matter ID.", - "type": "string", - "required": true + "required": true, + "type": "string" } }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], "flatPath": "v1/matters/{matterId}:removePermissions", "path": "v1/matters/{matterId}:removePermissions", "id": "vault.matters.removePermissions", @@ -532,10 +552,12 @@ "description": "Removes an account as a matter collaborator." }, "reopen": { - "description": "Reopens the specified matter. Returns matter with updated state.", + "id": "vault.matters.reopen", + "path": "v1/matters/{matterId}:reopen", "request": { "$ref": "ReopenMatterRequest" }, + "description": "Reopens the specified matter. Returns matter with updated state.", "httpMethod": "POST", "parameterOrder": [ "matterId" @@ -545,22 +567,80 @@ }, "parameters": { "matterId": { - "location": "path", "description": "The matter ID.", + "required": true, "type": "string", - "required": true + "location": "path" } }, "scopes": [ "https://www.googleapis.com/auth/ediscovery" ], - "flatPath": "v1/matters/{matterId}:reopen", - "path": "v1/matters/{matterId}:reopen", - "id": "vault.matters.reopen" + "flatPath": "v1/matters/{matterId}:reopen" + }, + "close": { + "response": { + "$ref": "CloseMatterResponse" + }, + "parameterOrder": [ + "matterId" + ], + "httpMethod": "POST", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "parameters": { + "matterId": { + "location": "path", + "description": "The matter ID.", + "required": true, + "type": "string" + } + }, + "flatPath": "v1/matters/{matterId}:close", + "path": "v1/matters/{matterId}:close", + "id": "vault.matters.close", + "description": "Closes the specified matter. Returns matter with updated state.", + "request": { + "$ref": "CloseMatterRequest" + } + }, + "get": { + "path": "v1/matters/{matterId}", + "id": "vault.matters.get", + "description": "Gets the specified matter.", + "response": { + "$ref": "Matter" + }, + "parameterOrder": [ + "matterId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery", + "https://www.googleapis.com/auth/ediscovery.readonly" + ], + "parameters": { + "matterId": { + "location": "path", + "description": "The matter ID.", + "required": true, + "type": "string" + }, + "view": { + "location": "query", + "enum": [ + "VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ], + "description": "Specifies which parts of the Matter to return in the response.", + "type": "string" + } + }, + "flatPath": "v1/matters/{matterId}" }, "undelete": { - "id": "vault.matters.undelete", - "path": "v1/matters/{matterId}:undelete", "description": "Undeletes the specified matter. Returns matter with updated state.", "request": { "$ref": "UndeleteMatterRequest" @@ -572,113 +652,139 @@ "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" - ] + "type": "string" } }, - "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" - ] + "flatPath": "v1/matters/{matterId}:undelete", + "path": "v1/matters/{matterId}:undelete", + "id": "vault.matters.undelete" } }, "resources": { "holds": { + "resources": { + "accounts": { + "methods": { + "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.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "matterId", + "holdId", + "accountId" + ], + "httpMethod": "DELETE", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "parameters": { + "holdId": { + "description": "The hold ID.", + "required": true, + "type": "string", + "location": "path" + }, + "accountId": { + "location": "path", + "description": "The ID of the account to remove from the hold.", + "required": true, + "type": "string" + }, + "matterId": { + "description": "The matter ID.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}", + "path": "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}", + "id": "vault.matters.holds.accounts.delete" + }, + "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.", + "response": { + "$ref": "ListHeldAccountsResponse" + }, + "parameterOrder": [ + "matterId", + "holdId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery", + "https://www.googleapis.com/auth/ediscovery.readonly" + ], + "parameters": { + "holdId": { + "location": "path", + "description": "The hold ID.", + "required": true, + "type": "string" + }, + "matterId": { + "description": "The matter ID.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts", + "path": "v1/matters/{matterId}/holds/{holdId}/accounts", + "id": "vault.matters.holds.accounts.list" + }, + "create": { + "httpMethod": "POST", + "parameterOrder": [ + "matterId", + "holdId" + ], + "response": { + "$ref": "HeldAccount" + }, + "parameters": { + "holdId": { + "location": "path", + "description": "The hold ID.", + "required": true, + "type": "string" + }, + "matterId": { + "location": "path", + "description": "The matter ID.", + "required": true, + "type": "string" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/ediscovery" + ], + "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts", + "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." + } + } + } + }, "methods": { "delete": { + "path": "v1/matters/{matterId}/holds/{holdId}", + "id": "vault.matters.holds.delete", + "description": "Removes a hold by ID. This will release any HeldAccounts on this Hold.", "response": { "$ref": "Empty" }, @@ -694,30 +800,65 @@ "matterId": { "location": "path", "description": "The matter ID.", - "type": "string", - "required": true + "required": true, + "type": "string" }, + "holdId": { + "description": "The hold ID.", + "required": true, + "type": "string", + "location": "path" + } + }, + "flatPath": "v1/matters/{matterId}/holds/{holdId}" + }, + "get": { + "path": "v1/matters/{matterId}/holds/{holdId}", + "id": "vault.matters.holds.get", + "description": "Gets a hold by ID.", + "response": { + "$ref": "Hold" + }, + "parameterOrder": [ + "matterId", + "holdId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/ediscovery", + "https://www.googleapis.com/auth/ediscovery.readonly" + ], + "parameters": { "holdId": { "location": "path", "description": "The hold ID.", + "required": true, + "type": "string" + }, + "matterId": { + "description": "The matter ID.", + "required": true, "type": "string", - "required": true + "location": "path" } }, - "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." + "flatPath": "v1/matters/{matterId}/holds/{holdId}" }, "list": { - "httpMethod": "GET", "response": { "$ref": "ListHoldsResponse" }, "parameterOrder": [ "matterId" ], + "httpMethod": "GET", "parameters": { + "matterId": { + "description": "The matter ID.", + "required": true, + "type": "string", + "location": "path" + }, "pageToken": { "description": "The pagination token as returned in the response.\nAn empty token means start from the beginning.", "type": "string", @@ -725,15 +866,9 @@ }, "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.", + "format": "int32", "type": "integer" - }, - "matterId": { - "description": "The matter ID.", - "type": "string", - "required": true, - "location": "path" } }, "scopes": [ @@ -745,12 +880,7 @@ "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", + "update": { "response": { "$ref": "Hold" }, @@ -758,62 +888,35 @@ "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" - } - }, + "httpMethod": "PUT", "scopes": [ "https://www.googleapis.com/auth/ediscovery" ], + "parameters": { + "holdId": { + "description": "The ID of the hold.", + "required": true, + "type": "string", + "location": "path" + }, + "matterId": { + "description": "The matter ID.", + "required": true, + "type": "string", + "location": "path" + } + }, "flatPath": "v1/matters/{matterId}/holds/{holdId}", - "id": "vault.matters.holds.update", "path": "v1/matters/{matterId}/holds/{holdId}", + "id": "vault.matters.holds.update", "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", + "id": "vault.matters.holds.create", "request": { "$ref": "Hold" }, @@ -825,181 +928,29 @@ "matterId" ], "httpMethod": "POST", + "parameters": { + "matterId": { + "location": "path", + "description": "The matter ID.", + "required": true, + "type": "string" + } + }, "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": { + "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": { "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", @@ -1020,11 +971,17 @@ "type": "string" }, "callback": { + "location": "query", "description": "JSONP", - "type": "string", - "location": "query" + "type": "string" }, "alt": { + "enum": [ + "json", + "media", + "proto" + ], + "type": "string", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", @@ -1032,15 +989,58 @@ ], "location": "query", "description": "Data format for response.", - "default": "json", - "enum": [ - "json", - "media", - "proto" - ], + "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": { + "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": { + "location": "query", + "description": "Returns response with indentations and line breaks.", + "type": "boolean", + "default": "true" } }, "version": "v1", - "baseUrl": "https://vault.googleapis.com/" + "baseUrl": "https://vault.googleapis.com/", + "servicePath": "", + "description": "Archiving and eDiscovery for G Suite.", + "kind": "discovery#restDescription", + "basePath": "", + "documentationLink": "https://developers.google.com/vault", + "id": "vault:v1", + "revision": "20171026" } diff --git a/etc/api/videointelligence/v1beta1/videointelligence-api.json b/etc/api/videointelligence/v1beta1/videointelligence-api.json index b9bd8e0b10..d735cb7f41 100644 --- a/etc/api/videointelligence/v1beta1/videointelligence-api.json +++ b/etc/api/videointelligence/v1beta1/videointelligence-api.json @@ -1,189 +1,326 @@ { - "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": { + "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": { - "time": { - "format": "google-duration", - "description": "Time-offset, relative to the beginning of the video,\ncorresponding to the video frame for this annotation.", + "annotationProgress": { + "description": "Progress metadata for all videos specified in `AnnotateVideoRequest`.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1_VideoAnnotationProgress" + } + } + }, + "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" }, - "adult": { + "error": { + "description": "The error result of the operation in case of failure or cancellation.", + "$ref": "GoogleRpc_Status" + }, + "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": { + "progressPercent": { + "description": "Approximate percentage processed thus far.\nGuaranteed to be 100 when fully processed.", + "format": "int32", + "type": "integer" + }, + "updateTime": { + "description": "Time of the most recent update.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "Time when the request was received.", + "format": "google-datetime", + "type": "string" + }, + "inputUri": { + "description": "Video file location in\n[Google Cloud Storage](https://cloud.google.com/storage/).", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress" + }, + "GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults": { + "description": "Annotation results for a single video.", + "type": "object", + "properties": { + "labelAnnotations": { + "description": "Label annotations. There is exactly one element for each unique label.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_LabelAnnotation" + } + }, + "error": { + "description": "If set, indicates an error. Note that for a single `AnnotateVideoRequest`\nsome videos may succeed and some may fail.", + "$ref": "GoogleRpc_Status" + }, + "shotAnnotations": { + "description": "Shot annotations. Each shot is represented as a video segment.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_VideoSegment" + } + }, + "inputUri": { + "description": "Video file location in\n[Google Cloud Storage](https://cloud.google.com/storage/).", + "type": "string" + }, + "safeSearchAnnotations": { + "description": "Safe search annotations.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation" + } + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults" + }, + "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`.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1_VideoAnnotationResults" + } + } + }, + "id": "GoogleCloudVideointelligenceV1_AnnotateVideoResponse" + }, + "GoogleCloudVideointelligenceV1_LabelSegment": { + "description": "Video segment level annotation results for label detection.", + "type": "object", + "properties": { + "segment": { + "$ref": "GoogleCloudVideointelligenceV1_VideoSegment", + "description": "Video segment where a label was detected." + }, + "confidence": { + "description": "Confidence that the label is accurate. Range: [0, 1].", + "format": "float", + "type": "number" + } + }, + "id": "GoogleCloudVideointelligenceV1_LabelSegment" + }, + "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", + "properties": { + "annotationResults": { + "description": "Annotation results for all videos specified in `AnnotateVideoRequest`.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults" + } + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_AnnotateVideoResponse" + }, + "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": { + "description": "Approximate percentage processed thus far.\nGuaranteed to be 100 when fully processed.", + "format": "int32", + "type": "integer" + }, + "updateTime": { + "description": "Time of the most recent update.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "Time when the request was received.", + "format": "google-datetime", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress" + }, + "GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame": { + "description": "Video frame level annotation results for explicit content.", + "type": "object", + "properties": { + "pornographyLikelihood": { + "enumDescriptions": [ + "Unspecified likelihood.", + "Very unlikely.", + "Unlikely.", + "Possible.", + "Likely.", + "Very likely." + ], "enum": [ - "UNKNOWN", + "LIKELIHOOD_UNSPECIFIED", "VERY_UNLIKELY", "UNLIKELY", "POSSIBLE", "LIKELY", "VERY_LIKELY" ], - "description": "Likelihood of adult content.", - "type": "string", - "enumDescriptions": [ - "Unknown likelihood.", - "Very unlikely.", - "Unlikely.", - "Possible.", - "Likely.", - "Very likely." - ] + "description": "Likelihood of the pornography content..", + "type": "string" + }, + "timeOffset": { + "description": "Time-offset, relative to the beginning of the video, corresponding to the\nvideo frame for this location.", + "format": "google-duration", + "type": "string" } }, - "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" + "id": "GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame" + }, + "GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest": { + "description": "Video annotation request.", + "type": "object", + "properties": { + "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" + }, + "features": { + "enumDescriptions": [ + "Unspecified.", + "Label detection. Detect objects, such as dog or flower.", + "Shot change detection.", + "Safe search detection." + ], + "description": "Requested video annotation features.", + "type": "array", + "items": { + "enum": [ + "FEATURE_UNSPECIFIED", + "LABEL_DETECTION", + "SHOT_CHANGE_DETECTION", + "SAFE_SEARCH_DETECTION" + ], + "type": "string" + } + }, + "videoContext": { + "$ref": "GoogleCloudVideointelligenceV1beta1_VideoContext", + "description": "Additional video context and/or feature-specific parameters." + }, + "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": { + "description": "End offset in microseconds (inclusive). Unset means 0.", + "format": "int64", + "type": "string" + }, + "startTimeOffset": { + "description": "Start offset in microseconds (inclusive). Unset means 0.", + "format": "int64", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1beta1_VideoSegment" + }, + "GoogleCloudVideointelligenceV1beta2_LabelSegment": { + "description": "Video segment level annotation results for label detection.", + "type": "object", + "properties": { + "segment": { + "$ref": "GoogleCloudVideointelligenceV1beta2_VideoSegment", + "description": "Video segment where a label was detected." + }, + "confidence": { + "description": "Confidence that the label is accurate. Range: [0, 1].", + "format": "float", + "type": "number" + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_LabelSegment" }, "GoogleCloudVideointelligenceV1beta2_LabelAnnotation": { "description": "Label annotation.", "type": "object", "properties": { + "entity": { + "$ref": "GoogleCloudVideointelligenceV1beta2_Entity", + "description": "Detected entity." + }, "frames": { "description": "All video frames where a label was detected.", + "type": "array", "items": { "$ref": "GoogleCloudVideointelligenceV1beta2_LabelFrame" - }, - "type": "array" + } }, "segments": { "description": "All video segments where a label was detected.", + "type": "array", "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`.", + "type": "array", "items": { "$ref": "GoogleCloudVideointelligenceV1beta2_Entity" - }, - "type": "array" - }, - "entity": { - "description": "Detected entity.", - "$ref": "GoogleCloudVideointelligenceV1beta2_Entity" + } } }, "id": "GoogleCloudVideointelligenceV1beta2_LabelAnnotation" @@ -213,13 +350,11 @@ ] }, "timeOffset": { - "format": "int64", "description": "Video time offset in microseconds.", + "format": "int64", "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.", @@ -235,7 +370,9 @@ "POSSIBLE", "LIKELY", "VERY_LIKELY" - ] + ], + "description": "Likelihood that an obvious modification was made to the original\nversion to make it appear funny or offensive.", + "type": "string" }, "violent": { "description": "Likelihood of violent content.", @@ -258,6 +395,8 @@ ] }, "medical": { + "description": "Likelihood of medical content.", + "type": "string", "enumDescriptions": [ "Unknown likelihood.", "Very unlikely.", @@ -273,9 +412,7 @@ "POSSIBLE", "LIKELY", "VERY_LIKELY" - ], - "description": "Likelihood of medical content.", - "type": "string" + ] }, "adult": { "description": "Likelihood of adult content.", @@ -306,22 +443,18 @@ "properties": { "annotationProgress": { "description": "Progress metadata for all videos specified in `AnnotateVideoRequest`.", + "type": "array", "items": { "$ref": "GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress" - }, - "type": "array" + } } }, "id": "GoogleCloudVideointelligenceV1beta1_AnnotateVideoProgress" }, - "GoogleCloudVideointelligenceV1beta2_Entity": { + "GoogleCloudVideointelligenceV1_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" @@ -329,129 +462,129 @@ "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" + }, + "description": { + "description": "Textual description, e.g. `Fixed-gear bicycle`.", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1_Entity" + }, + "GoogleCloudVideointelligenceV1beta2_Entity": { + "description": "Detected entity from video analysis.", + "type": "object", + "properties": { + "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" + }, + "description": { + "description": "Textual description, e.g. `Fixed-gear bicycle`.", + "type": "string" } }, "id": "GoogleCloudVideointelligenceV1beta2_Entity" }, "GoogleCloudVideointelligenceV1beta2_VideoSegment": { + "description": "Video segment.", + "type": "object", "properties": { "endTimeOffset": { - "format": "google-duration", "description": "Time-offset, relative to the beginning of the video,\ncorresponding to the end of the segment (inclusive).", + "format": "google-duration", "type": "string" }, "startTimeOffset": { - "format": "google-duration", "description": "Time-offset, relative to the beginning of the video,\ncorresponding to the start of the segment (inclusive).", + "format": "google-duration", "type": "string" } }, - "id": "GoogleCloudVideointelligenceV1beta2_VideoSegment", - "description": "Video segment.", - "type": "object" + "id": "GoogleCloudVideointelligenceV1beta2_VideoSegment" }, "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.", + "type": "array", "items": { "$ref": "GoogleCloudVideointelligenceV1_VideoSegment" - }, - "type": "array" + } }, - "safeSearchAnnotations": { - "description": "Safe search annotations.", + "shotLabelAnnotations": { + "description": "Label annotations on shot level.\nThere is exactly one element for each unique label.", + "type": "array", "items": { - "$ref": "GoogleCloudVideointelligenceV1_SafeSearchAnnotation" - }, - "type": "array" + "$ref": "GoogleCloudVideointelligenceV1_LabelAnnotation" + } + }, + "error": { + "description": "If set, indicates an error. Note that for a single `AnnotateVideoRequest`\nsome videos may succeed and some may fail.", + "$ref": "GoogleRpc_Status" + }, + "frameLabelAnnotations": { + "description": "Label annotations on frame level.\nThere is exactly one element for each unique label.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1_LabelAnnotation" + } }, "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.", + "segmentLabelAnnotations": { + "description": "Label annotations on video level or user specified segment level.\nThere is exactly one element for each unique label.", + "type": "array", "items": { "$ref": "GoogleCloudVideointelligenceV1_LabelAnnotation" - }, - "type": "array" + } + }, + "explicitAnnotation": { + "$ref": "GoogleCloudVideointelligenceV1_ExplicitContentAnnotation", + "description": "Explicit content annotation." } }, "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": { + "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`.", + "type": "array", "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" + "id": "GoogleCloudVideointelligenceV1beta2_AnnotateVideoResponse" }, "GoogleCloudVideointelligenceV1beta1_LabelAnnotation": { "description": "Label annotation.", "type": "object", "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.", + "type": "array", "items": { "$ref": "GoogleCloudVideointelligenceV1beta1_LabelLocation" - }, - "type": "array" - }, - "languageCode": { - "description": "Language code for `description` in BCP-47 format.", - "type": "string" + } } }, "id": "GoogleCloudVideointelligenceV1beta1_LabelAnnotation" @@ -460,11 +593,32 @@ "description": "Video context and/or feature-specific parameters.", "type": "object", "properties": { + "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.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta1_VideoSegment" + } + }, + "labelDetectionModel": { + "description": "Model to use for label detection.\nSupported values: \"latest\" and \"stable\" (the default).", + "type": "string" + }, "shotChangeDetectionModel": { "description": "Model to use for shot change detection.\nSupported values: \"latest\" and \"stable\" (the default).", "type": "string" }, "labelDetectionMode": { + "enumDescriptions": [ + "Unspecified.", + "Detect shot-level labels.", + "Detect frame-level labels.", + "Detect both shot-level and frame-level labels." + ], "enum": [ "LABEL_DETECTION_MODE_UNSPECIFIED", "SHOT_MODE", @@ -472,103 +626,111 @@ "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." - ] + "type": "string" }, "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": { + "description": "Label annotation.", + "type": "object", "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.", + "segments": { + "description": "All video segments where a label was detected.", + "type": "array", "items": { - "$ref": "GoogleCloudVideointelligenceV1_LabelLocation" - }, - "type": "array" + "$ref": "GoogleCloudVideointelligenceV1_LabelSegment" + } + }, + "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`.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1_Entity" + } + }, + "entity": { + "$ref": "GoogleCloudVideointelligenceV1_Entity", + "description": "Detected entity." + }, + "frames": { + "description": "All video frames where a label was detected.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1_LabelFrame" + } } }, - "id": "GoogleCloudVideointelligenceV1_LabelAnnotation", - "description": "Label annotation.", - "type": "object" + "id": "GoogleCloudVideointelligenceV1_LabelAnnotation" }, "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.", + "type": "array", "items": { + "type": "object", "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.", + "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" }, "GoogleCloudVideointelligenceV1_VideoSegment": { + "description": "Video segment.", + "type": "object", "properties": { - "startTime": { + "endTimeOffset": { + "description": "Time-offset, relative to the beginning of the video,\ncorresponding to the end of the segment (inclusive).", "format": "google-duration", - "description": "Time-offset, relative to the beginning of the video,\ncorresponding to the start of the segment (inclusive).", "type": "string" }, - "endTime": { + "startTimeOffset": { + "description": "Time-offset, relative to the beginning of the video,\ncorresponding to the start of the segment (inclusive).", "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" + "id": "GoogleCloudVideointelligenceV1_VideoSegment" + }, + "GoogleCloudVideointelligenceV1_LabelFrame": { + "description": "Video frame level annotation results for label detection.", + "type": "object", + "properties": { + "confidence": { + "description": "Confidence that the label is accurate. Range: [0, 1].", + "format": "float", + "type": "number" + }, + "timeOffset": { + "description": "Time-offset, relative to the beginning of the video, corresponding to the\nvideo frame for this location.", + "format": "google-duration", + "type": "string" + } + }, + "id": "GoogleCloudVideointelligenceV1_LabelFrame" }, "GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults": { + "description": "Annotation results for a single video.", + "type": "object", "properties": { "error": { "$ref": "GoogleRpc_Status", @@ -576,59 +738,48 @@ }, "frameLabelAnnotations": { "description": "Label annotations on frame level.\nThere is exactly one element for each unique label.", + "type": "array", "items": { "$ref": "GoogleCloudVideointelligenceV1beta2_LabelAnnotation" - }, - "type": "array" + } }, "inputUri": { "description": "Video file location in\n[Google Cloud Storage](https://cloud.google.com/storage/).", "type": "string" }, + "segmentLabelAnnotations": { + "description": "Label annotations on video level or user specified segment level.\nThere is exactly one element for each unique label.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_LabelAnnotation" + } + }, "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.", + "type": "array", "items": { "$ref": "GoogleCloudVideointelligenceV1beta2_VideoSegment" - }, - "type": "array" + } }, "shotLabelAnnotations": { "description": "Label annotations on shot level.\nThere is exactly one element for each unique label.", + "type": "array", "items": { "$ref": "GoogleCloudVideointelligenceV1beta2_LabelAnnotation" - }, - "type": "array" + } } }, - "id": "GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults", - "description": "Annotation results for a single video.", - "type": "object" + "id": "GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults" }, "GoogleCloudVideointelligenceV1beta1_LabelLocation": { + "description": "Label location.", + "type": "object", "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": [ @@ -637,17 +788,26 @@ "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." + ], + "enum": [ + "LABEL_LEVEL_UNSPECIFIED", + "VIDEO_LEVEL", + "SEGMENT_LEVEL", + "SHOT_LEVEL", + "FRAME_LEVEL" ] }, "confidence": { - "format": "float", "description": "Confidence that the label is accurate. Range: [0, 1].", + "format": "float", "type": "number" + }, + "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" } }, - "id": "GoogleCloudVideointelligenceV1beta1_LabelLocation", - "description": "Label location.", - "type": "object" + "id": "GoogleCloudVideointelligenceV1beta1_LabelLocation" }, "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.", @@ -655,10 +815,10 @@ "properties": { "frames": { "description": "All video frames where explicit content was detected.", + "type": "array", "items": { "$ref": "GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame" - }, - "type": "array" + } } }, "id": "GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation" @@ -668,224 +828,19 @@ "type": "object", "properties": { "confidence": { - "format": "float", "description": "Confidence that the label is accurate. Range: [0, 1].", + "format": "float", "type": "number" }, "timeOffset": { - "format": "google-duration", "description": "Time-offset, relative to the beginning of the video, corresponding to the\nvideo frame for this location.", + "format": "google-duration", "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": { + "GoogleCloudVideointelligenceV1_ExplicitContentFrame": { "description": "Video frame level annotation results for explicit content.", "type": "object", "properties": { @@ -910,98 +865,73 @@ ] }, "timeOffset": { - "format": "google-duration", "description": "Time-offset, relative to the beginning of the video, corresponding to the\nvideo frame for this location.", + "format": "google-duration", "type": "string" } }, - "id": "GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame" + "id": "GoogleCloudVideointelligenceV1_ExplicitContentFrame" }, - "GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest": { - "description": "Video annotation request.", + "GoogleCloudVideointelligenceV1_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": { - "features": { - "description": "Requested video annotation features.", - "items": { - "enum": [ - "FEATURE_UNSPECIFIED", - "LABEL_DETECTION", - "SHOT_CHANGE_DETECTION", - "SAFE_SEARCH_DETECTION" - ], - "type": "string" - }, + "frames": { + "description": "All video frames where explicit content was detected.", "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" - }, + "items": { + "$ref": "GoogleCloudVideointelligenceV1_ExplicitContentFrame" + } + } + }, + "id": "GoogleCloudVideointelligenceV1_ExplicitContentAnnotation" + }, + "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", + "properties": { + "annotationProgress": { + "description": "Progress metadata for all videos specified in `AnnotateVideoRequest`.", + "type": "array", + "items": { + "$ref": "GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress" + } + } + }, + "id": "GoogleCloudVideointelligenceV1beta2_AnnotateVideoProgress" + }, + "GoogleCloudVideointelligenceV1_VideoAnnotationProgress": { + "description": "Annotation progress for a single video.", + "type": "object", + "properties": { "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.", + "description": "Video file location in\n[Google Cloud Storage](https://cloud.google.com/storage/).", "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.", + "progressPercent": { + "description": "Approximate percentage processed thus far.\nGuaranteed to be 100 when fully processed.", + "format": "int32", + "type": "integer" + }, + "updateTime": { + "description": "Time of the most recent update.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "Time when the request was received.", + "format": "google-datetime", "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" + "id": "GoogleCloudVideointelligenceV1_VideoAnnotationProgress" } }, + "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", "canonicalName": "Cloud Video Intelligence", "auth": { "oauth2": { @@ -1016,5 +946,129 @@ "ownerDomain": "google.com", "name": "videointelligence", "batchPath": "batch", - "title": "Cloud Video Intelligence API" + "fullyEncodeReservedExpansion": true, + "title": "Cloud Video Intelligence API", + "ownerName": "Google", + "resources": { + "videos": { + "methods": { + "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" + }, + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "GoogleLongrunning_Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "parameters": {}, + "flatPath": "v1beta1/videos:annotate", + "id": "videointelligence.videos.annotate", + "path": "v1beta1/videos:annotate" + } + } + } + }, + "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" + }, + "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": { + "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": { + "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" + } + }, + "version": "v1beta1", + "baseUrl": "https://videointelligence.googleapis.com/", + "servicePath": "", + "kind": "discovery#restDescription", + "description": "Cloud Video Intelligence API.", + "basePath": "", + "revision": "20171122", + "documentationLink": "https://cloud.google.com/video-intelligence/docs/", + "id": "videointelligence:v1beta1", + "discoveryVersion": "v1" } diff --git a/etc/api/vision/v1/vision-api.json b/etc/api/vision/v1/vision-api.json index 44f1a38320..88471dfa87 100644 --- a/etc/api/vision/v1/vision-api.json +++ b/etc/api/vision/v1/vision-api.json @@ -1,27 +1,15 @@ { - "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": { + "flatPath": "v1/images:annotate", + "path": "v1/images:annotate", + "id": "vision.images.annotate", + "description": "Run image detection and annotation for a batch of images.", + "request": { + "$ref": "BatchAnnotateImagesRequest" + }, "response": { "$ref": "BatchAnnotateImagesResponse" }, @@ -31,31 +19,55 @@ "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": {} } } } }, "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": { + "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": { + "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" + "type": "string" }, "callback": { "location": "query", @@ -63,6 +75,8 @@ "type": "string" }, "alt": { + "description": "Data format for response.", + "default": "json", "enum": [ "json", "media", @@ -74,61 +88,28 @@ "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" }, "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.", + "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", - "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" - }, - "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" + "default": "true" } }, "version": "v1", @@ -137,14 +118,90 @@ "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": "", - "revision": "20170922", + "revision": "20171107", "documentationLink": "https://cloud.google.com/vision/", "id": "vision:v1", "discoveryVersion": "v1", "version_module": true, "schemas": { + "Page": { + "type": "object", + "properties": { + "width": { + "description": "Page width in pixels.", + "format": "int32", + "type": "integer" + }, + "blocks": { + "description": "List of blocks of text, images etc on this page.", + "type": "array", + "items": { + "$ref": "Block" + } + }, + "property": { + "$ref": "TextProperty", + "description": "Additional information detected on the page." + }, + "height": { + "description": "Page height in pixels.", + "format": "int32", + "type": "integer" + } + }, + "id": "Page", + "description": "Detected page from OCR." + }, + "AnnotateImageRequest": { + "properties": { + "image": { + "$ref": "Image", + "description": "The image to be processed." + }, + "features": { + "description": "Requested features.", + "type": "array", + "items": { + "$ref": "Feature" + } + }, + "imageContext": { + "$ref": "ImageContext", + "description": "Additional context that may accompany the image." + } + }, + "id": "AnnotateImageRequest", + "description": "Request for performing Google Cloud Vision API tasks over a user-provided\nimage, with user-requested features.", + "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.", + "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" + } + } + }, "LatLongRect": { - "description": "Rectangle determined by min and max `LatLng` pairs.", "type": "object", "properties": { "minLatLng": { @@ -152,110 +209,119 @@ "description": "Min lat/long pair." }, "maxLatLng": { - "$ref": "LatLng", - "description": "Max lat/long pair." + "description": "Max lat/long pair.", + "$ref": "LatLng" } }, - "id": "LatLongRect" + "id": "LatLongRect", + "description": "Rectangle determined by min and max `LatLng` pairs." }, "Symbol": { + "description": "A single symbol representation.", "type": "object", "properties": { + "boundingBox": { + "$ref": "BoundingPoly", + "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)." + }, "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" + "description": "Additional information detected for the symbol.", + "$ref": "TextProperty" } }, - "id": "Symbol", - "description": "A single symbol representation." + "id": "Symbol" }, "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" }, - "type": "array" + "description": "Crop hint results." } }, - "id": "CropHintsAnnotation", - "description": "Set of crop hints that are used to generate new crops when serving images.", - "type": "object" + "id": "CropHintsAnnotation" }, "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.", + "type": "object", "properties": { "latitude": { - "format": "double", "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "format": "double", "type": "number" }, "longitude": { - "format": "double", "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "format": "double", "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" + "id": "LatLng" }, "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": { + "green": { + "description": "The amount of green in the color as a value in the interval [0, 1].", "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", + "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" }, - "green": { - "type": "number", + "red": { + "description": "The amount of red in the color as a value in the interval [0, 1].", "format": "float", - "description": "The amount of green in the color as a value in the interval [0, 1]." + "type": "number" } }, - "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 // ..." + "id": "Color" }, "ImageProperties": { - "description": "Stores image properties, such as dominant colors.", - "type": "object", "properties": { "dominantColors": { "$ref": "DominantColorsAnnotation", "description": "If present, dominant colors completed successfully." } }, - "id": "ImageProperties" + "id": "ImageProperties", + "description": "Stores image properties, such as dominant colors.", + "type": "object" }, "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": { + "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" + ], "description": "The feature type.", "type": "string", "enumDescriptions": [ @@ -270,30 +336,21 @@ "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": { + "violence": { "type": "string", "enumDescriptions": [ "Unknown likelihood.", @@ -311,50 +368,10 @@ "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" + "description": "Likelihood that this image contains violent content." }, "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.", + "description": "Represents the adult content likelihood for the image. Adult content may\ncontain elements such as nudity, pornographic images or cartoons, or\nsexual activities.", "type": "string", "enumDescriptions": [ "Unknown likelihood.", @@ -372,8 +389,49 @@ "LIKELY", "VERY_LIKELY" ] + }, + "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" + }, + "medical": { + "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.", + "type": "string" } - } + }, + "id": "SafeSearchAnnotation" }, "DominantColorsAnnotation": { "description": "Set of dominant colors and their corresponding scores.", @@ -381,69 +439,92 @@ "properties": { "colors": { "description": "RGB color values with their score and pixel fraction.", + "type": "array", "items": { "$ref": "ColorInfo" - }, - "type": "array" + } } }, "id": "DominantColorsAnnotation" }, "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 refer\nto the TextAnnotation.TextProperty message definition below for more\ndetail.", + "type": "object", "properties": { "pages": { "description": "List of pages detected by OCR.", + "type": "array", "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" + "id": "TextAnnotation" }, "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": { + "y": { + "description": "Y coordinate.", "format": "int32", - "description": "X coordinate.", "type": "integer" }, - "y": { + "x": { + "description": "X coordinate.", "format": "int32", - "description": "Y coordinate.", "type": "integer" } }, "id": "Vertex" }, "DetectedLanguage": { + "description": "Detected language for a structural component.", + "type": "object", "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." + "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": { - "format": "float", + "type": "number", "description": "Confidence of detected language. Range [0, 1].", - "type": "number" + "format": "float" } }, - "id": "DetectedLanguage", - "description": "Detected language for a structural component.", - "type": "object" + "id": "DetectedLanguage" + }, + "TextProperty": { + "id": "TextProperty", + "description": "Additional information detected on the structural component.", + "type": "object", + "properties": { + "detectedBreak": { + "description": "Detected start or end of a text segment.", + "$ref": "DetectedBreak" + }, + "detectedLanguages": { + "type": "array", + "items": { + "$ref": "DetectedLanguage" + }, + "description": "A list of detected languages together with confidence." + } + } }, "WebEntity": { "description": "Entity deduced from similar images on the Internet.", "type": "object", "properties": { + "score": { + "description": "Overall relevancy score for the entity.\nNot normalized and not comparable across different image queries.", + "format": "float", + "type": "number" + }, "entityId": { "description": "Opaque entity ID.", "type": "string" @@ -451,11 +532,6 @@ "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" @@ -466,95 +542,77 @@ "properties": { "vertices": { "description": "The bounding polygon vertices.", + "type": "array", "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.", "type": "object", "properties": { - "landmarkAnnotations": { - "description": "If present, landmark detection has completed successfully.", - "items": { - "$ref": "EntityAnnotation" - }, - "type": "array" - }, - "textAnnotations": { - "description": "If present, text (OCR) detection has completed successfully.", - "items": { - "$ref": "EntityAnnotation" - }, - "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.", - "items": { - "$ref": "EntityAnnotation" - }, - "type": "array" - }, - "webDetection": { - "$ref": "WebDetection", - "description": "If present, web detection has completed successfully." - }, - "cropHintsAnnotation": { - "description": "If present, crop hints have completed successfully.", - "$ref": "CropHintsAnnotation" - }, - "safeSearchAnnotation": { - "$ref": "SafeSearchAnnotation", - "description": "If present, safe-search annotation has completed successfully." - }, - "labelAnnotations": { - "items": { - "$ref": "EntityAnnotation" - }, - "type": "array", - "description": "If present, label detection has completed successfully." - }, "error": { "$ref": "Status", "description": "If set, represents the error message for the operation.\nNote that filled-in image annotations are guaranteed to be\ncorrect, even when `error` is set." }, "fullTextAnnotation": { - "description": "If present, text (OCR) detection or document (OCR) text detection has\ncompleted successfully.\nThis annotation provides the structural hierarchy for the OCR detected\ntext.", - "$ref": "TextAnnotation" + "$ref": "TextAnnotation", + "description": "If present, text (OCR) detection or document (OCR) text detection has\ncompleted successfully.\nThis annotation provides the structural hierarchy for the OCR detected\ntext." + }, + "landmarkAnnotations": { + "description": "If present, landmark detection has completed successfully.", + "type": "array", + "items": { + "$ref": "EntityAnnotation" + } + }, + "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" + } + }, + "imagePropertiesAnnotation": { + "description": "If present, image properties were extracted successfully.", + "$ref": "ImageProperties" + }, + "logoAnnotations": { + "description": "If present, logo detection has completed successfully.", + "type": "array", + "items": { + "$ref": "EntityAnnotation" + } + }, + "cropHintsAnnotation": { + "$ref": "CropHintsAnnotation", + "description": "If present, crop hints have completed successfully." + }, + "webDetection": { + "description": "If present, web detection has completed successfully.", + "$ref": "WebDetection" + }, + "labelAnnotations": { + "type": "array", + "items": { + "$ref": "EntityAnnotation" + }, + "description": "If present, label detection has completed successfully." + }, + "safeSearchAnnotation": { + "description": "If present, safe-search annotation has completed successfully.", + "$ref": "SafeSearchAnnotation" } } }, @@ -563,24 +621,23 @@ "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", "description": "Parameters for crop hints annotation request." }, "Block": { - "id": "Block", "description": "Logical element on the page.", "type": "object", "properties": { "property": { - "$ref": "TextProperty", - "description": "Additional information detected for the block." + "description": "Additional information detected for the block.", + "$ref": "TextProperty" }, "blockType": { "type": "string", @@ -603,29 +660,30 @@ "description": "Detected block type (text, image etc) for this block." }, "boundingBox": { - "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" + "$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)." }, "paragraphs": { "description": "List of paragraphs in this block (if this blocks is of type text).", + "type": "array", "items": { "$ref": "Paragraph" - }, - "type": "array" + } } - } + }, + "id": "Block" }, "Property": { "description": "A `Property` consists of a user-supplied name/value pair.", "type": "object", "properties": { "value": { - "type": "string", - "description": "Value of the property." + "description": "Value of the property.", + "type": "string" }, "uint64Value": { - "format": "uint64", "description": "Value of numeric properties.", + "format": "uint64", "type": "string" }, "name": { @@ -636,6 +694,7 @@ "id": "Property" }, "LocationInfo": { + "description": "Detected entity location information.", "type": "object", "properties": { "latLng": { @@ -643,11 +702,9 @@ "description": "lat/long location coordinates." } }, - "id": "LocationInfo", - "description": "Detected entity location information." + "id": "LocationInfo" }, "ImageSource": { - "id": "ImageSource", "description": "External image source (Google Cloud Storage image location).", "type": "object", "properties": { @@ -659,7 +716,8 @@ "description": "Image URI which supports:\n1) Google Cloud Storage image URI, which must be in the following form:\n`gs://bucket_name/object_name` (for details, see\n[Google Cloud Storage Request\nURIs](https://cloud.google.com/storage/docs/reference-uris)).\nNOTE: Cloud Storage object versioning is not supported.\n2) Publicly accessible image HTTP/HTTPS URL.\nThis is preferred over the legacy `gcs_image_uri` above. When both\n`gcs_image_uri` and `image_uri` are specified, `image_uri` takes\nprecedence.", "type": "string" } - } + }, + "id": "ImageSource" }, "BatchAnnotateImagesResponse": { "description": "Response to a batch image annotation request.", @@ -667,10 +725,10 @@ "properties": { "responses": { "description": "Individual responses to image annotation requests within the batch.", + "type": "array", "items": { "$ref": "AnnotateImageResponse" - }, - "type": "array" + } } }, "id": "BatchAnnotateImagesResponse" @@ -679,40 +737,40 @@ "description": "Relevant information for the image from the Internet.", "type": "object", "properties": { - "webEntities": { - "description": "Deduced entities from similar images on the Internet.", + "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": "WebEntity" - }, - "type": "array" - }, - "pagesWithMatchingImages": { - "description": "Web pages containing the matching images from the Internet.", - "items": { - "$ref": "WebPage" - }, - "type": "array" + "$ref": "WebImage" + } }, "visuallySimilarImages": { "description": "The visually similar image results.", + "type": "array", "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": { + "description": "Fully matching images from the Internet.\nCan include resized copies of the query image.", + "type": "array", "items": { "$ref": "WebImage" - }, + } + }, + "webEntities": { + "description": "Deduced entities from similar images on the Internet.", "type": "array", - "description": "Fully matching images from the Internet.\nCan include resized copies of the query image." + "items": { + "$ref": "WebEntity" + } + }, + "pagesWithMatchingImages": { + "description": "Web pages containing the matching images from the Internet.", + "type": "array", + "items": { + "$ref": "WebPage" + } } }, "id": "WebDetection" @@ -721,48 +779,46 @@ "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": { - "z": { + "y": { + "description": "Y coordinate.", "format": "float", - "description": "Z coordinate (or depth).", "type": "number" }, "x": { - "format": "float", "description": "X coordinate.", + "format": "float", "type": "number" }, - "y": { + "z": { + "description": "Z coordinate (or depth).", "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", + "description": "The fraction of pixels the color occupies in the image.\nValue in range [0, 1].", "format": "float", - "description": "The fraction of pixels the color occupies in the image.\nValue in range [0, 1]." + "type": "number" }, "color": { - "description": "RGB components of the color.", - "$ref": "Color" + "$ref": "Color", + "description": "RGB components of the color." }, "score": { - "format": "float", "description": "Image-specific score for this color. Value in range [0, 1].", + "format": "float", "type": "number" } - } + }, + "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" }, "WebPage": { - "id": "WebPage", - "description": "Metadata for web pages.", "type": "object", "properties": { "url": { @@ -770,61 +826,63 @@ "type": "string" }, "score": { - "format": "float", "description": "(Deprecated) Overall relevancy score for the web page.", + "format": "float", "type": "number" } - } + }, + "id": "WebPage", + "description": "Metadata for web pages." }, "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": { - "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.", - "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": { - "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": { + "$ref": "BoundingPoly", + "description": "Image region to which this entity belongs. Not produced\nfor `LABEL_DETECTION` features." }, "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", + "type": "number", "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" + "format": "float" }, "description": { - "description": "Entity textual description, expressed in its `locale` language.", + "type": "string", + "description": "Entity textual description, expressed in its `locale` language." + }, + "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" + } + }, + "score": { + "type": "number", + "description": "Overall score of the result. Range [0, 1].", + "format": "float" + }, + "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" + } + }, + "mid": { + "description": "Opaque entity ID. Some IDs may be available in\n[Google Knowledge Graph Search\nAPI](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", + "type": "number" } } }, @@ -832,70 +890,32 @@ "description": "Single crop hint that is used to generate a new crop when serving an image.", "type": "object", "properties": { - "importanceFraction": { - "format": "float", - "description": "Fraction of importance of this salient region with respect to the original\nimage.", - "type": "number" - }, - "confidence": { - "format": "float", - "description": "Confidence of this being a salient region. Range [0, 1].", - "type": "number" - }, "boundingPoly": { "$ref": "BoundingPoly", "description": "The bounding polygon for the crop region. The coordinates of the bounding\nbox are in the original image's scale, as returned in `ImageParams`." + }, + "confidence": { + "description": "Confidence of this being a salient region. Range [0, 1].", + "format": "float", + "type": "number" + }, + "importanceFraction": { + "description": "Fraction of importance of this salient region with respect to the original\nimage.", + "format": "float", + "type": "number" } }, "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`.", + "description": "A face-specific landmark (for example, a face feature).", "type": "object", "properties": { "position": { - "description": "Face landmark position.", - "$ref": "Position" + "$ref": "Position", + "description": "Face landmark position." }, "type": { - "enum": [ - "UNKNOWN_LANDMARK", - "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" - ], "description": "Face landmark type.", "type": "string", "enumDescriptions": [ @@ -934,17 +954,55 @@ "Chin gnathion.", "Chin left gonion.", "Chin right gonion." + ], + "enum": [ + "UNKNOWN_LANDMARK", + "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": { "description": "Metadata for online images.", "type": "object", "properties": { "score": { - "format": "float", "description": "(Deprecated) Overall relevancy score for the image.", + "format": "float", "type": "number" }, "url": { @@ -958,48 +1016,31 @@ "description": "A word representation.", "type": "object", "properties": { + "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)." + "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).", + "$ref": "BoundingPoly" }, "symbols": { "description": "List of symbols in the word.\nThe order of the symbols follows the natural reading order.", + "type": "array", "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": { - "source": { - "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" - }, "Paragraph": { - "id": "Paragraph", "description": "Structural unit of text representing a number of words in certain order.", "type": "object", "properties": { "property": { - "description": "Additional information detected for the paragraph.", - "$ref": "TextProperty" + "$ref": "TextProperty", + "description": "Additional information detected for the paragraph." }, "boundingBox": { "$ref": "BoundingPoly", @@ -1007,56 +1048,34 @@ }, "words": { "description": "List of words in this paragraph.", + "type": "array", "items": { "$ref": "Word" - }, - "type": "array" + } } - } + }, + "id": "Paragraph" }, - "FaceAnnotation": { - "description": "A face annotation object contains the results of face detection.", + "Image": { + "description": "Client image to perform Google Cloud Vision API tasks over.", "type": "object", "properties": { - "headwearLikelihood": { - "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": "Headwear likelihood." - }, - "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": { - "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" + "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." + } + }, + "id": "Image" + }, + "FaceAnnotation": { + "type": "object", + "properties": { "sorrowLikelihood": { - "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", @@ -1065,44 +1084,26 @@ "LIKELY", "VERY_LIKELY" ], - "description": "Sorrow likelihood." + "description": "Sorrow 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." + ] }, "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].", + "format": "float", "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": [ - "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": "Anger likelihood.", - "type": "string" - }, - "landmarks": { - "description": "Detected face landmarks.", - "items": { - "$ref": "Landmark" - }, - "type": "array" - }, "surpriseLikelihood": { "enumDescriptions": [ "Unknown likelihood.", @@ -1123,13 +1124,14 @@ "description": "Surprise likelihood.", "type": "string" }, - "landmarkingConfidence": { - "format": "float", - "description": "Face landmarking confidence. Range [0, 1].", - "type": "number" + "landmarks": { + "description": "Detected face landmarks.", + "type": "array", + "items": { + "$ref": "Landmark" + } }, - "joyLikelihood": { - "type": "string", + "angerLikelihood": { "enumDescriptions": [ "Unknown likelihood.", "It is very unlikely that the image belongs to the specified vertical.", @@ -1146,9 +1148,15 @@ "LIKELY", "VERY_LIKELY" ], - "description": "Joy likelihood." + "description": "Anger likelihood.", + "type": "string" }, - "underExposedLikelihood": { + "landmarkingConfidence": { + "description": "Face landmarking confidence. Range [0, 1].", + "format": "float", + "type": "number" + }, + "joyLikelihood": { "enumDescriptions": [ "Unknown likelihood.", "It is very unlikely that the image belongs to the specified vertical.", @@ -1157,6 +1165,28 @@ "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.", + "type": "string" + }, + "detectionConfidence": { + "description": "Detection confidence. Range [0, 1].", + "format": "float", + "type": "number" + }, + "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" + }, + "underExposedLikelihood": { "enum": [ "UNKNOWN", "VERY_UNLIKELY", @@ -1166,17 +1196,15 @@ "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]." + "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." + ] }, "blurredLikelihood": { "description": "Blurred likelihood.", @@ -1197,28 +1225,61 @@ "LIKELY", "VERY_LIKELY" ] + }, + "headwearLikelihood": { + "description": "Headwear 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" + ] + }, + "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" + }, + "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", + "type": "number" } }, - "id": "FaceAnnotation" + "id": "FaceAnnotation", + "description": "A face annotation object contains the results of face detection." }, "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": { + "isPrefix": { + "description": "True if break prepends the element.", + "type": "boolean" + }, "type": { "enum": [ "UNKNOWN", @@ -1238,117 +1299,57 @@ "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.", - "type": "boolean" } }, - "id": "DetectedBreak" + "id": "DetectedBreak", + "description": "Detected start or end of a structural component." }, "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).", - "items": { - "type": "string" - }, - "type": "array" - }, "latLongRect": { "description": "lat/long rectangle that specifies the location of the image.", "$ref": "LatLongRect" }, "cropHintsParams": { - "description": "Parameters for crop hints annotation request.", - "$ref": "CropHintsParams" + "$ref": "CropHintsParams", + "description": "Parameters for crop hints annotation request." + }, + "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" + } } }, "id": "ImageContext" - }, - "Page": { - "description": "Detected page from OCR.", - "type": "object", - "properties": { - "width": { - "format": "int32", - "description": "Page width in pixels.", - "type": "integer" - }, - "blocks": { - "items": { - "$ref": "Block" - }, - "type": "array", - "description": "List of blocks of text, images etc on this page." - }, - "property": { - "description": "Additional information detected on the page.", - "$ref": "TextProperty" - }, - "height": { - "type": "integer", - "format": "int32", - "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" - }, - "imageContext": { - "$ref": "ImageContext", - "description": "Additional context that may accompany the image." - } - }, - "id": "AnnotateImageRequest" - }, - "Status": { - "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", - "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": { "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": "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", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud Vision API", + "ownerName": "Google" } diff --git a/etc/api/vision/v1p1beta1/vision-api.json b/etc/api/vision/v1p1beta1/vision-api.json new file mode 100644 index 0000000000..7bd60382a5 --- /dev/null +++ b/etc/api/vision/v1p1beta1/vision-api.json @@ -0,0 +1,1459 @@ +{ + "discoveryVersion": "v1", + "version_module": true, + "schemas": { + "GoogleCloudVisionV1p1beta1Property": { + "description": "A `Property` consists of a user-supplied name/value pair.", + "type": "object", + "properties": { + "value": { + "description": "Value of the property.", + "type": "string" + }, + "uint64Value": { + "description": "Value of numeric properties.", + "format": "uint64", + "type": "string" + }, + "name": { + "description": "Name of the property.", + "type": "string" + } + }, + "id": "GoogleCloudVisionV1p1beta1Property" + }, + "GoogleCloudVisionV1p1beta1ImageContext": { + "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" + } + }, + "webDetectionParams": { + "$ref": "GoogleCloudVisionV1p1beta1WebDetectionParams", + "description": "Parameters for web detection." + }, + "latLongRect": { + "description": "lat/long rectangle that specifies the location of the image.", + "$ref": "GoogleCloudVisionV1p1beta1LatLongRect" + }, + "cropHintsParams": { + "description": "Parameters for crop hints annotation request.", + "$ref": "GoogleCloudVisionV1p1beta1CropHintsParams" + } + }, + "id": "GoogleCloudVisionV1p1beta1ImageContext", + "description": "Image context and/or feature-specific parameters.", + "type": "object" + }, + "GoogleCloudVisionV1p1beta1WebDetectionWebImage": { + "description": "Metadata for online images.", + "type": "object", + "properties": { + "url": { + "description": "The result image URL.", + "type": "string" + }, + "score": { + "description": "(Deprecated) Overall relevancy score for the image.", + "format": "float", + "type": "number" + } + }, + "id": "GoogleCloudVisionV1p1beta1WebDetectionWebImage" + }, + "GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse": { + "properties": { + "responses": { + "description": "Individual responses to image annotation requests within the batch.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1AnnotateImageResponse" + } + } + }, + "id": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse", + "description": "Response to a batch image annotation request.", + "type": "object" + }, + "GoogleCloudVisionV1p1beta1WebDetectionWebLabel": { + "description": "Label to provide extra metadata for the web detection.", + "type": "object", + "properties": { + "label": { + "description": "Label for extra metadata.", + "type": "string" + }, + "languageCode": { + "description": "The BCP-47 language code for `label`, such as \"en-US\" or \"sr-Latn\".\nFor more information, see\nhttp://www.unicode.org/reports/tr35/#Unicode_locale_identifier.", + "type": "string" + } + }, + "id": "GoogleCloudVisionV1p1beta1WebDetectionWebLabel" + }, + "GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage": { + "description": "Detected language for a structural component.", + "type": "object", + "properties": { + "confidence": { + "description": "Confidence of detected language. Range [0, 1].", + "format": "float", + "type": "number" + }, + "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" + } + }, + "id": "GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage" + }, + "GoogleCloudVisionV1p1beta1Symbol": { + "description": "A single symbol representation.", + "type": "object", + "properties": { + "text": { + "description": "The actual UTF-8 representation of the symbol.", + "type": "string" + }, + "property": { + "description": "Additional information detected for the symbol.", + "$ref": "GoogleCloudVisionV1p1beta1TextAnnotationTextProperty" + }, + "boundingBox": { + "$ref": "GoogleCloudVisionV1p1beta1BoundingPoly", + "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)." + }, + "confidence": { + "description": "Confidence of the OCR results for the symbol. Range [0, 1].", + "format": "float", + "type": "number" + } + }, + "id": "GoogleCloudVisionV1p1beta1Symbol" + }, + "GoogleCloudVisionV1p1beta1ImageProperties": { + "description": "Stores image properties, such as dominant colors.", + "type": "object", + "properties": { + "dominantColors": { + "description": "If present, dominant colors completed successfully.", + "$ref": "GoogleCloudVisionV1p1beta1DominantColorsAnnotation" + } + }, + "id": "GoogleCloudVisionV1p1beta1ImageProperties" + }, + "GoogleCloudVisionV1p1beta1Image": { + "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": { + "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": "GoogleCloudVisionV1p1beta1ImageSource" + } + }, + "id": "GoogleCloudVisionV1p1beta1Image" + }, + "GoogleCloudVisionV1p1beta1WebDetectionWebEntity": { + "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": "GoogleCloudVisionV1p1beta1WebDetectionWebEntity" + }, + "GoogleCloudVisionV1p1beta1ColorInfo": { + "description": "Color information consists of RGB channels, score, and the fraction of\nthe image that the color occupies in the image.", + "type": "object", + "properties": { + "score": { + "description": "Image-specific score for this color. Value in range [0, 1].", + "format": "float", + "type": "number" + }, + "pixelFraction": { + "description": "The fraction of pixels the color occupies in the image.\nValue in range [0, 1].", + "format": "float", + "type": "number" + }, + "color": { + "description": "RGB components of the color.", + "$ref": "Color" + } + }, + "id": "GoogleCloudVisionV1p1beta1ColorInfo" + }, + "GoogleCloudVisionV1p1beta1FaceAnnotationLandmark": { + "description": "A face-specific landmark (for example, a face feature).", + "type": "object", + "properties": { + "position": { + "description": "Face landmark position.", + "$ref": "GoogleCloudVisionV1p1beta1Position" + }, + "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", + "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" + ], + "description": "Face landmark type.", + "type": "string" + } + }, + "id": "GoogleCloudVisionV1p1beta1FaceAnnotationLandmark" + }, + "GoogleCloudVisionV1p1beta1WebDetection": { + "description": "Relevant information for the image from the Internet.", + "type": "object", + "properties": { + "pagesWithMatchingImages": { + "description": "Web pages containing the matching images from the Internet.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1WebDetectionWebPage" + } + }, + "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": "GoogleCloudVisionV1p1beta1WebDetectionWebImage" + } + }, + "visuallySimilarImages": { + "description": "The visually similar image results.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1WebDetectionWebImage" + } + }, + "bestGuessLabels": { + "description": "Best guess text labels for the request image.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1WebDetectionWebLabel" + } + }, + "fullMatchingImages": { + "description": "Fully matching images from the Internet.\nCan include resized copies of the query image.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1WebDetectionWebImage" + } + }, + "webEntities": { + "description": "Deduced entities from similar images on the Internet.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1WebDetectionWebEntity" + } + } + }, + "id": "GoogleCloudVisionV1p1beta1WebDetection" + }, + "GoogleCloudVisionV1p1beta1AnnotateImageResponse": { + "description": "Response to an image annotation request.", + "type": "object", + "properties": { + "fullTextAnnotation": { + "$ref": "GoogleCloudVisionV1p1beta1TextAnnotation", + "description": "If present, text (OCR) detection or document (OCR) text detection has\ncompleted successfully.\nThis annotation provides the structural hierarchy for the OCR detected\ntext." + }, + "landmarkAnnotations": { + "description": "If present, landmark detection has completed successfully.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1EntityAnnotation" + } + }, + "textAnnotations": { + "description": "If present, text (OCR) detection has completed successfully.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1EntityAnnotation" + } + }, + "imagePropertiesAnnotation": { + "description": "If present, image properties were extracted successfully.", + "$ref": "GoogleCloudVisionV1p1beta1ImageProperties" + }, + "faceAnnotations": { + "description": "If present, face detection has completed successfully.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1FaceAnnotation" + } + }, + "logoAnnotations": { + "description": "If present, logo detection has completed successfully.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1EntityAnnotation" + } + }, + "cropHintsAnnotation": { + "$ref": "GoogleCloudVisionV1p1beta1CropHintsAnnotation", + "description": "If present, crop hints have completed successfully." + }, + "webDetection": { + "description": "If present, web detection has completed successfully.", + "$ref": "GoogleCloudVisionV1p1beta1WebDetection" + }, + "labelAnnotations": { + "description": "If present, label detection has completed successfully.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1EntityAnnotation" + } + }, + "safeSearchAnnotation": { + "description": "If present, safe-search annotation has completed successfully.", + "$ref": "GoogleCloudVisionV1p1beta1SafeSearchAnnotation" + }, + "error": { + "description": "If set, represents the error message for the operation.\nNote that filled-in image annotations are guaranteed to be\ncorrect, even when `error` is set.", + "$ref": "Status" + } + }, + "id": "GoogleCloudVisionV1p1beta1AnnotateImageResponse" + }, + "GoogleCloudVisionV1p1beta1FaceAnnotation": { + "description": "A face annotation object contains the results of face detection.", + "type": "object", + "properties": { + "underExposedLikelihood": { + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Under-exposed 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." + ] + }, + "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.", + "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" + ] + }, + "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": "GoogleCloudVisionV1p1beta1BoundingPoly" + }, + "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", + "type": "number" + }, + "sorrowLikelihood": { + "description": "Sorrow 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" + ] + }, + "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": "GoogleCloudVisionV1p1beta1BoundingPoly", + "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": "GoogleCloudVisionV1p1beta1FaceAnnotationLandmark" + } + }, + "surpriseLikelihood": { + "description": "Surprise 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" + ] + }, + "angerLikelihood": { + "description": "Anger 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" + ] + }, + "landmarkingConfidence": { + "description": "Face landmarking confidence. Range [0, 1].", + "format": "float", + "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" + ] + } + }, + "id": "GoogleCloudVisionV1p1beta1FaceAnnotation" + }, + "GoogleCloudVisionV1p1beta1SafeSearchAnnotation": { + "properties": { + "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" + }, + "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" + ] + }, + "racy": { + "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 the request image contains racy content. Racy content may\ninclude (but is not limited to) skimpy or sheer clothing, strategically\ncovered nudity, lewd or provocative poses, or close-ups of sensitive\nbody areas.", + "type": "string" + }, + "violence": { + "enum": [ + "UNKNOWN", + "VERY_UNLIKELY", + "UNLIKELY", + "POSSIBLE", + "LIKELY", + "VERY_LIKELY" + ], + "description": "Likelihood that this image contains violent content.", + "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." + ] + }, + "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. Adult content may\ncontain elements such as nudity, pornographic images or cartoons, or\nsexual activities.", + "type": "string" + } + }, + "id": "GoogleCloudVisionV1p1beta1SafeSearchAnnotation", + "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" + }, + "GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak": { + "description": "Detected start or end of a structural component.", + "type": "object", + "properties": { + "isPrefix": { + "description": "True if break prepends the element.", + "type": "boolean" + }, + "type": { + "enum": [ + "UNKNOWN", + "SPACE", + "SURE_SPACE", + "EOL_SURE_SPACE", + "HYPHEN", + "LINE_BREAK" + ], + "description": "Detected break type.", + "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." + ] + } + }, + "id": "GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak" + }, + "GoogleCloudVisionV1p1beta1AnnotateImageRequest": { + "description": "Request for performing Google Cloud Vision API tasks over a user-provided\nimage, with user-requested features.", + "type": "object", + "properties": { + "image": { + "$ref": "GoogleCloudVisionV1p1beta1Image", + "description": "The image to be processed." + }, + "features": { + "description": "Requested features.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1Feature" + } + }, + "imageContext": { + "description": "Additional context that may accompany the image.", + "$ref": "GoogleCloudVisionV1p1beta1ImageContext" + } + }, + "id": "GoogleCloudVisionV1p1beta1AnnotateImageRequest" + }, + "GoogleCloudVisionV1p1beta1Page": { + "description": "Detected page from OCR.", + "type": "object", + "properties": { + "width": { + "description": "Page width in pixels.", + "format": "int32", + "type": "integer" + }, + "blocks": { + "description": "List of blocks of text, images etc on this page.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1Block" + } + }, + "property": { + "description": "Additional information detected on the page.", + "$ref": "GoogleCloudVisionV1p1beta1TextAnnotationTextProperty" + }, + "confidence": { + "description": "Confidence of the OCR results on the page. Range [0, 1].", + "format": "float", + "type": "number" + }, + "height": { + "description": "Page height in pixels.", + "format": "int32", + "type": "integer" + } + }, + "id": "GoogleCloudVisionV1p1beta1Page" + }, + "GoogleCloudVisionV1p1beta1Block": { + "description": "Logical element on the page.", + "type": "object", + "properties": { + "property": { + "description": "Additional information detected for the block.", + "$ref": "GoogleCloudVisionV1p1beta1TextAnnotationTextProperty" + }, + "blockType": { + "enum": [ + "UNKNOWN", + "TEXT", + "TABLE", + "PICTURE", + "RULER", + "BARCODE" + ], + "description": "Detected block type (text, image etc) for this block.", + "type": "string", + "enumDescriptions": [ + "Unknown block type.", + "Regular text block.", + "Table block.", + "Image block.", + "Horizontal/vertical line box.", + "Barcode block." + ] + }, + "boundingBox": { + "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": "GoogleCloudVisionV1p1beta1BoundingPoly" + }, + "confidence": { + "description": "Confidence of the OCR results on the block. Range [0, 1].", + "format": "float", + "type": "number" + }, + "paragraphs": { + "description": "List of paragraphs in this block (if this blocks is of type text).", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1Paragraph" + } + } + }, + "id": "GoogleCloudVisionV1p1beta1Block" + }, + "GoogleCloudVisionV1p1beta1Paragraph": { + "properties": { + "property": { + "description": "Additional information detected for the paragraph.", + "$ref": "GoogleCloudVisionV1p1beta1TextAnnotationTextProperty" + }, + "boundingBox": { + "description": "The bounding box for the paragraph.\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": "GoogleCloudVisionV1p1beta1BoundingPoly" + }, + "confidence": { + "description": "Confidence of the OCR results for the paragraph. Range [0, 1].", + "format": "float", + "type": "number" + }, + "words": { + "description": "List of words in this paragraph.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1Word" + } + } + }, + "id": "GoogleCloudVisionV1p1beta1Paragraph", + "description": "Structural unit of text representing a number of words in certain order.", + "type": "object" + }, + "GoogleCloudVisionV1p1beta1TextAnnotation": { + "properties": { + "pages": { + "description": "List of pages detected by OCR.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1Page" + } + }, + "text": { + "description": "UTF-8 text detected on the pages.", + "type": "string" + } + }, + "id": "GoogleCloudVisionV1p1beta1TextAnnotation", + "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 refer\nto the TextAnnotation.TextProperty message definition below for more\ndetail.", + "type": "object" + }, + "GoogleCloudVisionV1p1beta1EntityAnnotation": { + "properties": { + "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": "GoogleCloudVisionV1p1beta1Property" + } + }, + "score": { + "description": "Overall score of the result. Range [0, 1].", + "format": "float", + "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": "GoogleCloudVisionV1p1beta1LocationInfo" + } + }, + "mid": { + "description": "Opaque entity ID. Some IDs may be available in\n[Google Knowledge Graph Search\nAPI](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", + "type": "number" + }, + "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": "GoogleCloudVisionV1p1beta1BoundingPoly" + } + }, + "id": "GoogleCloudVisionV1p1beta1EntityAnnotation", + "description": "Set of detected entity features.", + "type": "object" + }, + "GoogleCloudVisionV1p1beta1BoundingPoly": { + "description": "A bounding polygon for the detected image annotation.", + "type": "object", + "properties": { + "vertices": { + "description": "The bounding polygon vertices.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1Vertex" + } + } + }, + "id": "GoogleCloudVisionV1p1beta1BoundingPoly" + }, + "GoogleCloudVisionV1p1beta1TextAnnotationTextProperty": { + "properties": { + "detectedLanguages": { + "description": "A list of detected languages together with confidence.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage" + } + }, + "detectedBreak": { + "description": "Detected start or end of a text segment.", + "$ref": "GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak" + } + }, + "id": "GoogleCloudVisionV1p1beta1TextAnnotationTextProperty", + "description": "Additional information detected on the structural component.", + "type": "object" + }, + "GoogleCloudVisionV1p1beta1LocationInfo": { + "description": "Detected entity location information.", + "type": "object", + "properties": { + "latLng": { + "description": "lat/long location coordinates.", + "$ref": "LatLng" + } + }, + "id": "GoogleCloudVisionV1p1beta1LocationInfo" + }, + "GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest": { + "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": "GoogleCloudVisionV1p1beta1AnnotateImageRequest" + } + } + }, + "id": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest" + }, + "GoogleCloudVisionV1p1beta1WebDetectionParams": { + "description": "Parameters for web detection request.", + "type": "object", + "properties": { + "includeGeoResults": { + "description": "Whether to include results derived from the geo information in the image.", + "type": "boolean" + } + }, + "id": "GoogleCloudVisionV1p1beta1WebDetectionParams" + }, + "GoogleCloudVisionV1p1beta1ImageSource": { + "description": "External image source (Google Cloud Storage image location).", + "type": "object", + "properties": { + "gcsImageUri": { + "description": "NOTE: For new code `image_uri` below is preferred.\nGoogle Cloud Storage image URI, which must be in the following form:\n`gs://bucket_name/object_name` (for details, see\n[Google Cloud Storage Request\nURIs](https://cloud.google.com/storage/docs/reference-uris)).\nNOTE: Cloud Storage object versioning is not supported.", + "type": "string" + }, + "imageUri": { + "description": "Image URI which supports:\n1) Google Cloud Storage image URI, which must be in the following form:\n`gs://bucket_name/object_name` (for details, see\n[Google Cloud Storage Request\nURIs](https://cloud.google.com/storage/docs/reference-uris)).\nNOTE: Cloud Storage object versioning is not supported.\n2) Publicly accessible image HTTP/HTTPS URL.\nThis is preferred over the legacy `gcs_image_uri` above. When both\n`gcs_image_uri` and `image_uri` are specified, `image_uri` takes\nprecedence.", + "type": "string" + } + }, + "id": "GoogleCloudVisionV1p1beta1ImageSource" + }, + "GoogleCloudVisionV1p1beta1CropHintsParams": { + "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" + } + } + }, + "id": "GoogleCloudVisionV1p1beta1CropHintsParams" + }, + "GoogleCloudVisionV1p1beta1Word": { + "description": "A word representation.", + "type": "object", + "properties": { + "property": { + "$ref": "GoogleCloudVisionV1p1beta1TextAnnotationTextProperty", + "description": "Additional information detected for the word." + }, + "boundingBox": { + "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).", + "$ref": "GoogleCloudVisionV1p1beta1BoundingPoly" + }, + "confidence": { + "description": "Confidence of the OCR results for the word. Range [0, 1].", + "format": "float", + "type": "number" + }, + "symbols": { + "description": "List of symbols in the word.\nThe order of the symbols follows the natural reading order.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1Symbol" + } + } + }, + "id": "GoogleCloudVisionV1p1beta1Word" + }, + "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" + }, + "GoogleCloudVisionV1p1beta1Vertex": { + "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": "GoogleCloudVisionV1p1beta1Vertex" + }, + "GoogleCloudVisionV1p1beta1LatLongRect": { + "properties": { + "minLatLng": { + "description": "Min lat/long pair.", + "$ref": "LatLng" + }, + "maxLatLng": { + "description": "Max lat/long pair.", + "$ref": "LatLng" + } + }, + "id": "GoogleCloudVisionV1p1beta1LatLongRect", + "description": "Rectangle determined by min and max `LatLng` pairs.", + "type": "object" + }, + "GoogleCloudVisionV1p1beta1DominantColorsAnnotation": { + "properties": { + "colors": { + "description": "RGB color values with their score and pixel fraction.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1ColorInfo" + } + } + }, + "id": "GoogleCloudVisionV1p1beta1DominantColorsAnnotation", + "description": "Set of dominant colors and their corresponding scores.", + "type": "object" + }, + "GoogleCloudVisionV1p1beta1WebDetectionWebPage": { + "description": "Metadata for web pages.", + "type": "object", + "properties": { + "pageTitle": { + "description": "Title for the web page, may contain HTML markups.", + "type": "string" + }, + "fullMatchingImages": { + "description": "Fully matching images on the page.\nCan include resized copies of the query image.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1WebDetectionWebImage" + } + }, + "score": { + "description": "(Deprecated) Overall relevancy score for the web page.", + "format": "float", + "type": "number" + }, + "partialMatchingImages": { + "description": "Partial matching images on the page.\nThose images are similar enough to share some key-point features. For\nexample an original image will likely have partial matching for its\ncrops.", + "type": "array", + "items": { + "$ref": "GoogleCloudVisionV1p1beta1WebDetectionWebImage" + } + }, + "url": { + "description": "The result web page URL.", + "type": "string" + } + }, + "id": "GoogleCloudVisionV1p1beta1WebDetectionWebPage" + }, + "GoogleCloudVisionV1p1beta1CropHint": { + "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].", + "format": "float", + "type": "number" + }, + "importanceFraction": { + "description": "Fraction of importance of this salient region with respect to the original\nimage.", + "format": "float", + "type": "number" + }, + "boundingPoly": { + "$ref": "GoogleCloudVisionV1p1beta1BoundingPoly", + "description": "The bounding polygon for the crop region. The coordinates of the bounding\nbox are in the original image's scale, as returned in `ImageParams`." + } + }, + "id": "GoogleCloudVisionV1p1beta1CropHint" + }, + "GoogleCloudVisionV1p1beta1Feature": { + "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" + }, + "model": { + "description": "Model to use for the feature.\nSupported values: \"builtin/stable\" (the default if unset) and\n\"builtin/latest\".", + "type": "string" + } + }, + "id": "GoogleCloudVisionV1p1beta1Feature" + }, + "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.", + "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" + }, + "GoogleCloudVisionV1p1beta1Position": { + "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.", + "format": "float", + "type": "number" + }, + "x": { + "description": "X coordinate.", + "format": "float", + "type": "number" + }, + "z": { + "description": "Z coordinate (or depth).", + "format": "float", + "type": "number" + } + }, + "id": "GoogleCloudVisionV1p1beta1Position" + }, + "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": { + "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" + }, + "red": { + "description": "The amount of red in the color as a value in the interval [0, 1].", + "format": "float", + "type": "number" + } + }, + "id": "Color" + }, + "GoogleCloudVisionV1p1beta1CropHintsAnnotation": { + "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": "GoogleCloudVisionV1p1beta1CropHint" + } + } + }, + "id": "GoogleCloudVisionV1p1beta1CropHintsAnnotation" + } + }, + "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": "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", + "fullyEncodeReservedExpansion": true, + "title": "Google Cloud Vision API", + "ownerName": "Google", + "resources": { + "images": { + "methods": { + "annotate": { + "httpMethod": "POST", + "parameterOrder": [], + "response": { + "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse" + }, + "parameters": {}, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-vision" + ], + "flatPath": "v1p1beta1/images:annotate", + "id": "vision.images.annotate", + "path": "v1p1beta1/images:annotate", + "request": { + "$ref": "GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest" + }, + "description": "Run image detection and annotation for a batch of images." + } + } + } + }, + "parameters": { + "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" + }, + "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": { + "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": { + "description": "Returns response with indentations and line breaks.", + "type": "boolean", + "default": "true", + "location": "query" + } + }, + "version": "v1p1beta1", + "baseUrl": "https://vision.googleapis.com/", + "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.", + "kind": "discovery#restDescription", + "basePath": "", + "id": "vision:v1p1beta1", + "documentationLink": "https://cloud.google.com/vision/", + "revision": "20171107" +} diff --git a/etc/api/webmasters/v3/webmasters-api.json b/etc/api/webmasters/v3/webmasters-api.json index 83f03e98b9..657cab5b78 100644 --- a/etc/api/webmasters/v3/webmasters-api.json +++ b/etc/api/webmasters/v3/webmasters-api.json @@ -20,7 +20,7 @@ "basePath": "/webmasters/v3/", "rootUrl": "https://www.googleapis.com/", "servicePath": "webmasters/v3/", - "batchPath": "batch", + "batchPath": "batch/webmasters/v3", "parameters": { "alt": { "type": "string", diff --git a/etc/api/youtube/v3/youtube-api.json b/etc/api/youtube/v3/youtube-api.json index 65146c6c3a..62c1d3696f 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/AIWw-yWxHTNchYNbx8LfngbqcZ8\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/QsthGWG9JYScjn9llsqMMChWCIQ\"", "discoveryVersion": "v1", "id": "youtube:v3", "name": "youtube", "canonicalName": "YouTube", "version": "v3", - "revision": "20170918", + "revision": "20171129", "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", @@ -727,9 +727,11 @@ "description": "The frame rate of the inbound video data.", "enum": [ "30fps", - "60fps" + "60fps", + "variable" ], "enumDescriptions": [ + "", "", "" ] @@ -766,7 +768,8 @@ "240p", "360p", "480p", - "720p" + "720p", + "variable" ], "enumDescriptions": [ "", @@ -775,6 +778,7 @@ "", "", "", + "", "" ] } @@ -3066,6 +3070,7 @@ "oflcR18", "oflcRp13", "oflcRp16", + "oflcRp18", "oflcUnrated" ], "enumDescriptions": [ @@ -3078,6 +3083,7 @@ "", "", "", + "", "" ] }, @@ -3939,6 +3945,10 @@ "" ] }, + "enableAutoStart": { + "type": "boolean", + "description": "This setting indicates whether auto start is enabled for this broadcast." + }, "enableClosedCaptions": { "type": "boolean", "description": "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." @@ -4868,6 +4878,7 @@ "videoBitrateMismatch", "videoCodec", "videoCodecMismatch", + "videoIngestionFasterThanRealtime", "videoIngestionStarved", "videoInterlaceMismatch", "videoProfileMismatch", @@ -4907,6 +4918,7 @@ "", "", "", + "", "" ] } @@ -6179,6 +6191,19 @@ "type": "object", "description": "A video resource represents a YouTube video.", "properties": { + "accessToken": { + "type": "string", + "description": "The access token to uniquely identify a revocable unlisted video.", + "annotations": { + "required": [ + "youtube.videos.getRating", + "youtube.videos.list", + "youtube.videos.rate", + "youtube.videos.reportAbuse", + "youtube.videos.update" + ] + } + }, "ageGating": { "$ref": "VideoAgeGating", "description": "Age restriction details related to a video. This data can only be retrieved by the video owner." diff --git a/etc/api/youtubeanalytics/v1/youtubeanalytics-api.json b/etc/api/youtubeanalytics/v1/youtubeanalytics-api.json index 67824c43d0..8284d16437 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/Wwas2fOb4cRmT-_jQ0LHI2aJh5Y\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/RHGHEKfu1073YFgYY-1pDGME5rY\"", "discoveryVersion": "v1", "id": "youtubeAnalytics:v1", "name": "youtubeAnalytics", "canonicalName": "YouTube Analytics", "version": "v1", - "revision": "20170925", + "revision": "20171206", "title": "YouTube Analytics API", "description": "Retrieves your YouTube Analytics data.", "ownerDomain": "google.com", diff --git a/etc/api/youtubeanalytics/v1beta1/youtubeanalytics-api.json b/etc/api/youtubeanalytics/v1beta1/youtubeanalytics-api.json index 2ccd1852c2..448cf0ecb2 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/5Tq-2PG0h9A81sunD_QAIeC7AjQ\"", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/GSWenMRs6LiXXdykFsVipU3nQgA\"", "discoveryVersion": "v1", "id": "youtubeAnalytics:v1beta1", "name": "youtubeAnalytics", "canonicalName": "YouTube Analytics", "version": "v1beta1", - "revision": "20170925", + "revision": "20171206", "title": "YouTube Analytics API", "description": "Retrieves your YouTube Analytics data.", "ownerDomain": "google.com", diff --git a/etc/api/youtubereporting/v1/youtubereporting-api.json b/etc/api/youtubereporting/v1/youtubereporting-api.json index b474632ed1..76343add09 100644 --- a/etc/api/youtubereporting/v1/youtubereporting-api.json +++ b/etc/api/youtubereporting/v1/youtubereporting-api.json @@ -1,88 +1,30 @@ { - "revision": "20170926", - "documentationLink": "https://developers.google.com/youtube/reporting/v1/reports/", - "id": "youtubereporting:v1", - "title": "YouTube Reporting API", - "ownerName": "Google", - "discoveryVersion": "v1", "resources": { - "media": { + "reportTypes": { "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, + "list": { + "description": "Lists report types.", "httpMethod": "GET", - "parameterOrder": [ - "resourceName" - ], "response": { - "$ref": "Media" + "$ref": "ListReportTypesResponse" }, + "parameterOrder": [], "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", + "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" }, - "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" + "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", @@ -94,16 +36,61 @@ "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": { + "flatPath": "v1/reportTypes", + "id": "youtubereporting.reportTypes.list", + "path": "v1/reportTypes" + } + } + }, + "media": { + "methods": { + "download": { + "description": "Method for media download. Download is supported\non the URI `/v1/media/{+name}?alt=media`.", + "supportsMediaDownload": true, + "response": { + "$ref": "Media" + }, + "parameterOrder": [ + "resourceName" + ], + "httpMethod": "GET", "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", + "resourceName": { + "location": "path", + "description": "Name of the media that is being downloaded. See\nReadRequest.resource_name.", + "required": true, + "type": "string", + "pattern": "^.+$" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", + "https://www.googleapis.com/auth/yt-analytics.readonly" + ], + "flatPath": "v1/media/{mediaId}", + "path": "v1/media/{+resourceName}", + "id": "youtubereporting.media.download" + } + } + }, + "jobs": { + "methods": { + "list": { + "httpMethod": "GET", + "response": { + "$ref": "ListJobsResponse" + }, + "parameterOrder": [], + "parameters": { + "pageSize": { + "description": "Requested page size. Server may return fewer jobs than requested.\nIf unspecified, server will pick an appropriate default.", + "format": "int32", + "type": "integer", + "location": "query" + }, + "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" }, "pageToken": { @@ -111,15 +98,9 @@ "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", + "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" } }, @@ -130,81 +111,98 @@ "flatPath": "v1/jobs", "id": "youtubereporting.jobs.list", "path": "v1/jobs", - "description": "Lists jobs.", - "response": { - "$ref": "ListJobsResponse" - }, - "parameterOrder": [], - "httpMethod": "GET" + "description": "Lists jobs." }, - "create": { - "path": "v1/jobs", - "id": "youtubereporting.jobs.create", - "description": "Creates a job and returns it.", - "request": { - "$ref": "Job" - }, - "httpMethod": "POST", - "parameterOrder": [], + "get": { + "description": "Gets a job.", "response": { "$ref": "Job" }, + "parameterOrder": [ + "jobId" + ], + "httpMethod": "GET", + "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 retrieve.", + "required": true, + "type": "string" + }, "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" } }, + "flatPath": "v1/jobs/{jobId}", + "path": "v1/jobs/{jobId}", + "id": "youtubereporting.jobs.get" + }, + "create": { + "request": { + "$ref": "Job" + }, + "description": "Creates a job and returns it.", + "response": { + "$ref": "Job" + }, + "parameterOrder": [], + "httpMethod": "POST", + "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" + } + }, "scopes": [ "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", "https://www.googleapis.com/auth/yt-analytics.readonly" ], - "flatPath": "v1/jobs" + "flatPath": "v1/jobs", + "path": "v1/jobs", + "id": "youtubereporting.jobs.create" + }, + "delete": { + "flatPath": "v1/jobs/{jobId}", + "path": "v1/jobs/{jobId}", + "id": "youtubereporting.jobs.delete", + "description": "Deletes a job.", + "response": { + "$ref": "Empty" + }, + "parameterOrder": [ + "jobId" + ], + "httpMethod": "DELETE", + "parameters": { + "jobId": { + "location": "path", + "description": "The ID of the job to delete.", + "required": true, + "type": "string" + }, + "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" + ] } }, "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" }, @@ -217,104 +215,155 @@ "https://www.googleapis.com/auth/yt-analytics.readonly" ], "parameters": { + "startTimeBefore": { + "location": "query", + "description": "If set, only reports whose start time is smaller than the specified\ndate/time are returned.", + "format": "google-datetime", + "type": "string" + }, "jobId": { "description": "The ID of the job.", - "type": "string", "required": true, + "type": "string", "location": "path" }, "createdAfter": { - "location": "query", - "format": "google-datetime", "description": "If set, only reports created after the specified date/time are returned.", - "type": "string" + "format": "google-datetime", + "type": "string", + "location": "query" }, "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.", + "format": "google-datetime", "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" + "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" + "format": "int32", + "type": "integer", + "location": "query" }, "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", + "path": "v1/jobs/{jobId}/reports", "id": "youtubereporting.jobs.reports.list", - "path": "v1/jobs/{jobId}/reports" + "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.", + "response": { + "$ref": "Report" + }, + "parameterOrder": [ + "jobId", + "reportId" + ], + "httpMethod": "GET", + "scopes": [ + "https://www.googleapis.com/auth/yt-analytics-monetary.readonly", + "https://www.googleapis.com/auth/yt-analytics.readonly" + ], + "parameters": { + "reportId": { + "location": "path", + "description": "The ID of the report to retrieve.", + "required": true, + "type": "string" + }, + "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" + } + }, + "flatPath": "v1/jobs/{jobId}/reports/{reportId}", + "path": "v1/jobs/{jobId}/reports/{reportId}", + "id": "youtubereporting.jobs.reports.get" } } } } - }, - "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": { + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "type": "string", + "location": "query" + }, + "prettyPrint": { "location": "query", - "description": "OAuth access token.", + "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": { + "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.", @@ -327,13 +376,8 @@ }, "pp": { "description": "Pretty-print response.", - "default": "true", "type": "boolean", - "location": "query" - }, - "bearer_token": { - "description": "OAuth bearer token.", - "type": "string", + "default": "true", "location": "query" }, "oauth_token": { @@ -341,219 +385,13 @@ "type": "string", "location": "query" }, - "upload_protocol": { - "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "bearer_token": { + "description": "OAuth bearer token.", "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", @@ -564,13 +402,169 @@ } }, "id": "Media" + }, + "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": { + "description": "The end of the time period that the report instance covers. The value is\nexclusive.", + "format": "google-datetime", + "type": "string" + }, + "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" + }, + "ListReportTypesResponse": { + "description": "Response message for ReportingService.ListReportTypes.", + "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" + }, + "ReportType": { + "description": "A report type.", + "type": "object", + "properties": { + "id": { + "description": "The ID of the report type (max. 100 characters).", + "type": "string" + }, + "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" + }, + "deprecateTime": { + "description": "The date/time when this report type was/will be deprecated.", + "format": "google-datetime", + "type": "string" + }, + "name": { + "description": "The name of the report type (max. 100 characters).", + "type": "string" + } + }, + "id": "ReportType" + }, + "ListJobsResponse": { + "description": "Response message for ReportingService.ListJobs.", + "type": "object", + "properties": { + "jobs": { + "description": "The list of jobs.", + "type": "array", + "items": { + "$ref": "Job" + } + }, + "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" + } + }, + "id": "ListJobsResponse" + }, + "Job": { + "description": "A job creating reports of a specific type.", + "type": "object", + "properties": { + "createTime": { + "description": "The creation date/time of the job.", + "format": "google-datetime", + "type": "string" + }, + "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" + }, + "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" + } + }, + "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" } }, - "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://youtubereporting.googleapis.com/", "canonicalName": "YouTube Reporting", @@ -586,12 +580,18 @@ } } }, - "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": "", + "description": "Schedules reporting jobs containing your YouTube Analytics data and downloads the resulting bulk data reports in the form of CSV files.", + "kind": "discovery#restDescription", "rootUrl": "https://youtubereporting.googleapis.com/", "basePath": "", "ownerDomain": "google.com", "name": "youtubereporting", - "batchPath": "batch" + "batchPath": "batch", + "revision": "20171208", + "documentationLink": "https://developers.google.com/youtube/reporting/v1/reports/", + "id": "youtubereporting:v1", + "title": "YouTube Reporting API", + "discoveryVersion": "v1", + "ownerName": "Google" } diff --git a/gen/abusiveexperiencereport1-cli/Cargo.toml b/gen/abusiveexperiencereport1-cli/Cargo.toml new file mode 100644 index 0000000000..ca49fda1ef --- /dev/null +++ b/gen/abusiveexperiencereport1-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-abusiveexperiencereport1-cli" +version = "1.0.6+20171129" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Abusive Experience Report (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/abusiveexperiencereport1-cli" +homepage = "https://developers.google.com/abusive-experience-report/" +documentation = "http://byron.github.io/google-apis-rs/google_abusiveexperiencereport1_cli" +license = "MIT" +keywords = ["abusiveexperiencerep", "google", "cli"] + +[[bin]] +name = "abusiveexperiencereport1" + +[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-abusiveexperiencereport1] +path = "../abusiveexperiencereport1" +version = "1.0.6+20171129" diff --git a/gen/abusiveexperiencereport1-cli/LICENSE.md b/gen/abusiveexperiencereport1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/abusiveexperiencereport1-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/abusiveexperiencereport1-cli/README.md b/gen/abusiveexperiencereport1-cli/README.md new file mode 100644 index 0000000000..09d73e1641 --- /dev/null +++ b/gen/abusiveexperiencereport1-cli/README.md @@ -0,0 +1,116 @@ + +The `abusiveexperiencereport1` command-line interface *(CLI)* allows to use most features of the *Google Abusive 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 *Abusive Experience Report* API can be found at the +[official documentation site](https://developers.google.com/abusive-experience-report/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-abusiveexperiencereport1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/abusiveexperiencereport1-cli). + +# Usage + +This documentation was generated from the *Abusive Experience Report* API at revision *20171129*. The CLI is at version *1.0.6*. + +```bash +abusiveexperiencereport1 [options] + sites + get [-p ]... [-o ] + violating-sites + list [-p ]... [-o ] + abusiveexperiencereport1 --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 `abusiveexperiencereport1-`. 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/abusiveexperiencereport1-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/abusiveexperiencereport1-secret.json`, assuming that the required *abusiveexperiencereport* 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. `abusiveexperiencereport1 --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/abusiveexperiencereport1-cli/mkdocs.yml b/gen/abusiveexperiencereport1-cli/mkdocs.yml new file mode 100644 index 0000000000..689e9a5f07 --- /dev/null +++ b/gen/abusiveexperiencereport1-cli/mkdocs.yml @@ -0,0 +1,18 @@ +site_name: Abusive Experience Report v1.0.6+20171129 +site_url: http://byron.github.io/google-apis-rs/google-abusiveexperiencereport1-cli +site_description: A complete library to interact with Abusive Experience Report (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/abusiveexperiencereport1-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/abusiveexperiencereport1-cli/src/cmn.rs b/gen/abusiveexperiencereport1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/abusiveexperiencereport1-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/abusiveexperiencereport1-cli/src/main.rs b/gen/abusiveexperiencereport1-cli/src/main.rs new file mode 100644 index 0000000000..7f86338ba5 --- /dev/null +++ b/gen/abusiveexperiencereport1-cli/src/main.rs @@ -0,0 +1,414 @@ +// 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_abusiveexperiencereport1 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::AbusiveExperienceReport>, + 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, "abusiveexperiencereport1-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: "abusiveexperiencereport1", + 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::AbusiveExperienceReport::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 abusive experience rating of a site."##), + "Details at http://byron.github.io/google-apis-rs/google_abusiveexperiencereport1_cli/sites_get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The required site name. This is the site property whose abusive + experiences have been reviewed, and it must 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 Abusive + 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 Abusive Experience Report statuses of "Failing"."##), + "Details at http://byron.github.io/google-apis-rs/google_abusiveexperiencereport1_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("abusiveexperiencereport1") + .author("Sebastian Thiel ") + .version("1.0.6+20171129") + .about("View Abusive Experience Report data, and get a list of sites that have a significant number of abusive experiences.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_abusiveexperiencereport1_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/abusiveexperiencereport1/Cargo.toml b/gen/abusiveexperiencereport1/Cargo.toml new file mode 100644 index 0000000000..8f5521983a --- /dev/null +++ b/gen/abusiveexperiencereport1/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-abusiveexperiencereport1" +version = "1.0.6+20171129" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Abusive Experience Report (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/abusiveexperiencereport1" +homepage = "https://developers.google.com/abusive-experience-report/" +documentation = "https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129" +license = "MIT" +keywords = ["abusiveexperiencerep", "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/abusiveexperiencereport1/LICENSE.md b/gen/abusiveexperiencereport1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/abusiveexperiencereport1/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/abusiveexperiencereport1/README.md b/gen/abusiveexperiencereport1/README.md new file mode 100644 index 0000000000..e7d2d6e3bd --- /dev/null +++ b/gen/abusiveexperiencereport1/README.md @@ -0,0 +1,176 @@ + +The `google-abusiveexperiencereport1` library allows access to all features of the *Google Abusive Experience Report* service. + +This documentation was generated from *Abusive Experience Report* crate version *1.0.6+20171129*, where *20171129* is the exact revision of the *abusiveexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Abusive Experience Report* *v1* API can be found at the +[official documentation site](https://developers.google.com/abusive-experience-report/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/struct.AbusiveExperienceReport.html) ... + +* sites + * [*get*](https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/struct.SiteGetCall.html) +* violating sites + * [*list*](https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/struct.ViolatingSiteListCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/struct.AbusiveExperienceReport.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/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-abusiveexperiencereport1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_abusiveexperiencereport1 as abusiveexperiencereport1; +use abusiveexperiencereport1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use abusiveexperiencereport1::AbusiveExperienceReport; + +// 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 = AbusiveExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +// You can configure optional parameters by calling 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-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/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-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/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-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/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-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/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-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/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-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/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-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/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-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/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-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/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-abusiveexperiencereport1/1.0.6+20171129/google_abusiveexperiencereport1/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 **abusiveexperiencereport1** 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/abusiveexperiencereport1/src/cmn.rs b/gen/abusiveexperiencereport1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/abusiveexperiencereport1/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/abusiveexperiencereport1/src/lib.rs b/gen/abusiveexperiencereport1/src/lib.rs new file mode 100644 index 0000000000..255f4768ca --- /dev/null +++ b/gen/abusiveexperiencereport1/src/lib.rs @@ -0,0 +1,1020 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Abusive Experience Report* crate version *1.0.6+20171129*, where *20171129* is the exact revision of the *abusiveexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Abusive Experience Report* *v1* API can be found at the +//! [official documentation site](https://developers.google.com/abusive-experience-report/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/abusiveexperiencereport1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.AbusiveExperienceReport.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.AbusiveExperienceReport.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-abusiveexperiencereport1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_abusiveexperiencereport1 as abusiveexperiencereport1; +//! use abusiveexperiencereport1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use abusiveexperiencereport1::AbusiveExperienceReport; +//! +//! // 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 = AbusiveExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +//! // You can configure optional parameters by calling 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 AbusiveExperienceReport 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_abusiveexperiencereport1 as abusiveexperiencereport1; +/// use abusiveexperiencereport1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use abusiveexperiencereport1::AbusiveExperienceReport; +/// +/// // 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 = AbusiveExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling 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 AbusiveExperienceReport { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for AbusiveExperienceReport {} + +impl<'a, C, A> AbusiveExperienceReport + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> AbusiveExperienceReport { + AbusiveExperienceReport { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://abusiveexperiencereport.googleapis.com/".to_string(), + _root_url: "https://abusiveexperiencereport.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://abusiveexperiencereport.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://abusiveexperiencereport.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 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 { + /// Whether the site is currently under review. + #[serde(rename="underReview")] + pub under_review: Option, + /// The date on which enforcement 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 name of the site reviewed. + #[serde(rename="reviewedSite")] + pub reviewed_site: Option, + /// A link that leads to a full abusive experience report. + #[serde(rename="reportUrl")] + pub report_url: Option, + /// The status of the site reviewed for the abusive experiences. + #[serde(rename="abusiveStatus")] + pub abusive_status: Option, + /// The abusive experience enforcement status of the site. + #[serde(rename="filterStatus")] + pub filter_status: 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 `AbusiveExperienceReport` 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_abusiveexperiencereport1 as abusiveexperiencereport1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use abusiveexperiencereport1::AbusiveExperienceReport; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AbusiveExperienceReport::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 AbusiveExperienceReport, +} + +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 abusive experience rating of a site. + /// + /// # Arguments + /// + /// * `name` - The required site name. This is the site property whose abusive + /// experiences have been reviewed, and it must 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 Abusive + /// 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 `AbusiveExperienceReport` 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_abusiveexperiencereport1 as abusiveexperiencereport1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use abusiveexperiencereport1::AbusiveExperienceReport; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AbusiveExperienceReport::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 AbusiveExperienceReport, +} + +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 Abusive Experience Report statuses of "Failing". + 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 abusive 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_abusiveexperiencereport1 as abusiveexperiencereport1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use abusiveexperiencereport1::AbusiveExperienceReport; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AbusiveExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling 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 AbusiveExperienceReport, + _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: "abusiveexperiencereport.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. This is the site property whose abusive + /// experiences have been reviewed, and it must 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 Abusive + /// 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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. 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) -> 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 Abusive Experience Report statuses of "Failing". +/// +/// 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_abusiveexperiencereport1 as abusiveexperiencereport1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use abusiveexperiencereport1::AbusiveExperienceReport; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AbusiveExperienceReport::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling 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 AbusiveExperienceReport, + _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: "abusiveexperiencereport.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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. 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) -> 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/adexchangeseller2-cli/Cargo.toml b/gen/adexchangeseller2-cli/Cargo.toml index d4133bdba9..178ed8c98f 100644 --- a/gen/adexchangeseller2-cli/Cargo.toml +++ b/gen/adexchangeseller2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangeseller2-cli" -version = "1.0.6+20160805" +version = "1.0.6+20171101" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Seller (protocol v2.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangeseller2-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-adexchangeseller2] path = "../adexchangeseller2" -version = "1.0.6+20160805" +version = "1.0.6+20171101" diff --git a/gen/adexchangeseller2-cli/README.md b/gen/adexchangeseller2-cli/README.md index a510066641..c9d4e42d06 100644 --- a/gen/adexchangeseller2-cli/README.md +++ b/gen/adexchangeseller2-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 Seller* API at revision *20160805*. The CLI is at version *1.0.6*. +This documentation was generated from the *Ad Exchange Seller* API at revision *20171101*. The CLI is at version *1.0.6*. ```bash adexchangeseller2 [options] diff --git a/gen/adexchangeseller2-cli/mkdocs.yml b/gen/adexchangeseller2-cli/mkdocs.yml index f344cbffd8..2c5afd62a9 100644 --- a/gen/adexchangeseller2-cli/mkdocs.yml +++ b/gen/adexchangeseller2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Seller v1.0.6+20160805 +site_name: Ad Exchange Seller v1.0.6+20171101 site_url: http://byron.github.io/google-apis-rs/google-adexchangeseller2-cli site_description: A complete library to interact with Ad Exchange Seller (protocol v2.0) diff --git a/gen/adexchangeseller2-cli/src/main.rs b/gen/adexchangeseller2-cli/src/main.rs index 76f7d246b4..c2260c4fa5 100644 --- a/gen/adexchangeseller2-cli/src/main.rs +++ b/gen/adexchangeseller2-cli/src/main.rs @@ -1348,7 +1348,7 @@ fn main() { let mut app = App::new("adexchangeseller2") .author("Sebastian Thiel ") - .version("1.0.6+20160805") + .version("1.0.6+20171101") .about("Accesses the inventory of Ad Exchange seller users and generates reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexchangeseller2_cli") .arg(Arg::with_name("url") diff --git a/gen/adexchangeseller2/Cargo.toml b/gen/adexchangeseller2/Cargo.toml index f2ab81fb44..56030d887e 100644 --- a/gen/adexchangeseller2/Cargo.toml +++ b/gen/adexchangeseller2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adexchangeseller2" -version = "1.0.6+20160805" +version = "1.0.6+20171101" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Seller (protocol v2.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangeseller2" homepage = "https://developers.google.com/ad-exchange/seller-rest/" -documentation = "https://docs.rs/google-adexchangeseller2/1.0.6+20160805" +documentation = "https://docs.rs/google-adexchangeseller2/1.0.6+20171101" license = "MIT" keywords = ["adexchangeseller", "google", "protocol", "web", "api"] diff --git a/gen/adexchangeseller2/README.md b/gen/adexchangeseller2/README.md index 7aa267dc99..5aff55ae5f 100644 --- a/gen/adexchangeseller2/README.md +++ b/gen/adexchangeseller2/README.md @@ -5,21 +5,21 @@ DO NOT EDIT ! --> The `google-adexchangeseller2` library allows access to all features of the *Google Ad Exchange Seller* service. -This documentation was generated from *Ad Exchange Seller* crate version *1.0.6+20160805*, where *20160805* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Ad Exchange Seller* crate version *1.0.6+20171101*, where *20171101* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Ad Exchange Seller* *v2* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/seller-rest/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AdExchangeSeller.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AdExchangeSeller.html) ... -* [accounts](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.Account.html) - * [*adclients list*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountAdclientListCall.html), [*alerts list*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountAlertListCall.html), [*customchannels get*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountCustomchannelGetCall.html), [*customchannels list*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountCustomchannelListCall.html), [*get*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountListCall.html), [*metadata dimensions list*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountMetadataDimensionListCall.html), [*metadata metrics list*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountMetadataMetricListCall.html), [*preferreddeals get*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountPreferreddealGetCall.html), [*preferreddeals list*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountPreferreddealListCall.html), [*reports generate*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountReportGenerateCall.html), [*reports saved generate*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountReportSavedGenerateCall.html), [*reports saved list*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountReportSavedListCall.html) and [*urlchannels list*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountUrlchannelListCall.html) +* [accounts](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.Account.html) + * [*adclients list*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountAdclientListCall.html), [*alerts list*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountAlertListCall.html), [*customchannels get*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountCustomchannelGetCall.html), [*customchannels list*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountCustomchannelListCall.html), [*get*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountListCall.html), [*metadata dimensions list*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountMetadataDimensionListCall.html), [*metadata metrics list*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountMetadataMetricListCall.html), [*preferreddeals get*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountPreferreddealGetCall.html), [*preferreddeals list*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountPreferreddealListCall.html), [*reports generate*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountReportGenerateCall.html), [*reports saved generate*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountReportSavedGenerateCall.html), [*reports saved list*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountReportSavedListCall.html) and [*urlchannels list*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountUrlchannelListCall.html) Download supported by ... -* [*reports generate accounts*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AccountReportGenerateCall.html) +* [*reports generate accounts*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AccountReportGenerateCall.html) @@ -27,17 +27,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/struct.AdExchangeSeller.html)** +* **[Hub](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/struct.AdExchangeSeller.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.Part.html)** + * **[Parts](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -140,17 +140,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/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-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/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-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/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-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/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")`. @@ -160,29 +160,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-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/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-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/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-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/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-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/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-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/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-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/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-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/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-adexchangeseller2/1.0.6+20160805/google_adexchangeseller2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adexchangeseller2/1.0.6+20171101/google_adexchangeseller2/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/adexchangeseller2/src/lib.rs b/gen/adexchangeseller2/src/lib.rs index 682a2b3fc8..e8d8e72c5e 100644 --- a/gen/adexchangeseller2/src/lib.rs +++ b/gen/adexchangeseller2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Seller* crate version *1.0.6+20160805*, where *20160805* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Ad Exchange Seller* crate version *1.0.6+20171101*, where *20171101* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Ad Exchange Seller* *v2* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/seller-rest/). diff --git a/gen/adexperiencereport1-cli/Cargo.toml b/gen/adexperiencereport1-cli/Cargo.toml index d4820f3ce6..49100b903a 100644 --- a/gen/adexperiencereport1-cli/Cargo.toml +++ b/gen/adexperiencereport1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexperiencereport1-cli" -version = "1.0.6+20170918" +version = "1.0.6+20171129" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-adexperiencereport1] path = "../adexperiencereport1" -version = "1.0.6+20170918" +version = "1.0.6+20171129" diff --git a/gen/adexperiencereport1-cli/README.md b/gen/adexperiencereport1-cli/README.md index 32f428b845..bc5aea6633 100644 --- a/gen/adexperiencereport1-cli/README.md +++ b/gen/adexperiencereport1-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 Experience Report* API at revision *20170918*. The CLI is at version *1.0.6*. +This documentation was generated from the *Ad Experience Report* API at revision *20171129*. The CLI is at version *1.0.6*. ```bash adexperiencereport1 [options] diff --git a/gen/adexperiencereport1-cli/mkdocs.yml b/gen/adexperiencereport1-cli/mkdocs.yml index c2f38a3025..db408ef9bf 100644 --- a/gen/adexperiencereport1-cli/mkdocs.yml +++ b/gen/adexperiencereport1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Experience Report v1.0.6+20170918 +site_name: Ad Experience Report v1.0.6+20171129 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) diff --git a/gen/adexperiencereport1-cli/src/main.rs b/gen/adexperiencereport1-cli/src/main.rs index 5129cbdd2f..fcaf83696f 100644 --- a/gen/adexperiencereport1-cli/src/main.rs +++ b/gen/adexperiencereport1-cli/src/main.rs @@ -317,7 +317,7 @@ fn main() { let mut app = App::new("adexperiencereport1") .author("Sebastian Thiel ") - .version("1.0.6+20170918") + .version("1.0.6+20171129") .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") diff --git a/gen/adexperiencereport1/Cargo.toml b/gen/adexperiencereport1/Cargo.toml index d2e820ee71..3f07d645fa 100644 --- a/gen/adexperiencereport1/Cargo.toml +++ b/gen/adexperiencereport1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adexperiencereport1" -version = "1.0.6+20170918" +version = "1.0.6+20171129" 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" +documentation = "https://docs.rs/google-adexperiencereport1/1.0.6+20171129" license = "MIT" keywords = ["adexperiencereport", "google", "protocol", "web", "api"] diff --git a/gen/adexperiencereport1/README.md b/gen/adexperiencereport1/README.md index b3f6981a56..aacb1255eb 100644 --- a/gen/adexperiencereport1/README.md +++ b/gen/adexperiencereport1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Ad Experience Report* crate version *1.0.6+20171129*, where *20171129* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/google_adexperiencereport1/struct.AdExperienceReport.html) ... * sites - * [*get*](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/struct.SiteGetCall.html) + * [*get*](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/google_adexperiencereport1/struct.SiteGetCall.html) * violating sites - * [*list*](https://docs.rs/google-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/struct.ViolatingSiteListCall.html) + * [*list*](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/google_adexperiencereport1/struct.ViolatingSiteListCall.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-adexperiencereport1/1.0.6+20170918/google_adexperiencereport1/struct.AdExperienceReport.html)** +* **[Hub](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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)** + * creates [*Method Builders*](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/google_adexperiencereport1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/google_adexperiencereport1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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)** + * **[Parts](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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)** +* **[Activities](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/google_adexperiencereport1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -118,17 +118,17 @@ match result { ``` ## 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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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). +[Hub Delegate](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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. +If such a method also supports a [Response Result](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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")`. @@ -138,29 +138,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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/google_adexperiencereport1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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. +The [delegate trait](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/google_adexperiencereport1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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 +Most optionals are are considered [Parts](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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. +Using [method builders](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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 +* [request values](https://docs.rs/google-adexperiencereport1/1.0.6+20171129/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. diff --git a/gen/adexperiencereport1/src/lib.rs b/gen/adexperiencereport1/src/lib.rs index d6e764bc09..9ecbe4e57f 100644 --- a/gen/adexperiencereport1/src/lib.rs +++ b/gen/adexperiencereport1/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 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*. +//! This documentation was generated from *Ad Experience Report* crate version *1.0.6+20171129*, where *20171129* 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/). @@ -397,12 +397,12 @@ impl Part for PlatformSummary {} /// #[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, + /// The name of the site reviewed. + #[serde(rename="reviewedSite")] + pub reviewed_site: Option, /// Summary for the mobile review of the site. #[serde(rename="mobileSummary")] pub mobile_summary: Option, @@ -779,12 +779,12 @@ impl<'a, C, A> SiteGetCall<'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) -> SiteGetCall<'a, C, A> @@ -995,12 +995,12 @@ impl<'a, C, A> ViolatingSiteListCall<'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) -> ViolatingSiteListCall<'a, C, A> diff --git a/gen/admin1_directory-cli/Cargo.toml b/gen/admin1_directory-cli/Cargo.toml index 73009c7d6b..9f1d666592 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+20170830" +version = "1.0.6+20171127" 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+20170830" +version = "1.0.6+20171127" diff --git a/gen/admin1_directory-cli/README.md b/gen/admin1_directory-cli/README.md index e688baa26b..493bc35ff2 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 *20170830*. The CLI is at version *1.0.6*. +This documentation was generated from the *directory* API at revision *20171127*. The CLI is at version *1.0.6*. ```bash admin1-directory [options] @@ -69,6 +69,7 @@ admin1-directory [options] members delete [-p ]... get [-p ]... [-o ] + has-member [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] @@ -93,6 +94,9 @@ admin1-directory [options] update ... (-r )... [-p ]... [-o ] privileges list [-p ]... [-o ] + resolved-app-access-settings + get-settings [-p ]... [-o ] + list-trusted-apps [-p ]... [-o ] resources calendars-delete [-p ]... calendars-get [-p ]... [-o ] diff --git a/gen/admin1_directory-cli/mkdocs.yml b/gen/admin1_directory-cli/mkdocs.yml index d5e5083752..d6a936c523 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+20170830 +site_name: directory v1.0.6+20171127 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) @@ -41,6 +41,7 @@ pages: - ['groups_update.md', 'Groups', 'Update'] - ['members_delete.md', 'Members', 'Delete'] - ['members_get.md', 'Members', 'Get'] +- ['members_has-member.md', 'Members', 'Has Member'] - ['members_insert.md', 'Members', 'Insert'] - ['members_list.md', 'Members', 'List'] - ['members_patch.md', 'Members', 'Patch'] @@ -61,6 +62,8 @@ pages: - ['orgunits_patch.md', 'Orgunits', 'Patch'] - ['orgunits_update.md', 'Orgunits', 'Update'] - ['privileges_list.md', 'Privileges', 'List'] +- ['resolved-app-access-settings_get-settings.md', 'Resolved App Access Settings', 'Get Settings'] +- ['resolved-app-access-settings_list-trusted-apps.md', 'Resolved App Access Settings', 'List Trusted Apps'] - ['resources_calendars-delete.md', 'Resources', 'Calendars Delete'] - ['resources_calendars-get.md', 'Resources', 'Calendars Get'] - ['resources_calendars-insert.md', 'Resources', 'Calendars Insert'] diff --git a/gen/admin1_directory-cli/src/main.rs b/gen/admin1_directory-cli/src/main.rs index ca711c07ef..390a076338 100644 --- a/gen/admin1_directory-cli/src/main.rs +++ b/gen/admin1_directory-cli/src/main.rs @@ -2250,6 +2250,58 @@ impl<'n> Engine<'n> { } } + fn _members_has_member(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.members().has_member(opt.value_of("group-key").unwrap_or(""), opt.value_of("member-key").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _members_insert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -3661,6 +3713,104 @@ impl<'n> Engine<'n> { } } + fn _resolved_app_access_settings_get_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.resolved_app_access_settings().get_settings(); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::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 _resolved_app_access_settings_list_trusted_apps(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.resolved_app_access_settings().list_trusted_apps(); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::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 _resources_calendars_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.resources().calendars_delete(opt.value_of("customer").unwrap_or(""), opt.value_of("calendar-resource-id").unwrap_or("")); @@ -3781,15 +3931,21 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "capacity" => Some(("capacity", JsonTypeInfo { jtype: JsonType::Int, 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-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 })), + "resource-category" => Some(("resourceCategory", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-visible-description" => Some(("userVisibleDescription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-id" => Some(("resourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "building-id" => Some(("buildingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floor-name" => Some(("floorName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floor-section" => Some(("floorSection", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etags", "generated-resource-name", "kind", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["building-id", "capacity", "etags", "floor-name", "floor-section", "generated-resource-name", "kind", "resource-category", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type", "user-visible-description"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3932,15 +4088,21 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "capacity" => Some(("capacity", JsonTypeInfo { jtype: JsonType::Int, 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-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 })), + "resource-category" => Some(("resourceCategory", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-visible-description" => Some(("userVisibleDescription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-id" => Some(("resourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "building-id" => Some(("buildingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floor-name" => Some(("floorName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floor-section" => Some(("floorSection", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etags", "generated-resource-name", "kind", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["building-id", "capacity", "etags", "floor-name", "floor-section", "generated-resource-name", "kind", "resource-category", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type", "user-visible-description"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4024,15 +4186,21 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "capacity" => Some(("capacity", JsonTypeInfo { jtype: JsonType::Int, 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-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 })), + "resource-category" => Some(("resourceCategory", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-visible-description" => Some(("userVisibleDescription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-id" => Some(("resourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "building-id" => Some(("buildingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floor-name" => Some(("floorName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "floor-section" => Some(("floorSection", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etags", "generated-resource-name", "kind", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["building-id", "capacity", "etags", "floor-name", "floor-section", "generated-resource-name", "kind", "resource-category", "resource-description", "resource-email", "resource-id", "resource-name", "resource-type", "user-visible-description"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -7017,6 +7185,9 @@ impl<'n> Engine<'n> { ("get", Some(opt)) => { call_result = self._members_get(opt, dry_run, &mut err); }, + ("has-member", Some(opt)) => { + call_result = self._members_has_member(opt, dry_run, &mut err); + }, ("insert", Some(opt)) => { call_result = self._members_insert(opt, dry_run, &mut err); }, @@ -7115,6 +7286,20 @@ impl<'n> Engine<'n> { } } }, + ("resolved-app-access-settings", Some(opt)) => { + match opt.subcommand() { + ("get-settings", Some(opt)) => { + call_result = self._resolved_app_access_settings_get_settings(opt, dry_run, &mut err); + }, + ("list-trusted-apps", Some(opt)) => { + call_result = self._resolved_app_access_settings_list_trusted_apps(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("resolved-app-access-settings".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("resources", Some(opt)) => { match opt.subcommand() { ("calendars-delete", Some(opt)) => { @@ -7562,7 +7747,7 @@ fn main() { Some(false)), ]), ("move-devices-to-ou", - Some(r##"Move or insert multiple Chrome OS Devices to Organization Unit"##), + Some(r##"Move or insert multiple Chrome OS Devices to organizational unit"##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/chromeosdevices_move-devices-to-ou", vec![ (Some(r##"customer-id"##), @@ -7573,7 +7758,7 @@ fn main() { (Some(r##"org-unit-path"##), None, - Some(r##"Full path of the target organization unit or its Id"##), + Some(r##"Full path of the target organizational unit or its ID"##), Some(true), Some(false)), @@ -7953,7 +8138,7 @@ fn main() { vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group"##), + Some(r##"Email or immutable ID of the group"##), Some(true), Some(false)), @@ -7975,7 +8160,7 @@ fn main() { vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group"##), + Some(r##"Email or immutable ID of the group"##), Some(true), Some(false)), @@ -8003,7 +8188,7 @@ fn main() { vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group"##), + Some(r##"Email or immutable ID of the group"##), Some(true), Some(false)), @@ -8025,7 +8210,7 @@ fn main() { vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group"##), + Some(r##"Email or immutable ID of the group"##), Some(true), Some(false)), @@ -8041,7 +8226,7 @@ fn main() { vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group"##), + Some(r##"Email or immutable ID of the group"##), Some(true), Some(false)), @@ -8101,7 +8286,7 @@ fn main() { vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group. If Id, it should match with id of group object"##), + Some(r##"Email or immutable ID of the group. If ID, it should match with id of group object"##), Some(true), Some(false)), @@ -8129,7 +8314,7 @@ fn main() { vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group. If Id, it should match with id of group object"##), + Some(r##"Email or immutable ID of the group. If ID, it should match with id of group object"##), Some(true), Some(false)), @@ -8153,20 +8338,20 @@ fn main() { ]), ]), - ("members", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("members", "methods: 'delete', 'get', 'has-member', 'insert', 'list', 'patch' and 'update'", vec![ ("delete", Some(r##"Remove membership."##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/members_delete", vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group"##), + Some(r##"Email or immutable ID of the group"##), Some(true), Some(false)), (Some(r##"member-key"##), None, - Some(r##"Email or immutable Id of the member"##), + Some(r##"Email or immutable ID of the member"##), Some(true), Some(false)), @@ -8179,6 +8364,34 @@ fn main() { ("get", Some(r##"Retrieve Group Member"##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/members_get", + vec![ + (Some(r##"group-key"##), + None, + Some(r##"Email or immutable ID of the group"##), + Some(true), + Some(false)), + + (Some(r##"member-key"##), + None, + Some(r##"Email or immutable ID of the member"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("has-member", + Some(r##"Checks Membership of an user within a Group"##), + "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/members_has-member", vec![ (Some(r##"group-key"##), None, @@ -8210,7 +8423,7 @@ fn main() { vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group"##), + Some(r##"Email or immutable ID of the group"##), Some(true), Some(false)), @@ -8238,7 +8451,7 @@ fn main() { vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group"##), + Some(r##"Email or immutable ID of the group"##), Some(true), Some(false)), @@ -8260,13 +8473,13 @@ fn main() { vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group. If Id, it should match with id of group object"##), + Some(r##"Email or immutable ID of the group. If ID, it should match with id of group object"##), Some(true), Some(false)), (Some(r##"member-key"##), None, - Some(r##"Email or immutable Id of the user. If Id, it should match with id of member object"##), + Some(r##"Email or immutable ID of the user. If ID, it should match with id of member object"##), Some(true), Some(false)), @@ -8294,13 +8507,13 @@ fn main() { vec![ (Some(r##"group-key"##), None, - Some(r##"Email or immutable Id of the group. If Id, it should match with id of group object"##), + Some(r##"Email or immutable ID of the group. If ID, it should match with id of group object"##), Some(true), Some(false)), (Some(r##"member-key"##), None, - Some(r##"Email or immutable Id of the user. If Id, it should match with id of member object"##), + Some(r##"Email or immutable ID of the user. If ID, it should match with id of member object"##), Some(true), Some(false)), @@ -8572,7 +8785,7 @@ fn main() { ("orgunits", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ ("delete", - Some(r##"Remove Organization Unit"##), + Some(r##"Remove organizational unit"##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/orgunits_delete", vec![ (Some(r##"customer-id"##), @@ -8583,7 +8796,7 @@ fn main() { (Some(r##"org-unit-path"##), None, - Some(r##"Full path of the organization unit or its Id"##), + Some(r##"Full path of the organizational unit or its ID"##), Some(true), Some(false)), @@ -8594,7 +8807,7 @@ fn main() { Some(true)), ]), ("get", - Some(r##"Retrieve Organization Unit"##), + Some(r##"Retrieve organizational unit"##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/orgunits_get", vec![ (Some(r##"customer-id"##), @@ -8605,7 +8818,7 @@ fn main() { (Some(r##"org-unit-path"##), None, - Some(r##"Full path of the organization unit or its Id"##), + Some(r##"Full path of the organizational unit or its ID"##), Some(true), Some(false)), @@ -8622,7 +8835,7 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Add Organization Unit"##), + Some(r##"Add organizational unit"##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/orgunits_insert", vec![ (Some(r##"customer-id"##), @@ -8650,7 +8863,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Retrieve all Organization Units"##), + Some(r##"Retrieve all organizational units"##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/orgunits_list", vec![ (Some(r##"customer-id"##), @@ -8672,7 +8885,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Update Organization Unit. This method supports patch semantics."##), + Some(r##"Update organizational unit. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/orgunits_patch", vec![ (Some(r##"customer-id"##), @@ -8683,7 +8896,7 @@ fn main() { (Some(r##"org-unit-path"##), None, - Some(r##"Full path of the organization unit or its Id"##), + Some(r##"Full path of the organizational unit or its ID"##), Some(true), Some(false)), @@ -8706,7 +8919,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Update Organization Unit"##), + Some(r##"Update organizational unit"##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/orgunits_update", vec![ (Some(r##"customer-id"##), @@ -8717,7 +8930,7 @@ fn main() { (Some(r##"org-unit-path"##), None, - Some(r##"Full path of the organization unit or its Id"##), + Some(r##"Full path of the organizational unit or its ID"##), Some(true), Some(false)), @@ -8766,6 +8979,41 @@ fn main() { ]), ]), + ("resolved-app-access-settings", "methods: 'get-settings' and 'list-trusted-apps'", vec![ + ("get-settings", + Some(r##"Retrieves resolved app access settings of the logged in user."##), + "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/resolved-app-access-settings_get-settings", + 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)), + ]), + ("list-trusted-apps", + Some(r##"Retrieves the list of apps trusted by the admin of the logged in user."##), + "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/resolved-app-access-settings_list-trusted-apps", + 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)), + ]), + ]), + ("resources", "methods: 'calendars-delete', 'calendars-get', 'calendars-insert', 'calendars-list', 'calendars-patch' and 'calendars-update'", vec![ ("calendars-delete", Some(r##"Deletes a calendar resource."##), @@ -8868,7 +9116,9 @@ fn main() { Some(false)), ]), ("calendars-patch", - Some(r##"Updates a calendar resource. This method supports patch semantics."##), + Some(r##"Updates a calendar resource. + + This method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/resources_calendars-patch", vec![ (Some(r##"customer"##), @@ -8902,7 +9152,9 @@ fn main() { Some(false)), ]), ("calendars-update", - Some(r##"Updates a calendar resource."##), + Some(r##"Updates a calendar resource. + + This method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved."##), "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/resources_calendars-update", vec![ (Some(r##"customer"##), @@ -9224,7 +9476,7 @@ fn main() { (Some(r##"schema-key"##), None, - Some(r##"Name or immutable Id of the schema"##), + Some(r##"Name or immutable ID of the schema"##), Some(true), Some(false)), @@ -9246,7 +9498,7 @@ fn main() { (Some(r##"schema-key"##), None, - Some(r##"Name or immutable Id of the schema"##), + Some(r##"Name or immutable ID of the schema"##), Some(true), Some(false)), @@ -9324,7 +9576,7 @@ fn main() { (Some(r##"schema-key"##), None, - Some(r##"Name or immutable Id of the schema."##), + Some(r##"Name or immutable ID of the schema."##), Some(true), Some(false)), @@ -9358,7 +9610,7 @@ fn main() { (Some(r##"schema-key"##), None, - Some(r##"Name or immutable Id of the schema."##), + Some(r##"Name or immutable ID of the schema."##), Some(true), Some(false)), @@ -9464,7 +9716,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9486,7 +9738,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9514,7 +9766,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9536,7 +9788,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9564,7 +9816,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9580,7 +9832,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9640,7 +9892,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user as admin"##), + Some(r##"Email or immutable ID of the user as admin"##), Some(true), Some(false)), @@ -9662,7 +9914,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user. If Id, it should match with id of user object"##), + Some(r##"Email or immutable ID of the user. If ID, it should match with id of user object"##), Some(true), Some(false)), @@ -9690,7 +9942,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9706,7 +9958,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9728,7 +9980,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9756,7 +10008,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9806,7 +10058,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user. If Id, it should match with id of user object"##), + Some(r##"Email or immutable ID of the user. If ID, it should match with id of user object"##), Some(true), Some(false)), @@ -9859,7 +10111,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9875,7 +10127,7 @@ fn main() { vec![ (Some(r##"user-key"##), None, - Some(r##"Email or immutable Id of the user"##), + Some(r##"Email or immutable ID of the user"##), Some(true), Some(false)), @@ -9913,7 +10165,7 @@ fn main() { let mut app = App::new("admin1-directory") .author("Sebastian Thiel ") - .version("1.0.6+20170830") + .version("1.0.6+20171127") .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 5189f40860..043a6b8086 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+20170830" +version = "1.0.6+20171127" 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+20170830" +documentation = "https://docs.rs/google-admin1_directory/1.0.6+20171127" license = "MIT" keywords = ["admin", "google", "protocol", "web", "api"] diff --git a/gen/admin1_directory/README.md b/gen/admin1_directory/README.md index a6d1639e72..ee8d68fd41 100644 --- a/gen/admin1_directory/README.md +++ b/gen/admin1_directory/README.md @@ -5,61 +5,63 @@ 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+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*. +This documentation was generated from *directory* crate version *1.0.6+20171127*, where *20171127* 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+20170830/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+20171127/google_admin1_directory/struct.Directory.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) +* [asps](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.Asp.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.AspDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.AspGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.AspListCall.html) +* [channels](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.Channel.html) + * [*stop*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ChannelStopCall.html) * chromeosdevices - * [*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) + * [*action*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ChromeosdeviceActionCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ChromeosdeviceGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ChromeosdeviceListCall.html), [*move devices to ou*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ChromeosdeviceMoveDevicesToOuCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ChromeosdevicePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ChromeosdeviceUpdateCall.html) +* [customers](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.Customer.html) + * [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.CustomerGetCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.CustomerPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.CustomerUpdateCall.html) * domain aliases - * [*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) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.DomainAliaseDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.DomainAliaseGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.DomainAliaseInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.DomainAliaseListCall.html) * domains - * [*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) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.DomainDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.DomainGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.DomainInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.DomainListCall.html) +* [groups](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.Group.html) + * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.GroupAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.GroupAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.GroupAliaseListCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.GroupDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.GroupGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.GroupListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.GroupPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.GroupUpdateCall.html) +* [members](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.Member.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.MemberDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.MemberGetCall.html), [*has member*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.MemberHasMemberCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.MemberInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.MemberListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.MemberPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.MemberUpdateCall.html) * mobiledevices - * [*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) + * [*action*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.MobiledeviceActionCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.MobiledeviceDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.MobiledeviceGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.MobiledeviceListCall.html) +* [notifications](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.Notification.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.NotificationGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.NotificationListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.NotificationPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.NotificationUpdateCall.html) * orgunits - * [*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) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.OrgunitDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.OrgunitGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.OrgunitInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.OrgunitListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.OrgunitPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.OrgunitUpdateCall.html) +* [privileges](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.Privilege.html) + * [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.PrivilegeListCall.html) +* resolved app access settings + * [*get settings*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ResolvedAppAccessSettingGetSettingCall.html) and [*list trusted apps*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ResolvedAppAccessSettingListTrustedAppCall.html) * resources - * [*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) + * [*calendars delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ResourceCalendarDeleteCall.html), [*calendars get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ResourceCalendarGetCall.html), [*calendars insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ResourceCalendarInsertCall.html), [*calendars list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ResourceCalendarListCall.html), [*calendars patch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ResourceCalendarPatchCall.html) and [*calendars update*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.ResourceCalendarUpdateCall.html) +* [role assignments](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.RoleAssignment.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.RoleAssignmentDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.RoleAssignmentGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.RoleAssignmentInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.RoleAssignmentListCall.html) +* [roles](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.Role.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.RoleDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.RoleGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.RoleInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.RoleListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.RolePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.RoleUpdateCall.html) +* [schemas](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.Schema.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.SchemaDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.SchemaGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.SchemaInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.SchemaListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.SchemaPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.SchemaUpdateCall.html) +* [tokens](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.Token.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.TokenDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.TokenGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.TokenListCall.html) +* [users](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.User.html) + * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserAliaseListCall.html), [*aliases watch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserAliaseWatchCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserListCall.html), [*make admin*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserMakeAdminCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserPatchCall.html), [*photos delete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserPhotoDeleteCall.html), [*photos get*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserPhotoGetCall.html), [*photos patch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserPhotoPatchCall.html), [*photos update*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserPhotoUpdateCall.html), [*undelete*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserUndeleteCall.html), [*update*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserUpdateCall.html) and [*watch*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserWatchCall.html) +* [verification codes](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.VerificationCode.html) + * [*generate*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.VerificationCodeGenerateCall.html), [*invalidate*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.VerificationCodeInvalidateCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.VerificationCodeListCall.html) Subscription supported by ... -* [*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) +* [*list users*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserListCall.html) +* [*aliases watch users*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserAliaseWatchCall.html) +* [*watch users*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserWatchCall.html) +* [*aliases list users*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.UserAliaseListCall.html) +* [*aliases list groups*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/struct.GroupAliaseListCall.html) @@ -67,17 +69,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-admin1_directory/1.0.6+20170830/google_admin1_directory/struct.Directory.html)** +* **[Hub](https://docs.rs/google-admin1_directory/1.0.6+20171127/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+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)** + * creates [*Method Builders*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-admin1_directory/1.0.6+20171127/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+20170830/google_admin1_directory/trait.Part.html)** + * **[Parts](https://docs.rs/google-admin1_directory/1.0.6+20171127/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+20170830/google_admin1_directory/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-admin1_directory/1.0.6+20171127/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 +196,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+20170830/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+20171127/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+20170830/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+20171127/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+20170830/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+20171127/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+20170830/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+20171127/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 +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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-admin1_directory/1.0.6+20171127/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+20170830/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+20171127/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-admin1_directory/1.0.6+20171127/google_admin1_directory/trait.RequestValue.html) and +[decodable](https://docs.rs/google-admin1_directory/1.0.6+20171127/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+20170830/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+20171127/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+20170830/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+20171127/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+20170830/google_admin1_directory/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-admin1_directory/1.0.6+20171127/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 cf0d42dcba..3cf803b75a 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+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*. +//! This documentation was generated from *directory* crate version *1.0.6+20171127*, where *20171127* 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/). @@ -26,7 +26,7 @@ //! * [groups](struct.Group.html) //! * [*aliases delete*](struct.GroupAliaseDeleteCall.html), [*aliases insert*](struct.GroupAliaseInsertCall.html), [*aliases list*](struct.GroupAliaseListCall.html), [*delete*](struct.GroupDeleteCall.html), [*get*](struct.GroupGetCall.html), [*insert*](struct.GroupInsertCall.html), [*list*](struct.GroupListCall.html), [*patch*](struct.GroupPatchCall.html) and [*update*](struct.GroupUpdateCall.html) //! * [members](struct.Member.html) -//! * [*delete*](struct.MemberDeleteCall.html), [*get*](struct.MemberGetCall.html), [*insert*](struct.MemberInsertCall.html), [*list*](struct.MemberListCall.html), [*patch*](struct.MemberPatchCall.html) and [*update*](struct.MemberUpdateCall.html) +//! * [*delete*](struct.MemberDeleteCall.html), [*get*](struct.MemberGetCall.html), [*has member*](struct.MemberHasMemberCall.html), [*insert*](struct.MemberInsertCall.html), [*list*](struct.MemberListCall.html), [*patch*](struct.MemberPatchCall.html) and [*update*](struct.MemberUpdateCall.html) //! * mobiledevices //! * [*action*](struct.MobiledeviceActionCall.html), [*delete*](struct.MobiledeviceDeleteCall.html), [*get*](struct.MobiledeviceGetCall.html) and [*list*](struct.MobiledeviceListCall.html) //! * [notifications](struct.Notification.html) @@ -35,6 +35,8 @@ //! * [*delete*](struct.OrgunitDeleteCall.html), [*get*](struct.OrgunitGetCall.html), [*insert*](struct.OrgunitInsertCall.html), [*list*](struct.OrgunitListCall.html), [*patch*](struct.OrgunitPatchCall.html) and [*update*](struct.OrgunitUpdateCall.html) //! * [privileges](struct.Privilege.html) //! * [*list*](struct.PrivilegeListCall.html) +//! * resolved app access settings +//! * [*get settings*](struct.ResolvedAppAccessSettingGetSettingCall.html) and [*list trusted apps*](struct.ResolvedAppAccessSettingListTrustedAppCall.html) //! * resources //! * [*calendars delete*](struct.ResourceCalendarDeleteCall.html), [*calendars get*](struct.ResourceCalendarGetCall.html), [*calendars insert*](struct.ResourceCalendarInsertCall.html), [*calendars list*](struct.ResourceCalendarListCall.html), [*calendars patch*](struct.ResourceCalendarPatchCall.html) and [*calendars update*](struct.ResourceCalendarUpdateCall.html) //! * [role assignments](struct.RoleAssignment.html) @@ -54,8 +56,8 @@ //! Subscription supported by ... //! //! * [*list users*](struct.UserListCall.html) -//! * [*watch users*](struct.UserWatchCall.html) //! * [*aliases watch users*](struct.UserAliaseWatchCall.html) +//! * [*watch users*](struct.UserWatchCall.html) //! * [*aliases list users*](struct.UserAliaseListCall.html) //! * [*aliases list groups*](struct.GroupAliaseListCall.html) //! @@ -553,6 +555,9 @@ impl<'a, C, A> Directory pub fn privileges(&'a self) -> PrivilegeMethods<'a, C, A> { PrivilegeMethods { hub: &self } } + pub fn resolved_app_access_settings(&'a self) -> ResolvedAppAccessSettingMethods<'a, C, A> { + ResolvedAppAccessSettingMethods { hub: &self } + } pub fn resources(&'a self) -> ResourceMethods<'a, C, A> { ResourceMethods { hub: &self } } @@ -624,49 +629,6 @@ pub struct UserName { impl Part for UserName {} -/// The set of privileges that are granted to this 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 RoleRolePrivileges { - /// The obfuscated ID of the service this privilege is for. - #[serde(rename="serviceId")] - pub service_id: Option, - /// The name of the privilege. - #[serde(rename="privilegeName")] - pub privilege_name: Option, -} - -impl NestedType for RoleRolePrivileges {} -impl Part for RoleRolePrivileges {} - - -/// JSON response template for List roleAssignments 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 role assignments](struct.RoleAssignmentListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RoleAssignments { - /// no description provided - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of RoleAssignment resources. - pub items: Option>, - /// The type of the API resource. This is always admin#directory#roleAssignments. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, -} - -impl ResponseResult for RoleAssignments {} - - /// JSON template for Group resource in Directory API. /// /// # Activities @@ -791,6 +753,7 @@ impl ResponseResult for Privileges {} /// * [list members](struct.MemberListCall.html) (none) /// * [insert members](struct.MemberInsertCall.html) (request|response) /// * [get members](struct.MemberGetCall.html) (response) +/// * [has member members](struct.MemberHasMemberCall.html) (none) /// * [delete members](struct.MemberDeleteCall.html) (none) /// * [update members](struct.MemberUpdateCall.html) (request|response) /// @@ -818,27 +781,26 @@ impl Resource for Member {} impl ResponseResult for Member {} -/// JSON response template for List Organization Units operation in Directory API. +/// 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 orgunits](struct.OrgunitListCall.html) (response) +/// * [list schemas](struct.SchemaListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrgUnits { +pub struct Schemas { /// Kind of resource this is. pub kind: Option, /// ETag of the resource. pub etag: Option, - /// List of user objects. - #[serde(rename="organizationUnits")] - pub organization_units: Option>, + /// List of UserSchema objects. + pub schemas: Option>, } -impl ResponseResult for OrgUnits {} +impl ResponseResult for Schemas {} /// JSON template for role resource in Directory API. @@ -886,28 +848,6 @@ impl Resource for Role {} impl ResponseResult for Role {} -/// 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 asps](struct.AspListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Asps { - /// A list of ASP resources. - pub items: Option>, - /// The type of the API resource. This is always admin#directory#aspList. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, -} - -impl ResponseResult for Asps {} - - /// JSON template for privilege resource in Directory API. /// /// # Activities @@ -959,208 +899,52 @@ 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, - /// The type of the calendar resource. Used for grouping resources in the calendar user interface. + /// Capacity of a resource, number of seats in a room. + pub capacity: Option, + /// The type of the calendar resource, intended for non-room resources. 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. + /// Description of the resource, visible only to admins. 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) + /// The read-only 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 category of the calendar resource. Either CONFERENCE_ROOM or OTHER. Legacy data is set to CATEGORY_UNKNOWN. + #[serde(rename="resourceCategory")] + pub resource_category: Option, + /// The read-only email ID for the calendar resource. Generated as part of creating a new calendar resource. The read-only email for the calendar resource. Generated as part of creating a new calendar resource. + #[serde(rename="resourceEmail")] + pub resource_email: Option, + /// The name of the calendar resource. For example, "Training Room 1A". The name of the calendar resource. For example, Training Room 1A + #[serde(rename="resourceName")] + pub resource_name: Option, + /// no description provided + #[serde(rename="featureInstances")] + pub feature_instances: Option, + /// Name of the section within a floor a resource is located in. + #[serde(rename="floorSection")] + pub floor_section: 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, + /// Unique ID for the building a resource is located in. + #[serde(rename="buildingId")] + pub building_id: Option, + /// Name of the floor a resource is located on. + #[serde(rename="floorName")] + pub floor_name: Option, + /// Description of the resource, visible to users and admins. + #[serde(rename="userVisibleDescription")] + pub user_visible_description: Option, } impl RequestValue for CalendarResource {} impl ResponseResult for CalendarResource {} -/// JSON template for postal address of a 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 CustomerPostalAddress { - /// The company or company division name. - #[serde(rename="organizationName")] - pub organization_name: Option, - /// This is a required property. For countryCode information see the ISO 3166 country code elements. - #[serde(rename="countryCode")] - pub country_code: Option, - /// Name of the locality. An example of a locality value is the city of San Francisco. - pub locality: Option, - /// Name of the region. An example of a region value is NY for the state of New York. - pub region: Option, - /// Address line 2 of the address. - #[serde(rename="addressLine2")] - pub address_line2: Option, - /// Address line 3 of the address. - #[serde(rename="addressLine3")] - pub address_line3: Option, - /// The customer contact's name. - #[serde(rename="contactName")] - pub contact_name: Option, - /// A customer's physical address. The address can be composed of one to three lines. - #[serde(rename="addressLine1")] - pub address_line1: Option, - /// The postal code. A postalCode example is a postal zip code such as 10009. This is in accordance with - http://portablecontacts.net/draft-spec.html#address_element. - #[serde(rename="postalCode")] - pub postal_code: Option, -} - -impl Part for CustomerPostalAddress {} - - -/// An notification channel used to watch for resource 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*). -/// -/// * [watch users](struct.UserWatchCall.html) (request|response) -/// * [stop channels](struct.ChannelStopCall.html) (request) -/// * [aliases watch users](struct.UserAliaseWatchCall.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 {} - - -/// JSON template for Schema resource 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*). -/// -/// * [get schemas](struct.SchemaGetCall.html) (response) -/// * [insert schemas](struct.SchemaInsertCall.html) (request|response) -/// * [patch schemas](struct.SchemaPatchCall.html) (request|response) -/// * [delete schemas](struct.SchemaDeleteCall.html) (none) -/// * [list schemas](struct.SchemaListCall.html) (none) -/// * [update schemas](struct.SchemaUpdateCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Schema { - /// Fields of Schema - pub fields: Option>, - /// Kind of resource this is. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, - /// Unique identifier of Schema (Read-only) - #[serde(rename="schemaId")] - pub schema_id: Option, - /// Schema name - #[serde(rename="schemaName")] - pub schema_name: Option, -} - -impl RequestValue for Schema {} -impl Resource for Schema {} -impl ResponseResult for Schema {} - - -/// The template that returns individual ASP (Access Code) data. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list asps](struct.AspListCall.html) (none) -/// * [delete asps](struct.AspDeleteCall.html) (none) -/// * [get asps](struct.AspGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Asp { - /// The type of the API resource. This is always admin#directory#asp. - pub kind: Option, - /// ETag of the ASP. - pub etag: Option, - /// The name of the application that the user, represented by their userId, entered when the ASP was created. - pub name: Option, - /// The unique ID of the ASP. - #[serde(rename="codeId")] - pub code_id: Option, - /// The time when the ASP was last used. Expressed in Unix time format. - #[serde(rename="lastTimeUsed")] - pub last_time_used: Option, - /// The unique ID of the user who issued the ASP. - #[serde(rename="userKey")] - pub user_key: Option, - /// The time when the ASP was created. Expressed in Unix time format. - #[serde(rename="creationTime")] - pub creation_time: Option, -} - -impl Resource for Asp {} -impl ResponseResult for Asp {} - - -/// JSON response template for List Chrome OS Devices 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 chromeosdevices](struct.ChromeosdeviceListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChromeOsDevices { - /// Token used to access next page of this result. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// List of Chrome OS Device objects. - pub chromeosdevices: Option>, - /// ETag of the resource. - pub etag: Option, - /// Kind of resource this is. - pub kind: Option, -} - -impl ResponseResult for ChromeOsDevices {} - - /// JSON template for roleAssignment resource in Directory API. /// /// # Activities @@ -1203,28 +987,6 @@ impl Resource for RoleAssignment {} impl ResponseResult for RoleAssignment {} -/// JSON response template for List tokens 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 tokens](struct.TokenListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Tokens { - /// A list of Token resources. - pub items: Option>, - /// The type of the API resource. This is always admin#directory#tokenList. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, -} - -impl ResponseResult for Tokens {} - - /// Template for notifications list response. /// /// # Activities @@ -1286,95 +1048,6 @@ impl RequestValue for DomainAlias {} impl ResponseResult for DomainAlias {} -/// JSON template for Chrome Os Device resource 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*). -/// -/// * [get chromeosdevices](struct.ChromeosdeviceGetCall.html) (response) -/// * [update chromeosdevices](struct.ChromeosdeviceUpdateCall.html) (request|response) -/// * [patch chromeosdevices](struct.ChromeosdevicePatchCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChromeOsDevice { - /// List of recent device users, in descending order by last login time (Read-only) - #[serde(rename="recentUsers")] - pub recent_users: Option>, - /// Chromebook Mac Address on wifi network interface (Read-only) - #[serde(rename="macAddress")] - pub mac_address: Option, - /// Chromebook serial number (Read-only) - #[serde(rename="serialNumber")] - pub serial_number: Option, - /// Date and time the device was last synchronized with the policy settings in the G Suite administrator control panel (Read-only) - #[serde(rename="lastSync")] - pub last_sync: Option, - /// Chromebook order number (Read-only) - #[serde(rename="orderNumber")] - pub order_number: Option, - /// Mobile Equipment identifier for the 3G mobile card in the Chromebook (Read-only) - pub meid: Option, - /// Address or location of the device as noted by the administrator - #[serde(rename="annotatedLocation")] - pub annotated_location: Option, - /// User of the device - #[serde(rename="annotatedUser")] - pub annotated_user: Option, - /// Chromebook platform version (Read-only) - #[serde(rename="platformVersion")] - pub platform_version: Option, - /// List of active time ranges (Read-only) - #[serde(rename="activeTimeRanges")] - pub active_time_ranges: Option>, - /// Unique identifier of Chrome OS Device (Read-only) - #[serde(rename="deviceId")] - pub device_id: Option, - /// Chromebook Mac Address on ethernet network interface (Read-only) - #[serde(rename="ethernetMacAddress")] - pub ethernet_mac_address: Option, - /// AssetId specified during enrollment or through later annotation - #[serde(rename="annotatedAssetId")] - pub annotated_asset_id: Option, - /// Chromebook firmware version (Read-only) - #[serde(rename="firmwareVersion")] - pub firmware_version: Option, - /// Date and time the device was last enrolled (Read-only) - #[serde(rename="lastEnrollmentTime")] - pub last_enrollment_time: Option, - /// Kind of resource this is. - pub kind: Option, - /// Chromebook Os Version (Read-only) - #[serde(rename="osVersion")] - pub os_version: Option, - /// Notes added by the administrator - pub notes: Option, - /// Will Chromebook auto renew after support end date (Read-only) - #[serde(rename="willAutoRenew")] - pub will_auto_renew: Option, - /// Chromebook boot mode (Read-only) - #[serde(rename="bootMode")] - pub boot_mode: Option, - /// ETag of the resource. - pub etag: Option, - /// status of the device (Read-only) - pub status: Option, - /// OrgUnit of the device - #[serde(rename="orgUnitPath")] - pub org_unit_path: Option, - /// Chromebook Model (Read-only) - pub model: Option, - /// Final date the device will be supported (Read-only) - #[serde(rename="supportEndDate")] - pub support_end_date: Option, -} - -impl RequestValue for ChromeOsDevice {} -impl Resource for ChromeOsDevice {} -impl ResponseResult for ChromeOsDevice {} - - /// JSON template for User object in Directory API. /// /// # Activities @@ -1544,112 +1217,120 @@ pub struct Groups { impl ResponseResult for Groups {} -/// List of recent device users, in descending order by last login time (Read-only) +/// JSON template for Chrome Os Device resource 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*). +/// +/// * [get chromeosdevices](struct.ChromeosdeviceGetCall.html) (response) +/// * [update chromeosdevices](struct.ChromeosdeviceUpdateCall.html) (request|response) +/// * [patch chromeosdevices](struct.ChromeosdevicePatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChromeOsDevice { + /// List of recent device users, in descending order by last login time (Read-only) + #[serde(rename="recentUsers")] + pub recent_users: Option>, + /// Chromebook Mac Address on wifi network interface (Read-only) + #[serde(rename="macAddress")] + pub mac_address: Option, + /// Chromebook serial number (Read-only) + #[serde(rename="serialNumber")] + pub serial_number: Option, + /// Date and time the device was last synchronized with the policy settings in the G Suite administrator control panel (Read-only) + #[serde(rename="lastSync")] + pub last_sync: Option, + /// Chromebook order number (Read-only) + #[serde(rename="orderNumber")] + pub order_number: Option, + /// Mobile Equipment identifier for the 3G mobile card in the Chromebook (Read-only) + pub meid: Option, + /// Address or location of the device as noted by the administrator + #[serde(rename="annotatedLocation")] + pub annotated_location: Option, + /// User of the device + #[serde(rename="annotatedUser")] + pub annotated_user: Option, + /// Chromebook platform version (Read-only) + #[serde(rename="platformVersion")] + pub platform_version: Option, + /// List of active time ranges (Read-only) + #[serde(rename="activeTimeRanges")] + pub active_time_ranges: Option>, + /// Unique identifier of Chrome OS Device (Read-only) + #[serde(rename="deviceId")] + pub device_id: Option, + /// Chromebook Mac Address on ethernet network interface (Read-only) + #[serde(rename="ethernetMacAddress")] + pub ethernet_mac_address: Option, + /// AssetId specified during enrollment or through later annotation + #[serde(rename="annotatedAssetId")] + pub annotated_asset_id: Option, + /// Chromebook firmware version (Read-only) + #[serde(rename="firmwareVersion")] + pub firmware_version: Option, + /// Date and time the device was last enrolled (Read-only) + #[serde(rename="lastEnrollmentTime")] + pub last_enrollment_time: Option, + /// Kind of resource this is. + pub kind: Option, + /// Chromebook Os Version (Read-only) + #[serde(rename="osVersion")] + pub os_version: Option, + /// List of device files to download (Read-only) + #[serde(rename="deviceFiles")] + pub device_files: Option>, + /// Notes added by the administrator + pub notes: Option, + /// Will Chromebook auto renew after support end date (Read-only) + #[serde(rename="willAutoRenew")] + pub will_auto_renew: Option, + /// Chromebook boot mode (Read-only) + #[serde(rename="bootMode")] + pub boot_mode: Option, + /// ETag of the resource. + pub etag: Option, + /// status of the device (Read-only) + pub status: Option, + /// OrgUnit of the device + #[serde(rename="orgUnitPath")] + pub org_unit_path: Option, + /// Chromebook Model (Read-only) + pub model: Option, + /// Final date the device will be supported (Read-only) + #[serde(rename="supportEndDate")] + pub support_end_date: Option, +} + +impl RequestValue for ChromeOsDevice {} +impl Resource for ChromeOsDevice {} +impl ResponseResult for ChromeOsDevice {} + + +/// JSON template for Trusted App Ids Resource object in Directory 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 ChromeOsDeviceRecentUsers { - /// The type of the user - #[serde(rename="type")] - pub type_: Option, - /// Email address of the user. Present only if the user type is managed - pub email: Option, -} - -impl NestedType for ChromeOsDeviceRecentUsers {} -impl Part for ChromeOsDeviceRecentUsers {} - - -/// JSON response template to list aliases 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*). -/// -/// * [aliases list users](struct.UserAliaseListCall.html) (response) -/// * [aliases list groups](struct.GroupAliaseListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Aliases { - /// Kind of resource this is. +pub struct TrustedAppId { + /// Android package name. + #[serde(rename="androidPackageName")] + pub android_package_name: Option, + /// Identifies the resource as a trusted AppId. pub kind: Option, - /// ETag of the resource. + /// no description provided pub etag: Option, - /// List of alias objects. - pub aliases: Option>, + /// SHA1 signature of the app certificate. + #[serde(rename="certificateHashSHA1")] + pub certificate_hash_sha1: Option, + /// SHA256 signature of the app certificate. + #[serde(rename="certificateHashSHA256")] + pub certificate_hash_sha256: Option, } -impl ResponseResult for Aliases {} - - -/// JSON response template for List Members 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 members](struct.MemberListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Members { - /// Token used to access next page of this result. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Kind of resource this is. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, - /// List of member objects. - pub members: Option>, -} - -impl ResponseResult for Members {} - - -/// JSON template for Customer Resource 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*). -/// -/// * [patch customers](struct.CustomerPatchCall.html) (request|response) -/// * [update customers](struct.CustomerUpdateCall.html) (request|response) -/// * [get customers](struct.CustomerGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Customer { - /// The customer's primary domain name string. Do not include the www prefix when creating a new customer. - #[serde(rename="customerDomain")] - pub customer_domain: Option, - /// The customer's ISO 639-2 language code. The default value is en-US - pub language: Option, - /// The customer's secondary contact email address. This email address cannot be on the same domain as the customerDomain - #[serde(rename="alternateEmail")] - pub alternate_email: Option, - /// The customer's creation time (Readonly) - #[serde(rename="customerCreationTime")] - pub customer_creation_time: Option, - /// Identifies the resource as a customer. Value: admin#directory#customer - pub kind: Option, - /// ETag of the resource. - pub etag: Option, - /// The customer's contact phone number in E.164 format. - #[serde(rename="phoneNumber")] - pub phone_number: Option, - /// The customer's postal address information. - #[serde(rename="postalAddress")] - pub postal_address: Option, - /// The unique ID for the customer's G Suite account. (Readonly) - pub id: Option, -} - -impl RequestValue for Customer {} -impl Resource for Customer {} -impl ResponseResult for Customer {} +impl Part for TrustedAppId {} /// JSON template for a set of custom properties (i.e. all fields in a particular schema) @@ -1722,48 +1403,6 @@ pub struct Roles { impl ResponseResult for Roles {} -/// JSON request template to undelete a user 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*). -/// -/// * [undelete users](struct.UserUndeleteCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UserUndelete { - /// OrgUnit of User - #[serde(rename="orgUnitPath")] - pub org_unit_path: Option, -} - -impl RequestValue for UserUndelete {} - - -/// JSON response template to list domain aliases 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 domain aliases](struct.DomainAliaseListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DomainAliases { - /// List of domain alias objects. - #[serde(rename="domainAliases")] - pub domain_aliases: Option>, - /// Kind of resource this is. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, -} - -impl ResponseResult for DomainAliases {} - - /// JSON response template for List verification codes operation in Directory API. /// /// # Activities @@ -1786,35 +1425,6 @@ pub struct VerificationCodes { impl ResponseResult for VerificationCodes {} -/// JSON template for Alias 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*). -/// -/// * [aliases insert users](struct.UserAliaseInsertCall.html) (request|response) -/// * [aliases insert groups](struct.GroupAliaseInsertCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Alias { - /// A alias email - pub alias: Option, - /// Kind of resource this is. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, - /// Group's primary email (Read-only) User's primary email (Read-only) - #[serde(rename="primaryEmail")] - pub primary_email: Option, - /// Unique id of the group (Read-only) Unique id of the user (Read-only) - pub id: Option, -} - -impl RequestValue for Alias {} -impl ResponseResult for Alias {} - - /// JSON response template for List Mobile Devices operation in Directory API. /// /// # Activities @@ -1840,45 +1450,21 @@ pub struct MobileDevices { impl ResponseResult for MobileDevices {} -/// JSON response template to list Domains in Directory API. +/// List of active time ranges (Read-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*). -/// -/// * [list domains](struct.DomainListCall.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 Domains2 { - /// List of domain objects. - pub domains: Option>, - /// Kind of resource this is. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, +pub struct ChromeOsDeviceActiveTimeRanges { + /// Date of usage + pub date: Option, + /// Duration in milliseconds + #[serde(rename="activeTime")] + pub active_time: Option, } -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 {} +impl NestedType for ChromeOsDeviceActiveTimeRanges {} +impl Part for ChromeOsDeviceActiveTimeRanges {} /// JSON template for Photo object in Directory API. @@ -1945,24 +1531,6 @@ impl NestedType for MobileDeviceApplications {} impl Part for MobileDeviceApplications {} -/// JSON request template for firing commands on Mobile Device 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*). -/// -/// * [action mobiledevices](struct.MobiledeviceActionCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MobileDeviceAction { - /// Action to be taken on the Mobile Device - pub action: Option, -} - -impl RequestValue for MobileDeviceAction {} - - /// JSON request template for setting/revoking admin status of a user in Directory API. /// /// # Activities @@ -1981,67 +1549,91 @@ pub struct UserMakeAdmin { impl RequestValue for UserMakeAdmin {} -/// JSON response template for List Users operation in Apps Directory API. +/// JSON response template to list Domains 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 users](struct.UserListCall.html) (response) +/// * [list domains](struct.DomainListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Users { - /// Token used to access next page of this result. +pub struct Domains2 { + /// List of domain objects. + pub domains: Option>, + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, +} + +impl ResponseResult for Domains2 {} + + +/// JSON template for token resource 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 tokens](struct.TokenListCall.html) (none) +/// * [delete tokens](struct.TokenDeleteCall.html) (none) +/// * [get tokens](struct.TokenGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Token { + /// A list of authorization scopes the application is granted. + pub scopes: Option>, + /// The type of the API resource. This is always admin#directory#token. + pub kind: Option, + /// The Client ID of the application the token is issued to. + #[serde(rename="clientId")] + pub client_id: Option, + /// Whether the token is issued to an installed application. The value is true if the application is installed to a desktop or mobile device. + #[serde(rename="nativeApp")] + pub native_app: Option, + /// The displayable name of the application the token is issued to. + #[serde(rename="displayText")] + pub display_text: Option, + /// ETag of the resource. + pub etag: Option, + /// Whether the application is registered with Google. The value is true if the application has an anonymous Client ID. + pub anonymous: Option, + /// The unique ID of the user that issued the token. + #[serde(rename="userKey")] + pub user_key: Option, +} + +impl Resource for Token {} +impl ResponseResult for Token {} + + +/// JSON template for Trusted Apps response object of a user 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 trusted apps resolved app access settings](struct.ResolvedAppAccessSettingListTrustedAppCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TrustedApps { + /// no description provided #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// Kind of resource this is. + /// Identifies the resource as trusted apps response. pub kind: Option, /// ETag of the resource. pub etag: Option, - /// Event that triggered this response (only used in case of Push Response) - pub trigger_event: Option, - /// List of user objects. - pub users: Option>, + /// Trusted Apps list. + #[serde(rename="trustedApps")] + pub trusted_apps: Option>, } -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 {} +impl ResponseResult for TrustedApps {} /// JSON template for Mobile Device resource in Directory API. @@ -2167,43 +1759,626 @@ impl Resource for MobileDevice {} impl ResponseResult for MobileDevice {} -/// JSON template for token resource in Directory API. +/// List of device files to download (Read-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 ChromeOsDeviceDeviceFiles { + /// File downlod URL + #[serde(rename="downloadUrl")] + pub download_url: Option, + /// File type + #[serde(rename="type")] + pub type_: Option, + /// Date and time the file was created + #[serde(rename="createTime")] + pub create_time: Option, + /// File name + pub name: Option, +} + +impl NestedType for ChromeOsDeviceDeviceFiles {} +impl Part for ChromeOsDeviceDeviceFiles {} + + +/// JSON template for App Access Collections Resource 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*). /// -/// * [list tokens](struct.TokenListCall.html) (none) -/// * [delete tokens](struct.TokenDeleteCall.html) (none) -/// * [get tokens](struct.TokenGetCall.html) (response) +/// * [get settings resolved app access settings](struct.ResolvedAppAccessSettingGetSettingCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Token { - /// A list of authorization scopes the application is granted. - pub scopes: Option>, - /// The type of the API resource. This is always admin#directory#token. +pub struct AppAccessCollections { + /// Identifies the resource as an app access collection. Value: admin#directory#appaccesscollection pub kind: Option, - /// The Client ID of the application the token is issued to. - #[serde(rename="clientId")] - pub client_id: Option, - /// Whether the token is issued to an installed application. The value is true if the application is installed to a desktop or mobile device. - #[serde(rename="nativeApp")] - pub native_app: Option, - /// The displayable name of the application the token is issued to. - #[serde(rename="displayText")] - pub display_text: Option, + /// Boolean that indicates whether to trust domain owned apps. + #[serde(rename="trustDomainOwnedApps")] + pub trust_domain_owned_apps: Option, + /// Unique ID of app access collection. (Readonly) + #[serde(rename="resourceId")] + pub resource_id: Option, + /// Error message provided by the Admin that will be shown to the user when an app is blocked. + #[serde(rename="errorMessage")] + pub error_message: Option, /// ETag of the resource. pub etag: Option, - /// Whether the application is registered with Google. The value is true if the application has an anonymous Client ID. - pub anonymous: Option, - /// The unique ID of the user that issued the token. - #[serde(rename="userKey")] - pub user_key: Option, + /// List of blocked api access buckets. + #[serde(rename="blockedApiAccessBuckets")] + pub blocked_api_access_buckets: Option>, + /// Resource name given by the customer while creating/updating. Should be unique under given customer. + #[serde(rename="resourceName")] + pub resource_name: Option, + /// Boolean to indicate whether to enforce app access settings on Android Drive or not. + #[serde(rename="enforceSettingsForAndroidDrive")] + pub enforce_settings_for_android_drive: Option, } -impl Resource for Token {} -impl ResponseResult for Token {} +impl ResponseResult for AppAccessCollections {} + + +/// JSON template for Has Member response 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*). +/// +/// * [has member members](struct.MemberHasMemberCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MembersHasMember { + /// Identifies whether given user is a member or not. + #[serde(rename="isMember")] + pub is_member: Option, +} + +impl ResponseResult for MembersHasMember {} + + +/// Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the numericIndexingSpec allows range queries to be 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 SchemaFieldSpecNumericIndexingSpec { + /// Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant. + #[serde(rename="maxValue")] + pub max_value: Option, + /// Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant. + #[serde(rename="minValue")] + pub min_value: Option, +} + +impl NestedType for SchemaFieldSpecNumericIndexingSpec {} +impl Part for SchemaFieldSpecNumericIndexingSpec {} + + +/// 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 asps](struct.AspListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Asps { + /// A list of ASP resources. + pub items: Option>, + /// The type of the API resource. This is always admin#directory#aspList. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, +} + +impl ResponseResult for Asps {} + + +/// JSON template for postal address of a 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 CustomerPostalAddress { + /// The company or company division name. + #[serde(rename="organizationName")] + pub organization_name: Option, + /// This is a required property. For countryCode information see the ISO 3166 country code elements. + #[serde(rename="countryCode")] + pub country_code: Option, + /// Name of the locality. An example of a locality value is the city of San Francisco. + pub locality: Option, + /// Name of the region. An example of a region value is NY for the state of New York. + pub region: Option, + /// Address line 2 of the address. + #[serde(rename="addressLine2")] + pub address_line2: Option, + /// Address line 3 of the address. + #[serde(rename="addressLine3")] + pub address_line3: Option, + /// The customer contact's name. + #[serde(rename="contactName")] + pub contact_name: Option, + /// A customer's physical address. The address can be composed of one to three lines. + #[serde(rename="addressLine1")] + pub address_line1: Option, + /// The postal code. A postalCode example is a postal zip code such as 10009. This is in accordance with - http://portablecontacts.net/draft-spec.html#address_element. + #[serde(rename="postalCode")] + pub postal_code: Option, +} + +impl Part for CustomerPostalAddress {} + + +/// An notification channel used to watch for resource 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*). +/// +/// * [watch users](struct.UserWatchCall.html) (request|response) +/// * [stop channels](struct.ChannelStopCall.html) (request) +/// * [aliases watch users](struct.UserAliaseWatchCall.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 {} + + +/// JSON template for Schema resource 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*). +/// +/// * [get schemas](struct.SchemaGetCall.html) (response) +/// * [insert schemas](struct.SchemaInsertCall.html) (request|response) +/// * [patch schemas](struct.SchemaPatchCall.html) (request|response) +/// * [delete schemas](struct.SchemaDeleteCall.html) (none) +/// * [list schemas](struct.SchemaListCall.html) (none) +/// * [update schemas](struct.SchemaUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Schema { + /// Fields of Schema + pub fields: Option>, + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, + /// Unique identifier of Schema (Read-only) + #[serde(rename="schemaId")] + pub schema_id: Option, + /// Schema name + #[serde(rename="schemaName")] + pub schema_name: Option, +} + +impl RequestValue for Schema {} +impl Resource for Schema {} +impl ResponseResult for Schema {} + + +/// The template that returns individual ASP (Access Code) data. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list asps](struct.AspListCall.html) (none) +/// * [delete asps](struct.AspDeleteCall.html) (none) +/// * [get asps](struct.AspGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Asp { + /// The type of the API resource. This is always admin#directory#asp. + pub kind: Option, + /// ETag of the ASP. + pub etag: Option, + /// The name of the application that the user, represented by their userId, entered when the ASP was created. + pub name: Option, + /// The unique ID of the ASP. + #[serde(rename="codeId")] + pub code_id: Option, + /// The time when the ASP was last used. Expressed in Unix time format. + #[serde(rename="lastTimeUsed")] + pub last_time_used: Option, + /// The unique ID of the user who issued the ASP. + #[serde(rename="userKey")] + pub user_key: Option, + /// The time when the ASP was created. Expressed in Unix time format. + #[serde(rename="creationTime")] + pub creation_time: Option, +} + +impl Resource for Asp {} +impl ResponseResult for Asp {} + + +/// JSON response template for List Users operation in Apps 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 users](struct.UserListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Users { + /// Token used to access next page of this result. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, + /// Event that triggered this response (only used in case of Push Response) + pub trigger_event: Option, + /// List of user objects. + pub users: Option>, +} + +impl ResponseResult for Users {} + + +/// JSON response template for List tokens 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 tokens](struct.TokenListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Tokens { + /// A list of Token resources. + pub items: Option>, + /// The type of the API resource. This is always admin#directory#tokenList. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, +} + +impl ResponseResult for Tokens {} + + +/// JSON response template for List Members 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 members](struct.MemberListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Members { + /// Token used to access next page of this result. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, + /// List of member objects. + pub members: Option>, +} + +impl ResponseResult for Members {} + + +/// List of recent device users, in descending order by last login time (Read-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 ChromeOsDeviceRecentUsers { + /// The type of the user + #[serde(rename="type")] + pub type_: Option, + /// Email address of the user. Present only if the user type is managed + pub email: Option, +} + +impl NestedType for ChromeOsDeviceRecentUsers {} +impl Part for ChromeOsDeviceRecentUsers {} + + +/// JSON template for Customer Resource 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*). +/// +/// * [patch customers](struct.CustomerPatchCall.html) (request|response) +/// * [update customers](struct.CustomerUpdateCall.html) (request|response) +/// * [get customers](struct.CustomerGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Customer { + /// The customer's primary domain name string. Do not include the www prefix when creating a new customer. + #[serde(rename="customerDomain")] + pub customer_domain: Option, + /// The customer's ISO 639-2 language code. The default value is en-US + pub language: Option, + /// The customer's secondary contact email address. This email address cannot be on the same domain as the customerDomain + #[serde(rename="alternateEmail")] + pub alternate_email: Option, + /// The customer's creation time (Readonly) + #[serde(rename="customerCreationTime")] + pub customer_creation_time: Option, + /// Identifies the resource as a customer. Value: admin#directory#customer + pub kind: Option, + /// ETag of the resource. + pub etag: Option, + /// The customer's contact phone number in E.164 format. + #[serde(rename="phoneNumber")] + pub phone_number: Option, + /// The customer's postal address information. + #[serde(rename="postalAddress")] + pub postal_address: Option, + /// The unique ID for the customer's G Suite account. (Readonly) + pub id: Option, +} + +impl RequestValue for Customer {} +impl Resource for Customer {} +impl ResponseResult for Customer {} + + +/// JSON response template for List Organization Units 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 orgunits](struct.OrgunitListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrgUnits { + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, + /// List of user objects. + #[serde(rename="organizationUnits")] + pub organization_units: Option>, +} + +impl ResponseResult for OrgUnits {} + + +/// JSON response template for List roleAssignments 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 role assignments](struct.RoleAssignmentListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RoleAssignments { + /// no description provided + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of RoleAssignment resources. + pub items: Option>, + /// The type of the API resource. This is always admin#directory#roleAssignments. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, +} + +impl ResponseResult for RoleAssignments {} + + +/// JSON request template to undelete a user 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*). +/// +/// * [undelete users](struct.UserUndeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserUndelete { + /// OrgUnit of User + #[serde(rename="orgUnitPath")] + pub org_unit_path: Option, +} + +impl RequestValue for UserUndelete {} + + +/// JSON template for Alias 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*). +/// +/// * [aliases insert users](struct.UserAliaseInsertCall.html) (request|response) +/// * [aliases insert groups](struct.GroupAliaseInsertCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Alias { + /// A alias email + pub alias: Option, + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, + /// Group's primary email (Read-only) User's primary email (Read-only) + #[serde(rename="primaryEmail")] + pub primary_email: Option, + /// Unique id of the group (Read-only) Unique id of the user (Read-only) + pub id: Option, +} + +impl RequestValue for Alias {} +impl ResponseResult for Alias {} + + +/// The set of privileges that are granted to this 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 RoleRolePrivileges { + /// The obfuscated ID of the service this privilege is for. + #[serde(rename="serviceId")] + pub service_id: Option, + /// The name of the privilege. + #[serde(rename="privilegeName")] + pub privilege_name: Option, +} + +impl NestedType for RoleRolePrivileges {} +impl Part for RoleRolePrivileges {} + + +/// 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 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 to list domain aliases 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 domain aliases](struct.DomainAliaseListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DomainAliases { + /// List of domain alias objects. + #[serde(rename="domainAliases")] + pub domain_aliases: Option>, + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, +} + +impl ResponseResult for DomainAliases {} + + +/// JSON response template for List Chrome OS Devices 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 chromeosdevices](struct.ChromeosdeviceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChromeOsDevices { + /// Token used to access next page of this result. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// List of Chrome OS Device objects. + pub chromeosdevices: Option>, + /// ETag of the resource. + pub etag: Option, + /// Kind of resource this is. + pub kind: Option, +} + +impl ResponseResult for ChromeOsDevices {} /// JSON template for Org Unit resource in Directory API. @@ -2250,45 +2425,6 @@ 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. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChromeOsDeviceActiveTimeRanges { - /// Date of usage - pub date: Option, - /// Duration in milliseconds - #[serde(rename="activeTime")] - pub active_time: Option, -} - -impl NestedType for ChromeOsDeviceActiveTimeRanges {} -impl Part for ChromeOsDeviceActiveTimeRanges {} - - /// JSON template for verification codes in Directory API. /// /// # Activities @@ -2338,22 +2474,22 @@ pub struct ChromeOsDeviceAction { impl RequestValue for ChromeOsDeviceAction {} -/// Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the numericIndexingSpec allows range queries to be supported. +/// JSON request template for firing commands on Mobile Device in Directory Devices API. /// -/// 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*). +/// +/// * [action mobiledevices](struct.MobiledeviceActionCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SchemaFieldSpecNumericIndexingSpec { - /// Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant. - #[serde(rename="maxValue")] - pub max_value: Option, - /// Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant. - #[serde(rename="minValue")] - pub min_value: Option, +pub struct MobileDeviceAction { + /// Action to be taken on the Mobile Device + pub action: Option, } -impl NestedType for SchemaFieldSpecNumericIndexingSpec {} -impl Part for SchemaFieldSpecNumericIndexingSpec {} +impl RequestValue for MobileDeviceAction {} /// JSON template for Calendar Resource List Response object in Directory API. @@ -2381,6 +2517,29 @@ pub struct CalendarResources { impl ResponseResult for CalendarResources {} +/// JSON response template to list aliases 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*). +/// +/// * [aliases list users](struct.UserAliaseListCall.html) (response) +/// * [aliases list groups](struct.GroupAliaseListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Aliases { + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, + /// List of alias objects. + pub aliases: Option>, +} + +impl ResponseResult for Aliases {} + + // ################### // MethodBuilders ### @@ -2431,7 +2590,7 @@ impl<'a, C, A> VerificationCodeMethods<'a, C, A> { /// /// # Arguments /// - /// * `userKey` - Email or immutable Id of the user + /// * `userKey` - Email or immutable ID of the user pub fn generate(&self, user_key: &str) -> VerificationCodeGenerateCall<'a, C, A> { VerificationCodeGenerateCall { hub: self.hub, @@ -2448,7 +2607,7 @@ impl<'a, C, A> VerificationCodeMethods<'a, C, A> { /// /// # Arguments /// - /// * `userKey` - Email or immutable Id of the user + /// * `userKey` - Email or immutable ID of the user pub fn invalidate(&self, user_key: &str) -> VerificationCodeInvalidateCall<'a, C, A> { VerificationCodeInvalidateCall { hub: self.hub, @@ -2617,7 +2776,7 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieve all Organization Units + /// Retrieve all organizational units /// /// # Arguments /// @@ -2636,7 +2795,7 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Add Organization Unit + /// Add organizational unit /// /// # Arguments /// @@ -2655,13 +2814,13 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Update Organization Unit + /// Update organizational unit /// /// # Arguments /// /// * `request` - No description provided. /// * `customerId` - Immutable ID of the G Suite account - /// * `orgUnitPath` - Full path of the organization unit or its Id + /// * `orgUnitPath` - Full path of the organizational unit or its ID pub fn update(&self, request: OrgUnit, customer_id: &str, org_unit_path: &Vec) -> OrgunitUpdateCall<'a, C, A> { OrgunitUpdateCall { hub: self.hub, @@ -2676,31 +2835,12 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Remove Organization Unit + /// Retrieve organizational unit /// /// # Arguments /// /// * `customerId` - Immutable ID of the G Suite account - /// * `orgUnitPath` - Full path of the organization unit or its Id - pub fn delete(&self, customer_id: &str, org_unit_path: &Vec) -> OrgunitDeleteCall<'a, C, A> { - OrgunitDeleteCall { - hub: self.hub, - _customer_id: customer_id.to_string(), - _org_unit_path: org_unit_path.clone(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieve Organization Unit - /// - /// # Arguments - /// - /// * `customerId` - Immutable ID of the G Suite account - /// * `orgUnitPath` - Full path of the organization unit or its Id + /// * `orgUnitPath` - Full path of the organizational unit or its ID pub fn get(&self, customer_id: &str, org_unit_path: &Vec) -> OrgunitGetCall<'a, C, A> { OrgunitGetCall { hub: self.hub, @@ -2714,13 +2854,32 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Update Organization Unit. This method supports patch semantics. + /// Remove organizational unit + /// + /// # Arguments + /// + /// * `customerId` - Immutable ID of the G Suite account + /// * `orgUnitPath` - Full path of the organizational unit or its ID + pub fn delete(&self, customer_id: &str, org_unit_path: &Vec) -> OrgunitDeleteCall<'a, C, A> { + OrgunitDeleteCall { + hub: self.hub, + _customer_id: customer_id.to_string(), + _org_unit_path: org_unit_path.clone(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update organizational unit. This method supports patch semantics. /// /// # Arguments /// /// * `request` - No description provided. /// * `customerId` - Immutable ID of the G Suite account - /// * `orgUnitPath` - Full path of the organization unit or its Id + /// * `orgUnitPath` - Full path of the organizational unit or its ID pub fn patch(&self, request: OrgUnit, customer_id: &str, org_unit_path: &Vec) -> OrgunitPatchCall<'a, C, A> { OrgunitPatchCall { hub: self.hub, @@ -2736,7 +2895,7 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { -/// A builder providing access to all methods supported on *member* resources. +/// A builder providing access to all methods supported on *group* resources. /// It is not used directly, but through the `Directory` hub. /// /// # Example @@ -2760,33 +2919,31 @@ impl<'a, C, A> OrgunitMethods<'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 `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `aliases_delete(...)`, `aliases_insert(...)`, `aliases_list(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` /// // to build up your call. -/// let rb = hub.members(); +/// let rb = hub.groups(); /// # } /// ``` -pub struct MemberMethods<'a, C, A> +pub struct GroupMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, } -impl<'a, C, A> MethodsBuilder for MemberMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for GroupMethods<'a, C, A> {} -impl<'a, C, A> MemberMethods<'a, C, A> { +impl<'a, C, A> GroupMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Add user to the specified group. + /// Delete Group /// /// # Arguments /// - /// * `request` - No description provided. - /// * `groupKey` - Email or immutable Id of the group - pub fn insert(&self, request: Member, group_key: &str) -> MemberInsertCall<'a, C, A> { - MemberInsertCall { + /// * `groupKey` - Email or immutable ID of the group + pub fn delete(&self, group_key: &str) -> GroupDeleteCall<'a, C, A> { + GroupDeleteCall { hub: self.hub, - _request: request, _group_key: group_key.to_string(), _delegate: Default::default(), _scopes: Default::default(), @@ -2796,60 +2953,15 @@ impl<'a, C, A> MemberMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Update membership of a user in the specified group. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `groupKey` - Email or immutable Id of the group. If Id, it should match with id of group object - /// * `memberKey` - Email or immutable Id of the user. If Id, it should match with id of member object - pub fn patch(&self, request: Member, group_key: &str, member_key: &str) -> MemberPatchCall<'a, C, A> { - MemberPatchCall { + /// Retrieve all groups in a domain (paginated) + pub fn list(&self) -> GroupListCall<'a, C, A> { + GroupListCall { hub: self.hub, - _request: request, - _group_key: group_key.to_string(), - _member_key: member_key.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Update membership of a user in the specified group. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `groupKey` - Email or immutable Id of the group. If Id, it should match with id of group object - /// * `memberKey` - Email or immutable Id of the user. If Id, it should match with id of member object - pub fn update(&self, request: Member, group_key: &str, member_key: &str) -> MemberUpdateCall<'a, C, A> { - MemberUpdateCall { - hub: self.hub, - _request: request, - _group_key: group_key.to_string(), - _member_key: member_key.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieve all members in a group (paginated) - /// - /// # Arguments - /// - /// * `groupKey` - Email or immutable Id of the group - pub fn list(&self, group_key: &str) -> MemberListCall<'a, C, A> { - MemberListCall { - hub: self.hub, - _group_key: group_key.to_string(), - _roles: Default::default(), + _user_key: Default::default(), _page_token: Default::default(), _max_results: Default::default(), + _domain: Default::default(), + _customer: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2858,17 +2970,17 @@ impl<'a, C, A> MemberMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieve Group Member + /// Update Group /// /// # Arguments /// - /// * `groupKey` - Email or immutable Id of the group - /// * `memberKey` - Email or immutable Id of the member - pub fn get(&self, group_key: &str, member_key: &str) -> MemberGetCall<'a, C, A> { - MemberGetCall { + /// * `request` - No description provided. + /// * `groupKey` - Email or immutable ID of the group. If ID, it should match with id of group object + pub fn update(&self, request: Group, group_key: &str) -> GroupUpdateCall<'a, C, A> { + GroupUpdateCall { hub: self.hub, + _request: request, _group_key: group_key.to_string(), - _member_key: member_key.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2877,17 +2989,106 @@ impl<'a, C, A> MemberMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Remove membership. + /// Create Group /// /// # Arguments /// - /// * `groupKey` - Email or immutable Id of the group - /// * `memberKey` - Email or immutable Id of the member - pub fn delete(&self, group_key: &str, member_key: &str) -> MemberDeleteCall<'a, C, A> { - MemberDeleteCall { + /// * `request` - No description provided. + pub fn insert(&self, request: Group) -> GroupInsertCall<'a, C, A> { + GroupInsertCall { + 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: + /// + /// Add a alias for the group + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `groupKey` - Email or immutable ID of the group + pub fn aliases_insert(&self, request: Alias, group_key: &str) -> GroupAliaseInsertCall<'a, C, A> { + GroupAliaseInsertCall { + hub: self.hub, + _request: request, + _group_key: group_key.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List all aliases for a group + /// + /// # Arguments + /// + /// * `groupKey` - Email or immutable ID of the group + pub fn aliases_list(&self, group_key: &str) -> GroupAliaseListCall<'a, C, A> { + GroupAliaseListCall { hub: self.hub, _group_key: group_key.to_string(), - _member_key: member_key.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieve Group + /// + /// # Arguments + /// + /// * `groupKey` - Email or immutable ID of the group + pub fn get(&self, group_key: &str) -> GroupGetCall<'a, C, A> { + GroupGetCall { + hub: self.hub, + _group_key: group_key.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update Group. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `groupKey` - Email or immutable ID of the group. If ID, it should match with id of group object + pub fn patch(&self, request: Group, group_key: &str) -> GroupPatchCall<'a, C, A> { + GroupPatchCall { + hub: self.hub, + _request: request, + _group_key: group_key.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Remove a alias for the group + /// + /// # Arguments + /// + /// * `groupKey` - Email or immutable ID of the group + /// * `alias` - The alias to be removed + pub fn aliases_delete(&self, group_key: &str, alias: &str) -> GroupAliaseDeleteCall<'a, C, A> { + GroupAliaseDeleteCall { + hub: self.hub, + _group_key: group_key.to_string(), + _alias: alias.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3258,7 +3459,7 @@ impl<'a, C, A> PrivilegeMethods<'a, C, A> { -/// A builder providing access to all methods supported on *channel* resources. +/// A builder providing access to all methods supported on *resolvedAppAccessSetting* resources. /// It is not used directly, but through the `Directory` hub. /// /// # Example @@ -3282,34 +3483,39 @@ impl<'a, C, A> PrivilegeMethods<'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 `stop(...)` +/// // like `get_settings(...)` and `list_trusted_apps(...)` /// // to build up your call. -/// let rb = hub.channels(); +/// let rb = hub.resolved_app_access_settings(); /// # } /// ``` -pub struct ChannelMethods<'a, C, A> +pub struct ResolvedAppAccessSettingMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, } -impl<'a, C, A> MethodsBuilder for ChannelMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for ResolvedAppAccessSettingMethods<'a, C, A> {} -impl<'a, C, A> ChannelMethods<'a, C, A> { +impl<'a, C, A> ResolvedAppAccessSettingMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Stop watching resources through this channel - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn stop(&self, request: Channel) -> ChannelStopCall<'a, C, A> { - ChannelStopCall { + /// Retrieves resolved app access settings of the logged in user. + pub fn get_settings(&self) -> ResolvedAppAccessSettingGetSettingCall<'a, C, A> { + ResolvedAppAccessSettingGetSettingCall { + hub: self.hub, + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of apps trusted by the admin of the logged in user. + pub fn list_trusted_apps(&self) -> ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> { + ResolvedAppAccessSettingListTrustedAppCall { hub: self.hub, - _request: request, _delegate: Default::default(), - _scopes: Default::default(), _additional_params: Default::default(), } } @@ -3442,6 +3648,65 @@ impl<'a, C, A> MobiledeviceMethods<'a, C, A> { +/// A builder providing access to all methods supported on *channel* resources. +/// It is not used directly, but through the `Directory` 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_admin1_directory as admin1_directory; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use admin1_directory::Directory; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::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 `stop(...)` +/// // to build up your call. +/// let rb = hub.channels(); +/// # } +/// ``` +pub struct ChannelMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, +} + +impl<'a, C, A> MethodsBuilder for ChannelMethods<'a, C, A> {} + +impl<'a, C, A> ChannelMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Stop watching resources through this channel + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn stop(&self, request: Channel) -> ChannelStopCall<'a, C, A> { + ChannelStopCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *token* resources. /// It is not used directly, but through the `Directory` hub. /// @@ -3809,13 +4074,13 @@ impl<'a, C, A> ChromeosdeviceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Move or insert multiple Chrome OS Devices to Organization Unit + /// Move or insert multiple Chrome OS Devices to organizational 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 + /// * `orgUnitPath` - Full path of the target organizational 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, @@ -3831,7 +4096,7 @@ impl<'a, C, A> ChromeosdeviceMethods<'a, C, A> { -/// A builder providing access to all methods supported on *group* resources. +/// A builder providing access to all methods supported on *member* resources. /// It is not used directly, but through the `Directory` hub. /// /// # Example @@ -3855,32 +4120,53 @@ impl<'a, C, A> ChromeosdeviceMethods<'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 `aliases_delete(...)`, `aliases_insert(...)`, `aliases_list(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `has_member(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` /// // to build up your call. -/// let rb = hub.groups(); +/// let rb = hub.members(); /// # } /// ``` -pub struct GroupMethods<'a, C, A> +pub struct MemberMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, } -impl<'a, C, A> MethodsBuilder for GroupMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for MemberMethods<'a, C, A> {} -impl<'a, C, A> GroupMethods<'a, C, A> { +impl<'a, C, A> MemberMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Delete Group + /// Checks Membership of an user within a Group /// /// # Arguments /// /// * `groupKey` - Email or immutable Id of the group - pub fn delete(&self, group_key: &str) -> GroupDeleteCall<'a, C, A> { - GroupDeleteCall { + /// * `memberKey` - Email or immutable Id of the member + pub fn has_member(&self, group_key: &str, member_key: &str) -> MemberHasMemberCall<'a, C, A> { + MemberHasMemberCall { hub: self.hub, _group_key: group_key.to_string(), + _member_key: member_key.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Add user to the specified group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `groupKey` - Email or immutable ID of the group + pub fn insert(&self, request: Member, group_key: &str) -> MemberInsertCall<'a, C, A> { + MemberInsertCall { + hub: self.hub, + _request: request, + _group_key: group_key.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3889,15 +4175,60 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieve all groups in a domain (paginated) - pub fn list(&self) -> GroupListCall<'a, C, A> { - GroupListCall { + /// Update membership of a user in the specified group. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `groupKey` - Email or immutable ID of the group. If ID, it should match with id of group object + /// * `memberKey` - Email or immutable ID of the user. If ID, it should match with id of member object + pub fn patch(&self, request: Member, group_key: &str, member_key: &str) -> MemberPatchCall<'a, C, A> { + MemberPatchCall { hub: self.hub, - _user_key: Default::default(), + _request: request, + _group_key: group_key.to_string(), + _member_key: member_key.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update membership of a user in the specified group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `groupKey` - Email or immutable ID of the group. If ID, it should match with id of group object + /// * `memberKey` - Email or immutable ID of the user. If ID, it should match with id of member object + pub fn update(&self, request: Member, group_key: &str, member_key: &str) -> MemberUpdateCall<'a, C, A> { + MemberUpdateCall { + hub: self.hub, + _request: request, + _group_key: group_key.to_string(), + _member_key: member_key.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieve all members in a group (paginated) + /// + /// # Arguments + /// + /// * `groupKey` - Email or immutable ID of the group + pub fn list(&self, group_key: &str) -> MemberListCall<'a, C, A> { + MemberListCall { + hub: self.hub, + _group_key: group_key.to_string(), + _roles: Default::default(), _page_token: Default::default(), _max_results: Default::default(), - _domain: Default::default(), - _customer: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3906,70 +4237,17 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Update Group + /// Retrieve Group Member /// /// # Arguments /// - /// * `request` - No description provided. - /// * `groupKey` - Email or immutable Id of the group. If Id, it should match with id of group object - pub fn update(&self, request: Group, group_key: &str) -> GroupUpdateCall<'a, C, A> { - GroupUpdateCall { - hub: self.hub, - _request: request, - _group_key: group_key.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Create Group - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn insert(&self, request: Group) -> GroupInsertCall<'a, C, A> { - GroupInsertCall { - 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: - /// - /// Add a alias for the group - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `groupKey` - Email or immutable Id of the group - pub fn aliases_insert(&self, request: Alias, group_key: &str) -> GroupAliaseInsertCall<'a, C, A> { - GroupAliaseInsertCall { - hub: self.hub, - _request: request, - _group_key: group_key.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// List all aliases for a group - /// - /// # Arguments - /// - /// * `groupKey` - Email or immutable Id of the group - pub fn aliases_list(&self, group_key: &str) -> GroupAliaseListCall<'a, C, A> { - GroupAliaseListCall { + /// * `groupKey` - Email or immutable ID of the group + /// * `memberKey` - Email or immutable ID of the member + pub fn get(&self, group_key: &str, member_key: &str) -> MemberGetCall<'a, C, A> { + MemberGetCall { hub: self.hub, _group_key: group_key.to_string(), + _member_key: member_key.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3978,53 +4256,17 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieve Group + /// Remove membership. /// /// # Arguments /// - /// * `groupKey` - Email or immutable Id of the group - pub fn get(&self, group_key: &str) -> GroupGetCall<'a, C, A> { - GroupGetCall { + /// * `groupKey` - Email or immutable ID of the group + /// * `memberKey` - Email or immutable ID of the member + pub fn delete(&self, group_key: &str, member_key: &str) -> MemberDeleteCall<'a, C, A> { + MemberDeleteCall { hub: self.hub, _group_key: group_key.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Update Group. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `groupKey` - Email or immutable Id of the group. If Id, it should match with id of group object - pub fn patch(&self, request: Group, group_key: &str) -> GroupPatchCall<'a, C, A> { - GroupPatchCall { - hub: self.hub, - _request: request, - _group_key: group_key.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Remove a alias for the group - /// - /// # Arguments - /// - /// * `groupKey` - Email or immutable Id of the group - /// * `alias` - The alias to be removed - pub fn aliases_delete(&self, group_key: &str, alias: &str) -> GroupAliaseDeleteCall<'a, C, A> { - GroupAliaseDeleteCall { - hub: self.hub, - _group_key: group_key.to_string(), - _alias: alias.to_string(), + _member_key: member_key.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4305,6 +4547,24 @@ impl<'a, C, A> DomainAliaseMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the domain aliases of the customer. + /// + /// # Arguments + /// + /// * `customer` - Immutable ID of the G Suite account. + pub fn list(&self, customer: &str) -> DomainAliaseListCall<'a, C, A> { + DomainAliaseListCall { + hub: self.hub, + _customer: customer.to_string(), + _parent_domain_name: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves a domain alias of the customer. @@ -4324,24 +4584,6 @@ impl<'a, C, A> DomainAliaseMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists the domain aliases of the customer. - /// - /// # Arguments - /// - /// * `customer` - Immutable ID of the G Suite account. - pub fn list(&self, customer: &str) -> DomainAliaseListCall<'a, C, A> { - DomainAliaseListCall { - hub: self.hub, - _customer: customer.to_string(), - _parent_domain_name: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes a Domain Alias of the customer. @@ -4410,7 +4652,7 @@ impl<'a, C, A> SchemaMethods<'a, C, A> { /// # Arguments /// /// * `customerId` - Immutable ID of the G Suite account - /// * `schemaKey` - Name or immutable Id of the schema + /// * `schemaKey` - Name or immutable ID of the schema pub fn get(&self, customer_id: &str, schema_key: &str) -> SchemaGetCall<'a, C, A> { SchemaGetCall { hub: self.hub, @@ -4430,7 +4672,7 @@ impl<'a, C, A> SchemaMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `customerId` - Immutable ID of the G Suite account - /// * `schemaKey` - Name or immutable Id of the schema. + /// * `schemaKey` - Name or immutable ID of the schema. pub fn update(&self, request: Schema, customer_id: &str, schema_key: &str) -> SchemaUpdateCall<'a, C, A> { SchemaUpdateCall { hub: self.hub, @@ -4468,7 +4710,7 @@ impl<'a, C, A> SchemaMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `customerId` - Immutable ID of the G Suite account - /// * `schemaKey` - Name or immutable Id of the schema. + /// * `schemaKey` - Name or immutable ID of the schema. pub fn patch(&self, request: Schema, customer_id: &str, schema_key: &str) -> SchemaPatchCall<'a, C, A> { SchemaPatchCall { hub: self.hub, @@ -4481,25 +4723,6 @@ impl<'a, C, A> SchemaMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Delete schema - /// - /// # Arguments - /// - /// * `customerId` - Immutable ID of the G Suite account - /// * `schemaKey` - Name or immutable Id of the schema - pub fn delete(&self, customer_id: &str, schema_key: &str) -> SchemaDeleteCall<'a, C, A> { - SchemaDeleteCall { - hub: self.hub, - _customer_id: customer_id.to_string(), - _schema_key: schema_key.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Create schema. @@ -4518,6 +4741,25 @@ impl<'a, C, A> SchemaMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Delete schema + /// + /// # Arguments + /// + /// * `customerId` - Immutable ID of the G Suite account + /// * `schemaKey` - Name or immutable ID of the schema + pub fn delete(&self, customer_id: &str, schema_key: &str) -> SchemaDeleteCall<'a, C, A> { + SchemaDeleteCall { + hub: self.hub, + _customer_id: customer_id.to_string(), + _schema_key: schema_key.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -4620,7 +4862,9 @@ impl<'a, C, A> ResourceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a calendar resource. This method supports patch semantics. + /// Updates a calendar resource. + /// + /// This method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved. This method supports patch semantics. /// /// # Arguments /// @@ -4643,6 +4887,8 @@ impl<'a, C, A> ResourceMethods<'a, C, A> { /// /// Updates a calendar resource. /// + /// This method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved. + /// /// # Arguments /// /// * `request` - No description provided. @@ -4746,7 +4992,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `userKey` - Email or immutable Id of the user + /// * `userKey` - Email or immutable ID of the user pub fn photos_delete(&self, user_key: &str) -> UserPhotoDeleteCall<'a, C, A> { UserPhotoDeleteCall { hub: self.hub, @@ -4764,7 +5010,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `userKey` - Email or immutable Id of the user + /// * `userKey` - Email or immutable ID of the user pub fn photos_patch(&self, request: UserPhoto, user_key: &str) -> UserPhotoPatchCall<'a, C, A> { UserPhotoPatchCall { hub: self.hub, @@ -4793,26 +5039,6 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Watch for changes in user aliases list - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `userKey` - Email or immutable Id of the user - pub fn aliases_watch(&self, request: Channel, user_key: &str) -> UserAliaseWatchCall<'a, C, A> { - UserAliaseWatchCall { - hub: self.hub, - _request: request, - _user_key: user_key.to_string(), - _event: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Add a photo for the user @@ -4820,7 +5046,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `userKey` - Email or immutable Id of the user + /// * `userKey` - Email or immutable ID of the user pub fn photos_update(&self, request: UserPhoto, user_key: &str) -> UserPhotoUpdateCall<'a, C, A> { UserPhotoUpdateCall { hub: self.hub, @@ -4868,7 +5094,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `userKey` - Email or immutable Id of the user. If Id, it should match with id of user object + /// * `userKey` - Email or immutable ID of the user. If ID, it should match with id of user object pub fn update(&self, request: User, user_key: &str) -> UserUpdateCall<'a, C, A> { UserUpdateCall { hub: self.hub, @@ -4886,7 +5112,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `userKey` - Email or immutable Id of the user + /// * `userKey` - Email or immutable ID of the user pub fn photos_get(&self, user_key: &str) -> UserPhotoGetCall<'a, C, A> { UserPhotoGetCall { hub: self.hub, @@ -4927,7 +5153,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `userKey` - Email or immutable Id of the user + /// * `userKey` - Email or immutable ID of the user pub fn get(&self, user_key: &str) -> UserGetCall<'a, C, A> { UserGetCall { hub: self.hub, @@ -4948,7 +5174,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `userKey` - Email or immutable Id of the user + /// * `userKey` - Email or immutable ID of the user pub fn aliases_insert(&self, request: Alias, user_key: &str) -> UserAliaseInsertCall<'a, C, A> { UserAliaseInsertCall { hub: self.hub, @@ -4966,7 +5192,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `userKey` - Email or immutable Id of the user + /// * `userKey` - Email or immutable ID of the user pub fn aliases_list(&self, user_key: &str) -> UserAliaseListCall<'a, C, A> { UserAliaseListCall { hub: self.hub, @@ -4985,7 +5211,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `userKey` - Email or immutable Id of the user as admin + /// * `userKey` - Email or immutable ID of the user as admin pub fn make_admin(&self, request: UserMakeAdmin, user_key: &str) -> UserMakeAdminCall<'a, C, A> { UserMakeAdminCall { hub: self.hub, @@ -5004,7 +5230,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `userKey` - Email or immutable Id of the user. If Id, it should match with id of user object + /// * `userKey` - Email or immutable ID of the user. If ID, it should match with id of user object pub fn patch(&self, request: User, user_key: &str) -> UserPatchCall<'a, C, A> { UserPatchCall { hub: self.hub, @@ -5022,7 +5248,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `userKey` - Email or immutable Id of the user + /// * `userKey` - Email or immutable ID of the user /// * `alias` - The alias to be removed pub fn aliases_delete(&self, user_key: &str, alias: &str) -> UserAliaseDeleteCall<'a, C, A> { UserAliaseDeleteCall { @@ -5035,13 +5261,33 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Watch for changes in user aliases list + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `userKey` - Email or immutable ID of the user + pub fn aliases_watch(&self, request: Channel, user_key: &str) -> UserAliaseWatchCall<'a, C, A> { + UserAliaseWatchCall { + hub: self.hub, + _request: request, + _user_key: user_key.to_string(), + _event: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Delete user /// /// # Arguments /// - /// * `userKey` - Email or immutable Id of the user + /// * `userKey` - Email or immutable ID of the user pub fn delete(&self, user_key: &str) -> UserDeleteCall<'a, C, A> { UserDeleteCall { hub: self.hub, @@ -5224,7 +5470,7 @@ impl<'a, C, A> VerificationCodeGenerateCall<'a, C, A> where C: BorrowMut VerificationCodeInvalidateCall<'a, C, A> where C: BorrowMut CustomerUpdateCall<'a, C, A> where C: BorrowMut, A } -/// Retrieve all Organization Units +/// Retrieve all organizational units /// /// A builder for the *list* method supported by a *orgunit* resource. /// It is not used directly, but through a `OrgunitMethods` instance. @@ -6760,7 +7006,7 @@ impl<'a, C, A> OrgunitListCall<'a, C, A> where C: BorrowMut, A: o self._type_ = Some(new_value.to_string()); self } - /// the URL-encoded organization unit's path or its Id + /// the URL-encoded organizational unit's path or its ID /// /// Sets the *org unit path* query property to the given value. pub fn org_unit_path(mut self, new_value: &str) -> OrgunitListCall<'a, C, A> { @@ -6826,7 +7072,7 @@ impl<'a, C, A> OrgunitListCall<'a, C, A> where C: BorrowMut, A: o } -/// Add Organization Unit +/// Add organizational unit /// /// A builder for the *insert* method supported by a *orgunit* resource. /// It is not used directly, but through a `OrgunitMethods` instance. @@ -7100,7 +7346,7 @@ impl<'a, C, A> OrgunitInsertCall<'a, C, A> where C: BorrowMut, A: } -/// Update Organization Unit +/// Update organizational unit /// /// A builder for the *update* method supported by a *orgunit* resource. /// It is not used directly, but through a `OrgunitMethods` instance. @@ -7321,7 +7567,7 @@ impl<'a, C, A> OrgunitUpdateCall<'a, C, A> where C: BorrowMut, A: self._customer_id = new_value.to_string(); self } - /// Full path of the organization unit or its Id + /// Full path of the organizational unit or its ID /// /// Append the given value to the *org unit path* path property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -7391,256 +7637,7 @@ impl<'a, C, A> OrgunitUpdateCall<'a, C, A> where C: BorrowMut, A: } -/// Remove Organization Unit -/// -/// A builder for the *delete* method supported by a *orgunit* resource. -/// It is not used directly, but through a `OrgunitMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.orgunits().delete("customerId", "orgUnitPath") -/// .doit(); -/// # } -/// ``` -pub struct OrgunitDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _customer_id: String, - _org_unit_path: Vec, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrgunitDeleteCall<'a, C, A> {} - -impl<'a, C, A> OrgunitDeleteCall<'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.orgunits.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("customerId", self._customer_id.to_string())); - if self._org_unit_path.len() > 0 { - for f in self._org_unit_path.iter() { - params.push(("orgUnitPath", f.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}/orgunits{/orgUnitPath*}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryOrgunit.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{customerId}", "customerId"), ("{/orgUnitPath*}", "orgUnitPath")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["orgUnitPath", "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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_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) - } - } - } - } - - - /// 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) -> OrgunitDeleteCall<'a, C, A> { - self._customer_id = new_value.to_string(); - self - } - /// Full path of the organization unit or its Id - /// - /// Append the given value to the *org unit path* path property. - /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn add_org_unit_path(mut self, new_value: &str) -> OrgunitDeleteCall<'a, C, A> { - self._org_unit_path.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) -> OrgunitDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrgunitDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryOrgunit`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrgunitDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieve Organization Unit +/// Retrieve organizational unit /// /// A builder for the *get* method supported by a *orgunit* resource. /// It is not used directly, but through a `OrgunitMethods` instance. @@ -7830,7 +7827,7 @@ impl<'a, C, A> OrgunitGetCall<'a, C, A> where C: BorrowMut, A: oa self._customer_id = new_value.to_string(); self } - /// Full path of the organization unit or its Id + /// Full path of the organizational unit or its ID /// /// Append the given value to the *org unit path* path property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -7900,7 +7897,256 @@ impl<'a, C, A> OrgunitGetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Update Organization Unit. This method supports patch semantics. +/// Remove organizational unit +/// +/// A builder for the *delete* method supported by a *orgunit* resource. +/// It is not used directly, but through a `OrgunitMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.orgunits().delete("customerId", "orgUnitPath") +/// .doit(); +/// # } +/// ``` +pub struct OrgunitDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _customer_id: String, + _org_unit_path: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrgunitDeleteCall<'a, C, A> {} + +impl<'a, C, A> OrgunitDeleteCall<'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.orgunits.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("customerId", self._customer_id.to_string())); + if self._org_unit_path.len() > 0 { + for f in self._org_unit_path.iter() { + params.push(("orgUnitPath", f.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}/orgunits{/orgUnitPath*}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryOrgunit.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{customerId}", "customerId"), ("{/orgUnitPath*}", "orgUnitPath")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["orgUnitPath", "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)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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) + } + } + } + } + + + /// 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) -> OrgunitDeleteCall<'a, C, A> { + self._customer_id = new_value.to_string(); + self + } + /// Full path of the organizational unit or its ID + /// + /// Append the given value to the *org unit path* path property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn add_org_unit_path(mut self, new_value: &str) -> OrgunitDeleteCall<'a, C, A> { + self._org_unit_path.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) -> OrgunitDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> OrgunitDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryOrgunit`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrgunitDeleteCall<'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 organizational unit. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *orgunit* resource. /// It is not used directly, but through a `OrgunitMethods` instance. @@ -8121,7 +8367,7 @@ impl<'a, C, A> OrgunitPatchCall<'a, C, A> where C: BorrowMut, A: self._customer_id = new_value.to_string(); self } - /// Full path of the organization unit or its Id + /// Full path of the organizational unit or its ID /// /// Append the given value to the *org unit path* path property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -8191,10 +8437,10 @@ impl<'a, C, A> OrgunitPatchCall<'a, C, A> where C: BorrowMut, A: } -/// Add user to the specified group. +/// Delete Group /// -/// A builder for the *insert* method supported by a *member* resource. -/// It is not used directly, but through a `MemberMethods` instance. +/// A builder for the *delete* method supported by a *group* resource. +/// It is not used directly, but through a `GroupMethods` instance. /// /// # Example /// @@ -8205,7 +8451,509 @@ impl<'a, C, A> OrgunitPatchCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_admin1_directory as admin1_directory; -/// use admin1_directory::Member; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.groups().delete("groupKey") +/// .doit(); +/// # } +/// ``` +pub struct GroupDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _group_key: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GroupDeleteCall<'a, C, A> {} + +impl<'a, C, A> GroupDeleteCall<'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.groups.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("groupKey", self._group_key.to_string())); + for &field in ["groupKey"].iter() { + if self._additional_params.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() + "groups/{groupKey}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["groupKey"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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) + } + } + } + } + + + /// Email or immutable ID of the group + /// + /// Sets the *group key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn group_key(mut self, new_value: &str) -> GroupDeleteCall<'a, C, A> { + self._group_key = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GroupDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryGroup`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GroupDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieve all groups in a domain (paginated) +/// +/// A builder for the *list* method supported by a *group* resource. +/// It is not used directly, but through a `GroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.groups().list() +/// .user_key("amet") +/// .page_token("et") +/// .max_results(-45) +/// .domain("ut") +/// .customer("ea") +/// .doit(); +/// # } +/// ``` +pub struct GroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _user_key: Option, + _page_token: Option, + _max_results: Option, + _domain: Option, + _customer: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GroupListCall<'a, C, A> {} + +impl<'a, C, A> GroupListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Groups)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.groups.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._user_key { + params.push(("userKey", 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._domain { + params.push(("domain", value.to_string())); + } + if let Some(value) = self._customer { + params.push(("customer", value.to_string())); + } + for &field in ["alt", "userKey", "pageToken", "maxResults", "domain", "customer"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "groups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryGroupReadonly.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) + } + } + } + } + + + /// Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If ID, it should match with id of user object + /// + /// Sets the *user key* query property to the given value. + pub fn user_key(mut self, new_value: &str) -> GroupListCall<'a, C, A> { + self._user_key = Some(new_value.to_string()); + self + } + /// Token to specify next page in the list + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> GroupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. Default is 200 + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> GroupListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Name of the domain. Fill this field to get groups from only this domain. To return all groups in a multi-domain fill customer field instead. + /// + /// Sets the *domain* query property to the given value. + pub fn domain(mut self, new_value: &str) -> GroupListCall<'a, C, A> { + self._domain = Some(new_value.to_string()); + self + } + /// Immutable ID of the G Suite account. In case of multi-domain, to fetch all groups for a customer, fill this field instead of domain. + /// + /// Sets the *customer* query property to the given value. + pub fn customer(mut self, new_value: &str) -> GroupListCall<'a, C, A> { + self._customer = 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) -> GroupListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GroupListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryGroupReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GroupListCall<'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 Group +/// +/// A builder for the *update* method supported by a *group* resource. +/// It is not used directly, but through a `GroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// use admin1_directory::Group; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -8219,33 +8967,33 @@ impl<'a, C, A> OrgunitPatchCall<'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 = Member::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.members().insert(req, "groupKey") +/// let result = hub.groups().update(req, "groupKey") /// .doit(); /// # } /// ``` -pub struct MemberInsertCall<'a, C, A> +pub struct GroupUpdateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, - _request: Member, + _request: Group, _group_key: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for MemberInsertCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for GroupUpdateCall<'a, C, A> {} -impl<'a, C, A> MemberInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> GroupUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Member)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Group)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -8253,7 +9001,522 @@ impl<'a, C, A> MemberInsertCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "directory.members.insert", + dlg.begin(MethodInfo { id: "directory.groups.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("groupKey", self._group_key.to_string())); + for &field in ["alt", "groupKey"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["groupKey"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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) -> GroupUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Email or immutable ID of the group. If ID, it should match with id of group object + /// + /// Sets the *group key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn group_key(mut self, new_value: &str) -> GroupUpdateCall<'a, C, A> { + self._group_key = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GroupUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryGroup`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GroupUpdateCall<'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 Group +/// +/// A builder for the *insert* method supported by a *group* resource. +/// It is not used directly, but through a `GroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// use admin1_directory::Group; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::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 = 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.groups().insert(req) +/// .doit(); +/// # } +/// ``` +pub struct GroupInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _request: Group, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GroupInsertCall<'a, C, A> {} + +impl<'a, C, A> GroupInsertCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.groups.insert", + 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() + "groups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryGroup.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: Group) -> GroupInsertCall<'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) -> GroupInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GroupInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryGroup`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GroupInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Add a alias for the group +/// +/// A builder for the *aliases.insert* method supported by a *group* resource. +/// It is not used directly, but through a `GroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// use admin1_directory::Alias; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::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 = Alias::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.groups().aliases_insert(req, "groupKey") +/// .doit(); +/// # } +/// ``` +pub struct GroupAliaseInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _request: Alias, + _group_key: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GroupAliaseInsertCall<'a, C, A> {} + +impl<'a, C, A> GroupAliaseInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Alias)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.groups.aliases.insert", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("groupKey", self._group_key.to_string())); @@ -8269,7 +9532,7 @@ impl<'a, C, A> MemberInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members"; + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/aliases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -8392,17 +9655,17 @@ impl<'a, C, A> MemberInsertCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: Member) -> MemberInsertCall<'a, C, A> { + pub fn request(mut self, new_value: Alias) -> GroupAliaseInsertCall<'a, C, A> { self._request = new_value; self } - /// Email or immutable Id of the group + /// Email or immutable ID of the group /// /// Sets the *group key* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> MemberInsertCall<'a, C, A> { + pub fn group_key(mut self, new_value: &str) -> GroupAliaseInsertCall<'a, C, A> { self._group_key = new_value.to_string(); self } @@ -8412,7 +9675,7 @@ impl<'a, C, A> MemberInsertCall<'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) -> MemberInsertCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupAliaseInsertCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8433,7 +9696,7 @@ impl<'a, C, A> MemberInsertCall<'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) -> MemberInsertCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> GroupAliaseInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8453,7 +9716,7 @@ impl<'a, C, A> MemberInsertCall<'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) -> MemberInsertCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> GroupAliaseInsertCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8465,10 +9728,10 @@ impl<'a, C, A> MemberInsertCall<'a, C, A> where C: BorrowMut, A: } -/// Update membership of a user in the specified group. This method supports patch semantics. +/// List all aliases for a group /// -/// A builder for the *patch* method supported by a *member* resource. -/// It is not used directly, but through a `MemberMethods` instance. +/// A builder for the *aliases.list* method supported by a *group* resource. +/// It is not used directly, but through a `GroupMethods` instance. /// /// # Example /// @@ -8479,7 +9742,493 @@ impl<'a, C, A> MemberInsertCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_admin1_directory as admin1_directory; -/// use admin1_directory::Member; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.groups().aliases_list("groupKey") +/// .doit(); +/// # } +/// ``` +pub struct GroupAliaseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _group_key: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GroupAliaseListCall<'a, C, A> {} + +impl<'a, C, A> GroupAliaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Aliases)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.groups.aliases.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("groupKey", self._group_key.to_string())); + for &field in ["alt", "groupKey"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/aliases"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryGroupReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["groupKey"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Email or immutable ID of the group + /// + /// Sets the *group key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn group_key(mut self, new_value: &str) -> GroupAliaseListCall<'a, C, A> { + self._group_key = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupAliaseListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GroupAliaseListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryGroupReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GroupAliaseListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieve Group +/// +/// A builder for the *get* method supported by a *group* resource. +/// It is not used directly, but through a `GroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.groups().get("groupKey") +/// .doit(); +/// # } +/// ``` +pub struct GroupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _group_key: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GroupGetCall<'a, C, A> {} + +impl<'a, C, A> GroupGetCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.groups.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("groupKey", self._group_key.to_string())); + for &field in ["alt", "groupKey"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryGroupReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["groupKey"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Email or immutable ID of the group + /// + /// Sets the *group key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn group_key(mut self, new_value: &str) -> GroupGetCall<'a, C, A> { + self._group_key = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GroupGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryGroupReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GroupGetCall<'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 Group. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *group* resource. +/// It is not used directly, but through a `GroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// use admin1_directory::Group; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -8493,34 +10242,33 @@ impl<'a, C, A> MemberInsertCall<'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 = Member::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.members().patch(req, "groupKey", "memberKey") +/// let result = hub.groups().patch(req, "groupKey") /// .doit(); /// # } /// ``` -pub struct MemberPatchCall<'a, C, A> +pub struct GroupPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, - _request: Member, + _request: Group, _group_key: String, - _member_key: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for MemberPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for GroupPatchCall<'a, C, A> {} -impl<'a, C, A> MemberPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Member)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Group)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -8528,12 +10276,11 @@ impl<'a, C, A> MemberPatchCall<'a, C, A> where C: BorrowMut, A: o Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "directory.members.patch", + dlg.begin(MethodInfo { id: "directory.groups.patch", http_method: hyper::method::Method::Patch }); - 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(("groupKey", self._group_key.to_string())); - params.push(("memberKey", self._member_key.to_string())); - for &field in ["alt", "groupKey", "memberKey"].iter() { + for &field in ["alt", "groupKey"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8545,12 +10292,12 @@ impl<'a, C, A> MemberPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; + let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{groupKey}", "groupKey"), ("{memberKey}", "memberKey")].iter() { + for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -8561,8 +10308,8 @@ impl<'a, C, A> MemberPatchCall<'a, C, A> where C: BorrowMut, A: o 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 ["memberKey", "groupKey"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["groupKey"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -8668,37 +10415,27 @@ impl<'a, C, A> MemberPatchCall<'a, C, A> where C: BorrowMut, A: o /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: Member) -> MemberPatchCall<'a, C, A> { + pub fn request(mut self, new_value: Group) -> GroupPatchCall<'a, C, A> { self._request = new_value; self } - /// Email or immutable Id of the group. If Id, it should match with id of group object + /// Email or immutable ID of the group. If ID, it should match with id of group object /// /// Sets the *group key* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> MemberPatchCall<'a, C, A> { + pub fn group_key(mut self, new_value: &str) -> GroupPatchCall<'a, C, A> { self._group_key = new_value.to_string(); self } - /// Email or immutable Id of the user. If Id, it should match with id of member object - /// - /// Sets the *member key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn member_key(mut self, new_value: &str) -> MemberPatchCall<'a, C, A> { - self._member_key = new_value.to_string(); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> MemberPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8719,7 +10456,7 @@ impl<'a, C, A> MemberPatchCall<'a, C, A> where C: BorrowMut, A: o /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> MemberPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> GroupPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8739,7 +10476,7 @@ impl<'a, C, A> MemberPatchCall<'a, C, A> where C: BorrowMut, A: o /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> MemberPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> GroupPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8751,296 +10488,10 @@ impl<'a, C, A> MemberPatchCall<'a, C, A> where C: BorrowMut, A: o } -/// Update membership of a user in the specified group. +/// Remove a alias for the group /// -/// A builder for the *update* method supported by a *member* resource. -/// It is not used directly, but through a `MemberMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// use admin1_directory::Member; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::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 = Member::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.members().update(req, "groupKey", "memberKey") -/// .doit(); -/// # } -/// ``` -pub struct MemberUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _request: Member, - _group_key: String, - _member_key: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for MemberUpdateCall<'a, C, A> {} - -impl<'a, C, A> MemberUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Member)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.members.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("groupKey", self._group_key.to_string())); - params.push(("memberKey", self._member_key.to_string())); - for &field in ["alt", "groupKey", "memberKey"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{groupKey}", "groupKey"), ("{memberKey}", "memberKey")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["memberKey", "groupKey"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).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: Member) -> MemberUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Email or immutable Id of the group. If Id, it should match with id of group object - /// - /// Sets the *group key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> MemberUpdateCall<'a, C, A> { - self._group_key = new_value.to_string(); - self - } - /// Email or immutable Id of the user. If Id, it should match with id of member object - /// - /// Sets the *member key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn member_key(mut self, new_value: &str) -> MemberUpdateCall<'a, C, A> { - self._member_key = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> MemberUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> MemberUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryGroup`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> MemberUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieve all members in a group (paginated) -/// -/// A builder for the *list* method supported by a *member* resource. -/// It is not used directly, but through a `MemberMethods` instance. +/// A builder for the *aliases.delete* method supported by a *group* resource. +/// It is not used directly, but through a `GroupMethods` instance. /// /// # Example /// @@ -9064,558 +10515,24 @@ impl<'a, C, A> MemberUpdateCall<'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.members().list("groupKey") -/// .roles("sed") -/// .page_token("dolor") -/// .max_results(-48) +/// let result = hub.groups().aliases_delete("groupKey", "alias") /// .doit(); /// # } /// ``` -pub struct MemberListCall<'a, C, A> +pub struct GroupAliaseDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, _group_key: String, - _roles: Option, - _page_token: Option, - _max_results: Option, + _alias: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for MemberListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for GroupAliaseDeleteCall<'a, C, A> {} -impl<'a, C, A> MemberListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Members)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.members.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("groupKey", self._group_key.to_string())); - if let Some(value) = self._roles { - params.push(("roles", 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", "groupKey", "roles", "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() + "groups/{groupKey}/members"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryGroupMemberReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["groupKey"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Email or immutable Id of the group - /// - /// Sets the *group key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> MemberListCall<'a, C, A> { - self._group_key = new_value.to_string(); - self - } - /// Comma separated role values to filter list results on. - /// - /// Sets the *roles* query property to the given value. - pub fn roles(mut self, new_value: &str) -> MemberListCall<'a, C, A> { - self._roles = Some(new_value.to_string()); - self - } - /// Token to specify next page in the list - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> MemberListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum number of results to return. Default is 200 - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: i32) -> MemberListCall<'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) -> MemberListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> MemberListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryGroupMemberReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> MemberListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieve Group Member -/// -/// A builder for the *get* method supported by a *member* resource. -/// It is not used directly, but through a `MemberMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.members().get("groupKey", "memberKey") -/// .doit(); -/// # } -/// ``` -pub struct MemberGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _group_key: String, - _member_key: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for MemberGetCall<'a, C, A> {} - -impl<'a, C, A> MemberGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Member)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.members.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("groupKey", self._group_key.to_string())); - params.push(("memberKey", self._member_key.to_string())); - for &field in ["alt", "groupKey", "memberKey"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryGroupMemberReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{groupKey}", "groupKey"), ("{memberKey}", "memberKey")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["memberKey", "groupKey"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Email or immutable Id of the group - /// - /// Sets the *group key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> MemberGetCall<'a, C, A> { - self._group_key = new_value.to_string(); - self - } - /// Email or immutable Id of the member - /// - /// Sets the *member key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn member_key(mut self, new_value: &str) -> MemberGetCall<'a, C, A> { - self._member_key = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> MemberGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> MemberGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryGroupMemberReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> MemberGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Remove membership. -/// -/// A builder for the *delete* method supported by a *member* resource. -/// It is not used directly, but through a `MemberMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.members().delete("groupKey", "memberKey") -/// .doit(); -/// # } -/// ``` -pub struct MemberDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _group_key: String, - _member_key: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for MemberDeleteCall<'a, C, A> {} - -impl<'a, C, A> MemberDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> GroupAliaseDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -9627,12 +10544,12 @@ impl<'a, C, A> MemberDeleteCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "directory.members.delete", + dlg.begin(MethodInfo { id: "directory.groups.aliases.delete", http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); params.push(("groupKey", self._group_key.to_string())); - params.push(("memberKey", self._member_key.to_string())); - for &field in ["groupKey", "memberKey"].iter() { + params.push(("alias", self._alias.to_string())); + for &field in ["groupKey", "alias"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9643,12 +10560,12 @@ impl<'a, C, A> MemberDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/aliases/{alias}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{groupKey}", "groupKey"), ("{memberKey}", "memberKey")].iter() { + for &(find_this, param_name) in [("{groupKey}", "groupKey"), ("{alias}", "alias")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -9660,7 +10577,7 @@ impl<'a, C, A> MemberDeleteCall<'a, C, A> where C: BorrowMut, A: } { let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["memberKey", "groupKey"].iter() { + for param_name in ["alias", "groupKey"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -9736,24 +10653,24 @@ impl<'a, C, A> MemberDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// Email or immutable Id of the group + /// Email or immutable ID of the group /// /// Sets the *group key* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> MemberDeleteCall<'a, C, A> { + pub fn group_key(mut self, new_value: &str) -> GroupAliaseDeleteCall<'a, C, A> { self._group_key = new_value.to_string(); self } - /// Email or immutable Id of the member + /// The alias to be removed /// - /// Sets the *member key* path property to the given value. + /// Sets the *alias* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn member_key(mut self, new_value: &str) -> MemberDeleteCall<'a, C, A> { - self._member_key = new_value.to_string(); + pub fn alias(mut self, new_value: &str) -> GroupAliaseDeleteCall<'a, C, A> { + self._alias = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -9762,7 +10679,7 @@ impl<'a, C, A> MemberDeleteCall<'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) -> MemberDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupAliaseDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -9783,7 +10700,7 @@ impl<'a, C, A> MemberDeleteCall<'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) -> MemberDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> GroupAliaseDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -9803,7 +10720,7 @@ impl<'a, C, A> MemberDeleteCall<'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) -> MemberDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> GroupAliaseDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -13020,10 +13937,10 @@ impl<'a, C, A> PrivilegeListCall<'a, C, A> where C: BorrowMut, A: } -/// Stop watching resources through this channel +/// Retrieves resolved app access settings of the logged in user. /// -/// A builder for the *stop* method supported by a *channel* resource. -/// It is not used directly, but through a `ChannelMethods` instance. +/// A builder for the *GetSettings* method supported by a *resolvedAppAccessSetting* resource. +/// It is not used directly, but through a `ResolvedAppAccessSettingMethods` instance. /// /// # Example /// @@ -13034,7 +13951,6 @@ impl<'a, C, A> PrivilegeListCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_admin1_directory as admin1_directory; -/// use admin1_directory::Channel; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -13045,35 +13961,28 @@ impl<'a, C, A> PrivilegeListCall<'a, C, A> where C: BorrowMut, A: /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::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 = Channel::default(); -/// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.channels().stop(req) +/// let result = hub.resolved_app_access_settings().get_settings() /// .doit(); /// # } /// ``` -pub struct ChannelStopCall<'a, C, A> +pub struct ResolvedAppAccessSettingGetSettingCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, - _request: Channel, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, - _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ChannelStopCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ResolvedAppAccessSettingGetSettingCall<'a, C, A> {} -impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ResolvedAppAccessSettingGetSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { + pub fn doit(mut self) -> Result<(hyper::client::Response, AppAccessCollections)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -13081,10 +13990,10 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "admin.channels.stop", - http_method: hyper::method::Method::Post }); + dlg.begin(MethodInfo { id: "directory.resolvedAppAccessSettings.GetSettings", + http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); - for &field in [].iter() { + for &field in ["alt"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -13094,10 +14003,20 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o params.push((&name, value.clone())); } + params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "/admin/directory_v1/channels/stop"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); + let mut url = self.hub._base_url.clone() + "resolvedappaccesssettings"; + + 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) + } } @@ -13106,42 +14025,13 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o url.push_str(&url::form_urlencoded::serialize(params)); } - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).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); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())); dlg.pre_request(); req.send() @@ -13172,7 +14062,17 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o Ok(serr) => Err(Error::BadRequest(serr)) } } - let result_value = 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) @@ -13182,22 +14082,13 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Channel) -> ChannelStopCall<'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) -> ChannelStopCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ResolvedAppAccessSettingGetSettingCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -13218,35 +14109,193 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ChannelStopCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ResolvedAppAccessSettingGetSettingCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self } - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryUser`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ChannelStopCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, +} + + +/// Retrieves the list of apps trusted by the admin of the logged in user. +/// +/// A builder for the *ListTrustedApps* method supported by a *resolvedAppAccessSetting* resource. +/// It is not used directly, but through a `ResolvedAppAccessSettingMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.resolved_app_access_settings().list_trusted_apps() +/// .doit(); +/// # } +/// ``` +pub struct ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> {} + +impl<'a, C, A> ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TrustedApps)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.resolvedAppAccessSettings.ListTrustedApps", + 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() + "trustedapps"; + + 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) + } + } + } + } + + + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> { + self._delegate = Some(new_value); self } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + } @@ -14351,6 +15400,236 @@ impl<'a, C, A> MobiledeviceActionCall<'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 = Channel::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.channels().stop(req) +/// .doit(); +/// # } +/// ``` +pub struct ChannelStopCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _request: Channel, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ChannelStopCall<'a, C, A> {} + +impl<'a, C, A> ChannelStopCall<'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: "admin.channels.stop", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + for &field in [].iter() { + if self._additional_params.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() + "/admin/directory_v1/channels/stop"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryUser.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 = 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: Channel) -> ChannelStopCall<'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) -> ChannelStopCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ChannelStopCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryUser`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ChannelStopCall<'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 an access token issued by a user. /// /// A builder for the *get* method supported by a *token* resource. @@ -16404,7 +17683,7 @@ impl<'a, C, A> ChromeosdeviceListCall<'a, C, A> where C: BorrowMut ChromeosdeviceListCall<'a, C, A> { @@ -17622,7 +18901,7 @@ impl<'a, C, A> ChromeosdeviceActionCall<'a, C, A> where C: BorrowMut ChromeosdeviceMoveDevicesToOuCall<'a, C, A> where C: BorrowMut ChromeosdeviceMoveDevicesToOuCall<'a, C, A> where C: BorrowMut ChromeosdeviceMoveDevicesToOuCall<'a, C, A> where C: BorrowMut +pub struct MemberHasMemberCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, _group_key: String, + _member_key: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for GroupDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for MemberHasMemberCall<'a, C, A> {} -impl<'a, C, A> GroupDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> MemberHasMemberCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { + pub fn doit(mut self) -> Result<(hyper::client::Response, MembersHasMember)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -17952,266 +19232,12 @@ impl<'a, C, A> GroupDeleteCall<'a, C, A> where C: BorrowMut, A: o Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "directory.groups.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); - params.push(("groupKey", self._group_key.to_string())); - for &field in ["groupKey"].iter() { - if self._additional_params.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() + "groups/{groupKey}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["groupKey"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_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) - } - } - } - } - - - /// Email or immutable Id of the group - /// - /// Sets the *group key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> GroupDeleteCall<'a, C, A> { - self._group_key = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> GroupDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryGroup`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> GroupDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieve all groups in a domain (paginated) -/// -/// A builder for the *list* method supported by a *group* resource. -/// It is not used directly, but through a `GroupMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.groups().list() -/// .user_key("kasd") -/// .page_token("invidunt") -/// .max_results(-15) -/// .domain("Lorem") -/// .customer("clita") -/// .doit(); -/// # } -/// ``` -pub struct GroupListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _user_key: Option, - _page_token: Option, - _max_results: Option, - _domain: Option, - _customer: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for GroupListCall<'a, C, A> {} - -impl<'a, C, A> GroupListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Groups)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.groups.list", + dlg.begin(MethodInfo { id: "directory.members.hasMember", 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._user_key { - params.push(("userKey", 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._domain { - params.push(("domain", value.to_string())); - } - if let Some(value) = self._customer { - params.push(("customer", value.to_string())); - } - for &field in ["alt", "userKey", "pageToken", "maxResults", "domain", "customer"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("groupKey", self._group_key.to_string())); + params.push(("memberKey", self._member_key.to_string())); + for &field in ["alt", "groupKey", "memberKey"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -18223,11 +19249,32 @@ impl<'a, C, A> GroupListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups"; + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/hasMember/{memberKey}"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryGroupReadonly.as_ref().to_string(), ()); + self._scopes.insert(Scope::DirectoryGroupMemberReadonly.as_ref().to_string(), ()); } + for &(find_this, param_name) in [("{groupKey}", "groupKey"), ("{memberKey}", "memberKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["memberKey", "groupKey"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } if params.len() > 0 { url.push('?'); @@ -18305,554 +19352,24 @@ impl<'a, C, A> GroupListCall<'a, C, A> where C: BorrowMut, A: oau } - /// Email or immutable Id of the user if only those groups are to be listed, the given user is a member of. If Id, it should match with id of user object - /// - /// Sets the *user key* query property to the given value. - pub fn user_key(mut self, new_value: &str) -> GroupListCall<'a, C, A> { - self._user_key = Some(new_value.to_string()); - self - } - /// Token to specify next page in the list - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> GroupListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum number of results to return. Default is 200 - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: i32) -> GroupListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Name of the domain. Fill this field to get groups from only this domain. To return all groups in a multi-domain fill customer field instead. - /// - /// Sets the *domain* query property to the given value. - pub fn domain(mut self, new_value: &str) -> GroupListCall<'a, C, A> { - self._domain = Some(new_value.to_string()); - self - } - /// Immutable ID of the G Suite account. In case of multi-domain, to fetch all groups for a customer, fill this field instead of domain. - /// - /// Sets the *customer* query property to the given value. - pub fn customer(mut self, new_value: &str) -> GroupListCall<'a, C, A> { - self._customer = 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) -> GroupListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> GroupListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryGroupReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> GroupListCall<'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 Group -/// -/// A builder for the *update* method supported by a *group* resource. -/// It is not used directly, but through a `GroupMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// use admin1_directory::Group; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::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 = 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.groups().update(req, "groupKey") -/// .doit(); -/// # } -/// ``` -pub struct GroupUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _request: Group, - _group_key: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for GroupUpdateCall<'a, C, A> {} - -impl<'a, C, A> GroupUpdateCall<'a, C, 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 std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.groups.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("groupKey", self._group_key.to_string())); - for &field in ["alt", "groupKey"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["groupKey"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).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) -> GroupUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Email or immutable Id of the group. If Id, it should match with id of group object + /// Email or immutable Id of the group /// /// Sets the *group key* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> GroupUpdateCall<'a, C, A> { + pub fn group_key(mut self, new_value: &str) -> MemberHasMemberCall<'a, C, A> { self._group_key = new_value.to_string(); self } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. + /// Email or immutable Id of the member /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> GroupUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryGroup`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> GroupUpdateCall<'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 Group -/// -/// A builder for the *insert* method supported by a *group* resource. -/// It is not used directly, but through a `GroupMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// use admin1_directory::Group; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::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 = 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.groups().insert(req) -/// .doit(); -/// # } -/// ``` -pub struct GroupInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _request: Group, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for GroupInsertCall<'a, C, A> {} - -impl<'a, C, A> GroupInsertCall<'a, C, 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 std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.groups.insert", - 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() + "groups"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryGroup.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. + /// Sets the *member key* path property to the given value. /// /// Even though 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) -> GroupInsertCall<'a, C, A> { - self._request = new_value; + pub fn member_key(mut self, new_value: &str) -> MemberHasMemberCall<'a, C, A> { + self._member_key = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -18861,7 +19378,7 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupInsertCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> MemberHasMemberCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -18882,7 +19399,7 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> GroupInsertCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> MemberHasMemberCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -18891,7 +19408,7 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryGroup`. + /// `Scope::DirectoryGroupMemberReadonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -18902,7 +19419,7 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> GroupInsertCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> MemberHasMemberCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -18914,10 +19431,10 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o } -/// Add a alias for the group +/// Add user to the specified group. /// -/// A builder for the *aliases.insert* method supported by a *group* resource. -/// It is not used directly, but through a `GroupMethods` instance. +/// A builder for the *insert* method supported by a *member* resource. +/// It is not used directly, but through a `MemberMethods` instance. /// /// # Example /// @@ -18928,7 +19445,7 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_admin1_directory as admin1_directory; -/// use admin1_directory::Alias; +/// use admin1_directory::Member; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -18942,33 +19459,33 @@ impl<'a, C, A> GroupInsertCall<'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 = Alias::default(); +/// let mut req = Member::default(); /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.groups().aliases_insert(req, "groupKey") +/// let result = hub.members().insert(req, "groupKey") /// .doit(); /// # } /// ``` -pub struct GroupAliaseInsertCall<'a, C, A> +pub struct MemberInsertCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, - _request: Alias, + _request: Member, _group_key: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for GroupAliaseInsertCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for MemberInsertCall<'a, C, A> {} -impl<'a, C, A> GroupAliaseInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> MemberInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Alias)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Member)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -18976,7 +19493,7 @@ impl<'a, C, A> GroupAliaseInsertCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "directory.groups.aliases.insert", + dlg.begin(MethodInfo { id: "directory.members.insert", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("groupKey", self._group_key.to_string())); @@ -18992,7 +19509,7 @@ impl<'a, C, A> GroupAliaseInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/aliases"; + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -19115,17 +19632,17 @@ impl<'a, C, A> GroupAliaseInsertCall<'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: Alias) -> GroupAliaseInsertCall<'a, C, A> { + pub fn request(mut self, new_value: Member) -> MemberInsertCall<'a, C, A> { self._request = new_value; self } - /// Email or immutable Id of the group + /// Email or immutable ID of the group /// /// Sets the *group key* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> GroupAliaseInsertCall<'a, C, A> { + pub fn group_key(mut self, new_value: &str) -> MemberInsertCall<'a, C, A> { self._group_key = new_value.to_string(); self } @@ -19135,7 +19652,7 @@ impl<'a, C, A> GroupAliaseInsertCall<'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) -> GroupAliaseInsertCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> MemberInsertCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -19156,7 +19673,7 @@ impl<'a, C, A> GroupAliaseInsertCall<'a, C, A> where C: BorrowMut /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> GroupAliaseInsertCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> MemberInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -19176,7 +19693,7 @@ impl<'a, C, A> GroupAliaseInsertCall<'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) -> GroupAliaseInsertCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> MemberInsertCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -19188,10 +19705,10 @@ impl<'a, C, A> GroupAliaseInsertCall<'a, C, A> where C: BorrowMut } -/// List all aliases for a group +/// Update membership of a user in the specified group. This method supports patch semantics. /// -/// A builder for the *aliases.list* method supported by a *group* resource. -/// It is not used directly, but through a `GroupMethods` instance. +/// A builder for the *patch* method supported by a *member* resource. +/// It is not used directly, but through a `MemberMethods` instance. /// /// # Example /// @@ -19202,493 +19719,7 @@ impl<'a, C, A> GroupAliaseInsertCall<'a, C, A> where C: BorrowMut /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_admin1_directory as admin1_directory; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.groups().aliases_list("groupKey") -/// .doit(); -/// # } -/// ``` -pub struct GroupAliaseListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _group_key: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for GroupAliaseListCall<'a, C, A> {} - -impl<'a, C, A> GroupAliaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Aliases)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.groups.aliases.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("groupKey", self._group_key.to_string())); - for &field in ["alt", "groupKey"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/aliases"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryGroupReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["groupKey"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Email or immutable Id of the group - /// - /// Sets the *group key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> GroupAliaseListCall<'a, C, A> { - self._group_key = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupAliaseListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> GroupAliaseListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryGroupReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> GroupAliaseListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieve Group -/// -/// A builder for the *get* method supported by a *group* resource. -/// It is not used directly, but through a `GroupMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.groups().get("groupKey") -/// .doit(); -/// # } -/// ``` -pub struct GroupGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _group_key: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for GroupGetCall<'a, C, A> {} - -impl<'a, C, A> GroupGetCall<'a, C, 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 std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.groups.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("groupKey", self._group_key.to_string())); - for &field in ["alt", "groupKey"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryGroupReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["groupKey"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Email or immutable Id of the group - /// - /// Sets the *group key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> GroupGetCall<'a, C, A> { - self._group_key = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> GroupGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryGroupReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> GroupGetCall<'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 Group. This method supports patch semantics. -/// -/// A builder for the *patch* method supported by a *group* resource. -/// It is not used directly, but through a `GroupMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// use admin1_directory::Group; +/// use admin1_directory::Member; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -19702,33 +19733,34 @@ impl<'a, C, A> GroupGetCall<'a, C, A> where C: BorrowMut, A: oaut /// // As the method needs a request, you would usually fill it with the desired information /// // into the 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(); +/// let mut req = Member::default(); /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.groups().patch(req, "groupKey") +/// let result = hub.members().patch(req, "groupKey", "memberKey") /// .doit(); /// # } /// ``` -pub struct GroupPatchCall<'a, C, A> +pub struct MemberPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, - _request: Group, + _request: Member, _group_key: String, + _member_key: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for GroupPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for MemberPatchCall<'a, C, A> {} -impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> MemberPatchCall<'a, C, 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)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Member)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -19736,11 +19768,12 @@ impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oa Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "directory.groups.patch", + dlg.begin(MethodInfo { id: "directory.members.patch", http_method: hyper::method::Method::Patch }); - 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(("groupKey", self._group_key.to_string())); - for &field in ["alt", "groupKey"].iter() { + params.push(("memberKey", self._member_key.to_string())); + for &field in ["alt", "groupKey", "memberKey"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -19752,12 +19785,12 @@ impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { + for &(find_this, param_name) in [("{groupKey}", "groupKey"), ("{memberKey}", "memberKey")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -19768,8 +19801,8 @@ impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oa 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 ["groupKey"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["memberKey", "groupKey"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -19875,27 +19908,37 @@ impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oa /// /// Even though 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) -> GroupPatchCall<'a, C, A> { + pub fn request(mut self, new_value: Member) -> MemberPatchCall<'a, C, A> { self._request = new_value; self } - /// Email or immutable Id of the group. If Id, it should match with id of group object + /// Email or immutable ID of the group. If ID, it should match with id of group object /// /// Sets the *group key* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> GroupPatchCall<'a, C, A> { + pub fn group_key(mut self, new_value: &str) -> MemberPatchCall<'a, C, A> { self._group_key = new_value.to_string(); self } + /// Email or immutable ID of the user. If ID, it should match with id of member object + /// + /// Sets the *member key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn member_key(mut self, new_value: &str) -> MemberPatchCall<'a, C, A> { + self._member_key = new_value.to_string(); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> GroupPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> MemberPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -19916,7 +19959,7 @@ impl<'a, C, A> GroupPatchCall<'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) -> GroupPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> MemberPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -19936,7 +19979,7 @@ impl<'a, C, A> GroupPatchCall<'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) -> GroupPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> MemberPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -19948,10 +19991,296 @@ impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oa } -/// Remove a alias for the group +/// Update membership of a user in the specified group. /// -/// A builder for the *aliases.delete* method supported by a *group* resource. -/// It is not used directly, but through a `GroupMethods` instance. +/// A builder for the *update* method supported by a *member* resource. +/// It is not used directly, but through a `MemberMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// use admin1_directory::Member; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::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 = Member::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.members().update(req, "groupKey", "memberKey") +/// .doit(); +/// # } +/// ``` +pub struct MemberUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _request: Member, + _group_key: String, + _member_key: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MemberUpdateCall<'a, C, A> {} + +impl<'a, C, A> MemberUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Member)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.members.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("groupKey", self._group_key.to_string())); + params.push(("memberKey", self._member_key.to_string())); + for &field in ["alt", "groupKey", "memberKey"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{groupKey}", "groupKey"), ("{memberKey}", "memberKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["memberKey", "groupKey"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: Member) -> MemberUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Email or immutable ID of the group. If ID, it should match with id of group object + /// + /// Sets the *group key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn group_key(mut self, new_value: &str) -> MemberUpdateCall<'a, C, A> { + self._group_key = new_value.to_string(); + self + } + /// Email or immutable ID of the user. If ID, it should match with id of member object + /// + /// Sets the *member key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn member_key(mut self, new_value: &str) -> MemberUpdateCall<'a, C, A> { + self._member_key = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> MemberUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> MemberUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryGroup`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MemberUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieve all members in a group (paginated) +/// +/// A builder for the *list* method supported by a *member* resource. +/// It is not used directly, but through a `MemberMethods` instance. /// /// # Example /// @@ -19975,28 +20304,33 @@ impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oa /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.groups().aliases_delete("groupKey", "alias") +/// let result = hub.members().list("groupKey") +/// .roles("At") +/// .page_token("consetetur") +/// .max_results(-22) /// .doit(); /// # } /// ``` -pub struct GroupAliaseDeleteCall<'a, C, A> +pub struct MemberListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, _group_key: String, - _alias: String, + _roles: Option, + _page_token: Option, + _max_results: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for GroupAliaseDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for MemberListCall<'a, C, A> {} -impl<'a, C, A> GroupAliaseDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> MemberListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { + pub fn doit(mut self) -> Result<(hyper::client::Response, Members)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -20004,12 +20338,20 @@ impl<'a, C, A> GroupAliaseDeleteCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "directory.groups.aliases.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "directory.members.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("groupKey", self._group_key.to_string())); - params.push(("alias", self._alias.to_string())); - for &field in ["groupKey", "alias"].iter() { + if let Some(value) = self._roles { + params.push(("roles", 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", "groupKey", "roles", "pageToken", "maxResults"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -20019,13 +20361,280 @@ impl<'a, C, A> GroupAliaseDeleteCall<'a, C, A> where C: BorrowMut params.push((&name, value.clone())); } + params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/aliases/{alias}"; + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); + self._scopes.insert(Scope::DirectoryGroupMemberReadonly.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{groupKey}", "groupKey"), ("{alias}", "alias")].iter() { + for &(find_this, param_name) in [("{groupKey}", "groupKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["groupKey"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Email or immutable ID of the group + /// + /// Sets the *group key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn group_key(mut self, new_value: &str) -> MemberListCall<'a, C, A> { + self._group_key = new_value.to_string(); + self + } + /// Comma separated role values to filter list results on. + /// + /// Sets the *roles* query property to the given value. + pub fn roles(mut self, new_value: &str) -> MemberListCall<'a, C, A> { + self._roles = Some(new_value.to_string()); + self + } + /// Token to specify next page in the list + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> MemberListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. Default is 200 + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> MemberListCall<'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) -> MemberListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> MemberListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryGroupMemberReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MemberListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieve Group Member +/// +/// A builder for the *get* method supported by a *member* resource. +/// It is not used directly, but through a `MemberMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.members().get("groupKey", "memberKey") +/// .doit(); +/// # } +/// ``` +pub struct MemberGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _group_key: String, + _member_key: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MemberGetCall<'a, C, A> {} + +impl<'a, C, A> MemberGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Member)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.members.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("groupKey", self._group_key.to_string())); + params.push(("memberKey", self._member_key.to_string())); + for &field in ["alt", "groupKey", "memberKey"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryGroupMemberReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{groupKey}", "groupKey"), ("{memberKey}", "memberKey")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -20037,7 +20646,261 @@ impl<'a, C, A> GroupAliaseDeleteCall<'a, C, A> where C: BorrowMut } { let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["alias", "groupKey"].iter() { + for param_name in ["memberKey", "groupKey"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Email or immutable ID of the group + /// + /// Sets the *group key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn group_key(mut self, new_value: &str) -> MemberGetCall<'a, C, A> { + self._group_key = new_value.to_string(); + self + } + /// Email or immutable ID of the member + /// + /// Sets the *member key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn member_key(mut self, new_value: &str) -> MemberGetCall<'a, C, A> { + self._member_key = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> MemberGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> MemberGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryGroupMemberReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MemberGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Remove membership. +/// +/// A builder for the *delete* method supported by a *member* resource. +/// It is not used directly, but through a `MemberMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.members().delete("groupKey", "memberKey") +/// .doit(); +/// # } +/// ``` +pub struct MemberDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _group_key: String, + _member_key: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MemberDeleteCall<'a, C, A> {} + +impl<'a, C, A> MemberDeleteCall<'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.members.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("groupKey", self._group_key.to_string())); + params.push(("memberKey", self._member_key.to_string())); + for &field in ["groupKey", "memberKey"].iter() { + if self._additional_params.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() + "groups/{groupKey}/members/{memberKey}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{groupKey}", "groupKey"), ("{memberKey}", "memberKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["memberKey", "groupKey"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -20113,24 +20976,24 @@ impl<'a, C, A> GroupAliaseDeleteCall<'a, C, A> where C: BorrowMut } - /// Email or immutable Id of the group + /// Email or immutable ID of the group /// /// Sets the *group key* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn group_key(mut self, new_value: &str) -> GroupAliaseDeleteCall<'a, C, A> { + pub fn group_key(mut self, new_value: &str) -> MemberDeleteCall<'a, C, A> { self._group_key = new_value.to_string(); self } - /// The alias to be removed + /// Email or immutable ID of the member /// - /// Sets the *alias* path property to the given value. + /// Sets the *member key* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn alias(mut self, new_value: &str) -> GroupAliaseDeleteCall<'a, C, A> { - self._alias = new_value.to_string(); + pub fn member_key(mut self, new_value: &str) -> MemberDeleteCall<'a, C, A> { + self._member_key = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -20139,7 +21002,7 @@ impl<'a, C, A> GroupAliaseDeleteCall<'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) -> GroupAliaseDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> MemberDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -20160,7 +21023,7 @@ impl<'a, C, A> GroupAliaseDeleteCall<'a, C, A> where C: BorrowMut /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> GroupAliaseDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> MemberDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -20180,7 +21043,7 @@ impl<'a, C, A> GroupAliaseDeleteCall<'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) -> GroupAliaseDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> MemberDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -20219,7 +21082,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", -43) +/// let result = hub.asps().get("userKey", -15) /// .doit(); /// # } /// ``` @@ -20474,7 +21337,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", -15) +/// let result = hub.asps().delete("userKey", -50) /// .doit(); /// # } /// ``` @@ -22224,261 +23087,6 @@ impl<'a, C, A> DomainAliaseInsertCall<'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); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.domain_aliases().get("customer", "domainAliasName") -/// .doit(); -/// # } -/// ``` -pub struct DomainAliaseGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _customer: String, - _domain_alias_name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DomainAliaseGetCall<'a, C, A> {} - -impl<'a, C, A> DomainAliaseGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DomainAlias)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.domainAliases.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("customer", self._customer.to_string())); - params.push(("domainAliasName", self._domain_alias_name.to_string())); - for &field in ["alt", "customer", "domainAliasName"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "customer/{customer}/domainaliases/{domainAliasName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{customer}", "customer"), ("{domainAliasName}", "domainAliasName")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["domainAliasName", "customer"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Immutable ID of the G Suite account. - /// - /// Sets the *customer* path property to 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(mut self, new_value: &str) -> DomainAliaseGetCall<'a, C, A> { - self._customer = new_value.to_string(); - self - } - /// Name of domain alias to be retrieved. - /// - /// Sets the *domain alias 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 domain_alias_name(mut self, new_value: &str) -> DomainAliaseGetCall<'a, C, A> { - self._domain_alias_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) -> DomainAliaseGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DomainAliaseGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryDomainReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DomainAliaseGetCall<'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 aliases of the customer. /// /// A builder for the *list* method supported by a *domainAliase* resource. @@ -22734,6 +23342,261 @@ impl<'a, C, A> DomainAliaseListCall<'a, C, A> where C: BorrowMut, } +/// Retrieves a domain alias of the customer. +/// +/// A builder for the *get* method supported by a *domainAliase* resource. +/// It is not used directly, but through a `DomainAliaseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.domain_aliases().get("customer", "domainAliasName") +/// .doit(); +/// # } +/// ``` +pub struct DomainAliaseGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _customer: String, + _domain_alias_name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DomainAliaseGetCall<'a, C, A> {} + +impl<'a, C, A> DomainAliaseGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DomainAlias)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.domainAliases.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("customer", self._customer.to_string())); + params.push(("domainAliasName", self._domain_alias_name.to_string())); + for &field in ["alt", "customer", "domainAliasName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "customer/{customer}/domainaliases/{domainAliasName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{customer}", "customer"), ("{domainAliasName}", "domainAliasName")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["domainAliasName", "customer"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Immutable ID of the G Suite account. + /// + /// Sets the *customer* path property to 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(mut self, new_value: &str) -> DomainAliaseGetCall<'a, C, A> { + self._customer = new_value.to_string(); + self + } + /// Name of domain alias to be retrieved. + /// + /// Sets the *domain alias 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 domain_alias_name(mut self, new_value: &str) -> DomainAliaseGetCall<'a, C, A> { + self._domain_alias_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) -> DomainAliaseGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DomainAliaseGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryDomainReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DomainAliaseGetCall<'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 Domain Alias of the customer. /// /// A builder for the *delete* method supported by a *domainAliase* resource. @@ -23164,7 +24027,7 @@ impl<'a, C, A> SchemaGetCall<'a, C, A> where C: BorrowMut, A: oau self._customer_id = new_value.to_string(); self } - /// Name or immutable Id of the schema + /// Name or immutable ID of the schema /// /// Sets the *schema key* path property to the given value. /// @@ -23450,7 +24313,7 @@ impl<'a, C, A> SchemaUpdateCall<'a, C, A> where C: BorrowMut, A: self._customer_id = new_value.to_string(); self } - /// Name or immutable Id of the schema. + /// Name or immutable ID of the schema. /// /// Sets the *schema key* path property to the given value. /// @@ -23979,7 +24842,7 @@ impl<'a, C, A> SchemaPatchCall<'a, C, A> where C: BorrowMut, A: o self._customer_id = new_value.to_string(); self } - /// Name or immutable Id of the schema. + /// Name or immutable ID of the schema. /// /// Sets the *schema key* path property to the given value. /// @@ -24048,250 +24911,6 @@ impl<'a, C, A> SchemaPatchCall<'a, C, A> where C: BorrowMut, A: o } -/// Delete schema -/// -/// A builder for the *delete* method supported by a *schema* resource. -/// It is not used directly, but through a `SchemaMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.schemas().delete("customerId", "schemaKey") -/// .doit(); -/// # } -/// ``` -pub struct SchemaDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _customer_id: String, - _schema_key: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for SchemaDeleteCall<'a, C, A> {} - -impl<'a, C, A> SchemaDeleteCall<'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.schemas.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("customerId", self._customer_id.to_string())); - params.push(("schemaKey", self._schema_key.to_string())); - for &field in ["customerId", "schemaKey"].iter() { - if self._additional_params.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}/schemas/{schemaKey}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryUserschema.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{customerId}", "customerId"), ("{schemaKey}", "schemaKey")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["schemaKey", "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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_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) - } - } - } - } - - - /// 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) -> SchemaDeleteCall<'a, C, A> { - self._customer_id = new_value.to_string(); - self - } - /// Name or immutable Id of the schema - /// - /// Sets the *schema key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn schema_key(mut self, new_value: &str) -> SchemaDeleteCall<'a, C, A> { - self._schema_key = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> SchemaDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> SchemaDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryUserschema`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SchemaDeleteCall<'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 schema. /// /// A builder for the *insert* method supported by a *schema* resource. @@ -24566,6 +25185,250 @@ impl<'a, C, A> SchemaInsertCall<'a, C, A> where C: BorrowMut, A: } +/// Delete schema +/// +/// A builder for the *delete* method supported by a *schema* resource. +/// It is not used directly, but through a `SchemaMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.schemas().delete("customerId", "schemaKey") +/// .doit(); +/// # } +/// ``` +pub struct SchemaDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _customer_id: String, + _schema_key: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SchemaDeleteCall<'a, C, A> {} + +impl<'a, C, A> SchemaDeleteCall<'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.schemas.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("customerId", self._customer_id.to_string())); + params.push(("schemaKey", self._schema_key.to_string())); + for &field in ["customerId", "schemaKey"].iter() { + if self._additional_params.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}/schemas/{schemaKey}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryUserschema.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{customerId}", "customerId"), ("{schemaKey}", "schemaKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["schemaKey", "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)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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) + } + } + } + } + + + /// 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) -> SchemaDeleteCall<'a, C, A> { + self._customer_id = new_value.to_string(); + self + } + /// Name or immutable ID of the schema + /// + /// Sets the *schema key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn schema_key(mut self, new_value: &str) -> SchemaDeleteCall<'a, C, A> { + self._schema_key = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> SchemaDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SchemaDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryUserschema`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SchemaDeleteCall<'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 calendar resources for an account. /// /// A builder for the *calendars.list* method supported by a *resource* resource. @@ -24594,8 +25457,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("dolor") -/// .max_results(-58) +/// .page_token("et") +/// .max_results(-91) /// .doit(); /// # } /// ``` @@ -25362,7 +26225,9 @@ impl<'a, C, A> ResourceCalendarInsertCall<'a, C, A> where C: BorrowMut ResourceCalendarPatchCall<'a, C, A> where C: BorrowMut UserPhotoDeleteCall<'a, C, A> where C: BorrowMut, } - /// Email or immutable Id of the user + /// Email or immutable ID of the user /// /// Sets the *user key* path property to the given value. /// @@ -26878,7 +27745,7 @@ impl<'a, C, A> UserPhotoPatchCall<'a, C, A> where C: BorrowMut, A self._request = new_value; self } - /// Email or immutable Id of the user + /// Email or immutable ID of the user /// /// Sets the *user key* path property to the given value. /// @@ -27188,292 +28055,6 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa } -/// Watch for changes in user aliases list -/// -/// A builder for the *aliases.watch* method supported by a *user* resource. -/// It is not used directly, but through a `UserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// use admin1_directory::Channel; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::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 = Channel::default(); -/// -/// // You can configure optional parameters by calling 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().aliases_watch(req, "userKey") -/// .event("At") -/// .doit(); -/// # } -/// ``` -pub struct UserAliaseWatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _request: Channel, - _user_key: String, - _event: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UserAliaseWatchCall<'a, C, A> {} - -impl<'a, C, A> UserAliaseWatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Channel)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.users.aliases.watch", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("userKey", self._user_key.to_string())); - if let Some(value) = self._event { - params.push(("event", value.to_string())); - } - for &field in ["alt", "userKey", "event"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases/watch"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{userKey}", "userKey")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["userKey"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).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: Channel) -> UserAliaseWatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Email or immutable Id of the user - /// - /// Sets the *user key* path property to 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_key(mut self, new_value: &str) -> UserAliaseWatchCall<'a, C, A> { - self._user_key = new_value.to_string(); - self - } - /// Event on which subscription is intended (if subscribing) - /// - /// Sets the *event* query property to the given value. - pub fn event(mut self, new_value: &str) -> UserAliaseWatchCall<'a, C, A> { - self._event = 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) -> UserAliaseWatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserAliaseWatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryUser`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserAliaseWatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Add a photo for the user /// /// A builder for the *photos.update* method supported by a *user* resource. @@ -27679,7 +28260,7 @@ impl<'a, C, A> UserPhotoUpdateCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// Email or immutable Id of the user + /// Email or immutable ID of the user /// /// Sets the *user key* path property to the given value. /// @@ -28338,7 +28919,7 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa self._request = new_value; self } - /// Email or immutable Id of the user. If Id, it should match with id of user object + /// Email or immutable ID of the user. If ID, it should match with id of user object /// /// Sets the *user key* path property to the given value. /// @@ -28581,7 +29162,7 @@ impl<'a, C, A> UserPhotoGetCall<'a, C, A> where C: BorrowMut, A: } - /// Email or immutable Id of the user + /// Email or immutable ID of the user /// /// Sets the *user key* path property to the given value. /// @@ -29193,7 +29774,7 @@ impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth } - /// Email or immutable Id of the user + /// Email or immutable ID of the user /// /// Sets the *user key* path property to the given value. /// @@ -29488,7 +30069,7 @@ impl<'a, C, A> UserAliaseInsertCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// Email or immutable Id of the user + /// Email or immutable ID of the user /// /// Sets the *user key* path property to the given value. /// @@ -29736,7 +30317,7 @@ impl<'a, C, A> UserAliaseListCall<'a, C, A> where C: BorrowMut, A } - /// Email or immutable Id of the user + /// Email or immutable ID of the user /// /// Sets the *user key* path property to the given value. /// @@ -30006,7 +30587,7 @@ impl<'a, C, A> UserMakeAdminCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Email or immutable Id of the user as admin + /// Email or immutable ID of the user as admin /// /// Sets the *user key* path property to the given value. /// @@ -30280,7 +30861,7 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau self._request = new_value; self } - /// Email or immutable Id of the user. If Id, it should match with id of user object + /// Email or immutable ID of the user. If ID, it should match with id of user object /// /// Sets the *user key* path property to the given value. /// @@ -30514,7 +31095,7 @@ impl<'a, C, A> UserAliaseDeleteCall<'a, C, A> where C: BorrowMut, } - /// Email or immutable Id of the user + /// Email or immutable ID of the user /// /// Sets the *user key* path property to the given value. /// @@ -30593,6 +31174,292 @@ impl<'a, C, A> UserAliaseDeleteCall<'a, C, A> where C: BorrowMut, } +/// Watch for changes in user aliases list +/// +/// A builder for the *aliases.watch* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// use admin1_directory::Channel; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::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 = Channel::default(); +/// +/// // You can configure optional parameters by calling 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().aliases_watch(req, "userKey") +/// .event("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct UserAliaseWatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _request: Channel, + _user_key: String, + _event: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserAliaseWatchCall<'a, C, A> {} + +impl<'a, C, A> UserAliaseWatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Channel)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.users.aliases.watch", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("userKey", self._user_key.to_string())); + if let Some(value) = self._event { + params.push(("event", value.to_string())); + } + for &field in ["alt", "userKey", "event"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases/watch"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{userKey}", "userKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["userKey"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: Channel) -> UserAliaseWatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Email or immutable ID of the user + /// + /// Sets the *user key* path property to 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_key(mut self, new_value: &str) -> UserAliaseWatchCall<'a, C, A> { + self._user_key = new_value.to_string(); + self + } + /// Event on which subscription is intended (if subscribing) + /// + /// Sets the *event* query property to the given value. + pub fn event(mut self, new_value: &str) -> UserAliaseWatchCall<'a, C, A> { + self._event = 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) -> UserAliaseWatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserAliaseWatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryUser`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserAliaseWatchCall<'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 user /// /// A builder for the *delete* method supported by a *user* resource. @@ -30756,7 +31623,7 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - /// Email or immutable Id of the user + /// Email or immutable ID of the user /// /// Sets the *user key* path property to the given value. /// diff --git a/gen/admin1_reports-cli/Cargo.toml b/gen/admin1_reports-cli/Cargo.toml index 80506bd538..9259503ec8 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+20170622" +version = "1.0.6+20171204" 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+20170622" +version = "1.0.6+20171204" diff --git a/gen/admin1_reports-cli/README.md b/gen/admin1_reports-cli/README.md index 5657a41e5b..825d8f3890 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 *20170622*. The CLI is at version *1.0.6*. +This documentation was generated from the *reports* API at revision *20171204*. The CLI is at version *1.0.6*. ```bash admin1-reports [options] @@ -36,6 +36,8 @@ admin1-reports [options] stop (-r )... [-p ]... customer-usage-reports get [-p ]... [-o ] + entity-usage-reports + get [-p ]... [-o ] user-usage-report get [-p ]... [-o ] admin1-reports --help diff --git a/gen/admin1_reports-cli/mkdocs.yml b/gen/admin1_reports-cli/mkdocs.yml index a09181ec5b..b2e33623d8 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+20170622 +site_name: reports v1.0.6+20171204 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) @@ -13,6 +13,7 @@ pages: - ['activities_watch.md', 'Activities', 'Watch'] - ['channels_stop.md', 'Channels', 'Stop'] - ['customer-usage-reports_get.md', 'Customer Usage Reports', 'Get'] +- ['entity-usage-reports_get.md', 'Entity Usage Reports', 'Get'] - ['user-usage-report_get.md', 'User Usage Report', 'Get'] theme: readthedocs diff --git a/gen/admin1_reports-cli/src/main.rs b/gen/admin1_reports-cli/src/main.rs index 342bc4d87b..9ea601a8a4 100644 --- a/gen/admin1_reports-cli/src/main.rs +++ b/gen/admin1_reports-cli/src/main.rs @@ -390,6 +390,74 @@ impl<'n> Engine<'n> { } } + fn _entity_usage_reports_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.entity_usage_reports().get(opt.value_of("entity-type").unwrap_or(""), opt.value_of("entity-key").unwrap_or(""), opt.value_of("date").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "parameters" => { + call = call.parameters(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")); + }, + "filters" => { + call = call.filters(value.unwrap_or("")); + }, + "customer-id" => { + call = call.customer_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(["page-token", "filters", "max-results", "parameters", "customer-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 _user_usage_report_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.user_usage_report().get(opt.value_of("user-key").unwrap_or(""), opt.value_of("date").unwrap_or("")); @@ -499,6 +567,17 @@ impl<'n> Engine<'n> { } } }, + ("entity-usage-reports", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._entity_usage_reports_get(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("entity-usage-reports".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("user-usage-report", Some(opt)) => { match opt.subcommand() { ("get", Some(opt)) => { @@ -701,6 +780,43 @@ fn main() { ]), ]), + ("entity-usage-reports", "methods: 'get'", vec![ + ("get", + Some(r##"Retrieves a report which is a collection of properties / statistics for a set of objects."##), + "Details at http://byron.github.io/google-apis-rs/google_admin1_reports_cli/entity-usage-reports_get", + vec![ + (Some(r##"entity-type"##), + None, + Some(r##"Type of object. Should be one of - gplus_communities."##), + Some(true), + Some(false)), + + (Some(r##"entity-key"##), + None, + Some(r##"Represents the key of object for which the data should be filtered."##), + Some(true), + Some(false)), + + (Some(r##"date"##), + None, + Some(r##"Represents the date in yyyy-mm-dd format for which the data is to be fetched."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-usage-report", "methods: 'get'", vec![ ("get", Some(r##"Retrieves a report which is a collection of properties / statistics for a set of users."##), @@ -736,7 +852,7 @@ fn main() { let mut app = App::new("admin1-reports") .author("Sebastian Thiel ") - .version("1.0.6+20170622") + .version("1.0.6+20171204") .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 efe16cbbfa..5d65cbe1eb 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+20170622" +version = "1.0.6+20171204" 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+20170622" +documentation = "https://docs.rs/google-admin1_reports/1.0.6+20171204" license = "MIT" keywords = ["admin", "google", "protocol", "web", "api"] diff --git a/gen/admin1_reports/README.md b/gen/admin1_reports/README.md index a8833c3d22..4b3b6e9c8b 100644 --- a/gen/admin1_reports/README.md +++ b/gen/admin1_reports/README.md @@ -5,28 +5,30 @@ 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+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*. +This documentation was generated from *reports* crate version *1.0.6+20171204*, where *20171204* 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+20170622/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+20171204/google_admin1_reports/struct.Reports.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) +* [activities](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/struct.Activity.html) + * [*list*](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/struct.ActivityListCall.html) and [*watch*](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/struct.ActivityWatchCall.html) +* [channels](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/struct.Channel.html) + * [*stop*](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/struct.ChannelStopCall.html) * customer usage reports - * [*get*](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.CustomerUsageReportGetCall.html) + * [*get*](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/struct.CustomerUsageReportGetCall.html) +* entity usage reports + * [*get*](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/struct.EntityUsageReportGetCall.html) * user usage report - * [*get*](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.UserUsageReportGetCall.html) + * [*get*](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/struct.UserUsageReportGetCall.html) Subscription supported by ... -* [*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) +* [*list activities*](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/struct.ActivityListCall.html) +* [*watch activities*](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/struct.ActivityWatchCall.html) @@ -34,17 +36,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-admin1_reports/1.0.6+20170622/google_admin1_reports/struct.Reports.html)** +* **[Hub](https://docs.rs/google-admin1_reports/1.0.6+20171204/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+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)** + * creates [*Method Builders*](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-admin1_reports/1.0.6+20171204/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+20170622/google_admin1_reports/trait.Part.html)** + * **[Parts](https://docs.rs/google-admin1_reports/1.0.6+20171204/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+20170622/google_admin1_reports/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-admin1_reports/1.0.6+20171204/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. @@ -58,8 +60,9 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.activities().watch(...).doit() -let r = hub.channels().stop(...).doit() +let r = hub.user_usage_report().get(...).doit() +let r = hub.entity_usage_reports().get(...).doit() +let r = hub.customer_usage_reports().get(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -85,7 +88,6 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_admin1_reports as admin1_reports; -use admin1_reports::Channel; use admin1_reports::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -103,23 +105,15 @@ let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), ::default(), None); let mut hub = Reports::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -// As the method needs a request, you would usually fill it with the desired information -// into the respective structure. Some of the parts shown here might not be applicable ! -// Values shown here are possibly random and not representative ! -let mut req = Channel::default(); - // You can configure optional parameters by calling the respective setters at will, and // execute the final call using `doit()`. // Values shown here are possibly random and not representative ! -let result = hub.activities().watch(req, "userKey", "applicationName") - .start_time("Stet") - .page_token("sed") - .max_results(-85) - .filters("dolores") - .event_name("kasd") - .end_time("accusam") - .customer_id("takimata") - .actor_ip_address("justo") +let result = hub.entity_usage_reports().get("entityType", "entityKey", "date") + .parameters("sed") + .page_token("et") + .max_results(83) + .filters("kasd") + .customer_id("accusam") .doit(); match result { @@ -142,17 +136,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+20170622/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+20171204/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+20170622/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+20171204/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+20170622/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+20171204/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+20170622/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+20171204/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 +156,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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-admin1_reports/1.0.6+20171204/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+20170622/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+20171204/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-admin1_reports/1.0.6+20171204/google_admin1_reports/trait.RequestValue.html) and +[decodable](https://docs.rs/google-admin1_reports/1.0.6+20171204/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+20170622/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+20171204/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+20170622/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+20171204/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+20170622/google_admin1_reports/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-admin1_reports/1.0.6+20171204/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 49beb6b238..1710f405d3 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+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*. +//! This documentation was generated from *reports* crate version *1.0.6+20171204*, where *20171204* 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/). @@ -17,14 +17,16 @@ //! * [*stop*](struct.ChannelStopCall.html) //! * customer usage reports //! * [*get*](struct.CustomerUsageReportGetCall.html) +//! * entity usage reports +//! * [*get*](struct.EntityUsageReportGetCall.html) //! * user usage report //! * [*get*](struct.UserUsageReportGetCall.html) //! //! //! Subscription supported by ... //! -//! * [*watch activities*](struct.ActivityWatchCall.html) //! * [*list activities*](struct.ActivityListCall.html) +//! * [*watch activities*](struct.ActivityWatchCall.html) //! //! //! @@ -58,8 +60,9 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.activities().watch(...).doit() -//! let r = hub.channels().stop(...).doit() +//! let r = hub.user_usage_report().get(...).doit() +//! let r = hub.entity_usage_reports().get(...).doit() +//! let r = hub.customer_usage_reports().get(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -85,7 +88,6 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_admin1_reports as admin1_reports; -//! use admin1_reports::Channel; //! use admin1_reports::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -104,23 +106,15 @@ //! hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), //! ::default(), None); //! let mut hub = Reports::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -//! // As the method needs a request, you would usually fill it with the desired information -//! // into the respective structure. Some of the parts shown here might not be applicable ! -//! // Values shown here are possibly random and not representative ! -//! let mut req = Channel::default(); -//! //! // You can configure optional parameters by calling the respective setters at will, and //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! -//! let result = hub.activities().watch(req, "userKey", "applicationName") -//! .start_time("labore") -//! .page_token("sea") -//! .max_results(-90) -//! .filters("dolores") -//! .event_name("gubergren") -//! .end_time("sadipscing") -//! .customer_id("aliquyam") -//! .actor_ip_address("ea") +//! let result = hub.entity_usage_reports().get("entityType", "entityKey", "date") +//! .parameters("erat") +//! .page_token("labore") +//! .max_results(92) +//! .filters("nonumy") +//! .customer_id("dolores") //! .doit(); //! //! match result { @@ -282,7 +276,6 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_admin1_reports as admin1_reports; -/// use admin1_reports::Channel; /// use admin1_reports::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -301,23 +294,15 @@ impl Default for Scope { /// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// ::default(), None); /// let mut hub = Reports::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = Channel::default(); -/// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.activities().watch(req, "userKey", "applicationName") -/// .start_time("justo") -/// .page_token("et") -/// .max_results(-17) -/// .filters("diam") -/// .event_name("ipsum") -/// .end_time("Lorem") +/// let result = hub.entity_usage_reports().get("entityType", "entityKey", "date") +/// .parameters("ea") +/// .page_token("no") +/// .max_results(80) +/// .filters("justo") /// .customer_id("et") -/// .actor_ip_address("duo") /// .doit(); /// /// match result { @@ -370,6 +355,9 @@ impl<'a, C, A> Reports pub fn customer_usage_reports(&'a self) -> CustomerUsageReportMethods<'a, C, A> { CustomerUsageReportMethods { hub: &self } } + pub fn entity_usage_reports(&'a self) -> EntityUsageReportMethods<'a, C, A> { + EntityUsageReportMethods { hub: &self } + } pub fn user_usage_report(&'a self) -> UserUsageReportMethods<'a, C, A> { UserUsageReportMethods { hub: &self } } @@ -565,6 +553,7 @@ impl Part for UsageReportsWarnings {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [get user usage report](struct.UserUsageReportGetCall.html) (response) +/// * [get entity usage reports](struct.EntityUsageReportGetCall.html) (response) /// * [get customer usage reports](struct.CustomerUsageReportGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -669,12 +658,15 @@ pub struct UsageReportEntity { /// Obfuscated user id for the record. #[serde(rename="profileId")] pub profile_id: Option, - /// user's email. + /// user's email. Only relevant if entity.type = "USER" #[serde(rename="userEmail")] pub user_email: Option, - /// The type of item, can be a customer or user. + /// The type of item, can be customer, user, or entity (aka. object). #[serde(rename="type")] pub type_: Option, + /// Object key. Only relevant if entity.type = "OBJECT" Note: external-facing name of report is "Entities" rather than "Objects". + #[serde(rename="entityId")] + pub entity_id: Option, /// Obfuscated customer id for the record. #[serde(rename="customerId")] pub customer_id: Option, @@ -790,6 +782,74 @@ impl<'a, C, A> ChannelMethods<'a, C, A> { +/// A builder providing access to all methods supported on *entityUsageReport* resources. +/// It is not used directly, but through the `Reports` 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_admin1_reports as admin1_reports; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use admin1_reports::Reports; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Reports::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.entity_usage_reports(); +/// # } +/// ``` +pub struct EntityUsageReportMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Reports, +} + +impl<'a, C, A> MethodsBuilder for EntityUsageReportMethods<'a, C, A> {} + +impl<'a, C, A> EntityUsageReportMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a report which is a collection of properties / statistics for a set of objects. + /// + /// # Arguments + /// + /// * `entityType` - Type of object. Should be one of - gplus_communities. + /// * `entityKey` - Represents the key of object for which the data should be filtered. + /// * `date` - Represents the date in yyyy-mm-dd format for which the data is to be fetched. + pub fn get(&self, entity_type: &str, entity_key: &str, date: &str) -> EntityUsageReportGetCall<'a, C, A> { + EntityUsageReportGetCall { + hub: self.hub, + _entity_type: entity_type.to_string(), + _entity_key: entity_key.to_string(), + _date: date.to_string(), + _parameters: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), + _filters: Default::default(), + _customer_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *activity* resources. /// It is not used directly, but through the `Reports` hub. /// @@ -831,17 +891,15 @@ impl<'a, C, A> ActivityMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Push changes to activities + /// Retrieves a list of activities for a specific customer and application. /// /// # Arguments /// - /// * `request` - No description provided. /// * `userKey` - Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. /// * `applicationName` - Application name for which the events are to be retrieved. - pub fn watch(&self, request: Channel, user_key: &str, application_name: &str) -> ActivityWatchCall<'a, C, A> { - ActivityWatchCall { + pub fn list(&self, user_key: &str, application_name: &str) -> ActivityListCall<'a, C, A> { + ActivityListCall { hub: self.hub, - _request: request, _user_key: user_key.to_string(), _application_name: application_name.to_string(), _start_time: Default::default(), @@ -860,15 +918,17 @@ impl<'a, C, A> ActivityMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a list of activities for a specific customer and application. + /// Push changes to activities /// /// # Arguments /// + /// * `request` - No description provided. /// * `userKey` - Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. /// * `applicationName` - Application name for which the events are to be retrieved. - pub fn list(&self, user_key: &str, application_name: &str) -> ActivityListCall<'a, C, A> { - ActivityListCall { + pub fn watch(&self, request: Channel, user_key: &str, application_name: &str) -> ActivityWatchCall<'a, C, A> { + ActivityWatchCall { hub: self.hub, + _request: request, _user_key: user_key.to_string(), _application_name: application_name.to_string(), _start_time: Default::default(), @@ -1252,6 +1312,684 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } +/// Retrieves a report which is a collection of properties / statistics for a set of objects. +/// +/// A builder for the *get* method supported by a *entityUsageReport* resource. +/// It is not used directly, but through a `EntityUsageReportMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_reports as admin1_reports; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_reports::Reports; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Reports::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.entity_usage_reports().get("entityType", "entityKey", "date") +/// .parameters("Lorem") +/// .page_token("et") +/// .max_results(31) +/// .filters("aliquyam") +/// .customer_id("sea") +/// .doit(); +/// # } +/// ``` +pub struct EntityUsageReportGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Reports, + _entity_type: String, + _entity_key: String, + _date: String, + _parameters: Option, + _page_token: Option, + _max_results: Option, + _filters: Option, + _customer_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EntityUsageReportGetCall<'a, C, A> {} + +impl<'a, C, A> EntityUsageReportGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UsageReports)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "reports.entityUsageReports.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + params.push(("entityType", self._entity_type.to_string())); + params.push(("entityKey", self._entity_key.to_string())); + params.push(("date", self._date.to_string())); + if let Some(value) = self._parameters { + params.push(("parameters", 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._filters { + params.push(("filters", value.to_string())); + } + if let Some(value) = self._customer_id { + params.push(("customerId", value.to_string())); + } + for &field in ["alt", "entityType", "entityKey", "date", "parameters", "pageToken", "maxResults", "filters", "customerId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "usage/{entityType}/{entityKey}/dates/{date}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ReportUsageReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{entityType}", "entityType"), ("{entityKey}", "entityKey"), ("{date}", "date")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["date", "entityKey", "entityType"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Type of object. Should be one of - gplus_communities. + /// + /// Sets the *entity 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 entity_type(mut self, new_value: &str) -> EntityUsageReportGetCall<'a, C, A> { + self._entity_type = new_value.to_string(); + self + } + /// Represents the key of object for which the data should be filtered. + /// + /// Sets the *entity key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn entity_key(mut self, new_value: &str) -> EntityUsageReportGetCall<'a, C, A> { + self._entity_key = new_value.to_string(); + self + } + /// Represents the date in yyyy-mm-dd format for which the data is to be fetched. + /// + /// Sets the *date* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn date(mut self, new_value: &str) -> EntityUsageReportGetCall<'a, C, A> { + self._date = new_value.to_string(); + self + } + /// Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. + /// + /// Sets the *parameters* query property to the given value. + pub fn parameters(mut self, new_value: &str) -> EntityUsageReportGetCall<'a, C, A> { + self._parameters = Some(new_value.to_string()); + self + } + /// Token to specify next page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> EntityUsageReportGetCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of results to return. Maximum allowed is 1000 + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> EntityUsageReportGetCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Represents the set of filters including parameter operator value. + /// + /// Sets the *filters* query property to the given value. + pub fn filters(mut self, new_value: &str) -> EntityUsageReportGetCall<'a, C, A> { + self._filters = Some(new_value.to_string()); + self + } + /// Represents the customer for which the data is to be fetched. + /// + /// Sets the *customer id* query property to the given value. + pub fn customer_id(mut self, new_value: &str) -> EntityUsageReportGetCall<'a, C, A> { + self._customer_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) -> EntityUsageReportGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EntityUsageReportGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::ReportUsageReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EntityUsageReportGetCall<'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 activities for a specific customer and application. +/// +/// A builder for the *list* method supported by a *activity* resource. +/// It is not used directly, but through a `ActivityMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_reports as admin1_reports; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_reports::Reports; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Reports::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.activities().list("userKey", "applicationName") +/// .start_time("erat") +/// .page_token("sadipscing") +/// .max_results(-48) +/// .filters("eirmod") +/// .event_name("elitr") +/// .end_time("amet") +/// .customer_id("no") +/// .actor_ip_address("labore") +/// .doit(); +/// # } +/// ``` +pub struct ActivityListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Reports, + _user_key: String, + _application_name: String, + _start_time: Option, + _page_token: Option, + _max_results: Option, + _filters: Option, + _event_name: Option, + _end_time: Option, + _customer_id: Option, + _actor_ip_address: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ActivityListCall<'a, C, A> {} + +impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Activities)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "reports.activities.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); + params.push(("userKey", self._user_key.to_string())); + params.push(("applicationName", self._application_name.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._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filters { + params.push(("filters", value.to_string())); + } + if let Some(value) = self._event_name { + params.push(("eventName", value.to_string())); + } + if let Some(value) = self._end_time { + params.push(("endTime", value.to_string())); + } + if let Some(value) = self._customer_id { + params.push(("customerId", value.to_string())); + } + if let Some(value) = self._actor_ip_address { + params.push(("actorIpAddress", value.to_string())); + } + for &field in ["alt", "userKey", "applicationName", "startTime", "pageToken", "maxResults", "filters", "eventName", "endTime", "customerId", "actorIpAddress"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "activity/users/{userKey}/applications/{applicationName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{userKey}", "userKey"), ("{applicationName}", "applicationName")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["applicationName", "userKey"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. + /// + /// Sets the *user key* path property to 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_key(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._user_key = new_value.to_string(); + self + } + /// Application name for which the events are to be retrieved. + /// + /// Sets the *application 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 application_name(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._application_name = new_value.to_string(); + self + } + /// Return events which occurred at or after this time. + /// + /// Sets the *start time* query property to the given value. + pub fn start_time(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._start_time = Some(new_value.to_string()); + self + } + /// Token to specify next page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of activity records to be shown in each page. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> ActivityListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... + /// + /// Sets the *filters* query property to the given value. + pub fn filters(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._filters = Some(new_value.to_string()); + self + } + /// Name of the event being queried. + /// + /// Sets the *event name* query property to the given value. + pub fn event_name(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._event_name = Some(new_value.to_string()); + self + } + /// Return events which occurred at or before this time. + /// + /// Sets the *end time* query property to the given value. + pub fn end_time(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._end_time = Some(new_value.to_string()); + self + } + /// Represents the customer for which the data is to be fetched. + /// + /// Sets the *customer id* query property to the given value. + pub fn customer_id(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._customer_id = Some(new_value.to_string()); + self + } + /// IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. + /// + /// Sets the *actor ip address* query property to the given value. + pub fn actor_ip_address(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._actor_ip_address = 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) -> ActivityListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ActivityListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::ReportAuditReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ActivityListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Push changes to activities /// /// A builder for the *watch* method supported by a *activity* resource. @@ -1286,14 +2024,14 @@ 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.activities().watch(req, "userKey", "applicationName") -/// .start_time("Lorem") -/// .page_token("eos") -/// .max_results(-81) -/// .filters("sadipscing") -/// .event_name("dolor") -/// .end_time("eirmod") -/// .customer_id("elitr") -/// .actor_ip_address("amet") +/// .start_time("invidunt") +/// .page_token("aliquyam") +/// .max_results(-73) +/// .filters("Lorem") +/// .event_name("sea") +/// .end_time("et") +/// .customer_id("duo") +/// .actor_ip_address("et") /// .doit(); /// # } /// ``` @@ -1634,357 +2372,6 @@ impl<'a, C, A> ActivityWatchCall<'a, C, A> where C: BorrowMut, A: } -/// Retrieves a list of activities for a specific customer and application. -/// -/// A builder for the *list* method supported by a *activity* resource. -/// It is not used directly, but through a `ActivityMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_reports as admin1_reports; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_reports::Reports; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Reports::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.activities().list("userKey", "applicationName") -/// .start_time("eirmod") -/// .page_token("dolore") -/// .max_results(-37) -/// .filters("aliquyam") -/// .event_name("accusam") -/// .end_time("Lorem") -/// .customer_id("sea") -/// .actor_ip_address("et") -/// .doit(); -/// # } -/// ``` -pub struct ActivityListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Reports, - _user_key: String, - _application_name: String, - _start_time: Option, - _page_token: Option, - _max_results: Option, - _filters: Option, - _event_name: Option, - _end_time: Option, - _customer_id: Option, - _actor_ip_address: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ActivityListCall<'a, C, A> {} - -impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Activities)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "reports.activities.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); - params.push(("userKey", self._user_key.to_string())); - params.push(("applicationName", self._application_name.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._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filters { - params.push(("filters", value.to_string())); - } - if let Some(value) = self._event_name { - params.push(("eventName", value.to_string())); - } - if let Some(value) = self._end_time { - params.push(("endTime", value.to_string())); - } - if let Some(value) = self._customer_id { - params.push(("customerId", value.to_string())); - } - if let Some(value) = self._actor_ip_address { - params.push(("actorIpAddress", value.to_string())); - } - for &field in ["alt", "userKey", "applicationName", "startTime", "pageToken", "maxResults", "filters", "eventName", "endTime", "customerId", "actorIpAddress"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "activity/users/{userKey}/applications/{applicationName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{userKey}", "userKey"), ("{applicationName}", "applicationName")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["applicationName", "userKey"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. - /// - /// Sets the *user key* path property to 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_key(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._user_key = new_value.to_string(); - self - } - /// Application name for which the events are to be retrieved. - /// - /// Sets the *application 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 application_name(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._application_name = new_value.to_string(); - self - } - /// Return events which occurred at or after this time. - /// - /// Sets the *start time* query property to the given value. - pub fn start_time(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._start_time = Some(new_value.to_string()); - self - } - /// Token to specify next page. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Number of activity records to be shown in each page. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: i32) -> ActivityListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... - /// - /// Sets the *filters* query property to the given value. - pub fn filters(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._filters = Some(new_value.to_string()); - self - } - /// Name of the event being queried. - /// - /// Sets the *event name* query property to the given value. - pub fn event_name(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._event_name = Some(new_value.to_string()); - self - } - /// Return events which occurred at or before this time. - /// - /// Sets the *end time* query property to the given value. - pub fn end_time(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._end_time = Some(new_value.to_string()); - self - } - /// Represents the customer for which the data is to be fetched. - /// - /// Sets the *customer id* query property to the given value. - pub fn customer_id(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._customer_id = Some(new_value.to_string()); - self - } - /// IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. - /// - /// Sets the *actor ip address* query property to the given value. - pub fn actor_ip_address(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._actor_ip_address = 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) -> ActivityListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ActivityListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::ReportAuditReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ActivityListCall<'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 which is a collection of properties / statistics for a specific customer. /// /// A builder for the *get* method supported by a *customerUsageReport* resource. @@ -2013,9 +2400,9 @@ impl<'a, C, A> ActivityListCall<'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.customer_usage_reports().get("date") -/// .parameters("et") -/// .page_token("eirmod") -/// .customer_id("sanctus") +/// .parameters("sanctus") +/// .page_token("et") +/// .customer_id("amet") /// .doit(); /// # } /// ``` @@ -2292,11 +2679,11 @@ impl<'a, C, A> CustomerUsageReportGetCall<'a, C, A> where C: BorrowMut"] 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+20170925" +version = "1.0.6+20171211" diff --git a/gen/adsense1d4-cli/README.md b/gen/adsense1d4-cli/README.md index 0a47b377bd..724ec7b429 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 *20170925*. The CLI is at version *1.0.6*. +This documentation was generated from the *AdSense* API at revision *20171211*. 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 de4e7e5fed..790f5076d6 100644 --- a/gen/adsense1d4-cli/mkdocs.yml +++ b/gen/adsense1d4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense v1.0.6+20170925 +site_name: AdSense v1.0.6+20171211 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 87b38ac86a..7470136d8a 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+20170925") + .version("1.0.6+20171211") .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 d39c51bec3..8ed60ee8ce 100644 --- a/gen/adsense1d4/Cargo.toml +++ b/gen/adsense1d4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adsense1d4" -version = "1.0.6+20170925" +version = "1.0.6+20171211" 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+20170925" +documentation = "https://docs.rs/google-adsense1d4/1.0.6+20171211" license = "MIT" keywords = ["adsense", "google", "protocol", "web", "api"] diff --git a/gen/adsense1d4/README.md b/gen/adsense1d4/README.md index 4a58c185e3..0bcee836ce 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+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*. +This documentation was generated from *AdSense* crate version *1.0.6+20171211*, where *20171211* 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+20170925/google_adsense1d4/struct.AdSense.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AdSense.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) +* [accounts](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.Account.html) + * [*adclients list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountAdclientListCall.html), [*adunits customchannels list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountAdunitCustomchannelListCall.html), [*adunits get*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountAdunitGetAdCodeCall.html), [*adunits list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountAdunitListCall.html), [*alerts delete*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountAlertDeleteCall.html), [*alerts list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountAlertListCall.html), [*customchannels adunits list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountCustomchannelAdunitListCall.html), [*customchannels get*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountCustomchannelGetCall.html), [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountListCall.html), [*payments list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountPaymentListCall.html), [*reports generate*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountReportGenerateCall.html), [*reports saved generate*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountReportSavedGenerateCall.html), [*reports saved list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountReportSavedListCall.html), [*savedadstyles get*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountSavedadstyleGetCall.html), [*savedadstyles list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountSavedadstyleListCall.html) and [*urlchannels list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AccountUrlchannelListCall.html) * adclients - * [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.AdclientListCall.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AdclientListCall.html) * adunits - * [*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 list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AdunitCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AdunitGetCall.html), [*get ad code*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AdunitGetAdCodeCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AdunitListCall.html) +* [alerts](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.Alert.html) + * [*delete*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AlertDeleteCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.AlertListCall.html) * customchannels - * [*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) + * [*adunits list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.CustomchannelAdunitListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.CustomchannelGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.CustomchannelListCall.html) +* [metadata](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.Metadata.html) + * [*dimensions list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.MetadataDimensionListCall.html) and [*metrics list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.MetadataMetricListCall.html) +* [payments](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.Payment.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.PaymentListCall.html) * reports - * [*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) + * [*generate*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.ReportGenerateCall.html), [*saved generate*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.ReportSavedGenerateCall.html) and [*saved list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.ReportSavedListCall.html) * savedadstyles - * [*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) + * [*get*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.SavedadstyleGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.SavedadstyleListCall.html) * urlchannels - * [*list*](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/struct.UrlchannelListCall.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.UrlchannelListCall.html) Download supported by ... -* [*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) +* [*generate reports*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/struct.ReportGenerateCall.html) +* [*reports generate accounts*](https://docs.rs/google-adsense1d4/1.0.6+20171211/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+20170925/google_adsense1d4/struct.AdSense.html)** +* **[Hub](https://docs.rs/google-adsense1d4/1.0.6+20171211/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+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)** + * creates [*Method Builders*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adsense1d4/1.0.6+20171211/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+20170925/google_adsense1d4/trait.Part.html)** + * **[Parts](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adsense1d4/1.0.6+20170925/google_adsense1d4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adsense1d4/1.0.6+20171211/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+20170925/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+20171211/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+20170925/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+20171211/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+20170925/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+20171211/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+20170925/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+20171211/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adsense1d4/1.0.6+20171211/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+20170925/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+20171211/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adsense1d4/1.0.6+20171211/google_adsense1d4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adsense1d4/1.0.6+20171211/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+20170925/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+20171211/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+20170925/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+20171211/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+20170925/google_adsense1d4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adsense1d4/1.0.6+20171211/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 1ffeaeccf0..5272b5d395 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+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*. +//! This documentation was generated from *AdSense* crate version *1.0.6+20171211*, where *20171211* 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 19bb2f776e..2b8d943f80 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+20170925" +version = "1.0.6+20171211" 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+20170925" +version = "1.0.6+20171211" diff --git a/gen/adsensehost4d1-cli/README.md b/gen/adsensehost4d1-cli/README.md index 419a414076..dbaa6f5e26 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 *20170925*. The CLI is at version *1.0.6*. +This documentation was generated from the *AdSense Host* API at revision *20171211*. 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 3185eb80e1..3a175d6228 100644 --- a/gen/adsensehost4d1-cli/mkdocs.yml +++ b/gen/adsensehost4d1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense Host v1.0.6+20170925 +site_name: AdSense Host v1.0.6+20171211 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 416664ca09..d868c99fcf 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+20170925") + .version("1.0.6+20171211") .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 8c394f9ebb..63c3e31dd1 100644 --- a/gen/adsensehost4d1/Cargo.toml +++ b/gen/adsensehost4d1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adsensehost4d1" -version = "1.0.6+20170925" +version = "1.0.6+20171211" 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+20170925" +documentation = "https://docs.rs/google-adsensehost4d1/1.0.6+20171211" license = "MIT" keywords = ["adsensehost", "google", "protocol", "web", "api"] diff --git a/gen/adsensehost4d1/README.md b/gen/adsensehost4d1/README.md index 3c23f7e246..9c62154c54 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+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*. +This documentation was generated from *AdSense Host* crate version *1.0.6+20171211*, where *20171211* 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+20170925/google_adsensehost4d1/struct.AdSenseHost.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AdSenseHost.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) +* [accounts](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.Account.html) + * [*adclients get*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountAdclientGetCall.html), [*adclients list*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountAdclientListCall.html), [*adunits delete*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountAdunitDeleteCall.html), [*adunits get*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountAdunitGetAdCodeCall.html), [*adunits insert*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountAdunitInsertCall.html), [*adunits list*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountAdunitListCall.html), [*adunits patch*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountAdunitPatchCall.html), [*adunits update*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountAdunitUpdateCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountListCall.html) and [*reports generate*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AccountReportGenerateCall.html) * adclients - * [*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) + * [*get*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AdclientGetCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AdclientListCall.html) * associationsessions - * [*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) + * [*start*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AssociationsessionStartCall.html) and [*verify*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.AssociationsessionVerifyCall.html) * customchannels - * [*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) + * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.CustomchannelDeleteCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.CustomchannelGetCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.CustomchannelInsertCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.CustomchannelListCall.html), [*patch*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.CustomchannelPatchCall.html) and [*update*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.CustomchannelUpdateCall.html) +* [reports](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.Report.html) + * [*generate*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.ReportGenerateCall.html) * urlchannels - * [*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) + * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.UrlchannelDeleteCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/struct.UrlchannelInsertCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/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+20170925/google_adsensehost4d1/struct.AdSenseHost.html)** +* **[Hub](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/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+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)** + * creates [*Method Builders*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/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+20170925/google_adsensehost4d1/trait.Part.html)** + * **[Parts](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adsensehost4d1/1.0.6+20170925/google_adsensehost4d1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/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+20170925/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+20171211/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+20170925/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+20171211/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+20170925/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+20171211/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+20170925/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+20171211/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/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+20170925/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+20171211/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/google_adsensehost4d1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/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+20170925/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+20171211/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+20170925/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+20171211/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+20170925/google_adsensehost4d1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adsensehost4d1/1.0.6+20171211/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 7afafe7e5a..24fbacf514 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+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*. +//! This documentation was generated from *AdSense Host* crate version *1.0.6+20171211*, where *20171211* 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/androiddeviceprovisioning1-cli/Cargo.toml b/gen/androiddeviceprovisioning1-cli/Cargo.toml index 9c5a94b912..93e1f166eb 100644 --- a/gen/androiddeviceprovisioning1-cli/Cargo.toml +++ b/gen/androiddeviceprovisioning1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androiddeviceprovisioning1-cli" -version = "1.0.6+20170923" +version = "1.0.6+20171202" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-androiddeviceprovisioning1] path = "../androiddeviceprovisioning1" -version = "1.0.6+20170923" +version = "1.0.6+20171202" diff --git a/gen/androiddeviceprovisioning1-cli/README.md b/gen/androiddeviceprovisioning1-cli/README.md index c6ec3eeb18..689d89d57e 100644 --- a/gen/androiddeviceprovisioning1-cli/README.md +++ b/gen/androiddeviceprovisioning1-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 Provisioning Partner* API at revision *20170923*. The CLI is at version *1.0.6*. +This documentation was generated from the *Android Provisioning Partner* API at revision *20171202*. The CLI is at version *1.0.6*. ```bash androiddeviceprovisioning1 [options] diff --git a/gen/androiddeviceprovisioning1-cli/mkdocs.yml b/gen/androiddeviceprovisioning1-cli/mkdocs.yml index 07cccc483b..3fba31e903 100644 --- a/gen/androiddeviceprovisioning1-cli/mkdocs.yml +++ b/gen/androiddeviceprovisioning1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Provisioning Partner v1.0.6+20170923 +site_name: Android Provisioning Partner v1.0.6+20171202 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) diff --git a/gen/androiddeviceprovisioning1-cli/src/main.rs b/gen/androiddeviceprovisioning1-cli/src/main.rs index 4efc3484d7..0fc68bcf5b 100644 --- a/gen/androiddeviceprovisioning1-cli/src/main.rs +++ b/gen/androiddeviceprovisioning1-cli/src/main.rs @@ -1130,7 +1130,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. The parent resource ID in format `partners/[PARTNER_ID]` that + Some(r##"Required. The parent resource ID in the format `partners/[PARTNER_ID]` that identifies the reseller."##), Some(true), Some(false)), @@ -1435,7 +1435,7 @@ fn main() { let mut app = App::new("androiddeviceprovisioning1") .author("Sebastian Thiel ") - .version("1.0.6+20170923") + .version("1.0.6+20171202") .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") diff --git a/gen/androiddeviceprovisioning1/Cargo.toml b/gen/androiddeviceprovisioning1/Cargo.toml index d1baf78948..fb9989f00f 100644 --- a/gen/androiddeviceprovisioning1/Cargo.toml +++ b/gen/androiddeviceprovisioning1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androiddeviceprovisioning1" -version = "1.0.6+20170923" +version = "1.0.6+20171202" 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" +documentation = "https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202" license = "MIT" keywords = ["androiddeviceprovisi", "google", "protocol", "web", "api"] diff --git a/gen/androiddeviceprovisioning1/README.md b/gen/androiddeviceprovisioning1/README.md index 667b50aba0..cecb683b48 100644 --- a/gen/androiddeviceprovisioning1/README.md +++ b/gen/androiddeviceprovisioning1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Android Provisioning Partner* crate version *1.0.6+20171202*, where *20171202* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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) +* [operations](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.Operation.html) + * [*get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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) + * [*customers create*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.PartnerCustomerCreateCall.html), [*customers list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.PartnerCustomerListCall.html), [*devices claim*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.PartnerDeviceClaimCall.html), [*devices claim async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.PartnerDeviceClaimAsyncCall.html), [*devices find by identifier*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.PartnerDeviceFindByIdentifierCall.html), [*devices find by owner*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.PartnerDeviceFindByOwnerCall.html), [*devices get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.PartnerDeviceGetCall.html), [*devices metadata*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.PartnerDeviceMetadataCall.html), [*devices unclaim*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.PartnerDeviceUnclaimCall.html), [*devices unclaim async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.PartnerDeviceUnclaimAsyncCall.html) and [*devices update metadata async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/struct.PartnerDeviceUpdateMetadataAsyncCall.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-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/struct.AndroidProvisioningPartner.html)** +* **[Hub](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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)** + * creates [*Method Builders*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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)** + * **[Parts](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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)** +* **[Activities](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/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-androiddeviceprovisioning1/1.0.6+20170923/google_androiddeviceprovisioning1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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). +[Hub Delegate](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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. +If such a method also supports a [Response Result](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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. +The [delegate trait](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/google_androiddeviceprovisioning1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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 +Most optionals are are considered [Parts](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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. +Using [method builders](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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 +* [request values](https://docs.rs/google-androiddeviceprovisioning1/1.0.6+20171202/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. diff --git a/gen/androiddeviceprovisioning1/src/lib.rs b/gen/androiddeviceprovisioning1/src/lib.rs index a05e06a092..95d6c5c4c4 100644 --- a/gen/androiddeviceprovisioning1/src/lib.rs +++ b/gen/androiddeviceprovisioning1/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 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*. +//! This documentation was generated from *Android Provisioning Partner* crate version *1.0.6+20171202*, where *20171202* 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/). @@ -377,12 +377,12 @@ impl ResponseResult for ClaimDeviceResponse {} /// #[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, + /// Device identifier of the device. + #[serde(rename="deviceIdentifier")] + pub device_identifier: Option, /// Section type to claim. #[serde(rename="sectionType")] pub section_type: Option, @@ -481,22 +481,24 @@ pub struct FindDevicesByDeviceIdentifierResponse { impl ResponseResult for FindDevicesByDeviceIdentifierResponse {} -/// Identifies a unique device. +/// Encapsulates hardware and product IDs to identify a manufactured device. To +/// learn more, read [Identifiers](/zero-touch/guides/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 DeviceIdentifier { - /// IMEI number. + /// The device’s IMEI number. Validated on input. pub imei: Option, - /// Serial number (optional). + /// The manufacturer's serial number for the device. This value might not be + /// unique. #[serde(rename="serialNumber")] pub serial_number: Option, - /// MEID number. + /// The device’s 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). + /// Required. The device manufacturer’s name. Matches the device's built-in + /// value returned from `android.os.Build.MANUFACTURER`. Allowed values are + /// listed in [manufacturer names](/zero-touch/resources/manufacturer-names). pub manufacturer: Option, } @@ -588,29 +590,23 @@ pub struct CreateCustomerRequest { impl RequestValue for CreateCustomerRequest {} -/// Request message to claim a device on behalf of a customer. +/// Metadata entries that can be attached to a `Device`. To learn more, read +/// [Device metadata](/zero-touch/guides/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 claim partners](struct.PartnerDeviceClaimCall.html) (request) +/// * [devices metadata partners](struct.PartnerDeviceMetadataCall.html) (response) /// #[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, +pub struct DeviceMetadata { + /// Metadata entries recorded as key-value pairs. + pub entries: Option>, } -impl RequestValue for ClaimDeviceRequest {} +impl ResponseResult for DeviceMetadata {} /// A generic empty message that you can re-use to avoid defining duplicated @@ -707,22 +703,29 @@ pub struct Status { impl Part for Status {} -/// A key-value pair of the device metadata. +/// 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 metadata partners](struct.PartnerDeviceMetadataCall.html) (response) +/// * [devices claim partners](struct.PartnerDeviceClaimCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeviceMetadata { - /// Metadata entries - pub entries: Option>, +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 ResponseResult for DeviceMetadata {} +impl RequestValue for ClaimDeviceRequest {} /// A customer resource in the zero-touch enrollment API. @@ -840,7 +843,7 @@ pub struct FindDevicesByDeviceIdentifierRequest { impl RequestValue for FindDevicesByDeviceIdentifierRequest {} -/// An Android device. +/// An Android device registered for zero-touch enrollment. /// /// # Activities /// @@ -851,20 +854,28 @@ impl RequestValue for FindDevicesByDeviceIdentifierRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Device { - /// Device identifier. + /// The hardware IDs that identify a manufactured device. To learn more, read + /// [Identifiers](/zero-touch/guides/identifiers). #[serde(rename="deviceIdentifier")] pub device_identifier: Option, - /// Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. + /// Output only. The API resource name in the format + /// `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. Assigned by the server. pub name: Option, - /// Claims. + /// Output only. The provisioning claims for a device. Devices claimed for + /// zero-touch enrollment have a claim with the type `SECTION_TYPE_ZERO_TOUCH`. + /// Call + /// `partners.devices.unclaim` + /// or + /// `partners.devices.unclaimAsync` + /// to remove the device from zero-touch enrollment. pub claims: Option>, - /// Device metadata. + /// The metadata attached to the device. Structured as key-value pairs. To + /// learn more, read [Device metadata](/zero-touch/guides/metadata). #[serde(rename="deviceMetadata")] pub device_metadata: Option, - /// The resource name of the configuration. - /// Only set for customers. + /// Not available to resellers. pub configuration: Option, - /// Device ID. + /// Output only. The ID of the device. Assigned by the server. #[serde(rename="deviceId")] pub device_id: Option, } @@ -872,16 +883,19 @@ pub struct Device { impl ResponseResult for Device {} -/// Information about a device claimed for a partner. +/// A record of a device claimed by a reseller for a customer. Devices claimed +/// for zero-touch enrollment have a claim with the type +/// `SECTION_TYPE_ZERO_TOUCH`. To learn more, read +/// [Claim devices for customers](/zero-touch/guides/how-it-works#claim). /// /// 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. + /// Output only. The type of claim made on the device. #[serde(rename="sectionType")] pub section_type: Option, - /// Owner ID. + /// The ID of the Customer that purchased the device. #[serde(rename="ownerCompanyId")] pub owner_company_id: Option, } @@ -1201,7 +1215,7 @@ impl<'a, C, A> PartnerMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The parent resource ID in format `partners/[PARTNER_ID]` that + /// * `parent` - Required. The parent resource ID in the format `partners/[PARTNER_ID]` that /// identifies the reseller. pub fn customers_create(&self, request: CreateCustomerRequest, parent: &str) -> PartnerCustomerCreateCall<'a, C, A> { PartnerCustomerCreateCall { @@ -1467,12 +1481,12 @@ impl<'a, C, A> OperationGetCall<'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) -> OperationGetCall<'a, C, A> @@ -1691,12 +1705,12 @@ impl<'a, C, A> PartnerDeviceGetCall<'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) -> PartnerDeviceGetCall<'a, C, A> @@ -1946,12 +1960,12 @@ impl<'a, C, A> PartnerDeviceFindByIdentifierCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PartnerDeviceFindByIdentifierCall<'a, C, A> @@ -2201,12 +2215,12 @@ impl<'a, C, A> PartnerDeviceFindByOwnerCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PartnerDeviceFindByOwnerCall<'a, C, A> @@ -2456,12 +2470,12 @@ impl<'a, C, A> PartnerDeviceClaimCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PartnerDeviceClaimCall<'a, C, A> @@ -2711,12 +2725,12 @@ impl<'a, C, A> PartnerDeviceUnclaimAsyncCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PartnerDeviceUnclaimAsyncCall<'a, C, A> @@ -2966,12 +2980,12 @@ impl<'a, C, A> PartnerDeviceClaimAsyncCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PartnerDeviceClaimAsyncCall<'a, C, A> @@ -3221,12 +3235,12 @@ impl<'a, C, A> PartnerDeviceUpdateMetadataAsyncCall<'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) -> PartnerDeviceUpdateMetadataAsyncCall<'a, C, A> @@ -3488,12 +3502,12 @@ impl<'a, C, A> PartnerDeviceMetadataCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PartnerDeviceMetadataCall<'a, C, A> @@ -3711,7 +3725,7 @@ impl<'a, C, A> PartnerCustomerCreateCall<'a, C, A> where C: BorrowMut PartnerCustomerCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PartnerCustomerCreateCall<'a, C, A> @@ -3973,12 +3987,12 @@ impl<'a, C, A> PartnerCustomerListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PartnerCustomerListCall<'a, C, A> @@ -4228,12 +4242,12 @@ impl<'a, C, A> PartnerDeviceUnclaimCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PartnerDeviceUnclaimCall<'a, C, A> diff --git a/gen/androidenterprise1-cli/Cargo.toml b/gen/androidenterprise1-cli/Cargo.toml index 391a089eaa..1d7b462691 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+20170922" +version = "1.0.6+20171206" 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+20170922" +version = "1.0.6+20171206" diff --git a/gen/androidenterprise1-cli/README.md b/gen/androidenterprise1-cli/README.md index 30437d475b..3bca6a9e19 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 *20170922*. The CLI is at version *1.0.6*. +This documentation was generated from the *Android Enterprise* API at revision *20171206*. The CLI is at version *1.0.6*. ```bash androidenterprise1 [options] @@ -33,7 +33,9 @@ androidenterprise1 [options] get [-p ]... [-o ] get-state [-p ]... [-o ] list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] set-state (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] enterprises acknowledge-notification-set [-p ]... complete-signup [-p ]... [-o ] @@ -82,6 +84,8 @@ androidenterprise1 [options] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] + managedconfigurationssettings + list [-p ]... [-o ] permissions get [-p ]... [-o ] products @@ -119,6 +123,7 @@ androidenterprise1 [options] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] + revoke-device-access [-p ]... revoke-token [-p ]... set-available-product-set (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] diff --git a/gen/androidenterprise1-cli/mkdocs.yml b/gen/androidenterprise1-cli/mkdocs.yml index 49542384e2..ab92aa1371 100644 --- a/gen/androidenterprise1-cli/mkdocs.yml +++ b/gen/androidenterprise1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Enterprise v1.0.6+20170922 +site_name: Android Enterprise v1.0.6+20171206 site_url: http://byron.github.io/google-apis-rs/google-androidenterprise1-cli site_description: A complete library to interact with Android Enterprise (protocol v1) @@ -12,7 +12,9 @@ pages: - ['devices_get.md', 'Devices', 'Get'] - ['devices_get-state.md', 'Devices', 'Get State'] - ['devices_list.md', 'Devices', 'List'] +- ['devices_patch.md', 'Devices', 'Patch'] - ['devices_set-state.md', 'Devices', 'Set State'] +- ['devices_update.md', 'Devices', 'Update'] - ['enterprises_acknowledge-notification-set.md', 'Enterprises', 'Acknowledge Notification Set'] - ['enterprises_complete-signup.md', 'Enterprises', 'Complete Signup'] - ['enterprises_create-web-token.md', 'Enterprises', 'Create Web Token'] @@ -54,6 +56,7 @@ pages: - ['managedconfigurationsforuser_list.md', 'Managedconfigurationsforuser', 'List'] - ['managedconfigurationsforuser_patch.md', 'Managedconfigurationsforuser', 'Patch'] - ['managedconfigurationsforuser_update.md', 'Managedconfigurationsforuser', 'Update'] +- ['managedconfigurationssettings_list.md', 'Managedconfigurationssettings', 'List'] - ['permissions_get.md', 'Permissions', 'Get'] - ['products_approve.md', 'Products', 'Approve'] - ['products_generate-approval-url.md', 'Products', 'Generate Approval Url'] @@ -85,6 +88,7 @@ pages: - ['users_insert.md', 'Users', 'Insert'] - ['users_list.md', 'Users', 'List'] - ['users_patch.md', 'Users', 'Patch'] +- ['users_revoke-device-access.md', 'Users', 'Revoke Device Access'] - ['users_revoke-token.md', 'Users', 'Revoke Token'] - ['users_set-available-product-set.md', 'Users', 'Set Available Product Set'] - ['users_update.md', 'Users', 'Update'] diff --git a/gen/androidenterprise1-cli/src/main.rs b/gen/androidenterprise1-cli/src/main.rs index 4269f6b23e..eea0727f0a 100644 --- a/gen/androidenterprise1-cli/src/main.rs +++ b/gen/androidenterprise1-cli/src/main.rs @@ -202,6 +202,98 @@ impl<'n> Engine<'n> { } } + fn _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()[..] { + "policy.product-availability-policy" => Some(("policy.productAvailabilityPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "management-type" => Some(("managementType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "android-id" => Some(("androidId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["android-id", "kind", "management-type", "policy", "product-availability-policy"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_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.devices().patch(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-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 { + "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 _devices_set_state(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -288,6 +380,98 @@ impl<'n> Engine<'n> { } } + fn _devices_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()[..] { + "policy.product-availability-policy" => Some(("policy.productAvailabilityPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "management-type" => Some(("managementType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "android-id" => Some(("androidId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["android-id", "kind", "management-type", "policy", "product-availability-policy"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_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.devices().update(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-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 { + "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_acknowledge_notification_set(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.enterprises().acknowledge_notification_set(); @@ -2415,9 +2599,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration-variables.kind" => Some(("configurationVariables.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration-variables.mcm-id" => Some(("configurationVariables.mcmId", 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!["kind", "product-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["configuration-variables", "kind", "mcm-id", "product-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2501,9 +2687,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration-variables.kind" => Some(("configurationVariables.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration-variables.mcm-id" => Some(("configurationVariables.mcmId", 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!["kind", "product-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["configuration-variables", "kind", "mcm-id", "product-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2735,9 +2923,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration-variables.kind" => Some(("configurationVariables.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration-variables.mcm-id" => Some(("configurationVariables.mcmId", 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!["kind", "product-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["configuration-variables", "kind", "mcm-id", "product-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2821,9 +3011,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration-variables.kind" => Some(("configurationVariables.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration-variables.mcm-id" => Some(("configurationVariables.mcmId", 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!["kind", "product-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["configuration-variables", "kind", "mcm-id", "product-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2883,6 +3075,58 @@ impl<'n> Engine<'n> { } } + fn _managedconfigurationssettings_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.managedconfigurationssettings().list(opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("product-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.permissions().get(opt.value_of("permission-id").unwrap_or("")); @@ -4842,6 +5086,50 @@ impl<'n> Engine<'n> { } } + fn _users_revoke_device_access(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().revoke_device_access(opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.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 _users_revoke_token(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.users().revoke_token(opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-id").unwrap_or("")); @@ -5080,9 +5368,15 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._devices_list(opt, dry_run, &mut err); }, + ("patch", Some(opt)) => { + call_result = self._devices_patch(opt, dry_run, &mut err); + }, ("set-state", Some(opt)) => { call_result = self._devices_set_state(opt, dry_run, &mut err); }, + ("update", Some(opt)) => { + call_result = self._devices_update(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("devices".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -5268,6 +5562,17 @@ impl<'n> Engine<'n> { } } }, + ("managedconfigurationssettings", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._managedconfigurationssettings_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("managedconfigurationssettings".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("permissions", Some(opt)) => { match opt.subcommand() { ("get", Some(opt)) => { @@ -5403,6 +5708,9 @@ impl<'n> Engine<'n> { ("patch", Some(opt)) => { call_result = self._users_patch(opt, dry_run, &mut err); }, + ("revoke-device-access", Some(opt)) => { + call_result = self._users_revoke_device_access(opt, dry_run, &mut err); + }, ("revoke-token", Some(opt)) => { call_result = self._users_revoke_token(opt, dry_run, &mut err); }, @@ -5500,7 +5808,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("devices", "methods: 'get', 'get-state', 'list' and 'set-state'", vec![ + ("devices", "methods: 'get', 'get-state', 'list', 'patch', 'set-state' and 'update'", vec![ ("get", Some(r##"Retrieves the details of a device."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/devices_get", @@ -5591,6 +5899,46 @@ 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)), + ]), + ("patch", + Some(r##"Updates the device policy. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/devices_patch", + vec![ + (Some(r##"enterprise-id"##), + None, + Some(r##"The ID of the enterprise."##), + Some(true), + Some(false)), + + (Some(r##"user-id"##), + None, + Some(r##"The ID of the user."##), + Some(true), + Some(false)), + + (Some(r##"device-id"##), + None, + Some(r##"The ID of the device."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -5631,6 +5979,46 @@ 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", + Some(r##"Updates the device policy"##), + "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/devices_update", + vec![ + (Some(r##"enterprise-id"##), + None, + Some(r##"The ID of the enterprise."##), + Some(true), + Some(false)), + + (Some(r##"user-id"##), + None, + Some(r##"The ID of the user."##), + Some(true), + Some(false)), + + (Some(r##"device-id"##), + None, + Some(r##"The ID of the device."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -6797,7 +7185,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics."##), + Some(r##"Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/managedconfigurationsforuser_patch", vec![ (Some(r##"enterprise-id"##), @@ -6837,7 +7225,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Adds or updates a per-user managed configuration for an app for the specified user."##), + Some(r##"Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/managedconfigurationsforuser_update", vec![ (Some(r##"enterprise-id"##), @@ -6878,6 +7266,37 @@ fn main() { ]), ]), + ("managedconfigurationssettings", "methods: 'list'", vec![ + ("list", + Some(r##"Lists all the managed configurations settings for the specified app. Only the ID and the name is set."##), + "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/managedconfigurationssettings_list", + vec![ + (Some(r##"enterprise-id"##), + None, + Some(r##"The ID of the enterprise."##), + Some(true), + Some(false)), + + (Some(r##"product-id"##), + None, + Some(r##"The ID of the product for which the managed configurations settings applies to."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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: 'get'", vec![ ("get", Some(r##"Retrieves details of an Android app permission for display to an enterprise admin."##), @@ -7549,7 +7968,7 @@ fn main() { ]), ]), - ("users", "methods: 'delete', 'generate-authentication-token', 'generate-token', 'get', 'get-available-product-set', 'insert', 'list', 'patch', 'revoke-token', 'set-available-product-set' and 'update'", vec![ + ("users", "methods: 'delete', 'generate-authentication-token', 'generate-token', 'get', 'get-available-product-set', 'insert', 'list', 'patch', 'revoke-device-access', 'revoke-token', 'set-available-product-set' and 'update'", vec![ ("delete", Some(r##"Deleted an EMM-managed user."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/users_delete", @@ -7783,6 +8202,30 @@ fn main() { Some(false), Some(false)), ]), + ("revoke-device-access", + Some(r##"Revokes access to all devices currently provisioned to the user. The user will no longer be able to use the managed Play store on any of their managed devices. + + This call only works with EMM-managed accounts."##), + "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/users_revoke-device-access", + vec![ + (Some(r##"enterprise-id"##), + None, + Some(r##"The ID of the enterprise."##), + Some(true), + Some(false)), + + (Some(r##"user-id"##), + None, + Some(r##"The ID of the 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)), + ]), ("revoke-token", Some(r##"Revokes a previously generated token (activation code) for the user."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/users_revoke-token", @@ -7881,7 +8324,7 @@ fn main() { let mut app = App::new("androidenterprise1") .author("Sebastian Thiel ") - .version("1.0.6+20170922") + .version("1.0.6+20171206") .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 ccf49866e6..10c589b819 100644 --- a/gen/androidenterprise1/Cargo.toml +++ b/gen/androidenterprise1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androidenterprise1" -version = "1.0.6+20170922" +version = "1.0.6+20171206" 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+20170922" +documentation = "https://docs.rs/google-androidenterprise1/1.0.6+20171206" license = "MIT" keywords = ["androidenterprise", "google", "protocol", "web", "api"] diff --git a/gen/androidenterprise1/README.md b/gen/androidenterprise1/README.md index 5035967855..e3b2d8c5e5 100644 --- a/gen/androidenterprise1/README.md +++ b/gen/androidenterprise1/README.md @@ -5,42 +5,44 @@ 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+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*. +This documentation was generated from *Android Enterprise* crate version *1.0.6+20171206*, where *20171206* 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+20170922/google_androidenterprise1/struct.AndroidEnterprise.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.AndroidEnterprise.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) +* [devices](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.Device.html) + * [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.DeviceGetCall.html), [*get state*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.DeviceGetStateCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.DeviceListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.DevicePatchCall.html), [*set state*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.DeviceSetStateCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.DeviceUpdateCall.html) +* [enterprises](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.Enterprise.html) + * [*acknowledge notification set*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseAcknowledgeNotificationSetCall.html), [*complete signup*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseCompleteSignupCall.html), [*create web token*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseCreateWebTokenCall.html), [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseDeleteCall.html), [*enroll*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseEnrollCall.html), [*generate signup url*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseGenerateSignupUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseGetCall.html), [*get android device policy config*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseGetAndroidDevicePolicyConfigCall.html), [*get service account*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseGetServiceAccountCall.html), [*get store layout*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseGetStoreLayoutCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseListCall.html), [*pull notification set*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterprisePullNotificationSetCall.html), [*send test push notification*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseSendTestPushNotificationCall.html), [*set account*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseSetAccountCall.html), [*set android device policy config*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseSetAndroidDevicePolicyConfigCall.html), [*set store layout*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseSetStoreLayoutCall.html) and [*unenroll*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EnterpriseUnenrollCall.html) +* [entitlements](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.Entitlement.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EntitlementDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EntitlementGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EntitlementListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EntitlementPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.EntitlementUpdateCall.html) * grouplicenses - * [*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) + * [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.GrouplicenseGetCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.GrouplicenseListCall.html) * grouplicenseusers - * [*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) + * [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.GrouplicenseuserListCall.html) +* [installs](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.Install.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.InstallDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.InstallGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.InstallListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.InstallPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.InstallUpdateCall.html) * managedconfigurationsfordevice - * [*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) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ManagedconfigurationsfordeviceDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ManagedconfigurationsfordeviceGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ManagedconfigurationsfordeviceListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ManagedconfigurationsfordevicePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ManagedconfigurationsfordeviceUpdateCall.html) * managedconfigurationsforuser - * [*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) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ManagedconfigurationsforuserDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ManagedconfigurationsforuserGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ManagedconfigurationsforuserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ManagedconfigurationsforuserPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ManagedconfigurationsforuserUpdateCall.html) +* managedconfigurationssettings + * [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ManagedconfigurationssettingListCall.html) +* [permissions](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.Permission.html) + * [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.PermissionGetCall.html) +* [products](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.Product.html) + * [*approve*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ProductApproveCall.html), [*generate approval url*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ProductGenerateApprovalUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ProductGetCall.html), [*get app restrictions schema*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ProductGetPermissionCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ProductListCall.html) and [*unapprove*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ProductUnapproveCall.html) * serviceaccountkeys - * [*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) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ServiceaccountkeyDeleteCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ServiceaccountkeyInsertCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.ServiceaccountkeyListCall.html) * storelayoutclusters - * [*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) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutclusterDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutclusterGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutclusterInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutclusterListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutclusterPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutclusterUpdateCall.html) * storelayoutpages - * [*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) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutpageDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutpageGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutpageInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutpageListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutpagePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.StorelayoutpageUpdateCall.html) +* [users](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.User.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserDeleteCall.html), [*generate authentication token*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserGenerateAuthenticationTokenCall.html), [*generate token*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserGenerateTokenCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserGetCall.html), [*get available product set*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserGetAvailableProductSetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserPatchCall.html), [*revoke device access*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserRevokeDeviceAccesCall.html), [*revoke token*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserRevokeTokenCall.html), [*set available product set*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserSetAvailableProductSetCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/struct.UserUpdateCall.html) @@ -49,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-androidenterprise1/1.0.6+20170922/google_androidenterprise1/struct.AndroidEnterprise.html)** +* **[Hub](https://docs.rs/google-androidenterprise1/1.0.6+20171206/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+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)** + * creates [*Method Builders*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidenterprise1/1.0.6+20171206/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+20170922/google_androidenterprise1/trait.Part.html)** + * **[Parts](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-androidenterprise1/1.0.6+20170922/google_androidenterprise1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -165,17 +167,17 @@ match result { ``` ## Handling Errors -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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-androidenterprise1/1.0.6+20171206/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+20170922/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+20171206/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+20170922/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+20171206/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+20170922/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+20171206/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")`. @@ -185,29 +187,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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidenterprise1/1.0.6+20171206/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+20170922/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+20171206/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidenterprise1/1.0.6+20171206/google_androidenterprise1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidenterprise1/1.0.6+20171206/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+20170922/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+20171206/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+20170922/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+20171206/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+20170922/google_androidenterprise1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-androidenterprise1/1.0.6+20171206/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 b3579f4caf..fdc99da207 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+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*. +//! This documentation was generated from *Android Enterprise* crate version *1.0.6+20171206*, where *20171206* 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). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.AndroidEnterprise.html) ... //! //! * [devices](struct.Device.html) -//! * [*get*](struct.DeviceGetCall.html), [*get state*](struct.DeviceGetStateCall.html), [*list*](struct.DeviceListCall.html) and [*set state*](struct.DeviceSetStateCall.html) +//! * [*get*](struct.DeviceGetCall.html), [*get state*](struct.DeviceGetStateCall.html), [*list*](struct.DeviceListCall.html), [*patch*](struct.DevicePatchCall.html), [*set state*](struct.DeviceSetStateCall.html) and [*update*](struct.DeviceUpdateCall.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 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) @@ -27,6 +27,8 @@ //! * [*delete*](struct.ManagedconfigurationsfordeviceDeleteCall.html), [*get*](struct.ManagedconfigurationsfordeviceGetCall.html), [*list*](struct.ManagedconfigurationsfordeviceListCall.html), [*patch*](struct.ManagedconfigurationsfordevicePatchCall.html) and [*update*](struct.ManagedconfigurationsfordeviceUpdateCall.html) //! * managedconfigurationsforuser //! * [*delete*](struct.ManagedconfigurationsforuserDeleteCall.html), [*get*](struct.ManagedconfigurationsforuserGetCall.html), [*list*](struct.ManagedconfigurationsforuserListCall.html), [*patch*](struct.ManagedconfigurationsforuserPatchCall.html) and [*update*](struct.ManagedconfigurationsforuserUpdateCall.html) +//! * managedconfigurationssettings +//! * [*list*](struct.ManagedconfigurationssettingListCall.html) //! * [permissions](struct.Permission.html) //! * [*get*](struct.PermissionGetCall.html) //! * [products](struct.Product.html) @@ -38,7 +40,7 @@ //! * storelayoutpages //! * [*delete*](struct.StorelayoutpageDeleteCall.html), [*get*](struct.StorelayoutpageGetCall.html), [*insert*](struct.StorelayoutpageInsertCall.html), [*list*](struct.StorelayoutpageListCall.html), [*patch*](struct.StorelayoutpagePatchCall.html) and [*update*](struct.StorelayoutpageUpdateCall.html) //! * [users](struct.User.html) -//! * [*delete*](struct.UserDeleteCall.html), [*generate authentication token*](struct.UserGenerateAuthenticationTokenCall.html), [*generate token*](struct.UserGenerateTokenCall.html), [*get*](struct.UserGetCall.html), [*get available product set*](struct.UserGetAvailableProductSetCall.html), [*insert*](struct.UserInsertCall.html), [*list*](struct.UserListCall.html), [*patch*](struct.UserPatchCall.html), [*revoke token*](struct.UserRevokeTokenCall.html), [*set available product set*](struct.UserSetAvailableProductSetCall.html) and [*update*](struct.UserUpdateCall.html) +//! * [*delete*](struct.UserDeleteCall.html), [*generate authentication token*](struct.UserGenerateAuthenticationTokenCall.html), [*generate token*](struct.UserGenerateTokenCall.html), [*get*](struct.UserGetCall.html), [*get available product set*](struct.UserGetAvailableProductSetCall.html), [*insert*](struct.UserInsertCall.html), [*list*](struct.UserListCall.html), [*patch*](struct.UserPatchCall.html), [*revoke device access*](struct.UserRevokeDeviceAccesCall.html), [*revoke token*](struct.UserRevokeTokenCall.html), [*set available product set*](struct.UserSetAvailableProductSetCall.html) and [*update*](struct.UserUpdateCall.html) //! //! //! @@ -396,6 +398,9 @@ impl<'a, C, A> AndroidEnterprise pub fn managedconfigurationsforuser(&'a self) -> ManagedconfigurationsforuserMethods<'a, C, A> { ManagedconfigurationsforuserMethods { hub: &self } } + pub fn managedconfigurationssettings(&'a self) -> ManagedconfigurationssettingMethods<'a, C, A> { + ManagedconfigurationssettingMethods { hub: &self } + } pub fn permissions(&'a self) -> PermissionMethods<'a, C, A> { PermissionMethods { hub: &self } } @@ -444,20 +449,6 @@ impl<'a, C, A> AndroidEnterprise // ############ // SCHEMAS ### // ########## -/// An event generated when a new app version is uploaded to Google Play and its app restrictions schema changed. To fetch the app restrictions schema for an app, use Products.getAppRestrictionsSchema on the EMM 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 AppRestrictionsSchemaChangeEvent { - /// The id of the product (e.g. "app:com.google.android.gm") for which the app restriction schema changed. This field will always be present. - #[serde(rename="productId")] - pub product_id: Option, -} - -impl Part for AppRestrictionsSchemaChangeEvent {} - - /// A typed value for the restriction. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -594,6 +585,9 @@ impl ResponseResult for InstallsListResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProductSet { + /// Additional list of product IDs making up the product set. Unlike the productID array, in this list It's possible to specify which tracks (alpha, beta, production) of a product are visible to the user. See ProductVisibility and its fields for more information. Specifying the same product ID both here and in the productId array is not allowed and it will result in an error. + #[serde(rename="productVisibility")] + pub product_visibility: Option>, /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productSet". pub kind: Option, /// The list of product IDs making up the set of products. @@ -632,36 +626,6 @@ pub struct NewDeviceEvent { impl Part for NewDeviceEvent {} -/// Definition of a managed Google Play store page, made of a localized name and links to other pages. A page also contains clusters defined as a subcollection. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 storelayoutpages](struct.StorelayoutpageGetCall.html) (response) -/// * [update storelayoutpages](struct.StorelayoutpageUpdateCall.html) (request|response) -/// * [patch storelayoutpages](struct.StorelayoutpagePatchCall.html) (request|response) -/// * [insert storelayoutpages](struct.StorelayoutpageInsertCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StorePage { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storePage". - pub kind: Option, - /// Ordered list of pages a user should be able to reach from this page. The pages must exist, must not be this page, and once a link is created the page linked to cannot be deleted until all links to it are removed. It is recommended that the basic pages are created first, before adding the links between pages. - /// - /// No attempt is made to verify that all pages are reachable from the homepage. - pub link: Option>, - /// Unique ID of this page. Assigned by the server. Immutable once assigned. - pub id: Option, - /// Ordered list of localized strings giving the name of this page. The text displayed is the one that best matches the user locale, or the first entry if there is no good match. There needs to be at least one entry. - pub name: Option>, -} - -impl RequestValue for StorePage {} -impl ResponseResult for StorePage {} - - /// The Android Device Policy configuration of an enterprise. /// /// # Activities @@ -684,6 +648,27 @@ impl RequestValue for AndroidDevicePolicyConfig {} impl ResponseResult for AndroidDevicePolicyConfig {} +/// A managed configurations settings resource contains the set of managed properties that have been configured for an Android app to be applied to a set of users. The app's developer would have defined configurable properties in the managed configurations 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 ManagedConfigurationsSettings { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfigurationsSettings". + pub kind: Option, + /// The set of managed properties for this configuration. + #[serde(rename="managedProperty")] + pub managed_property: Option>, + /// The name of the managed configurations settings. + pub name: Option, + /// The ID of the managed configurations settings. + #[serde(rename="mcmId")] + pub mcm_id: Option, +} + +impl Part for ManagedConfigurationsSettings {} + + /// 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. /// /// The API can be used to read the set of permissions, and also to update the set to indicate that permissions have been accepted. @@ -702,111 +687,6 @@ pub struct ProductPermission { impl Part for ProductPermission {} -/// This represents an enterprise admin who can manage the enterprise in the managed Google Play store. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Administrator { - /// The admin's email address. - pub email: Option, -} - -impl Part for Administrator {} - - -/// The managed configuration resources for the 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*). -/// -/// * [list managedconfigurationsfordevice](struct.ManagedconfigurationsfordeviceListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ManagedConfigurationsForDeviceListResponse { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfigurationsForDeviceListResponse". - pub kind: Option, - /// A managed configuration for an app on a specific device. - #[serde(rename="managedConfigurationForDevice")] - pub managed_configuration_for_device: Option>, -} - -impl ResponseResult for ManagedConfigurationsForDeviceListResponse {} - - -/// A Permissions resource represents some extra capability, to be granted to an Android app, which requires explicit consent. An enterprise admin must consent to these permissions on behalf of their users before an entitlement for the app can be created. -/// -/// The permissions collection is read-only. The information provided for each permission (localized name and description) is intended to be used in the MDM user interface when obtaining consent from the enterprise. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get permissions](struct.PermissionGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Permission { - /// An opaque string uniquely identifying the permission. - #[serde(rename="permissionId")] - pub permission_id: Option, - /// A longer description of the Permissions resource, giving more details of what it affects. - pub description: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#permission". - pub kind: Option, - /// The name of the permission. - pub name: Option, -} - -impl Resource for Permission {} -impl ResponseResult for Permission {} - - -/// A resource returned by the PullNotificationSet API, which contains a collection of notifications for enterprises associated with the service account authenticated for 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*). -/// -/// * [pull notification set enterprises](struct.EnterprisePullNotificationSetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NotificationSet { - /// The notifications received, or empty if no notifications are present. - pub notification: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#notificationSet". - pub kind: Option, - /// The notification set ID, required to mark the notification as received with the Enterprises.AcknowledgeNotification API. This will be omitted if no notifications are present. - #[serde(rename="notificationSetId")] - pub notification_set_id: Option, -} - -impl ResponseResult for NotificationSet {} - - -/// The entitlement resources for the 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 entitlements](struct.EntitlementListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EntitlementsListResponse { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#entitlementsListResponse". - pub kind: Option, - /// An entitlement of a user to a product (e.g. an app). For example, a free app that they have installed, or a paid app that they have been allocated a license to. - pub entitlement: Option>, -} - -impl ResponseResult for EntitlementsListResponse {} - - /// A notification of one event relating to an enterprise. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -882,77 +762,26 @@ pub struct ProductSigningCertificate { 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. +/// 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*). /// -/// * [patch managedconfigurationsforuser](struct.ManagedconfigurationsforuserPatchCall.html) (request|response) -/// * [get managedconfigurationsforuser](struct.ManagedconfigurationsforuserGetCall.html) (response) -/// * [update managedconfigurationsforuser](struct.ManagedconfigurationsforuserUpdateCall.html) (request|response) -/// * [patch managedconfigurationsfordevice](struct.ManagedconfigurationsfordevicePatchCall.html) (request|response) -/// * [get managedconfigurationsfordevice](struct.ManagedconfigurationsfordeviceGetCall.html) (response) -/// * [update managedconfigurationsfordevice](struct.ManagedconfigurationsfordeviceUpdateCall.html) (request|response) +/// * [send test push notification enterprises](struct.EnterpriseSendTestPushNotificationCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ManagedConfiguration { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfiguration". - pub kind: Option, - /// The set of managed properties for this configuration. - #[serde(rename="managedProperty")] - pub managed_property: Option>, - /// The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm". - #[serde(rename="productId")] - pub product_id: Option, +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 RequestValue for ManagedConfiguration {} -impl ResponseResult for ManagedConfiguration {} - - -/// 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*). -/// -/// * [get state devices](struct.DeviceGetStateCall.html) (response) -/// * [set state devices](struct.DeviceSetStateCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -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 RequestValue for DeviceState {} -impl ResponseResult for DeviceState {} - - -/// The user resources for the group license. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 grouplicenseusers](struct.GrouplicenseuserListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GroupLicenseUsersListResponse { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicenseUsersListResponse". - pub kind: Option, - /// A user of an enterprise. - pub user: Option>, -} - -impl ResponseResult for GroupLicenseUsersListResponse {} +impl ResponseResult for EnterprisesSendTestPushNotificationResponse {} /// A localized string with its locale. @@ -970,60 +799,42 @@ pub struct LocalizedText { impl Part for LocalizedText {} -/// A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise user. -/// -/// This collection cannot be modified via the API. It is automatically populated as devices are set up to be managed. +/// An AuthenticationToken is used by the EMM's device policy client on a device to provision the given EMM-managed user on that 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*). /// -/// * [get devices](struct.DeviceGetCall.html) (response) -/// * [get state devices](struct.DeviceGetStateCall.html) (none) -/// * [list devices](struct.DeviceListCall.html) (none) -/// * [set state devices](struct.DeviceSetStateCall.html) (none) +/// * [generate authentication token users](struct.UserGenerateAuthenticationTokenCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Device { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#device". +pub struct AuthenticationToken { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#authenticationToken". pub kind: Option, - /// The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0". - #[serde(rename="androidId")] - pub android_id: Option, - /// Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations. - /// - /// Possible values include: - /// - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner. - /// - "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC. - /// - "containerApp", no longer used (deprecated). - /// - "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC. - #[serde(rename="managementType")] - pub management_type: Option, + /// The authentication token to be passed to the device policy client on the device where it can be used to provision the account for which this token was generated. + pub token: Option, } -impl Resource for Device {} -impl ResponseResult for Device {} +impl ResponseResult for AuthenticationToken {} -/// There is no detailed description. +/// A variable set is a key-value pair of EMM-provided placeholders and its corresponding value, which is attributed to a user. For example, $FIRSTNAME could be a placeholder, and its value could be Alice. Placeholders should start with a '$' sign and should be alphanumeric 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 PageInfo { - /// no description provided - #[serde(rename="resultPerPage")] - pub result_per_page: Option, - /// no description provided - #[serde(rename="startIndex")] - pub start_index: Option, - /// no description provided - #[serde(rename="totalResults")] - pub total_results: Option, +pub struct VariableSet { + /// The value of the placeholder, specific to the user. + #[serde(rename="userValue")] + pub user_value: Option, + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#variableSet". + pub kind: Option, + /// The placeholder string; defined by EMM. + pub placeholder: Option, } -impl Part for PageInfo {} +impl Part for VariableSet {} /// There is no detailed description. @@ -1044,26 +855,6 @@ pub struct ProductsGenerateApprovalUrlResponse { impl ResponseResult for ProductsGenerateApprovalUrlResponse {} -/// Represents the list of app restrictions available to be pre-configured for the product. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 app restrictions schema products](struct.ProductGetAppRestrictionsSchemaCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AppRestrictionsSchema { - /// The set of restrictions that make up this schema. - pub restrictions: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#appRestrictionsSchema". - pub kind: Option, -} - -impl ResponseResult for AppRestrictionsSchema {} - - /// A restriction in the App Restriction Schema represents a piece of configuration that may be pre-applied. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1135,46 +926,25 @@ pub struct NewPermissionsEvent { impl Part for NewPermissionsEvent {} -/// The store page resources for the enterprise. +/// The managed configuration resources for the 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*). /// -/// * [list storelayoutpages](struct.StorelayoutpageListCall.html) (response) +/// * [list managedconfigurationsfordevice](struct.ManagedconfigurationsfordeviceListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StoreLayoutPagesListResponse { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayoutPagesListResponse". +pub struct ManagedConfigurationsForDeviceListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfigurationsForDeviceListResponse". pub kind: Option, - /// A store page of an enterprise. - pub page: Option>, + /// A managed configuration for an app on a specific device. + #[serde(rename="managedConfigurationForDevice")] + pub managed_configuration_for_device: Option>, } -impl ResponseResult for StoreLayoutPagesListResponse {} - - -/// A service account identity, including the name and credentials that can be used to authenticate as the 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*). -/// -/// * [get service account enterprises](struct.EnterpriseGetServiceAccountCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ServiceAccount { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#serviceAccount". - pub kind: Option, - /// The account name of the service account, in the form of an email address. Assigned by the server. - pub name: Option, - /// Credentials that can be used to authenticate as this ServiceAccount. - pub key: Option, -} - -impl ResponseResult for ServiceAccount {} +impl ResponseResult for ManagedConfigurationsForDeviceListResponse {} /// A service account that can be used to authenticate as the enterprise to API calls that require such authentication. @@ -1199,21 +969,26 @@ impl RequestValue for EnterpriseAccount {} impl ResponseResult for EnterpriseAccount {} -/// There is no detailed description. +/// A service account identity, including the name and credentials that can be used to authenticate as the service account. /// -/// 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*). +/// +/// * [get service account enterprises](struct.EnterpriseGetServiceAccountCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TokenPagination { - /// no description provided - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// no description provided - #[serde(rename="previousPageToken")] - pub previous_page_token: Option, +pub struct ServiceAccount { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#serviceAccount". + pub kind: Option, + /// The account name of the service account, in the form of an email address. Assigned by the server. + pub name: Option, + /// Credentials that can be used to authenticate as this ServiceAccount. + pub key: Option, } -impl Part for TokenPagination {} +impl ResponseResult for ServiceAccount {} /// The matching products. @@ -1242,64 +1017,69 @@ pub struct ProductsListResponse { impl ResponseResult for ProductsListResponse {} -/// This represents a single version of the app. +/// 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 serviceaccountkeys](struct.ServiceaccountkeyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ServiceAccountKeysListResponse { + /// The service account credentials. + #[serde(rename="serviceAccountKey")] + pub service_account_key: Option>, +} + +impl ResponseResult for ServiceAccountKeysListResponse {} + + +/// A product to be made visible to a 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 AppVersion { - /// Unique increasing identifier for the app version. - #[serde(rename="versionCode")] - pub version_code: Option, - /// The string used in the Play store by the app developer to identify the version. The string is not necessarily unique or localized (for example, the string could be "1.4"). - #[serde(rename="versionString")] - pub version_string: Option, +pub struct ProductVisibility { + /// Grants visibility to the specified track(s) of the product to the user. The track available to the user is based on the following order of preference: alpha, beta, production. For example, if an app has a prod version, a beta version and an alpha version and the enterprise has been granted visibility to both the alpha and beta tracks, if tracks is {"beta", "production"} the user will be able to install the app and they will get the beta version of the app. If there are no app versions in the specified track adding the "alpha" and "beta" values to the list of tracks will have no effect. Note that the enterprise requires access to alpha and/or beta tracks before users can be granted visibility to apps in those tracks. + /// + /// The allowed sets are: {} (considered equivalent to {"production"}) {"production"} {"beta", "production"} {"alpha", "beta", "production"} The order of elements is not relevant. Any other set of tracks will be rejected with an error. + pub tracks: Option>, + /// The product ID to make visible to the user. Required for each item in the productVisibility list. + #[serde(rename="productId")] + pub product_id: Option, } -impl Part for AppVersion {} +impl Part for ProductVisibility {} -/// An AuthenticationToken is used by the EMM's device policy client on a device to provision the given EMM-managed user on that device. +/// General setting for the managed Google Play store layout, currently only specifying the page to display the first time the store is opened. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [generate authentication token users](struct.UserGenerateAuthenticationTokenCall.html) (response) +/// * [set store layout enterprises](struct.EnterpriseSetStoreLayoutCall.html) (request|response) +/// * [get store layout enterprises](struct.EnterpriseGetStoreLayoutCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AuthenticationToken { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#authenticationToken". +pub struct StoreLayout { + /// The ID of the store page to be used as the homepage. The homepage is the first page shown in the managed Google Play Store. + /// + /// Not specifying a homepage is equivalent to setting the store layout type to "basic". + #[serde(rename="homepageId")] + pub homepage_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayout". pub kind: Option, - /// The authentication token to be passed to the device policy client on the device where it can be used to provision the account for which this token was generated. - pub token: Option, + /// The store layout type. By default, this value is set to "basic" if the homepageId field is not set, and to "custom" otherwise. If set to "basic", the layout will consist of all approved apps that have been whitelisted for the user. + #[serde(rename="storeLayoutType")] + pub store_layout_type: Option, } -impl ResponseResult for AuthenticationToken {} - - -/// A resource returned by the GenerateSignupUrl API, which contains the Signup URL and Completion 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*). -/// -/// * [generate signup url enterprises](struct.EnterpriseGenerateSignupUrlCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SignupInfo { - /// 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, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#signupInfo". - pub kind: Option, - /// An opaque token that will be required, along with the Enterprise Token, for obtaining the enterprise resource from CompleteSignup. - #[serde(rename="completionToken")] - pub completion_token: Option, -} - -impl ResponseResult for SignupInfo {} +impl RequestValue for StoreLayout {} +impl ResponseResult for StoreLayout {} /// The device resources for the user. @@ -1439,29 +1219,6 @@ pub struct InstallFailureEvent { impl Part for InstallFailureEvent {} -/// A UserToken is used by a user when setting up a managed device or profile with their managed Google Play account on a device. When the user enters their email address and token (activation code) the appropriate EMM app can be automatically downloaded. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [generate token users](struct.UserGenerateTokenCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UserToken { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#userToken". - pub kind: Option, - /// The unique ID for the user. - #[serde(rename="userId")] - pub user_id: Option, - /// The token (activation code) to be entered by the user. This consists of a sequence of decimal digits. Note that the leading digit may be 0. - pub token: Option, -} - -impl ResponseResult for UserToken {} - - /// Specification for a token used to generate iframes. The token specifies what data the admin is allowed to modify and the URI the iframe is allowed to communiate with. /// /// # Activities @@ -1518,26 +1275,533 @@ pub struct AdministratorWebToken { impl ResponseResult for AdministratorWebToken {} -/// There is no detailed description. +/// The policy for a product. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ProductPolicy { + /// Grants visibility to the specified track(s) of the product to the device. The track available to the device is based on the following order of preference: alpha, beta, production. For example, if an app has a prod version, a beta version and an alpha version and the enterprise has been granted visibility to both the alpha and beta tracks, if tracks is {"beta", "production"} then the beta version of the app is made available to the device. If there are no app versions in the specified track adding the "alpha" and "beta" values to the list of tracks will have no effect. Note that the enterprise requires access to alpha and/or beta tracks before users can be granted visibility to apps in those tracks. + /// + /// The allowed sets are: {} (considered equivalent to {"production"}) {"production"} {"beta", "production"} {"alpha", "beta", "production"} The order of elements is not relevant. Any other set of tracks will be rejected with an error. + pub tracks: Option>, + /// The ID of the product. For example, "app:com.google.android.gm". + #[serde(rename="productId")] + pub product_id: Option, +} + +impl Part for ProductPolicy {} + + +/// A bundle of managed 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 ManagedPropertyBundle { + /// The list of managed properties. + #[serde(rename="managedProperty")] + pub managed_property: Option>, +} + +impl Part for ManagedPropertyBundle {} + + +/// An event generated when a new app version is uploaded to Google Play and its app restrictions schema changed. To fetch the app restrictions schema for an app, use Products.getAppRestrictionsSchema on the EMM 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 AppRestrictionsSchemaChangeEvent { + /// The id of the product (e.g. "app:com.google.android.gm") for which the app restriction schema changed. This field will always be present. + #[serde(rename="productId")] + pub product_id: Option, +} + +impl Part for AppRestrictionsSchemaChangeEvent {} + + +/// A configuration variables resource contains the managed configuration settings ID to be applied to a single user, as well as the variable set that is attributed to the user. The variable set will be used to replace placeholders in the managed 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 ConfigurationVariables { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#configurationVariables". + pub kind: Option, + /// The variable set that is attributed to the user. + #[serde(rename="variableSet")] + pub variable_set: Option>, + /// The ID of the managed configurations settings. + #[serde(rename="mcmId")] + pub mcm_id: Option, +} + +impl Part for ConfigurationVariables {} + + +/// The device policy for a given managed 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 Policy { + /// The list of product policies. + #[serde(rename="productPolicy")] + pub product_policy: Option>, + /// The availability granted to the device for the specified products. "all" gives the device access to all products, regardless of approval status. "allApproved" entitles the device to access all products that are approved for the enterprise. "allApproved" and "all" do not enable automatic visibility of "alpha" or "beta" tracks. "whitelist" grants the device access the products specified in productPolicy[]. Only products that are approved or products that were previously approved (products with revoked approval) by the enterprise can be whitelisted. If no value is provided, the availability set at the user level is applied by default. + #[serde(rename="productAvailabilityPolicy")] + pub product_availability_policy: Option, +} + +impl Part for Policy {} + + +/// A Products resource represents an app in the Google Play store that is available to at least some users in the enterprise. (Some apps are restricted to a single enterprise, and no information about them is made available outside that enterprise.) +/// +/// The information provided for each product (localized name, icon, link to the full Google Play details page) is intended to allow a basic representation of the product within an EMM user interface. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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 permissions products](struct.ProductGetPermissionCall.html) (none) +/// * [get products](struct.ProductGetCall.html) (response) +/// * [approve products](struct.ProductApproveCall.html) (none) +/// * [get app restrictions schema products](struct.ProductGetAppRestrictionsSchemaCall.html) (none) +/// * [list products](struct.ProductListCall.html) (none) +/// * [unapprove products](struct.ProductUnapproveCall.html) (none) +/// * [generate approval url products](struct.ProductGenerateApprovalUrlCall.html) (none) /// #[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 Product { + /// 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. + #[serde(rename="smallIconUrl")] + pub small_icon_url: Option, + /// The countries which this app is available in. + #[serde(rename="availableCountries")] + pub available_countries: Option>, + /// A localized promotional description, if available. + pub description: Option, + /// A description of the recent changes made to the app. + #[serde(rename="recentChanges")] + pub recent_changes: Option, + /// 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. + #[serde(rename="appVersion")] + pub app_version: Option>, + /// A list of screenshot links representing the app. + #[serde(rename="screenshotUrls")] + pub screenshot_urls: Option>, + /// A link to an image that can be used as an icon for the product. This image is suitable for use at up to 512px x 512px. + #[serde(rename="iconUrl")] + pub icon_url: Option, + /// A link to the (consumer) Google Play details page for the product. + #[serde(rename="detailsUrl")] + pub details_url: 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). + #[serde(rename="productPricing")] + pub product_pricing: Option, + /// The permissions required for this app. + pub permissions: Option>, + /// The app category (e.g. RACING, SOCIAL, etc.) + pub category: Option, + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#product". + pub kind: Option, + /// How and to whom the package is made available. The value publicGoogleHosted means that the package is available through the Play store and not restricted to a specific enterprise. The value privateGoogleHosted means that the package is a private app (restricted to an enterprise) but hosted by Google. The value privateSelfHosted means that the package is a private app (restricted to an enterprise) and is privately hosted. + #[serde(rename="distributionChannel")] + pub distribution_channel: Option, + /// The name of the product. + pub title: Option, + /// The minimum Android SDK necessary to run the app. + #[serde(rename="minAndroidSdkVersion")] + pub min_android_sdk_version: Option, + /// The content rating for this app. + #[serde(rename="contentRating")] + pub content_rating: Option, + /// The tracks that are visible to the enterprise. + #[serde(rename="availableTracks")] + pub available_tracks: Option>, + /// The name of the author of the product (for example, the app developer). + #[serde(rename="authorName")] + pub author_name: Option, + /// The time (in milliseconds since epoch) when application was last published. (Timestamp is approximate within 7 days of actual publish time.) + #[serde(rename="lastUpdatedTimestampMillis")] + pub last_updated_timestamp_millis: Option, + /// The certificate used to sign this product. + #[serde(rename="signingCertificate")] + pub signing_certificate: Option, + /// Deprecated. + #[serde(rename="requiresContainerApp")] + pub requires_container_app: 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, } -impl ResponseResult for EnterprisesSendTestPushNotificationResponse {} +impl Resource for Product {} +impl ResponseResult for Product {} + + +/// A Permissions resource represents some extra capability, to be granted to an Android app, which requires explicit consent. An enterprise admin must consent to these permissions on behalf of their users before an entitlement for the app can be created. +/// +/// The permissions collection is read-only. The information provided for each permission (localized name and description) is intended to be used in the MDM user interface when obtaining consent from the enterprise. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get permissions](struct.PermissionGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Permission { + /// An opaque string uniquely identifying the permission. + #[serde(rename="permissionId")] + pub permission_id: Option, + /// A longer description of the Permissions resource, giving more details of what it affects. + pub description: Option, + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#permission". + pub kind: Option, + /// The name of the permission. + pub name: Option, +} + +impl Resource for Permission {} +impl ResponseResult for Permission {} + + +/// A resource returned by the PullNotificationSet API, which contains a collection of notifications for enterprises associated with the service account authenticated for 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*). +/// +/// * [pull notification set enterprises](struct.EnterprisePullNotificationSetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NotificationSet { + /// The notifications received, or empty if no notifications are present. + pub notification: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#notificationSet". + pub kind: Option, + /// The notification set ID, required to mark the notification as received with the Enterprises.AcknowledgeNotification API. This will be omitted if no notifications are present. + #[serde(rename="notificationSetId")] + pub notification_set_id: Option, +} + +impl ResponseResult for NotificationSet {} + + +/// The entitlement resources for the 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 entitlements](struct.EntitlementListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EntitlementsListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#entitlementsListResponse". + pub kind: Option, + /// An entitlement of a user to a product (e.g. an app). For example, a free app that they have installed, or a paid app that they have been allocated a license to. + pub entitlement: Option>, +} + +impl ResponseResult for EntitlementsListResponse {} + + +/// A managed configuration resource contains the set of managed properties defined by the app developer in the app's managed configurations schema, as well as any configuration variables defined for the 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*). +/// +/// * [patch managedconfigurationsforuser](struct.ManagedconfigurationsforuserPatchCall.html) (request|response) +/// * [get managedconfigurationsforuser](struct.ManagedconfigurationsforuserGetCall.html) (response) +/// * [update managedconfigurationsforuser](struct.ManagedconfigurationsforuserUpdateCall.html) (request|response) +/// * [patch managedconfigurationsfordevice](struct.ManagedconfigurationsfordevicePatchCall.html) (request|response) +/// * [get managedconfigurationsfordevice](struct.ManagedconfigurationsfordeviceGetCall.html) (response) +/// * [update managedconfigurationsfordevice](struct.ManagedconfigurationsfordeviceUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedConfiguration { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfiguration". + pub kind: Option, + /// Contains the ID of the managed configuration profile and the set of configuration variables (if any) defined for the user. + #[serde(rename="configurationVariables")] + pub configuration_variables: Option, + /// The set of managed properties for this configuration. + #[serde(rename="managedProperty")] + pub managed_property: Option>, + /// The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm". + #[serde(rename="productId")] + pub product_id: Option, +} + +impl RequestValue for ManagedConfiguration {} +impl ResponseResult for ManagedConfiguration {} + + +/// 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*). +/// +/// * [get state devices](struct.DeviceGetStateCall.html) (response) +/// * [set state devices](struct.DeviceSetStateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +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 RequestValue for DeviceState {} +impl ResponseResult for DeviceState {} + + +/// The user resources for the group license. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 grouplicenseusers](struct.GrouplicenseuserListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GroupLicenseUsersListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicenseUsersListResponse". + pub kind: Option, + /// A user of an enterprise. + pub user: Option>, +} + +impl ResponseResult for GroupLicenseUsersListResponse {} + + +/// Information on an approval URL. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApprovalUrlInfo { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#approvalUrlInfo". + pub kind: Option, + /// A URL that displays a product's permissions and that can also be used to approve the product with the Products.approve call. + #[serde(rename="approvalUrl")] + pub approval_url: Option, +} + +impl Part for ApprovalUrlInfo {} + + +/// Represents the list of app restrictions available to be pre-configured for the product. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 app restrictions schema products](struct.ProductGetAppRestrictionsSchemaCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppRestrictionsSchema { + /// The set of restrictions that make up this schema. + pub restrictions: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#appRestrictionsSchema". + pub kind: Option, +} + +impl ResponseResult for AppRestrictionsSchema {} + + +/// The store page resources for the enterprise. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list storelayoutpages](struct.StorelayoutpageListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StoreLayoutPagesListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayoutPagesListResponse". + pub kind: Option, + /// A store page of an enterprise. + pub page: Option>, +} + +impl ResponseResult for StoreLayoutPagesListResponse {} + + +/// 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 TokenPagination { + /// no description provided + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// no description provided + #[serde(rename="previousPageToken")] + pub previous_page_token: Option, +} + +impl Part for TokenPagination {} + + +/// This represents a single version of the 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 AppVersion { + /// The track that this app was published in. For example if track is "alpha", this is an alpha version of the app. + pub track: Option, + /// Unique increasing identifier for the app version. + #[serde(rename="versionCode")] + pub version_code: Option, + /// The string used in the Play store by the app developer to identify the version. The string is not necessarily unique or localized (for example, the string could be "1.4"). + #[serde(rename="versionString")] + pub version_string: Option, +} + +impl Part for AppVersion {} + + +/// A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise 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*). +/// +/// * [patch devices](struct.DevicePatchCall.html) (request|response) +/// * [set state devices](struct.DeviceSetStateCall.html) (none) +/// * [get devices](struct.DeviceGetCall.html) (response) +/// * [get state devices](struct.DeviceGetStateCall.html) (none) +/// * [update devices](struct.DeviceUpdateCall.html) (request|response) +/// * [list devices](struct.DeviceListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Device { + /// The policy enforced on the device. + pub policy: Option, + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#device". + pub kind: Option, + /// The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0". + #[serde(rename="androidId")] + pub android_id: Option, + /// Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations. + /// + /// Possible values include: + /// - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner. + /// - "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC. + /// - "containerApp", no longer used (deprecated). + /// - "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC. + #[serde(rename="managementType")] + pub management_type: Option, +} + +impl RequestValue for Device {} +impl Resource for Device {} +impl ResponseResult for Device {} + + +/// A resource returned by the GenerateSignupUrl API, which contains the Signup URL and Completion 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*). +/// +/// * [generate signup url enterprises](struct.EnterpriseGenerateSignupUrlCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SignupInfo { + /// 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, + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#signupInfo". + pub kind: Option, + /// An opaque token that will be required, along with the Enterprise Token, for obtaining the enterprise resource from CompleteSignup. + #[serde(rename="completionToken")] + pub completion_token: Option, +} + +impl ResponseResult for SignupInfo {} + + +/// A UserToken is used by a user when setting up a managed device or profile with their managed Google Play account on a device. When the user enters their email address and token (activation code) the appropriate EMM app can be automatically downloaded. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [generate token users](struct.UserGenerateTokenCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserToken { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#userToken". + pub kind: Option, + /// The unique ID for the user. + #[serde(rename="userId")] + pub user_id: Option, + /// The token (activation code) to be entered by the user. This consists of a sequence of decimal digits. Note that the leading digit may be 0. + pub token: Option, +} + +impl ResponseResult for UserToken {} + + +/// The managed configurations settings for a product. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 managedconfigurationssettings](struct.ManagedconfigurationssettingListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedConfigurationsSettingsListResponse { + /// A managed configurations settings for an app that may be assigned to a group of users in an enterprise. + #[serde(rename="managedConfigurationsSettings")] + pub managed_configurations_settings: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfigurationsSettingsListResponse". + pub kind: Option, +} + +impl ResponseResult for ManagedConfigurationsSettingsListResponse {} + + +/// This represents an enterprise admin who can manage the enterprise in the managed Google Play store. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Administrator { + /// The admin's email address. + pub email: Option, +} + +impl Part for Administrator {} /// The grouplicense resources for the enterprise. @@ -1615,34 +1879,6 @@ pub struct UsersListResponse { impl ResponseResult for UsersListResponse {} -/// General setting for the managed Google Play store layout, currently only specifying the page to display the first time the store is opened. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 store layout enterprises](struct.EnterpriseSetStoreLayoutCall.html) (request|response) -/// * [get store layout enterprises](struct.EnterpriseGetStoreLayoutCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StoreLayout { - /// The ID of the store page to be used as the homepage. The homepage is the first page shown in the managed Google Play Store. - /// - /// Not specifying a homepage is equivalent to setting the store layout type to "basic". - #[serde(rename="homepageId")] - pub homepage_id: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayout". - pub kind: Option, - /// The store layout type. By default, this value is set to "basic" if the homepageId field is not set, and to "custom" otherwise. If set to "basic", the layout will consist of all approved apps that have been whitelisted for the user. - #[serde(rename="storeLayoutType")] - pub store_layout_type: Option, -} - -impl RequestValue for StoreLayout {} -impl ResponseResult for StoreLayout {} - - /// Credentials that can be used to authenticate as a service account. /// /// # Activities @@ -1673,66 +1909,34 @@ impl Resource for ServiceAccountKey {} impl ResponseResult for ServiceAccountKey {} -/// A Products resource represents an app in the Google Play store that is available to at least some users in the enterprise. (Some apps are restricted to a single enterprise, and no information about them is made available outside that enterprise.) -/// -/// The information provided for each product (localized name, icon, link to the full Google Play details page) is intended to allow a basic representation of the product within an EMM user interface. +/// Definition of a managed Google Play store page, made of a localized name and links to other pages. A page also contains clusters defined as a subcollection. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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 permissions products](struct.ProductGetPermissionCall.html) (none) -/// * [get products](struct.ProductGetCall.html) (response) -/// * [approve products](struct.ProductApproveCall.html) (none) -/// * [get app restrictions schema products](struct.ProductGetAppRestrictionsSchemaCall.html) (none) -/// * [list products](struct.ProductListCall.html) (none) -/// * [unapprove products](struct.ProductUnapproveCall.html) (none) -/// * [generate approval url products](struct.ProductGenerateApprovalUrlCall.html) (none) +/// * [get storelayoutpages](struct.StorelayoutpageGetCall.html) (response) +/// * [update storelayoutpages](struct.StorelayoutpageUpdateCall.html) (request|response) +/// * [patch storelayoutpages](struct.StorelayoutpagePatchCall.html) (request|response) +/// * [insert storelayoutpages](struct.StorelayoutpageInsertCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Product { - /// 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. - #[serde(rename="smallIconUrl")] - pub small_icon_url: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#product". +pub struct StorePage { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storePage". pub kind: Option, - /// How and to whom the package is made available. The value publicGoogleHosted means that the package is available through the Play store and not restricted to a specific enterprise. The value privateGoogleHosted means that the package is a private app (restricted to an enterprise) but hosted by Google. The value privateSelfHosted means that the package is a private app (restricted to an enterprise) and is privately hosted. - #[serde(rename="distributionChannel")] - pub distribution_channel: Option, - /// The name of the product. - pub title: Option, - /// 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. - #[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). - #[serde(rename="productPricing")] - pub product_pricing: Option, - /// A link to an image that can be used as an icon for the product. This image is suitable for use at up to 512px x 512px. - #[serde(rename="iconUrl")] - pub icon_url: Option, - /// The name of the author of the product (for example, the app developer). - #[serde(rename="authorName")] - pub author_name: Option, - /// Deprecated. - #[serde(rename="requiresContainerApp")] - pub requires_container_app: Option, - /// A link to the (consumer) Google Play details page for the product. - #[serde(rename="detailsUrl")] - pub details_url: Option, - /// 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, + /// Ordered list of pages a user should be able to reach from this page. The pages must exist, must not be this page, and once a link is created the page linked to cannot be deleted until all links to it are removed. It is recommended that the basic pages are created first, before adding the links between pages. + /// + /// No attempt is made to verify that all pages are reachable from the homepage. + pub link: Option>, + /// Unique ID of this page. Assigned by the server. Immutable once assigned. + pub id: Option, + /// Ordered list of localized strings giving the name of this page. The text displayed is the one that best matches the user locale, or the first entry if there is no good match. There needs to be at least one entry. + pub name: Option>, } -impl Resource for Product {} -impl ResponseResult for Product {} +impl RequestValue for StorePage {} +impl ResponseResult for StorePage {} /// There is no detailed description. @@ -1821,6 +2025,7 @@ impl Part for ManagedProperty {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [revoke token users](struct.UserRevokeTokenCall.html) (none) +/// * [revoke device access users](struct.UserRevokeDeviceAccesCall.html) (none) /// * [delete users](struct.UserDeleteCall.html) (none) /// * [generate authentication token users](struct.UserGenerateAuthenticationTokenCall.html) (none) /// * [list users](struct.UserListCall.html) (none) @@ -1876,23 +2081,9 @@ pub struct ProductApprovalEvent { impl Part for ProductApprovalEvent {} -/// A bundle of managed 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 ManagedPropertyBundle { - /// The list of managed properties. - #[serde(rename="managedProperty")] - pub managed_property: Option>, -} - -impl Part for ManagedPropertyBundle {} - - /// 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. /// -/// 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. +/// 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. In other words, the total number of Entitlements that exist for the product. /// /// 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. /// @@ -1934,37 +2125,22 @@ impl ResponseResult for GroupLicense {} /// 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 serviceaccountkeys](struct.ServiceaccountkeyListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ServiceAccountKeysListResponse { - /// The service account credentials. - #[serde(rename="serviceAccountKey")] - pub service_account_key: Option>, -} - -impl ResponseResult for ServiceAccountKeysListResponse {} - - -/// Information on an approval URL. -/// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApprovalUrlInfo { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#approvalUrlInfo". - pub kind: Option, - /// A URL that displays a product's permissions and that can also be used to approve the product with the Products.approve call. - #[serde(rename="approvalUrl")] - pub approval_url: Option, +pub struct PageInfo { + /// no description provided + #[serde(rename="resultPerPage")] + pub result_per_page: Option, + /// no description provided + #[serde(rename="startIndex")] + pub start_index: Option, + /// no description provided + #[serde(rename="totalResults")] + pub total_results: Option, } -impl Part for ApprovalUrlInfo {} +impl Part for PageInfo {} @@ -1972,6 +2148,67 @@ impl Part for ApprovalUrlInfo {} // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *managedconfigurationssetting* resources. +/// It is not used directly, but through the `AndroidEnterprise` 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_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); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.managedconfigurationssettings(); +/// # } +/// ``` +pub struct ManagedconfigurationssettingMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, +} + +impl<'a, C, A> MethodsBuilder for ManagedconfigurationssettingMethods<'a, C, A> {} + +impl<'a, C, A> ManagedconfigurationssettingMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists all the managed configurations settings for the specified app. Only the ID and the name is set. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `productId` - The ID of the product for which the managed configurations settings applies to. + pub fn list(&self, enterprise_id: &str, product_id: &str) -> ManagedconfigurationssettingListCall<'a, C, A> { + ManagedconfigurationssettingListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _product_id: product_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *storelayoutpage* resources. /// It is not used directly, but through the `AndroidEnterprise` hub. /// @@ -2030,14 +2267,14 @@ impl<'a, C, A> StorelayoutpageMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves details of a store page. + /// Deletes a store page. /// /// # Arguments /// /// * `enterpriseId` - The ID of the enterprise. /// * `pageId` - The ID of the page. - pub fn get(&self, enterprise_id: &str, page_id: &str) -> StorelayoutpageGetCall<'a, C, A> { - StorelayoutpageGetCall { + pub fn delete(&self, enterprise_id: &str, page_id: &str) -> StorelayoutpageDeleteCall<'a, C, A> { + StorelayoutpageDeleteCall { hub: self.hub, _enterprise_id: enterprise_id.to_string(), _page_id: page_id.to_string(), @@ -2049,17 +2286,15 @@ impl<'a, C, A> StorelayoutpageMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the content of a store page. + /// Retrieves details of a store page. /// /// # Arguments /// - /// * `request` - No description provided. /// * `enterpriseId` - The ID of the enterprise. /// * `pageId` - The ID of the page. - pub fn update(&self, request: StorePage, enterprise_id: &str, page_id: &str) -> StorelayoutpageUpdateCall<'a, C, A> { - StorelayoutpageUpdateCall { + pub fn get(&self, enterprise_id: &str, page_id: &str) -> StorelayoutpageGetCall<'a, C, A> { + StorelayoutpageGetCall { hub: self.hub, - _request: request, _enterprise_id: enterprise_id.to_string(), _page_id: page_id.to_string(), _delegate: Default::default(), @@ -2110,15 +2345,17 @@ impl<'a, C, A> StorelayoutpageMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a store page. + /// Updates the content of a store page. /// /// # Arguments /// + /// * `request` - No description provided. /// * `enterpriseId` - The ID of the enterprise. /// * `pageId` - The ID of the page. - pub fn delete(&self, enterprise_id: &str, page_id: &str) -> StorelayoutpageDeleteCall<'a, C, A> { - StorelayoutpageDeleteCall { + pub fn update(&self, request: StorePage, enterprise_id: &str, page_id: &str) -> StorelayoutpageUpdateCall<'a, C, A> { + StorelayoutpageUpdateCall { hub: self.hub, + _request: request, _enterprise_id: enterprise_id.to_string(), _page_id: page_id.to_string(), _delegate: Default::default(), @@ -2154,7 +2391,7 @@ impl<'a, C, A> StorelayoutpageMethods<'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 `delete(...)`, `generate_authentication_token(...)`, `generate_token(...)`, `get(...)`, `get_available_product_set(...)`, `insert(...)`, `list(...)`, `patch(...)`, `revoke_token(...)`, `set_available_product_set(...)` and `update(...)` +/// // like `delete(...)`, `generate_authentication_token(...)`, `generate_token(...)`, `get(...)`, `get_available_product_set(...)`, `insert(...)`, `list(...)`, `patch(...)`, `revoke_device_access(...)`, `revoke_token(...)`, `set_available_product_set(...)` and `update(...)` /// // to build up your call. /// let rb = hub.users(); /// # } @@ -2230,6 +2467,27 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Revokes access to all devices currently provisioned to the user. The user will no longer be able to use the managed Play store on any of their managed devices. + /// + /// This call only works with EMM-managed accounts. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn revoke_device_access(&self, enterprise_id: &str, user_id: &str) -> UserRevokeDeviceAccesCall<'a, C, A> { + UserRevokeDeviceAccesCall { + 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: /// /// Deleted an EMM-managed user. @@ -2818,7 +3076,7 @@ impl<'a, C, A> ManagedconfigurationsfordeviceMethods<'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 `get(...)`, `get_state(...)`, `list(...)` and `set_state(...)` +/// // like `get(...)`, `get_state(...)`, `list(...)`, `patch(...)`, `set_state(...)` and `update(...)` /// // to build up your call. /// let rb = hub.devices(); /// # } @@ -2916,6 +3174,54 @@ impl<'a, C, A> DeviceMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Updates the device policy + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + /// * `deviceId` - The ID of the device. + pub fn update(&self, request: Device, enterprise_id: &str, user_id: &str, device_id: &str) -> DeviceUpdateCall<'a, C, A> { + DeviceUpdateCall { + hub: self.hub, + _request: request, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _device_id: device_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: + /// + /// Updates the device policy. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + /// * `deviceId` - The ID of the device. + pub fn patch(&self, request: Device, enterprise_id: &str, user_id: &str, device_id: &str) -> DevicePatchCall<'a, C, A> { + DevicePatchCall { + hub: self.hub, + _request: request, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _device_id: device_id.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -3008,6 +3314,25 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `enterpriseId` - The ID of the enterprise. + pub fn create_web_token(&self, request: AdministratorWebTokenSpec, enterprise_id: &str) -> EnterpriseCreateWebTokenCall<'a, C, A> { + EnterpriseCreateWebTokenCall { + 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: /// /// Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. @@ -3253,25 +3578,6 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - pub fn create_web_token(&self, request: AdministratorWebTokenSpec, enterprise_id: &str) -> EnterpriseCreateWebTokenCall<'a, C, A> { - EnterpriseCreateWebTokenCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -3674,7 +3980,7 @@ impl<'a, C, A> ManagedconfigurationsforuserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics. + /// Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. This method supports patch semantics. /// /// # Arguments /// @@ -3737,7 +4043,7 @@ impl<'a, C, A> ManagedconfigurationsforuserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Adds or updates a per-user managed configuration for an app for the specified user. + /// Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. /// /// # Arguments /// @@ -4159,6 +4465,261 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { // CallBuilders ### // ################# +/// Lists all the managed configurations settings for the specified app. Only the ID and the name is set. +/// +/// A builder for the *list* method supported by a *managedconfigurationssetting* resource. +/// It is not used directly, but through a `ManagedconfigurationssettingMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.managedconfigurationssettings().list("enterpriseId", "productId") +/// .doit(); +/// # } +/// ``` +pub struct ManagedconfigurationssettingListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _product_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ManagedconfigurationssettingListCall<'a, C, A> {} + +impl<'a, C, A> ManagedconfigurationssettingListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ManagedConfigurationsSettingsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.managedconfigurationssettings.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(("productId", self._product_id.to_string())); + for &field in ["alt", "enterpriseId", "productId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings"; + 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::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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) -> ManagedconfigurationssettingListCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the product for which the managed configurations settings applies to. + /// + /// 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) -> ManagedconfigurationssettingListCall<'a, C, A> { + self._product_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ManagedconfigurationssettingListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ManagedconfigurationssettingListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> ManagedconfigurationssettingListCall<'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 details of all pages in the store. /// /// A builder for the *list* method supported by a *storelayoutpage* resource. @@ -4402,6 +4963,250 @@ impl<'a, C, A> StorelayoutpageListCall<'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.storelayoutpages().delete("enterpriseId", "pageId") +/// .doit(); +/// # } +/// ``` +pub struct StorelayoutpageDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _page_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for StorelayoutpageDeleteCall<'a, C, A> {} + +impl<'a, C, A> StorelayoutpageDeleteCall<'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: "androidenterprise.storelayoutpages.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("pageId", self._page_id.to_string())); + for &field in ["enterpriseId", "pageId"].iter() { + if self._additional_params.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() + "enterprises/{enterpriseId}/storeLayout/pages/{pageId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{pageId}", "pageId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["pageId", "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::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 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) -> StorelayoutpageDeleteCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the page. + /// + /// Sets the *page id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn page_id(mut self, new_value: &str) -> StorelayoutpageDeleteCall<'a, C, A> { + self._page_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> StorelayoutpageDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> StorelayoutpageDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> StorelayoutpageDeleteCall<'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 store page. /// /// A builder for the *get* method supported by a *storelayoutpage* resource. @@ -4657,292 +5462,6 @@ impl<'a, C, A> StorelayoutpageGetCall<'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 = StorePage::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.storelayoutpages().update(req, "enterpriseId", "pageId") -/// .doit(); -/// # } -/// ``` -pub struct StorelayoutpageUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: StorePage, - _enterprise_id: String, - _page_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for StorelayoutpageUpdateCall<'a, C, A> {} - -impl<'a, C, A> StorelayoutpageUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StorePage)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.storelayoutpages.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("pageId", self._page_id.to_string())); - for &field in ["alt", "enterpriseId", "pageId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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}/storeLayout/pages/{pageId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{pageId}", "pageId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["pageId", "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: StorePage) -> StorelayoutpageUpdateCall<'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) -> StorelayoutpageUpdateCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the page. - /// - /// Sets the *page id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn page_id(mut self, new_value: &str) -> StorelayoutpageUpdateCall<'a, C, A> { - self._page_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> StorelayoutpageUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> StorelayoutpageUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization 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) -> StorelayoutpageUpdateCall<'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 store page. /// /// A builder for the *insert* method supported by a *storelayoutpage* resource. @@ -5503,9 +6022,9 @@ impl<'a, C, A> StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut StorelayoutpagePatchCall<'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 = StorePage::default(); +/// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.storelayoutpages().delete("enterpriseId", "pageId") +/// let result = hub.storelayoutpages().update(req, "enterpriseId", "pageId") /// .doit(); /// # } /// ``` -pub struct StorelayoutpageDeleteCall<'a, C, A> +pub struct StorelayoutpageUpdateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, + _request: StorePage, _enterprise_id: String, _page_id: String, _delegate: Option<&'a mut Delegate>, @@ -5545,13 +6071,13 @@ pub struct StorelayoutpageDeleteCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for StorelayoutpageDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for StorelayoutpageUpdateCall<'a, C, A> {} -impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> StorelayoutpageUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { + pub fn doit(mut self) -> Result<(hyper::client::Response, StorePage)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -5559,12 +6085,12 @@ impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("enterpriseId", self._enterprise_id.to_string())); params.push(("pageId", self._page_id.to_string())); - for &field in ["enterpriseId", "pageId"].iter() { + for &field in ["alt", "enterpriseId", "pageId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5574,6 +6100,7 @@ impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut Err(Error::BadRequest(serr)) } } - let result_value = 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) @@ -5668,13 +6220,22 @@ impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut StorelayoutpageUpdateCall<'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) -> StorelayoutpageDeleteCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutpageUpdateCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } @@ -5684,7 +6245,7 @@ impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut StorelayoutpageDeleteCall<'a, C, A> { + pub fn page_id(mut self, new_value: &str) -> StorelayoutpageUpdateCall<'a, C, A> { self._page_id = new_value.to_string(); self } @@ -5694,7 +6255,7 @@ impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut StorelayoutpageDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> StorelayoutpageUpdateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5715,7 +6276,7 @@ impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> StorelayoutpageDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> StorelayoutpageUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5735,7 +6296,7 @@ impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> StorelayoutpageDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> StorelayoutpageUpdateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -6534,6 +7095,252 @@ impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth } +/// Revokes access to all devices currently provisioned to the user. The user will no longer be able to use the managed Play store on any of their managed devices. +/// +/// This call only works with EMM-managed accounts. +/// +/// A builder for the *revokeDeviceAccess* 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_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.users().revoke_device_access("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserRevokeDeviceAccesCall<'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 UserRevokeDeviceAccesCall<'a, C, A> {} + +impl<'a, C, A> UserRevokeDeviceAccesCall<'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: "androidenterprise.users.revokeDeviceAccess", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["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())); + } + + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/deviceAccess"; + 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::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 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) -> UserRevokeDeviceAccesCall<'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) -> UserRevokeDeviceAccesCall<'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) -> UserRevokeDeviceAccesCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserRevokeDeviceAccesCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> UserRevokeDeviceAccesCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deleted an EMM-managed user. /// /// A builder for the *delete* method supported by a *user* resource. @@ -13106,6 +13913,630 @@ impl<'a, C, A> DeviceGetCall<'a, C, A> where C: BorrowMut, A: oau } +/// Updates the device policy +/// +/// A builder for the *update* method supported by a *device* resource. +/// It is not used directly, but through a `DeviceMethods` instance. +/// +/// # Example +/// +/// Instantiate 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; +/// use androidenterprise1::Device; +/// # #[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); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the 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.devices().update(req, "enterpriseId", "userId", "deviceId") +/// .update_mask("At") +/// .doit(); +/// # } +/// ``` +pub struct DeviceUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _request: Device, + _enterprise_id: String, + _user_id: String, + _device_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DeviceUpdateCall<'a, C, A> {} + +impl<'a, C, A> DeviceUpdateCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.devices.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + params.push(("deviceId", self._device_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "enterpriseId", "userId", "deviceId", "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() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{deviceId}", "deviceId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["deviceId", "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)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: Device) -> DeviceUpdateCall<'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) -> DeviceUpdateCall<'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) -> DeviceUpdateCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The ID of the device. + /// + /// 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) -> DeviceUpdateCall<'a, C, A> { + self._device_id = new_value.to_string(); + self + } + /// Mask that identifies which fields to update. If not set, all modifiable fields will be modified. + /// + /// When set in a query parameter, this field should be specified as updateMask=,,... + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> DeviceUpdateCall<'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) -> DeviceUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DeviceUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> DeviceUpdateCall<'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 device policy. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *device* resource. +/// It is not used directly, but through a `DeviceMethods` instance. +/// +/// # Example +/// +/// Instantiate 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; +/// use androidenterprise1::Device; +/// # #[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); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the 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.devices().patch(req, "enterpriseId", "userId", "deviceId") +/// .update_mask("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct DevicePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _request: Device, + _enterprise_id: String, + _user_id: String, + _device_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DevicePatchCall<'a, C, A> {} + +impl<'a, C, A> DevicePatchCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.devices.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + params.push(("deviceId", self._device_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "enterpriseId", "userId", "deviceId", "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() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{deviceId}", "deviceId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["deviceId", "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)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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) -> DevicePatchCall<'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) -> DevicePatchCall<'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) -> DevicePatchCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The ID of the device. + /// + /// 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) -> DevicePatchCall<'a, C, A> { + self._device_id = new_value.to_string(); + self + } + /// Mask that identifies which fields to update. If not set, all modifiable fields will be modified. + /// + /// When set in a query parameter, this field should be specified as updateMask=,,... + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> DevicePatchCall<'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) -> DevicePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DevicePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> DevicePatchCall<'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 notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. /// /// A builder for the *acknowledgeNotificationSet* method supported by a *enterprise* resource. @@ -13134,7 +14565,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("clita") +/// .notification_set_id("rebum.") /// .doit(); /// # } /// ``` @@ -13802,6 +15233,280 @@ impl<'a, C, A> EnterpriseInsertCall<'a, C, A> where C: BorrowMut, } +/// Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information. +/// +/// A builder for the *createWebToken* 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_androidenterprise1 as androidenterprise1; +/// use androidenterprise1::AdministratorWebTokenSpec; +/// # #[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); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = AdministratorWebTokenSpec::default(); +/// +/// // You can configure optional parameters by calling 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_web_token(req, "enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseCreateWebTokenCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _request: AdministratorWebTokenSpec, + _enterprise_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseCreateWebTokenCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseCreateWebTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AdministratorWebToken)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.createWebToken", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + 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}/createWebToken"; + 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::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: AdministratorWebTokenSpec) -> EnterpriseCreateWebTokenCall<'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) -> EnterpriseCreateWebTokenCall<'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) -> EnterpriseCreateWebTokenCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseCreateWebTokenCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> EnterpriseCreateWebTokenCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// 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. @@ -15055,8 +16760,8 @@ impl<'a, C, A> EnterpriseSetStoreLayoutCall<'a, C, A> where C: BorrowMut EnterpriseSetAndroidDevicePolicyConfigCall<'a, C, A> where C: Bor /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.enterprises().pull_notification_set() -/// .request_mode("sadipscing") +/// .request_mode("aliquyam") /// .doit(); /// # } /// ``` @@ -16294,7 +17999,7 @@ impl<'a, C, A> 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("sed") +/// .key_type("labore") /// .doit(); /// # } /// ``` @@ -17055,7 +18760,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("eirmod") +/// .callback_url("dolores") /// .doit(); /// # } /// ``` @@ -17250,280 +18955,6 @@ impl<'a, C, A> EnterpriseGenerateSignupUrlCall<'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 = AdministratorWebTokenSpec::default(); -/// -/// // You can configure optional parameters by calling 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_web_token(req, "enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseCreateWebTokenCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: AdministratorWebTokenSpec, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseCreateWebTokenCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseCreateWebTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AdministratorWebToken)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.createWebToken", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - 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}/createWebToken"; - 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::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: AdministratorWebTokenSpec) -> EnterpriseCreateWebTokenCall<'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) -> EnterpriseCreateWebTokenCall<'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) -> EnterpriseCreateWebTokenCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseCreateWebTokenCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization 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) -> EnterpriseCreateWebTokenCall<'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 cluster. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *storelayoutcluster* resource. @@ -19711,7 +21142,7 @@ impl<'a, C, A> ProductUnapproveCall<'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().get("enterpriseId", "productId") -/// .language("est") +/// .language("et") /// .doit(); /// # } /// ``` @@ -20255,7 +21686,7 @@ impl<'a, C, A> 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("eos") +/// .language("rebum.") /// .doit(); /// # } /// ``` @@ -20522,11 +21953,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("duo") -/// .query("sed") -/// .max_results(70) -/// .language("ea") -/// .approved(true) +/// .token("clita") +/// .query("invidunt") +/// .max_results(11) +/// .language("At") +/// .approved(false) /// .doit(); /// # } /// ``` @@ -20827,7 +22258,7 @@ impl<'a, C, A> ProductListCall<'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.products().generate_approval_url("enterpriseId", "productId") -/// .language_code("diam") +/// .language_code("sit") /// .doit(); /// # } /// ``` @@ -21066,7 +22497,7 @@ impl<'a, C, A> ProductGenerateApprovalUrlCall<'a, C, A> where C: BorrowMut ManagedconfigurationsforuserListCall<'a, C, A> where C: BorrowMut } -/// Adds or updates a per-user managed configuration for an app for the specified user. +/// Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. /// /// A builder for the *update* method supported by a *managedconfigurationsforuser* resource. /// It is not used directly, but through a `ManagedconfigurationsforuserMethods` instance. @@ -24884,7 +26315,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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-androidmanagement1] path = "../androidmanagement1" -version = "1.0.6+20170918" +version = "1.0.6+20171127" diff --git a/gen/androidmanagement1-cli/README.md b/gen/androidmanagement1-cli/README.md index 079f8b1081..03d7444c2d 100644 --- a/gen/androidmanagement1-cli/README.md +++ b/gen/androidmanagement1-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 Management* API at revision *20170918*. The CLI is at version *1.0.6*. +This documentation was generated from the *Android Management* API at revision *20171127*. The CLI is at version *1.0.6*. ```bash androidmanagement1 [options] diff --git a/gen/androidmanagement1-cli/mkdocs.yml b/gen/androidmanagement1-cli/mkdocs.yml index 29b413b78b..7f2179b3c6 100644 --- a/gen/androidmanagement1-cli/mkdocs.yml +++ b/gen/androidmanagement1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Management v1.0.6+20170918 +site_name: Android Management v1.0.6+20171127 site_url: http://byron.github.io/google-apis-rs/google-androidmanagement1-cli site_description: A complete library to interact with Android Management (protocol v1) diff --git a/gen/androidmanagement1-cli/src/main.rs b/gen/androidmanagement1-cli/src/main.rs index 979975be1d..045df19738 100644 --- a/gen/androidmanagement1-cli/src/main.rs +++ b/gen/androidmanagement1-cli/src/main.rs @@ -1282,19 +1282,26 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "data-roaming-disabled" => Some(("dataRoamingDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-reset-disabled" => Some(("networkResetDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tethering-config-disabled" => Some(("tetheringConfigDisabled", JsonTypeInfo { jtype: JsonType::Boolean, 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 })), + "permitted-input-methods.package-names" => Some(("permittedInputMethods.packageNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "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 })), + "bluetooth-config-disabled" => Some(("bluetoothConfigDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "mobile-networks-config-disabled" => Some(("mobileNetworksConfigDisabled", 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 })), + "remove-user-disabled" => Some(("removeUserDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "long-support-message.default-message" => Some(("longSupportMessage.defaultMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "long-support-message.localized-messages" => Some(("longSupportMessage.localizedMessages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "account-types-with-management-disabled" => Some(("accountTypesWithManagementDisabled", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "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 })), @@ -1309,26 +1316,53 @@ impl<'n> Engine<'n> { "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 })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mount-physical-media-disabled" => Some(("mountPhysicalMediaDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "vpn-config-disabled" => Some(("vpnConfigDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "modify-accounts-disabled" => Some(("modifyAccountsDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "set-wallpaper-disabled" => Some(("setWallpaperDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "ensure-verify-apps-enabled" => Some(("ensureVerifyAppsEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status-bar-disabled" => Some(("statusBarDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "sms-disabled" => Some(("smsDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "install-apps-disabled" => Some(("installAppsDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "usb-file-transfer-disabled" => Some(("usbFileTransferDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "adjust-volume-disabled" => Some(("adjustVolumeDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cell-broadcasts-config-disabled" => Some(("cellBroadcastsConfigDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "outgoing-beam-disabled" => Some(("outgoingBeamDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "fun-disabled" => Some(("funDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "always-on-vpn-package.package-name" => Some(("alwaysOnVpnPackage.packageName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "always-on-vpn-package.lockdown-enabled" => Some(("alwaysOnVpnPackage.lockdownEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "uninstall-apps-disabled" => Some(("uninstallAppsDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "screen-capture-disabled" => Some(("screenCaptureDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "keyguard-disabled-features" => Some(("keyguardDisabledFeatures", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "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 })), + "default-permission-policy" => Some(("defaultPermissionPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bluetooth-disabled" => Some(("bluetoothDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bluetooth-contact-sharing-disabled" => Some(("bluetoothContactSharingDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "network-escape-hatch-enabled" => Some(("networkEscapeHatchEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "outgoing-calls-disabled" => Some(("outgoingCallsDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "add-user-disabled" => Some(("addUserDisabled", 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 })), + "set-user-icon-disabled" => Some(("setUserIconDisabled", JsonTypeInfo { jtype: JsonType::Boolean, 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 })), + "safe-boot-disabled" => Some(("safeBootDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "credentials-config-disabled" => Some(("credentialsConfigDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "recommended-global-proxy.pac-uri" => Some(("recommendedGlobalProxy.pacUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recommended-global-proxy.excluded-hosts" => Some(("recommendedGlobalProxy.excludedHosts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "recommended-global-proxy.host" => Some(("recommendedGlobalProxy.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recommended-global-proxy.port" => Some(("recommendedGlobalProxy.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "wifi-config-disabled" => Some(("wifiConfigDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "short-support-message.default-message" => Some(("shortSupportMessage.defaultMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "short-support-message.localized-messages" => Some(("shortSupportMessage.localizedMessages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "factory-reset-disabled" => Some(("factoryResetDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "create-windows-disabled" => Some(("createWindowsDisabled", 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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-types-with-management-disabled", "add-user-disabled", "adjust-volume-disabled", "always-on-vpn-package", "auto-time-required", "block-applications-enabled", "bluetooth-config-disabled", "bluetooth-contact-sharing-disabled", "bluetooth-disabled", "camera-disabled", "cell-broadcasts-config-disabled", "create-windows-disabled", "credentials-config-disabled", "data-roaming-disabled", "debugging-features-allowed", "default-message", "default-permission-policy", "display-info-enabled", "end-minutes", "ensure-verify-apps-enabled", "excluded-hosts", "factory-reset-disabled", "frp-admin-emails", "fun-disabled", "hardware-status-enabled", "host", "install-apps-disabled", "install-unknown-sources-allowed", "keyguard-disabled", "keyguard-disabled-features", "localized-messages", "lockdown-enabled", "long-support-message", "maximum-failed-passwords-for-wipe", "maximum-time-to-lock", "memory-info-enabled", "mobile-networks-config-disabled", "modify-accounts-disabled", "mount-physical-media-disabled", "name", "network-escape-hatch-enabled", "network-info-enabled", "network-reset-disabled", "outgoing-beam-disabled", "outgoing-calls-disabled", "pac-uri", "package-name", "package-names", "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", "permitted-input-methods", "port", "power-management-events-enabled", "recommended-global-proxy", "remove-user-disabled", "safe-boot-disabled", "screen-capture-disabled", "set-user-icon-disabled", "set-wallpaper-disabled", "short-support-message", "sms-disabled", "software-info-enabled", "start-minutes", "status-bar-disabled", "status-reporting-settings", "stay-on-plugged-modes", "system-update", "tethering-config-disabled", "type", "uninstall-apps-disabled", "unmute-microphone-disabled", "usb-file-transfer-disabled", "version", "vpn-config-disabled", "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 } @@ -2211,7 +2245,7 @@ fn main() { let mut app = App::new("androidmanagement1") .author("Sebastian Thiel ") - .version("1.0.6+20170918") + .version("1.0.6+20171127") .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") diff --git a/gen/androidmanagement1/Cargo.toml b/gen/androidmanagement1/Cargo.toml index c0ea34fcd4..eda7edb7d9 100644 --- a/gen/androidmanagement1/Cargo.toml +++ b/gen/androidmanagement1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androidmanagement1" -version = "1.0.6+20170918" +version = "1.0.6+20171127" 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" +documentation = "https://docs.rs/google-androidmanagement1/1.0.6+20171127" license = "MIT" keywords = ["androidmanagement", "google", "protocol", "web", "api"] diff --git a/gen/androidmanagement1/README.md b/gen/androidmanagement1/README.md index 53d8cef8f2..75816de260 100644 --- a/gen/androidmanagement1/README.md +++ b/gen/androidmanagement1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Android Management* crate version *1.0.6+20171127*, where *20171127* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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) +* [enterprises](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.Enterprise.html) + * [*applications get*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseApplicationGetCall.html), [*create*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseCreateCall.html), [*devices delete*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseDeviceDeleteCall.html), [*devices get*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseDeviceGetCall.html), [*devices issue command*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseDeviceIssueCommandCall.html), [*devices list*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseDeviceListCall.html), [*devices operations cancel*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseDeviceOperationCancelCall.html), [*devices operations delete*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseDeviceOperationDeleteCall.html), [*devices operations get*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseDeviceOperationGetCall.html), [*devices operations list*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseDeviceOperationListCall.html), [*devices patch*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseDevicePatchCall.html), [*enrollment tokens create*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseEnrollmentTokenCreateCall.html), [*enrollment tokens delete*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseEnrollmentTokenDeleteCall.html), [*get*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseGetCall.html), [*patch*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterprisePatchCall.html), [*policies delete*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterprisePolicyDeleteCall.html), [*policies get*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterprisePolicyGetCall.html), [*policies list*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterprisePolicyListCall.html), [*policies patch*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterprisePolicyPatchCall.html) and [*web tokens create*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.EnterpriseWebTokenCreateCall.html) +* [signup urls](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.SignupUrl.html) + * [*create*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/struct.SignupUrlCreateCall.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-androidmanagement1/1.0.6+20170918/google_androidmanagement1/struct.AndroidManagement.html)** +* **[Hub](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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)** + * creates [*Method Builders*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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)** + * **[Parts](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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)** +* **[Activities](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -146,17 +146,17 @@ match result { ``` ## 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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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). +[Hub Delegate](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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. +If such a method also supports a [Response Result](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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")`. @@ -166,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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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. +The [delegate trait](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidmanagement1/1.0.6+20171127/google_androidmanagement1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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 +Most optionals are are considered [Parts](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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. +Using [method builders](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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 +* [request values](https://docs.rs/google-androidmanagement1/1.0.6+20171127/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. diff --git a/gen/androidmanagement1/src/lib.rs b/gen/androidmanagement1/src/lib.rs index 9a62c30b59..3fcf895880 100644 --- a/gen/androidmanagement1/src/lib.rs +++ b/gen/androidmanagement1/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 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*. +//! This documentation was generated from *Android Management* crate version *1.0.6+20171127*, where *20171127* 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). @@ -527,23 +527,6 @@ pub struct Application { 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 @@ -555,7 +538,7 @@ impl Part for MemoryInfo {} /// #[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. + /// 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_name for the user that owns the device is applied. If user_name also isn't specified, the policy defaults to enterprises/{enterpriseId}/policies/default. 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. @@ -579,6 +562,218 @@ impl RequestValue for EnrollmentToken {} impl ResponseResult for EnrollmentToken {} +/// 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 {} + + +/// 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 roaming data services are disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="dataRoamingDisabled")] + pub data_roaming_disabled: Option, + /// Whether resetting network settings is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="networkResetDisabled")] + pub network_reset_disabled: Option, + /// Whether configuring tethering and portable hotspots is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="tetheringConfigDisabled")] + pub tethering_config_disabled: 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 bluetooth is disabled. Prefer this setting over bluetooth_config_disabled because bluetooth_config_disabled can be bypassed by the user. Requires the beta version of the Android Device Policy app. + #[serde(rename="bluetoothDisabled")] + pub bluetooth_disabled: Option, + /// If present, only input methods provided by packages in this list are permitted. If this field is present, but the list is empty, then only system input methods are permitted. Requires the beta version of the Android Device Policy app. + #[serde(rename="permittedInputMethods")] + pub permitted_input_methods: 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 configuring mobile networks is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="mobileNetworksConfigDisabled")] + pub mobile_networks_config_disabled: 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 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, + /// Whether configuring bluetooth is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="bluetoothConfigDisabled")] + pub bluetooth_config_disabled: Option, + /// Network configuration for the device. See configure networks for more information. + #[serde(rename="openNetworkConfiguration")] + pub open_network_configuration: Option>, + /// The system update policy, which controls how OS updates are applied. If the update type is WINDOWED, the update window will automatically apply to Play app updates as well. + #[serde(rename="systemUpdate")] + pub system_update: Option, + /// A message displayed to the user in the device administators settings screen. Requires the beta version of the Android Device Policy app. + #[serde(rename="longSupportMessage")] + pub long_support_message: Option, + /// Account types that cannot be managed by the user. Requires the beta version of the Android Device Policy app. + #[serde(rename="accountTypesWithManagementDisabled")] + pub account_types_with_management_disabled: 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 mounting physical external media is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="mountPhysicalMediaDisabled")] + pub mount_physical_media_disabled: Option, + /// Whether configuring VPN is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="vpnConfigDisabled")] + pub vpn_config_disabled: Option, + /// Whether adding or removing accounts is disabled. + #[serde(rename="modifyAccountsDisabled")] + pub modify_accounts_disabled: Option, + /// Whether changing the wallpaper is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="setWallpaperDisabled")] + pub set_wallpaper_disabled: Option, + /// Whether application verification is forced to be enabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="ensureVerifyAppsEnabled")] + pub ensure_verify_apps_enabled: 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 adding new users and profiles is disabled. + #[serde(rename="addUserDisabled")] + pub add_user_disabled: Option, + /// Whether sending or receiving SMS messages is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="smsDisabled")] + pub sms_disabled: Option, + /// The network-independent global HTTP proxy. Typically proxies should be configured per-network in open_network_configuration. However for unusual configurations like general internal filtering a global HTTP proxy may be useful. If the proxy is not accessible, network access may break. The global proxy is only a recommendation and some apps may ignore it. Requires the beta version of the Android Device Policy app. + #[serde(rename="recommendedGlobalProxy")] + pub recommended_global_proxy: Option, + /// Whether transferring files over USB is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="usbFileTransferDisabled")] + pub usb_file_transfer_disabled: Option, + /// Whether configuring WiFi access points is disabled. + #[serde(rename="wifiConfigDisabled")] + pub wifi_config_disabled: Option, + /// Whether using NFC to beam out data from apps is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="outgoingBeamDisabled")] + pub outgoing_beam_disabled: 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>, + /// Configuration for an always-on VPN connection. Use with vpn_config_disabled to prevent modification of this setting. Requires the beta version of the Android Device Policy app. + #[serde(rename="alwaysOnVpnPackage")] + pub always_on_vpn_package: Option, + /// Whether the microphone is muted and adjusting microphone volume is disabled. + #[serde(rename="unmuteMicrophoneDisabled")] + pub unmute_microphone_disabled: Option, + /// Disabled keyguard customizations, such as widgets. Requires the beta version of the Android Device Policy app. + #[serde(rename="keyguardDisabledFeatures")] + pub keyguard_disabled_features: Option>, + /// Whether configuring cell broadcast is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="cellBroadcastsConfigDisabled")] + pub cell_broadcasts_config_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 user uninstallation of applications is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="uninstallAppsDisabled")] + pub uninstall_apps_disabled: Option, + /// Whether bluetooth contact sharing is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="bluetoothContactSharingDisabled")] + pub bluetooth_contact_sharing_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, + /// Whether outgoing calls are disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="outgoingCallsDisabled")] + pub outgoing_calls_disabled: Option, + /// The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} + pub name: 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 rebooting the device into safe boot is disabled. + #[serde(rename="safeBootDisabled")] + pub safe_boot_disabled: Option, + /// Whether changing the user icon is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="setUserIconDisabled")] + pub set_user_icon_disabled: 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 configuring user credentials is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="credentialsConfigDisabled")] + pub credentials_config_disabled: Option, + /// Whether user installation of apps is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="installAppsDisabled")] + pub install_apps_disabled: Option, + /// Whether adjusting the master volume is disabled. + #[serde(rename="adjustVolumeDisabled")] + pub adjust_volume_disabled: Option, + /// A message displayed to the user in the settings screen wherever functionality has been disabled by the admin. Requires the beta version of the Android Device Policy app. + #[serde(rename="shortSupportMessage")] + pub short_support_message: Option, + /// Whether factory resetting from settings is disabled. + #[serde(rename="factoryResetDisabled")] + pub factory_reset_disabled: Option, + /// Whether creating windows besides app windows is disabled. Requires the beta version of the Android Device Policy app. + #[serde(rename="createWindowsDisabled")] + pub create_windows_disabled: Option, +} + +impl RequestValue for Policy {} +impl ResponseResult for Policy {} + + /// 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. @@ -656,117 +851,6 @@ pub struct Status { 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. @@ -825,10 +909,10 @@ pub struct Device { /// 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. + /// The resource name of the user that owns this device in the form enterprises/{enterpriseId}/users/{userId}. #[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. + /// The name of the policy that is intended to be applied to the device. If empty, the policy_name for the user that owns this device 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. @@ -874,6 +958,26 @@ impl RequestValue for Device {} impl ResponseResult for Device {} +/// 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 {} + + /// Application permission. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -892,6 +996,49 @@ pub struct ApplicationPermission { impl Part for ApplicationPermission {} +/// 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 list of package names. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PackageNameList { + /// A list of package names. + #[serde(rename="packageNames")] + pub package_names: Option>, +} + +impl Part for PackageNameList {} + + /// 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. @@ -936,35 +1083,6 @@ pub struct PasswordRequirements { 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. @@ -1332,6 +1450,23 @@ pub struct ApplicationPolicy { impl Part for ApplicationPolicy {} +/// Configuration for an always-on VPN connection. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AlwaysOnVpnPackage { + /// The package name of the VPN app. + #[serde(rename="packageName")] + pub package_name: Option, + /// Disallows networking when the VPN is not connected. + #[serde(rename="lockdownEnabled")] + pub lockdown_enabled: Option, +} + +impl Part for AlwaysOnVpnPackage {} + + /// Managed property. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1450,24 +1585,25 @@ pub struct Operation { impl ResponseResult for Operation {} -/// A power management event. +/// Configuration info for an HTTP proxy. For a direct proxy, set the host, port, and excluded_hosts fields. For a PAC script proxy, set the pac_uri 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 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, +pub struct ProxyInfo { + /// The URI of the PAC script used to configure the proxy. + #[serde(rename="pacUri")] + pub pac_uri: Option, + /// For a direct proxy, the hosts for which the proxy is bypassed. The host names may contain wildcards such as *.example.com. + #[serde(rename="excludedHosts")] + pub excluded_hosts: Option>, + /// The host of the direct proxy. + pub host: Option, + /// The port of the direct proxy. + pub port: Option, } -impl Part for PowerManagementEvent {} +impl Part for ProxyInfo {} diff --git a/gen/androidpublisher2-cli/Cargo.toml b/gen/androidpublisher2-cli/Cargo.toml index 4ed072fe1b..db0c4dcdda 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+20170913" +version = "1.0.6+20171030" 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+20170913" +version = "1.0.6+20171030" diff --git a/gen/androidpublisher2-cli/README.md b/gen/androidpublisher2-cli/README.md index 6e75377fc7..ddbbac6deb 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 *20170913*. The CLI is at version *1.0.6*. +This documentation was generated from the *Android Publisher* API at revision *20171030*. The CLI is at version *1.0.6*. ```bash androidpublisher2 [options] @@ -72,7 +72,6 @@ androidpublisher2 [options] entitlements list [-p ]... [-o ] inappproducts - batch (-r )... [-p ]... [-o ] delete [-p ]... get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] diff --git a/gen/androidpublisher2-cli/mkdocs.yml b/gen/androidpublisher2-cli/mkdocs.yml index 4b3d0d6932..00a569e9e5 100644 --- a/gen/androidpublisher2-cli/mkdocs.yml +++ b/gen/androidpublisher2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Publisher v1.0.6+20170913 +site_name: Android Publisher v1.0.6+20171030 site_url: http://byron.github.io/google-apis-rs/google-androidpublisher2-cli site_description: A complete library to interact with Android Publisher (protocol v2) @@ -49,7 +49,6 @@ pages: - ['edits_tracks-update.md', 'Edits', 'Tracks Update'] - ['edits_validate.md', 'Edits', 'Validate'] - ['entitlements_list.md', 'Entitlements', 'List'] -- ['inappproducts_batch.md', 'Inappproducts', 'Batch'] - ['inappproducts_delete.md', 'Inappproducts', 'Delete'] - ['inappproducts_get.md', 'Inappproducts', 'Get'] - ['inappproducts_insert.md', 'Inappproducts', 'Insert'] diff --git a/gen/androidpublisher2-cli/src/main.rs b/gen/androidpublisher2-cli/src/main.rs index bfd0ad60b3..23e69d1800 100644 --- a/gen/androidpublisher2-cli/src/main.rs +++ b/gen/androidpublisher2-cli/src/main.rs @@ -2615,90 +2615,6 @@ impl<'n> Engine<'n> { } } - fn _inappproducts_batch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - 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::InappproductsBatchRequest = json::value::from_value(object).unwrap(); - let mut call = self.hub.inappproducts().batch(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 _inappproducts_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.inappproducts().delete(opt.value_of("package-name").unwrap_or(""), opt.value_of("sku").unwrap_or("")); @@ -3899,9 +3815,6 @@ impl<'n> Engine<'n> { }, ("inappproducts", Some(opt)) => { match opt.subcommand() { - ("batch", Some(opt)) => { - call_result = self._inappproducts_batch(opt, dry_run, &mut err); - }, ("delete", Some(opt)) => { call_result = self._inappproducts_delete(opt, dry_run, &mut err); }, @@ -5475,29 +5388,7 @@ fn main() { ]), ]), - ("inappproducts", "methods: 'batch', 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ - ("batch", - None, - "Details at http://byron.github.io/google-apis-rs/google_androidpublisher2_cli/inappproducts_batch", - 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)), - ]), + ("inappproducts", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ ("delete", Some(r##"Delete an in-app product for an app."##), "Details at http://byron.github.io/google-apis-rs/google_androidpublisher2_cli/inappproducts_delete", @@ -5976,7 +5867,7 @@ fn main() { let mut app = App::new("androidpublisher2") .author("Sebastian Thiel ") - .version("1.0.6+20170913") + .version("1.0.6+20171030") .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 24db78f4cf..9b1f4fca73 100644 --- a/gen/androidpublisher2/Cargo.toml +++ b/gen/androidpublisher2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androidpublisher2" -version = "1.0.6+20170913" +version = "1.0.6+20171030" 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+20170913" +documentation = "https://docs.rs/google-androidpublisher2/1.0.6+20171030" license = "MIT" keywords = ["androidpublisher", "google", "protocol", "web", "api"] diff --git a/gen/androidpublisher2/README.md b/gen/androidpublisher2/README.md index 777720680e..4e343a6317 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+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*. +This documentation was generated from *Android Publisher* crate version *1.0.6+20171030*, where *20171030* 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+20170913/google_androidpublisher2/struct.AndroidPublisher.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.AndroidPublisher.html) ... * edits - * [*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) + * [*apklistings delete*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditApklistingDeleteCall.html), [*apklistings deleteall*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditApklistingDeleteallCall.html), [*apklistings get*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditApklistingGetCall.html), [*apklistings list*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditApklistingListCall.html), [*apklistings patch*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditApklistingPatchCall.html), [*apklistings update*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditApklistingUpdateCall.html), [*apks addexternallyhosted*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditApkAddexternallyhostedCall.html), [*apks list*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditApkListCall.html), [*apks upload*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditApkUploadCall.html), [*commit*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditCommitCall.html), [*delete*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditDeleteCall.html), [*deobfuscationfiles upload*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html), [*details get*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditDetailGetCall.html), [*details patch*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditDetailPatchCall.html), [*details update*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditDetailUpdateCall.html), [*expansionfiles get*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditExpansionfileGetCall.html), [*expansionfiles patch*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditExpansionfilePatchCall.html), [*expansionfiles update*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditExpansionfileUpdateCall.html), [*expansionfiles upload*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditExpansionfileUploadCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditGetCall.html), [*images delete*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditImageDeleteCall.html), [*images deleteall*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditImageDeleteallCall.html), [*images list*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditImageListCall.html), [*images upload*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditImageUploadCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditInsertCall.html), [*listings delete*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditListingDeleteCall.html), [*listings deleteall*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditListingDeleteallCall.html), [*listings get*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditListingGetCall.html), [*listings list*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditListingListCall.html), [*listings patch*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditListingPatchCall.html), [*listings update*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditListingUpdateCall.html), [*testers get*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditTesterGetCall.html), [*testers patch*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditTesterPatchCall.html), [*testers update*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditTesterUpdateCall.html), [*tracks get*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditTrackGetCall.html), [*tracks list*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditTrackListCall.html), [*tracks patch*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditTrackPatchCall.html), [*tracks update*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditTrackUpdateCall.html) and [*validate*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditValidateCall.html) +* [entitlements](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.Entitlement.html) + * [*list*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EntitlementListCall.html) * inappproducts - * [*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) + * [*delete*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.InappproductDeleteCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.InappproductGetCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.InappproductInsertCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.InappproductListCall.html), [*patch*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.InappproductPatchCall.html) and [*update*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.InappproductUpdateCall.html) * purchases - * [*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) + * [*products get*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.PurchaseProductGetCall.html), [*subscriptions cancel*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.PurchaseSubscriptionCancelCall.html), [*subscriptions defer*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.PurchaseSubscriptionDeferCall.html), [*subscriptions get*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.PurchaseSubscriptionGetCall.html), [*subscriptions refund*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.PurchaseSubscriptionRefundCall.html), [*subscriptions revoke*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.PurchaseSubscriptionRevokeCall.html) and [*voidedpurchases list*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.PurchaseVoidedpurchaseListCall.html) +* [reviews](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.Review.html) + * [*get*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.ReviewGetCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.ReviewListCall.html) and [*reply*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.ReviewReplyCall.html) Upload supported by ... -* [*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) +* [*deobfuscationfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html) +* [*images upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditImageUploadCall.html) +* [*apks upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditApkUploadCall.html) +* [*expansionfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/struct.EditExpansionfileUploadCall.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+20170913/google_androidpublisher2/struct.AndroidPublisher.html)** +* **[Hub](https://docs.rs/google-androidpublisher2/1.0.6+20171030/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+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)** + * creates [*Method Builders*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidpublisher2/1.0.6+20171030/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+20170913/google_androidpublisher2/trait.Part.html)** + * **[Parts](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-androidpublisher2/1.0.6+20170913/google_androidpublisher2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-androidpublisher2/1.0.6+20171030/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+20170913/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+20171030/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+20170913/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+20171030/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+20170913/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+20171030/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+20170913/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+20171030/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidpublisher2/1.0.6+20171030/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+20170913/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+20171030/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidpublisher2/1.0.6+20171030/google_androidpublisher2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidpublisher2/1.0.6+20171030/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+20170913/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+20171030/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+20170913/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+20171030/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+20170913/google_androidpublisher2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-androidpublisher2/1.0.6+20171030/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 f34ea684ce..09bbff3539 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+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*. +//! This documentation was generated from *Android Publisher* crate version *1.0.6+20171030*, where *20171030* 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). @@ -16,7 +16,7 @@ //! * [entitlements](struct.Entitlement.html) //! * [*list*](struct.EntitlementListCall.html) //! * inappproducts -//! * [*batch*](struct.InappproductBatchCall.html), [*delete*](struct.InappproductDeleteCall.html), [*get*](struct.InappproductGetCall.html), [*insert*](struct.InappproductInsertCall.html), [*list*](struct.InappproductListCall.html), [*patch*](struct.InappproductPatchCall.html) and [*update*](struct.InappproductUpdateCall.html) +//! * [*delete*](struct.InappproductDeleteCall.html), [*get*](struct.InappproductGetCall.html), [*insert*](struct.InappproductInsertCall.html), [*list*](struct.InappproductListCall.html), [*patch*](struct.InappproductPatchCall.html) and [*update*](struct.InappproductUpdateCall.html) //! * purchases //! * [*products get*](struct.PurchaseProductGetCall.html), [*subscriptions cancel*](struct.PurchaseSubscriptionCancelCall.html), [*subscriptions defer*](struct.PurchaseSubscriptionDeferCall.html), [*subscriptions get*](struct.PurchaseSubscriptionGetCall.html), [*subscriptions refund*](struct.PurchaseSubscriptionRefundCall.html), [*subscriptions revoke*](struct.PurchaseSubscriptionRevokeCall.html) and [*voidedpurchases list*](struct.PurchaseVoidedpurchaseListCall.html) //! * [reviews](struct.Review.html) @@ -27,8 +27,8 @@ //! //! * [*deobfuscationfiles upload edits*](struct.EditDeobfuscationfileUploadCall.html) //! * [*images upload edits*](struct.EditImageUploadCall.html) -//! * [*expansionfiles upload edits*](struct.EditExpansionfileUploadCall.html) //! * [*apks upload edits*](struct.EditApkUploadCall.html) +//! * [*expansionfiles upload edits*](struct.EditExpansionfileUploadCall.html) //! //! //! @@ -401,16 +401,16 @@ impl<'a, C, A> AndroidPublisher /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [reply reviews](struct.ReviewReplyCall.html) (request) +/// * [subscriptions defer purchases](struct.PurchaseSubscriptionDeferCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReviewsReplyRequest { - /// The text to set as the reply. Replies of more than approximately 350 characters will be rejected. HTML tags will be stripped. - #[serde(rename="replyText")] - pub reply_text: Option, +pub struct SubscriptionPurchasesDeferRequest { + /// The information about the new desired expiry time for the subscription. + #[serde(rename="deferralInfo")] + pub deferral_info: Option, } -impl RequestValue for ReviewsReplyRequest {} +impl RequestValue for SubscriptionPurchasesDeferRequest {} /// An Entitlement resource indicates a user's current entitlement to an inapp item or subscription. @@ -488,19 +488,6 @@ impl Resource for Review {} impl ResponseResult for Review {} -/// 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 InappproductsUpdateResponse { - /// no description provided - pub inappproduct: Option, -} - -impl Part for InappproductsUpdateResponse {} - - /// There is no detailed description. /// /// # Activities @@ -659,24 +646,6 @@ impl RequestValue for Listing {} impl ResponseResult for Listing {} -/// 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 inappproducts](struct.InappproductBatchCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InappproductsBatchRequest { - /// no description provided - pub entrys: Option>, -} - -impl RequestValue for InappproductsBatchRequest {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -865,16 +834,16 @@ impl Part for InAppProductListing {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [subscriptions defer purchases](struct.PurchaseSubscriptionDeferCall.html) (request) +/// * [reply reviews](struct.ReviewReplyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubscriptionPurchasesDeferRequest { - /// The information about the new desired expiry time for the subscription. - #[serde(rename="deferralInfo")] - pub deferral_info: Option, +pub struct ReviewsReplyRequest { + /// The text to set as the reply. Replies of more than approximately 350 characters will be rejected. HTML tags will be stripped. + #[serde(rename="replyText")] + pub reply_text: Option, } -impl RequestValue for SubscriptionPurchasesDeferRequest {} +impl RequestValue for ReviewsReplyRequest {} /// Represents a deobfuscation file. @@ -891,19 +860,6 @@ pub struct DeobfuscationFile { impl Part for DeobfuscationFile {} -/// 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 InappproductsInsertResponse { - /// no description provided - pub inappproduct: Option, -} - -impl Part for InappproductsInsertResponse {} - - /// Defines an APK available for this application that is hosted externally and not uploaded to Google Play. This function is only available to enterprises who are using Google Play for Work, and whos application is restricted to the enterprise private channel /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -991,24 +947,6 @@ impl RequestValue for AppDetails {} impl ResponseResult for AppDetails {} -/// 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 InappproductsBatchResponseEntry { - /// no description provided - #[serde(rename="batchId")] - pub batch_id: Option, - /// no description provided - pub inappproductsinsertresponse: Option, - /// no description provided - pub inappproductsupdateresponse: Option, -} - -impl Part for InappproductsBatchResponseEntry {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1054,44 +992,6 @@ pub struct UserComment { impl Part for UserComment {} -/// Represents an edit of an app. An edit allows clients to make multiple changes before committing them in one operation. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [insert edits](struct.EditInsertCall.html) (request|response) -/// * [commit edits](struct.EditCommitCall.html) (response) -/// * [validate edits](struct.EditValidateCall.html) (response) -/// * [get edits](struct.EditGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AppEdit { - /// The time at which the edit will expire and will be no longer valid for use in any subsequent API calls (encoded as seconds since the Epoch). - #[serde(rename="expiryTimeSeconds")] - pub expiry_time_seconds: Option, - /// The ID of the edit that can be used in subsequent API calls. - pub id: Option, -} - -impl RequestValue for AppEdit {} -impl ResponseResult for AppEdit {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InappproductsInsertRequest { - /// no description provided - pub inappproduct: Option, -} - -impl Part for InappproductsInsertRequest {} - - /// A permission used by this APK. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1108,27 +1008,6 @@ pub struct ExternallyHostedApkUsesPermission { impl Part for ExternallyHostedApkUsesPermission {} -/// 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 InappproductsBatchRequestEntry { - /// no description provided - #[serde(rename="batchId")] - pub batch_id: Option, - /// no description provided - pub inappproductsinsertrequest: Option, - /// no description provided - #[serde(rename="methodName")] - pub method_name: Option, - /// no description provided - pub inappproductsupdaterequest: Option, -} - -impl Part for InappproductsBatchRequestEntry {} - - /// There is no detailed description. /// /// # Activities @@ -1517,17 +1396,29 @@ pub struct Prorate { impl Part for Prorate {} -/// There is no detailed description. +/// Represents an edit of an app. An edit allows clients to make multiple changes before committing them in one operation. /// -/// 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*). +/// +/// * [insert edits](struct.EditInsertCall.html) (request|response) +/// * [commit edits](struct.EditCommitCall.html) (response) +/// * [validate edits](struct.EditValidateCall.html) (response) +/// * [get edits](struct.EditGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InappproductsUpdateRequest { - /// no description provided - pub inappproduct: Option, +pub struct AppEdit { + /// The time at which the edit will expire and will be no longer valid for use in any subsequent API calls (encoded as seconds since the Epoch). + #[serde(rename="expiryTimeSeconds")] + pub expiry_time_seconds: Option, + /// The ID of the edit that can be used in subsequent API calls. + pub id: Option, } -impl Part for InappproductsUpdateRequest {} +impl RequestValue for AppEdit {} +impl ResponseResult for AppEdit {} /// There is no detailed description. @@ -1633,26 +1524,6 @@ impl RequestValue for Track {} impl ResponseResult for Track {} -/// 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 inappproducts](struct.InappproductBatchCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InappproductsBatchResponse { - /// no description provided - pub entrys: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "androidpublisher#inappproductsBatchResponse". - pub kind: Option, -} - -impl ResponseResult for InappproductsBatchResponse {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2999,7 +2870,7 @@ impl<'a, C, A> ReviewMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidPublisher::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(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` /// // to build up your call. /// let rb = hub.inappproducts(); /// # } @@ -3014,20 +2885,6 @@ impl<'a, C, A> MethodsBuilder for InappproductMethods<'a, C, A> {} impl<'a, C, A> InappproductMethods<'a, C, A> { - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn batch(&self, request: InappproductsBatchRequest) -> InappproductBatchCall<'a, C, A> { - InappproductBatchCall { - 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: /// /// List all the in-app products for an Android app, both subscriptions and managed in-app products.. @@ -17338,245 +17195,6 @@ impl<'a, C, A> ReviewListCall<'a, C, A> where C: BorrowMut, A: oa } -/// A builder for the *batch* method supported by a *inappproduct* resource. -/// It is not used directly, but through a `InappproductMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidpublisher2 as androidpublisher2; -/// use androidpublisher2::InappproductsBatchRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidpublisher2::AndroidPublisher; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidPublisher::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = InappproductsBatchRequest::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.inappproducts().batch(req) -/// .doit(); -/// # } -/// ``` -pub struct InappproductBatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidPublisher, - _request: InappproductsBatchRequest, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InappproductBatchCall<'a, C, A> {} - -impl<'a, C, A> InappproductBatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InappproductsBatchResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidpublisher.inappproducts.batch", - 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() + "inappproducts/batch"; - 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: InappproductsBatchRequest) -> InappproductBatchCall<'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) -> InappproductBatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InappproductBatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization 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) -> InappproductBatchCall<'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 the in-app products for an Android app, both subscriptions and managed in-app products.. /// /// A builder for the *list* method supported by a *inappproduct* resource. diff --git a/gen/appengine1-cli/Cargo.toml b/gen/appengine1-cli/Cargo.toml index c0c72645bb..5a6112ba75 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+20170914" +version = "1.0.6+20171208" 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+20170914" +version = "1.0.6+20171208" diff --git a/gen/appengine1-cli/README.md b/gen/appengine1-cli/README.md index 729b7fd540..9bcf98db71 100644 --- a/gen/appengine1-cli/README.md +++ b/gen/appengine1-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 *20170914*. The CLI is at version *1.0.6*. +This documentation was generated from the *appengine* API at revision *20171208*. The CLI is at version *1.0.6*. ```bash appengine1 [options] @@ -42,6 +42,12 @@ appengine1 [options] domain-mappings-get [-p ]... [-o ] domain-mappings-list [-p ]... [-o ] domain-mappings-patch (-r )... [-p ]... [-o ] + firewall-ingress-rules-batch-update (-r )... [-p ]... [-o ] + firewall-ingress-rules-create (-r )... [-p ]... [-o ] + firewall-ingress-rules-delete [-p ]... [-o ] + firewall-ingress-rules-get [-p ]... [-o ] + firewall-ingress-rules-list [-p ]... [-o ] + firewall-ingress-rules-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 53acb57ecc..23c9ea73e1 100644 --- a/gen/appengine1-cli/mkdocs.yml +++ b/gen/appengine1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appengine v1.0.6+20170914 +site_name: appengine v1.0.6+20171208 site_url: http://byron.github.io/google-apis-rs/google-appengine1-cli site_description: A complete library to interact with appengine (protocol v1) @@ -21,6 +21,12 @@ pages: - ['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_firewall-ingress-rules-batch-update.md', 'Apps', 'Firewall Ingress Rules Batch Update'] +- ['apps_firewall-ingress-rules-create.md', 'Apps', 'Firewall Ingress Rules Create'] +- ['apps_firewall-ingress-rules-delete.md', 'Apps', 'Firewall Ingress Rules Delete'] +- ['apps_firewall-ingress-rules-get.md', 'Apps', 'Firewall Ingress Rules Get'] +- ['apps_firewall-ingress-rules-list.md', 'Apps', 'Firewall Ingress Rules List'] +- ['apps_firewall-ingress-rules-patch.md', 'Apps', 'Firewall Ingress Rules 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 d3e3ddb444..c7611bfa91 100644 --- a/gen/appengine1-cli/src/main.rs +++ b/gen/appengine1-cli/src/main.rs @@ -490,19 +490,19 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "default-hostname" => Some(("defaultHostname", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gcr-domain" => Some(("gcrDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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 })), - "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 })), + "serving-status" => Some(("servingStatus", 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 })), + "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", 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-id" => Some(("iap.oauth2ClientId", 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 })), + "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", "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())))); @@ -605,6 +605,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 { + "override-strategy" => { + call = call.override_strategy(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -618,6 +621,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(["override-strategy"].iter().map(|v|*v)); v } )); } } @@ -905,6 +909,436 @@ impl<'n> Engine<'n> { } } + fn _apps_firewall_ingress_rules_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::BatchUpdateIngressRulesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.apps().firewall_ingress_rules_batch_update(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_firewall_ingress_rules_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()[..] { + "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-range" => Some(("sourceRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "description", "priority", "source-range"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::FirewallRule = json::value::from_value(object).unwrap(); + let mut call = self.hub.apps().firewall_ingress_rules_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_firewall_ingress_rules_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.apps().firewall_ingress_rules_delete(opt.value_of("apps-id").unwrap_or(""), opt.value_of("ingress-rules-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_firewall_ingress_rules_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.apps().firewall_ingress_rules_get(opt.value_of("apps-id").unwrap_or(""), opt.value_of("ingress-rules-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_firewall_ingress_rules_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.apps().firewall_ingress_rules_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")); + }, + "matching-address" => { + call = call.matching_address(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(["matching-address", "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_firewall_ingress_rules_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()[..] { + "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-range" => Some(("sourceRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "description", "priority", "source-range"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::FirewallRule = json::value::from_value(object).unwrap(); + let mut call = self.hub.apps().firewall_ingress_rules_patch(request, opt.value_of("apps-id").unwrap_or(""), opt.value_of("ingress-rules-id").unwrap_or("")); + for parg in 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("")); @@ -1210,19 +1644,19 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "default-hostname" => Some(("defaultHostname", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gcr-domain" => Some(("gcrDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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 })), - "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 })), + "serving-status" => Some(("servingStatus", 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 })), + "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", 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-id" => Some(("iap.oauth2ClientId", 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 })), + "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", "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())))); @@ -1655,9 +2089,8 @@ 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 })), + "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "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 })), "vm" => Some(("vm", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "instance-class" => Some(("instanceClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version-url" => Some(("versionUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1673,7 +2106,10 @@ 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 })), - "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 })), "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 })), @@ -1684,18 +2120,22 @@ impl<'n> Engine<'n> { "id" => Some(("id", 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.standard-scheduler-settings.min-instances" => Some(("automaticScaling.standardSchedulerSettings.minInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.standard-scheduler-settings.target-cpu-utilization" => Some(("automaticScaling.standardSchedulerSettings.targetCpuUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "automatic-scaling.standard-scheduler-settings.target-throughput-utilization" => Some(("automaticScaling.standardSchedulerSettings.targetThroughputUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "automatic-scaling.standard-scheduler-settings.max-instances" => Some(("automaticScaling.standardSchedulerSettings.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-packets-per-second" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-packets-per-second" => Some(("automaticScaling.networkUtilization.targetSentPacketsPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-bytes-per-second" => Some(("automaticScaling.networkUtilization.targetReceivedBytesPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-bytes-per-second" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSecond", 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-read-ops-per-second" => Some(("automaticScaling.diskUtilization.targetReadOpsPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-bytes-per-second" => Some(("automaticScaling.diskUtilization.targetWriteBytesPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-bytes-per-second" => Some(("automaticScaling.diskUtilization.targetReadBytesPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-ops-per-second" => Some(("automaticScaling.diskUtilization.targetWriteOpsPerSecond", 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-second" => Some(("automaticScaling.requestUtilization.targetRequestCountPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.cool-down-period" => Some(("automaticScaling.coolDownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1709,8 +2149,9 @@ impl<'n> Engine<'n> { "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 })), "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, 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 })), "inbound-services" => Some(("inboundServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "created-by" => Some(("createdBy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deployment.container.image" => Some(("deployment.container.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deployment.zip.files-count" => Some(("deployment.zip.filesCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1723,17 +2164,14 @@ 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 })), - "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 })), "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", "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"]); + 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-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", "standard-scheduler-settings", "subnetwork-name", "success-threshold", "target-concurrent-requests", "target-cpu-utilization", "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-throughput-utilization", "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 } @@ -2236,9 +2674,8 @@ 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 })), + "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "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 })), "vm" => Some(("vm", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "instance-class" => Some(("instanceClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version-url" => Some(("versionUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2254,7 +2691,10 @@ 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 })), - "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 })), "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 })), @@ -2265,18 +2705,22 @@ impl<'n> Engine<'n> { "id" => Some(("id", 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.standard-scheduler-settings.min-instances" => Some(("automaticScaling.standardSchedulerSettings.minInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.standard-scheduler-settings.target-cpu-utilization" => Some(("automaticScaling.standardSchedulerSettings.targetCpuUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "automatic-scaling.standard-scheduler-settings.target-throughput-utilization" => Some(("automaticScaling.standardSchedulerSettings.targetThroughputUtilization", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "automatic-scaling.standard-scheduler-settings.max-instances" => Some(("automaticScaling.standardSchedulerSettings.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-packets-per-second" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-packets-per-second" => Some(("automaticScaling.networkUtilization.targetSentPacketsPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-received-bytes-per-second" => Some(("automaticScaling.networkUtilization.targetReceivedBytesPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-bytes-per-second" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSecond", 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-read-ops-per-second" => Some(("automaticScaling.diskUtilization.targetReadOpsPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-bytes-per-second" => Some(("automaticScaling.diskUtilization.targetWriteBytesPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-bytes-per-second" => Some(("automaticScaling.diskUtilization.targetReadBytesPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-ops-per-second" => Some(("automaticScaling.diskUtilization.targetWriteOpsPerSecond", 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-second" => Some(("automaticScaling.requestUtilization.targetRequestCountPerSecond", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.cool-down-period" => Some(("automaticScaling.coolDownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2290,8 +2734,9 @@ impl<'n> Engine<'n> { "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 })), "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, 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 })), "inbound-services" => Some(("inboundServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "created-by" => Some(("createdBy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deployment.container.image" => Some(("deployment.container.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deployment.zip.files-count" => Some(("deployment.zip.filesCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -2304,17 +2749,14 @@ 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 })), - "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 })), "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", "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"]); + 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-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", "standard-scheduler-settings", "subnetwork-name", "success-threshold", "target-concurrent-requests", "target-cpu-utilization", "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-throughput-utilization", "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 } @@ -2421,6 +2863,24 @@ impl<'n> Engine<'n> { ("domain-mappings-patch", Some(opt)) => { call_result = self._apps_domain_mappings_patch(opt, dry_run, &mut err); }, + ("firewall-ingress-rules-batch-update", Some(opt)) => { + call_result = self._apps_firewall_ingress_rules_batch_update(opt, dry_run, &mut err); + }, + ("firewall-ingress-rules-create", Some(opt)) => { + call_result = self._apps_firewall_ingress_rules_create(opt, dry_run, &mut err); + }, + ("firewall-ingress-rules-delete", Some(opt)) => { + call_result = self._apps_firewall_ingress_rules_delete(opt, dry_run, &mut err); + }, + ("firewall-ingress-rules-get", Some(opt)) => { + call_result = self._apps_firewall_ingress_rules_get(opt, dry_run, &mut err); + }, + ("firewall-ingress-rules-list", Some(opt)) => { + call_result = self._apps_firewall_ingress_rules_list(opt, dry_run, &mut err); + }, + ("firewall-ingress-rules-patch", Some(opt)) => { + call_result = self._apps_firewall_ingress_rules_patch(opt, dry_run, &mut err); + }, ("get", Some(opt)) => { call_result = self._apps_get(opt, dry_run, &mut err); }, @@ -2573,7 +3033,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("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![ + ("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', 'firewall-ingress-rules-batch-update', 'firewall-ingress-rules-create', 'firewall-ingress-rules-delete', 'firewall-ingress-rules-get', 'firewall-ingress-rules-list', 'firewall-ingress-rules-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", @@ -2894,6 +3354,174 @@ 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)), + ]), + ("firewall-ingress-rules-batch-update", + Some(r##"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."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_firewall-ingress-rules-batch-update", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("firewall-ingress-rules-create", + Some(r##"Creates a firewall rule for the application."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_firewall-ingress-rules-create", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("firewall-ingress-rules-delete", + Some(r##"Deletes the specified firewall rule."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_firewall-ingress-rules-delete", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100."##), + Some(true), + Some(false)), + + (Some(r##"ingress-rules-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)), + ]), + ("firewall-ingress-rules-get", + Some(r##"Gets the specified firewall rule."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_firewall-ingress-rules-get", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100."##), + Some(true), + Some(false)), + + (Some(r##"ingress-rules-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)), + ]), + ("firewall-ingress-rules-list", + Some(r##"Lists the firewall rules of an application."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_firewall-ingress-rules-list", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("firewall-ingress-rules-patch", + Some(r##"Updates the specified firewall rule."##), + "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_firewall-ingress-rules-patch", + vec![ + (Some(r##"apps-id"##), + None, + Some(r##"Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100."##), + Some(true), + Some(false)), + + (Some(r##"ingress-rules-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"##), @@ -3536,7 +4164,7 @@ fn main() { let mut app = App::new("appengine1") .author("Sebastian Thiel ") - .version("1.0.6+20170914") + .version("1.0.6+20171208") .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 f3c76795e9..a7cb9d16c7 100644 --- a/gen/appengine1/Cargo.toml +++ b/gen/appengine1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appengine1" -version = "1.0.6+20170914" +version = "1.0.6+20171208" 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+20170914" +documentation = "https://docs.rs/google-appengine1/1.0.6+20171208" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] diff --git a/gen/appengine1/README.md b/gen/appengine1/README.md index 6bc1b579af..6600565d2a 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+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*. +This documentation was generated from *appengine* crate version *1.0.6+20171208*, where *20171208* 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+20170914/google_appengine1/struct.Appengine.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.Appengine.html) ... * apps - * [*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) + * [*authorized certificates create*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppAuthorizedCertificateCreateCall.html), [*authorized certificates delete*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppAuthorizedCertificateDeleteCall.html), [*authorized certificates get*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppAuthorizedCertificateGetCall.html), [*authorized certificates list*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppAuthorizedCertificateListCall.html), [*authorized certificates patch*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppAuthorizedCertificatePatchCall.html), [*authorized domains list*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppAuthorizedDomainListCall.html), [*create*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppCreateCall.html), [*domain mappings create*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppDomainMappingCreateCall.html), [*domain mappings delete*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppDomainMappingDeleteCall.html), [*domain mappings get*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppDomainMappingGetCall.html), [*domain mappings list*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppDomainMappingListCall.html), [*domain mappings patch*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppDomainMappingPatchCall.html), [*firewall ingress rules batch update*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppFirewallIngressRuleBatchUpdateCall.html), [*firewall ingress rules create*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppFirewallIngressRuleCreateCall.html), [*firewall ingress rules delete*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppFirewallIngressRuleDeleteCall.html), [*firewall ingress rules get*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppFirewallIngressRuleGetCall.html), [*firewall ingress rules list*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppFirewallIngressRuleListCall.html), [*firewall ingress rules patch*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppFirewallIngressRulePatchCall.html), [*get*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppPatchCall.html), [*repair*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppRepairCall.html), [*services delete*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1/1.0.6+20171208/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+20170914/google_appengine1/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1/1.0.6+20171208/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+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)** + * creates [*Method Builders*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1/1.0.6+20171208/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+20170914/google_appengine1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appengine1/1.0.6+20170914/google_appengine1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/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-appengine1/1.0.6+20170914/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+20171208/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+20170914/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+20171208/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+20170914/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+20171208/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+20170914/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+20171208/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1/1.0.6+20171208/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+20170914/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+20171208/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1/1.0.6+20171208/google_appengine1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1/1.0.6+20171208/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+20170914/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+20171208/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+20170914/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+20171208/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+20170914/google_appengine1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1/1.0.6+20171208/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 14fb90c527..653140e0dd 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+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*. +//! This documentation was generated from *appengine* crate version *1.0.6+20171208*, where *20171208* 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 -//! * [*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) +//! * [*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), [*firewall ingress rules batch update*](struct.AppFirewallIngressRuleBatchUpdateCall.html), [*firewall ingress rules create*](struct.AppFirewallIngressRuleCreateCall.html), [*firewall ingress rules delete*](struct.AppFirewallIngressRuleDeleteCall.html), [*firewall ingress rules get*](struct.AppFirewallIngressRuleGetCall.html), [*firewall ingress rules list*](struct.AppFirewallIngressRuleListCall.html), [*firewall ingress rules patch*](struct.AppFirewallIngressRulePatchCall.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) //! //! //! @@ -383,27 +383,6 @@ impl<'a, C, A> Appengine // ############ // SCHEMAS ### // ########## -/// Response message for Instances.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*). -/// -/// * [services versions instances list apps](struct.AppServiceVersionInstanceListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListInstancesResponse { - /// Continuation token for fetching the next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The instances belonging to the requested version. - pub instances: Option>, -} - -impl ResponseResult for ListInstancesResponse {} - - /// Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -433,31 +412,6 @@ pub struct LivenessCheck { impl Part for LivenessCheck {} -/// 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. 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. Only applicable for App Engine flexible environment versions. - #[serde(rename="forwardedPorts")] - pub forwarded_ports: Option>, - /// 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 App Engine flexible environment application. - #[serde(rename="subnetworkName")] - pub subnetwork_name: Option, -} - -impl Part for Network {} - - /// 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. /// /// # Activities @@ -465,8 +419,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 patch apps](struct.AppServicePatchCall.html) (request) /// * [services get apps](struct.AppServiceGetCall.html) (response) +/// * [services patch apps](struct.AppServicePatchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Service { @@ -482,21 +436,6 @@ impl RequestValue for Service {} impl ResponseResult for Service {} -/// Request message for 'Applications.RepairApplication'. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [repair apps](struct.AppRepairCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RepairApplicationRequest { _never_set: Option } - -impl RequestValue for RepairApplicationRequest {} - - /// An Instance resource is the computing unit that App Engine uses to automatically scale an application. /// /// # Activities @@ -555,16 +494,775 @@ pub struct Instance { impl ResponseResult for Instance {} +/// 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 {} + + +/// Target scaling by CPU 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 CpuUtilization { + /// Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1. + #[serde(rename="targetUtilization")] + pub target_utilization: Option, + /// Period of time over which CPU utilization is calculated. + #[serde(rename="aggregationWindowLength")] + pub aggregation_window_length: Option, +} + +impl Part for CpuUtilization {} + + +/// Machine resources for a version. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct 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, + /// Memory (GB) needed. + #[serde(rename="memoryGb")] + pub memory_gb: Option, +} + +impl Part for Resources {} + + +/// 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 {} + + +/// 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. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StaticFilesHandler { + /// 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. + #[serde(rename="mimeType")] + 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, + /// 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 {} + + +/// Target scaling by network usage. Only applicable for VM runtimes. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkUtilization { + /// Target packets received per second. + #[serde(rename="targetReceivedPacketsPerSecond")] + pub target_received_packets_per_second: Option, + /// Target packets sent per second. + #[serde(rename="targetSentPacketsPerSecond")] + pub target_sent_packets_per_second: Option, + /// Target bytes received per second. + #[serde(rename="targetReceivedBytesPerSecond")] + pub target_received_bytes_per_second: Option, + /// Target bytes sent per second. + #[serde(rename="targetSentBytesPerSecond")] + pub target_sent_bytes_per_second: Option, +} + +impl Part for NetworkUtilization {} + + +/// 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 {} + + +/// 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 {} + + +/// Response message for Firewall.UpdateAllIngressRules. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [firewall ingress rules batch update apps](struct.AppFirewallIngressRuleBatchUpdateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchUpdateIngressRulesResponse { + /// The full list of ingress FirewallRules for this application. + #[serde(rename="ingressRules")] + pub ingress_rules: Option>, +} + +impl ResponseResult for BatchUpdateIngressRulesResponse {} + + +/// Response message for Services.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*). +/// +/// * [services list apps](struct.AppServiceListCall.html) (response) +/// +#[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, +} + +impl ResponseResult for ListServicesResponse {} + + +/// 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 {} + + +/// Identity-Aware Proxy +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IdentityAwareProxy { + /// Hex-encoded SHA-256 hash of the client secret.@OutputOnly + #[serde(rename="oauth2ClientSecretSha256")] + pub oauth2_client_secret_sha256: Option, + /// 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. + pub enabled: Option, + /// 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 + #[serde(rename="oauth2ClientSecret")] + pub oauth2_client_secret: Option, + /// OAuth2 client ID to use for the authentication flow. + #[serde(rename="oauth2ClientId")] + pub oauth2_client_id: Option, +} + +impl Part for IdentityAwareProxy {} + + +/// Request message for 'Applications.RepairApplication'. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [repair apps](struct.AppRepairCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RepairApplicationRequest { _never_set: Option } + +impl RequestValue for RepairApplicationRequest {} + + +/// 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 { + /// 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, + /// 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 service. + #[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, + /// Target scaling by disk usage. + #[serde(rename="diskUtilization")] + pub disk_utilization: Option, + /// Target scaling by request utilization. + #[serde(rename="requestUtilization")] + pub request_utilization: Option, + /// 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. + #[serde(rename="coolDownPeriod")] + pub cool_down_period: Option, + /// Maximum number of instances that should be started to handle requests. + #[serde(rename="maxTotalInstances")] + pub max_total_instances: Option, + /// Number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance.Defaults to a runtime-specific value. + #[serde(rename="maxConcurrentRequests")] + pub max_concurrent_requests: Option, + /// Minimum number of instances that should be maintained for this version. + #[serde(rename="minTotalInstances")] + pub min_total_instances: Option, + /// Scheduler settings for standard environment. + #[serde(rename="standardSchedulerSettings")] + pub standard_scheduler_settings: Option, +} + +impl Part for AutomaticScaling {} + + +/// Single source file that is part of the version to be deployed. Each source file that is deployed must be specified separately. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileInfo { + /// The MIME type of the file.Defaults to the value from Google Cloud Storage. + #[serde(rename="mimeType")] + pub mime_type: Option, + /// 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//'. + #[serde(rename="sourceUrl")] + pub source_url: Option, + /// The SHA1 hash of the file, in hex. + #[serde(rename="sha1Sum")] + pub sha1_sum: Option, +} + +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. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ZipInfo { + /// 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. + #[serde(rename="filesCount")] + pub files_count: Option, + /// 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//'. + #[serde(rename="sourceUrl")] + pub source_url: Option, +} + +impl Part for ZipInfo {} + + +/// 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 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 UrlDispatchRule {} + + +/// Third-party Python runtime library that is required by the application. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Library { + /// Version of the library to select, or "latest". + pub version: Option, + /// Name of the library. Example: "django". + pub name: Option, +} + +impl Part for Library {} + + +/// Target scaling by disk usage. Only applicable for VM runtimes. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskUtilization { + /// Target ops read per seconds. + #[serde(rename="targetReadOpsPerSecond")] + pub target_read_ops_per_second: Option, + /// Target bytes written per second. + #[serde(rename="targetWriteBytesPerSecond")] + pub target_write_bytes_per_second: Option, + /// Target bytes read per second. + #[serde(rename="targetReadBytesPerSecond")] + pub target_read_bytes_per_second: Option, + /// Target ops written per second. + #[serde(rename="targetWriteOpsPerSecond")] + pub target_write_ops_per_second: Option, +} + +impl Part for DiskUtilization {} + + +/// 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, + /// Metadata settings that are supplied to this version to enable beta runtime features. + #[serde(rename="betaSettings")] + pub beta_settings: 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, + /// 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, + /// Extra network settings. Only applicable for App Engine flexible environment versions. + pub network: 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, + /// 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, + /// 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>, + /// 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, + /// 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, + /// 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 {} + + +/// 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 versions create apps](struct.AppServiceVersionCreateCall.html) (response) +/// * [patch apps](struct.AppPatchCall.html) (response) +/// * [services versions instances debug apps](struct.AppServiceVersionInstanceDebugCall.html) (response) +/// * [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) +/// * [services delete apps](struct.AppServiceDeleteCall.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 {} + + +/// Scheduler settings for standard 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 StandardSchedulerSettings { + /// Minimum number of instances for an app version. Set to a non-positive value (0 by convention) to disable min_instances configuration. + #[serde(rename="minInstances")] + pub min_instances: Option, + /// Target CPU utilization ratio to maintain when scaling. + #[serde(rename="targetCpuUtilization")] + pub target_cpu_utilization: Option, + /// Target throughput utilization ratio to maintain when scaling + #[serde(rename="targetThroughputUtilization")] + pub target_throughput_utilization: Option, + /// Maximum number of instances for an app version. Set to a non-positive value (0 by convention) to disable max_instances configuration. + #[serde(rename="maxInstances")] + pub max_instances: Option, +} + +impl Part for StandardSchedulerSettings {} + + +/// Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApiConfigHandler { + /// URL to serve the endpoint at. + pub url: Option, + /// Security (HTTPS) enforcement for this URL. + #[serde(rename="securityLevel")] + pub security_level: 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, +} + +impl Part for ApiConfigHandler {} + + +/// Response message for Instances.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*). +/// +/// * [services versions instances list apps](struct.AppServiceVersionInstanceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListInstancesResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The instances belonging to the requested version. + pub instances: Option>, +} + +impl ResponseResult for ListInstancesResponse {} + + +/// 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. 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. Only applicable for App Engine flexible environment versions. + #[serde(rename="forwardedPorts")] + pub forwarded_ports: Option>, + /// 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 App Engine flexible environment application. + #[serde(rename="subnetworkName")] + pub subnetwork_name: Option, +} + +impl Part for Network {} + + +/// 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*). +/// +/// * [authorized domains list apps](struct.AppAuthorizedDomainListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +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 ListAuthorizedDomainsResponse {} + + +/// 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*). +/// +/// * [create apps](struct.AppCreateCall.html) (request) +/// * [patch apps](struct.AppPatchCall.html) (request) +/// * [get apps](struct.AppGetCall.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, + /// 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, + /// Serving status of this application. + #[serde(rename="servingStatus")] + pub serving_status: 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, + /// 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, + /// 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, + /// The Google Container Registry domain used for storing managed build docker images for this application. + #[serde(rename="gcrDomain")] + pub gcr_domain: Option, +} + +impl RequestValue for Application {} +impl ResponseResult for Application {} + + /// 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). /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AuthorizedDomain { - /// Full path to the AuthorizedDomain resource in the API. Example: apps/myapp/authorizedDomains/example.com.@OutputOnly - pub name: Option, /// Fully qualified domain name of the domain authorized for use. Example: example.com. pub id: Option, + /// Full path to the AuthorizedDomain resource in the API. Example: apps/myapp/authorizedDomains/example.com.@OutputOnly + pub name: Option, } impl Part for AuthorizedDomain {} @@ -639,68 +1337,6 @@ pub struct DebugInstanceRequest { impl RequestValue for DebugInstanceRequest {} -/// Target scaling by CPU 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 CpuUtilization { - /// Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1. - #[serde(rename="targetUtilization")] - pub target_utilization: Option, - /// Period of time over which CPU utilization is calculated. - #[serde(rename="aggregationWindowLength")] - pub aggregation_window_length: Option, -} - -impl Part for CpuUtilization {} - - -/// Machine resources for a version. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Resources { - /// 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, - /// User specified volumes. - pub volumes: Option>, -} - -impl Part for Resources {} - - -/// 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 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. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -718,59 +1354,6 @@ pub struct BasicScaling { impl Part for BasicScaling {} -/// 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. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StaticFilesHandler { - /// 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. - #[serde(rename="mimeType")] - pub mime_type: Option, - /// Time a static file served by this handler should be cached by web proxies and browsers. - pub expiration: 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>, - /// 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, -} - -impl Part for StaticFilesHandler {} - - -/// Target scaling by network usage. Only applicable for VM runtimes. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkUtilization { - /// Target packets received per second. - #[serde(rename="targetReceivedPacketsPerSecond")] - pub target_received_packets_per_second: Option, - /// Target packets sent per second. - #[serde(rename="targetSentPacketsPerSecond")] - pub target_sent_packets_per_second: Option, - /// Target bytes received per second. - #[serde(rename="targetReceivedBytesPerSecond")] - pub target_received_bytes_per_second: Option, - /// Target bytes sent per second. - #[serde(rename="targetSentBytesPerSecond")] - pub target_sent_bytes_per_second: Option, -} - -impl Part for NetworkUtilization {} - - /// Response message for Versions.ListVersions. /// /// # Activities @@ -851,11 +1434,11 @@ impl ResponseResult for DomainMapping {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListAuthorizedCertificatesResponse { + /// The SSL certificates the user is authorized to administer. + pub certificates: Option>, /// 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 {} @@ -872,6 +1455,7 @@ impl ResponseResult for ListAuthorizedCertificatesResponse {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [firewall ingress rules delete apps](struct.AppFirewallIngressRuleDeleteCall.html) (response) /// * [authorized certificates delete apps](struct.AppAuthorizedCertificateDeleteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -880,20 +1464,6 @@ 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. @@ -938,28 +1508,6 @@ 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. @@ -1003,110 +1551,26 @@ 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. +/// Response message for Firewall.ListIngressRules. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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) +/// * [firewall ingress rules list apps](struct.AppFirewallIngressRuleListCall.html) (response) /// #[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, +pub struct ListIngressRulesResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The ingress FirewallRules for this application. + #[serde(rename="ingressRules")] + pub ingress_rules: Option>, } -impl RequestValue for Version {} -impl ResponseResult for Version {} +impl ResponseResult for ListIngressRulesResponse {} /// Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. Only applicable for instances in App Engine flexible environment. @@ -1153,35 +1617,18 @@ pub struct SslSettings { 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, + /// 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, @@ -1190,75 +1637,6 @@ pub struct ErrorHandler { impl Part for ErrorHandler {} -/// Identity-Aware Proxy -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IdentityAwareProxy { - /// OAuth2 client ID to use for the authentication flow. - #[serde(rename="oauth2ClientId")] - pub oauth2_client_id: Option, - /// 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. - pub enabled: Option, - /// 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 - #[serde(rename="oauth2ClientSecret")] - pub oauth2_client_secret: Option, - /// Hex-encoded SHA-256 hash of the client secret.@OutputOnly - #[serde(rename="oauth2ClientSecretSha256")] - pub oauth2_client_secret_sha256: Option, -} - -impl Part for IdentityAwareProxy {} - - -/// 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, - /// Target scaling by network usage. - #[serde(rename="networkUtilization")] - pub network_utilization: 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, - /// Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a service. - #[serde(rename="minIdleInstances")] - pub min_idle_instances: Option, - /// Target scaling by request utilization. - #[serde(rename="requestUtilization")] - pub request_utilization: Option, - /// 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. - #[serde(rename="coolDownPeriod")] - pub cool_down_period: Option, - /// Maximum number of instances that should be started to handle requests. - #[serde(rename="maxTotalInstances")] - pub max_total_instances: Option, - /// Number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance.Defaults to a runtime-specific value. - #[serde(rename="maxConcurrentRequests")] - pub max_concurrent_requests: Option, - /// 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, -} - -impl Part for AutomaticScaling {} - - /// 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. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1282,94 +1660,16 @@ 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 {} -/// Single source file that is part of the version to be deployed. Each source file that is deployed must be specified separately. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FileInfo { - /// The MIME type of the file.Defaults to the value from Google Cloud Storage. - #[serde(rename="mimeType")] - pub mime_type: Option, - /// 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//'. - #[serde(rename="sourceUrl")] - pub source_url: Option, - /// The SHA1 hash of the file, in hex. - #[serde(rename="sha1Sum")] - pub sha1_sum: Option, -} - -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. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ZipInfo { - /// 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. - #[serde(rename="filesCount")] - pub files_count: Option, - /// 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//'. - #[serde(rename="sourceUrl")] - pub source_url: Option, -} - -impl Part for ZipInfo {} - - /// 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). /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1407,80 +1707,32 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} -/// Response message for AuthorizedDomains.ListAuthorizedDomains. +/// A single firewall rule that is evaluated against incoming traffic and provides an action to take on matched requests. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [authorized domains list apps](struct.AppAuthorizedDomainListCall.html) (response) +/// * [firewall ingress rules create apps](struct.AppFirewallIngressRuleCreateCall.html) (request|response) +/// * [firewall ingress rules patch apps](struct.AppFirewallIngressRulePatchCall.html) (request|response) +/// * [firewall ingress rules get apps](struct.AppFirewallIngressRuleGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -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>, +pub struct FirewallRule { + /// 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. + pub priority: Option, + /// The action to take on matched requests. + pub action: Option, + /// An optional string description of this rule. This field has a maximum length of 100 characters. + pub description: Option, + /// 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.

Truncation 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. + #[serde(rename="sourceRange")] + pub source_range: Option, } -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 {} +impl RequestValue for FirewallRule {} +impl ResponseResult for FirewallRule {} /// A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. @@ -1496,122 +1748,6 @@ pub struct ManualScaling { impl Part for ManualScaling {} -/// 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 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 UrlDispatchRule {} - - -/// Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApiConfigHandler { - /// URL to serve the endpoint at. - pub url: Option, - /// Security (HTTPS) enforcement for this URL. - #[serde(rename="securityLevel")] - pub security_level: 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, -} - -impl Part for ApiConfigHandler {} - - -/// Third-party Python runtime library that is required by the application. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Library { - /// Version of the library to select, or "latest". - pub version: Option, - /// Name of the library. Example: "django". - pub name: Option, -} - -impl Part for Library {} - - -/// Target scaling by disk usage. Only applicable for VM runtimes. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskUtilization { - /// Target ops read per seconds. - #[serde(rename="targetReadOpsPerSecond")] - pub target_read_ops_per_second: Option, - /// Target bytes written per second. - #[serde(rename="targetWriteBytesPerSecond")] - pub target_write_bytes_per_second: Option, - /// Target bytes read per second. - #[serde(rename="targetReadBytesPerSecond")] - pub target_read_bytes_per_second: Option, - /// Target ops written per second. - #[serde(rename="targetWriteOpsPerSecond")] - pub target_write_ops_per_second: Option, -} - -impl Part for DiskUtilization {} - - -/// Target scaling by request utilization. Only applicable for VM runtimes. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RequestUtilization { - /// Target number of concurrent requests. - #[serde(rename="targetConcurrentRequests")] - pub target_concurrent_requests: Option, - /// Target requests per second. - #[serde(rename="targetRequestCountPerSecond")] - pub target_request_count_per_second: Option, -} - -impl Part for RequestUtilization {} - - -/// Response message for Services.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*). -/// -/// * [services list apps](struct.AppServiceListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListServicesResponse { - /// 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 {} - - /// 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. @@ -1628,61 +1764,40 @@ pub struct TrafficSplit { impl Part for TrafficSplit {} -/// This resource represents a long-running operation that is the result of a network API call. +/// Request message for Firewall.BatchUpdateIngressRules. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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) (response) -/// * [patch apps](struct.AppPatchCall.html) (response) -/// * [services versions instances debug apps](struct.AppServiceVersionInstanceDebugCall.html) (response) -/// * [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) -/// * [services delete apps](struct.AppServiceDeleteCall.html) (response) +/// * [firewall ingress rules batch update apps](struct.AppFirewallIngressRuleBatchUpdateCall.html) (request) /// #[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>, +pub struct BatchUpdateIngressRulesRequest { + /// A list of FirewallRules to replace the existing set. + #[serde(rename="ingressRules")] + pub ingress_rules: Option>, } -impl ResponseResult for Operation {} +impl RequestValue for BatchUpdateIngressRulesRequest {} -/// A DNS resource record. +/// Target scaling by request utilization. Only applicable for VM runtimes. /// /// 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, +pub struct RequestUtilization { + /// Target number of concurrent requests. + #[serde(rename="targetConcurrentRequests")] + pub target_concurrent_requests: Option, + /// Target requests per second. + #[serde(rename="targetRequestCountPerSecond")] + pub target_request_count_per_second: Option, } -impl Part for ResourceRecord {} +impl Part for RequestUtilization {} @@ -1714,7 +1829,7 @@ impl Part for ResourceRecord {} /// ::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 `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(...)` +/// // 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(...)`, `firewall_ingress_rules_batch_update(...)`, `firewall_ingress_rules_create(...)`, `firewall_ingress_rules_delete(...)`, `firewall_ingress_rules_get(...)`, `firewall_ingress_rules_list(...)`, `firewall_ingress_rules_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(); /// # } @@ -1754,21 +1869,17 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets instance information. + /// Lists all domains the user is authorized to administer. /// /// # 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 `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(), - _services_id: services_id.to_string(), - _versions_id: versions_id.to_string(), - _instances_id: instances_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1818,17 +1929,17 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get information about a location. + /// Deletes the specified firewall rule. /// /// # 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 { + /// * `appsId` - Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100. + /// * `ingressRulesId` - Part of `name`. See documentation of `appsId`. + pub fn firewall_ingress_rules_delete(&self, apps_id: &str, ingress_rules_id: &str) -> AppFirewallIngressRuleDeleteCall<'a, C, A> { + AppFirewallIngressRuleDeleteCall { hub: self.hub, _apps_id: apps_id.to_string(), - _locations_id: locations_id.to_string(), + _ingress_rules_id: ingress_rules_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1837,17 +1948,21 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all domains the user is authorized to administer. + /// Gets instance information. /// /// # 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 { + /// * `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(), - _page_token: Default::default(), - _page_size: Default::default(), + _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(), @@ -1874,6 +1989,26 @@ impl<'a, C, A> AppMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the firewall rules of an application. + /// + /// # Arguments + /// + /// * `appsId` - Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules. + pub fn firewall_ingress_rules_list(&self, apps_id: &str) -> AppFirewallIngressRuleListCall<'a, C, A> { + AppFirewallIngressRuleListCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _matching_address: 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. @@ -1932,6 +2067,28 @@ impl<'a, C, A> AppMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates the specified firewall rule. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `appsId` - Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100. + /// * `ingressRulesId` - Part of `name`. See documentation of `appsId`. + pub fn firewall_ingress_rules_patch(&self, request: FirewallRule, apps_id: &str, ingress_rules_id: &str) -> AppFirewallIngressRulePatchCall<'a, C, A> { + AppFirewallIngressRulePatchCall { + hub: self.hub, + _request: request, + _apps_id: apps_id.to_string(), + _ingress_rules_id: ingress_rules_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 the services in the application. @@ -2091,6 +2248,44 @@ impl<'a, C, A> AppMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Creates a firewall rule for the application. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `appsId` - Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules. + pub fn firewall_ingress_rules_create(&self, request: FirewallRule, apps_id: &str) -> AppFirewallIngressRuleCreateCall<'a, C, A> { + AppFirewallIngressRuleCreateCall { + 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: + /// + /// 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. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `appsId` - Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules. + pub fn firewall_ingress_rules_batch_update(&self, request: BatchUpdateIngressRulesRequest, apps_id: &str) -> AppFirewallIngressRuleBatchUpdateCall<'a, C, A> { + AppFirewallIngressRuleBatchUpdateCall { + 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: /// /// 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. @@ -2226,6 +2421,7 @@ impl<'a, C, A> AppMethods<'a, C, A> { hub: self.hub, _request: request, _apps_id: apps_id.to_string(), + _override_strategy: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2392,6 +2588,44 @@ impl<'a, C, A> AppMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Gets the specified firewall rule. + /// + /// # Arguments + /// + /// * `appsId` - Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100. + /// * `ingressRulesId` - Part of `name`. See documentation of `appsId`. + pub fn firewall_ingress_rules_get(&self, apps_id: &str, ingress_rules_id: &str) -> AppFirewallIngressRuleGetCall<'a, C, A> { + AppFirewallIngressRuleGetCall { + hub: self.hub, + _apps_id: apps_id.to_string(), + _ingress_rules_id: ingress_rules_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(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -2654,10 +2888,10 @@ impl<'a, C, A> AppServiceVersionInstanceListCall<'a, C, A> where C: BorrowMut 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().authorized_domains_list("appsId") +/// .page_token("aliquyam") +/// .page_size(-66) +/// .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 + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> 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 + } +} + + +/// 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("justo") +/// .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 + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> 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("et") +/// .page_size(-41) +/// .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 + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> 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 + } +} + + +/// Deletes the specified firewall rule. +/// +/// A builder for the *firewall.ingressRules.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().firewall_ingress_rules_delete("appsId", "ingressRulesId") +/// .doit(); +/// # } +/// ``` +pub struct AppFirewallIngressRuleDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _ingress_rules_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppFirewallIngressRuleDeleteCall<'a, C, A> {} + +impl<'a, C, A> AppFirewallIngressRuleDeleteCall<'a, C, 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: "appengine.apps.firewall.ingressRules.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("appsId", self._apps_id.to_string())); + params.push(("ingressRulesId", self._ingress_rules_id.to_string())); + for &field in ["alt", "appsId", "ingressRulesId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in 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}/firewall/ingressRules/{ingressRulesId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{ingressRulesId}", "ingressRulesId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["ingressRulesId", "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 Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100. + /// + /// 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) -> AppFirewallIngressRuleDeleteCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *ingress rules id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn ingress_rules_id(mut self, new_value: &str) -> AppFirewallIngressRuleDeleteCall<'a, C, A> { + self._ingress_rules_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppFirewallIngressRuleDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> AppFirewallIngressRuleDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AppFirewallIngressRuleDeleteCall<'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 instance information. /// /// A builder for the *services.versions.instances.get* method supported by a *app* resource. @@ -2939,10 +4284,10 @@ impl<'a, C, A> AppServiceVersionInstanceGetCall<'a, C, A> where C: BorrowMut AppServiceVersionInstanceGetCall<'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 = 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. @@ -4335,10 +4569,10 @@ 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. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4380,6 +4614,291 @@ impl<'a, C, A> AppOperationListCall<'a, C, A> where C: BorrowMut, } +/// Lists the firewall rules of an application. +/// +/// A builder for the *firewall.ingressRules.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().firewall_ingress_rules_list("appsId") +/// .page_token("eirmod") +/// .page_size(-43) +/// .matching_address("amet") +/// .doit(); +/// # } +/// ``` +pub struct AppFirewallIngressRuleListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _page_token: Option, + _page_size: Option, + _matching_address: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppFirewallIngressRuleListCall<'a, C, A> {} + +impl<'a, C, A> AppFirewallIngressRuleListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListIngressRulesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.firewall.ingressRules.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._matching_address { + params.push(("matchingAddress", value.to_string())); + } + for &field in ["alt", "appsId", "pageToken", "pageSize", "matchingAddress"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in 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}/firewall/ingressRules"; + 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 Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules. + /// + /// 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) -> AppFirewallIngressRuleListCall<'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) -> AppFirewallIngressRuleListCall<'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) -> AppFirewallIngressRuleListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// 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. + /// + /// Sets the *matching address* query property to the given value. + pub fn matching_address(mut self, new_value: &str) -> AppFirewallIngressRuleListCall<'a, C, A> { + self._matching_address = 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) -> AppFirewallIngressRuleListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> AppFirewallIngressRuleListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> AppFirewallIngressRuleListCall<'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. @@ -4584,10 +5103,10 @@ 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. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4845,10 +5364,10 @@ impl<'a, C, A> AppDomainMappingGetCall<'a, C, A> where C: BorrowMut AppDomainMappingGetCall<'a, C, A> where C: BorrowMut AppServiceVersionGetCall<'a, C, A> where C: BorrowMut AppServiceVersionGetCall<'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 = FirewallRule::default(); +/// +/// // You can configure optional parameters by calling 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().firewall_ingress_rules_patch(req, "appsId", "ingressRulesId") +/// .update_mask("et") +/// .doit(); +/// # } +/// ``` +pub struct AppFirewallIngressRulePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _request: FirewallRule, + _apps_id: String, + _ingress_rules_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppFirewallIngressRulePatchCall<'a, C, A> {} + +impl<'a, C, A> AppFirewallIngressRulePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, FirewallRule)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.firewall.ingressRules.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(("ingressRulesId", self._ingress_rules_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "appsId", "ingressRulesId", "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}/firewall/ingressRules/{ingressRulesId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{ingressRulesId}", "ingressRulesId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["ingressRulesId", "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: FirewallRule) -> AppFirewallIngressRulePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100. + /// + /// 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) -> AppFirewallIngressRulePatchCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *ingress rules id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn ingress_rules_id(mut self, new_value: &str) -> AppFirewallIngressRulePatchCall<'a, C, A> { + self._ingress_rules_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) -> AppFirewallIngressRulePatchCall<'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) -> AppFirewallIngressRulePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> AppFirewallIngressRulePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AppFirewallIngressRulePatchCall<'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. @@ -5203,8 +6026,8 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut AppServiceListCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5695,10 +6518,10 @@ impl<'a, C, A> AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut 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. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6062,9 +6885,9 @@ impl<'a, C, A> AppPatchCall<'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.apps().authorized_certificates_list("appsId") -/// .view("et") -/// .page_token("eirmod") -/// .page_size(-58) +/// .view("ut") +/// .page_token("ea") +/// .page_size(-80) /// .doit(); /// # } /// ``` @@ -6274,10 +7097,10 @@ impl<'a, C, A> AppAuthorizedCertificateListCall<'a, C, A> where C: BorrowMut AppServiceVersionInstanceDeleteCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6646,7 +7469,7 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< /// // 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") +/// .update_mask("Lorem") /// .doit(); /// # } /// ``` @@ -6883,10 +7706,10 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut AppServiceVersionListCall<'a, C, A> where C: BorrowMut AppServiceVersionListCall<'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 = FirewallRule::default(); +/// +/// // You can configure optional parameters by calling 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().firewall_ingress_rules_create(req, "appsId") +/// .doit(); +/// # } +/// ``` +pub struct AppFirewallIngressRuleCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _request: FirewallRule, + _apps_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppFirewallIngressRuleCreateCall<'a, C, A> {} + +impl<'a, C, A> AppFirewallIngressRuleCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, FirewallRule)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.firewall.ingressRules.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}/firewall/ingressRules"; + 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: FirewallRule) -> AppFirewallIngressRuleCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules. + /// + /// 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) -> AppFirewallIngressRuleCreateCall<'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) -> AppFirewallIngressRuleCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> AppFirewallIngressRuleCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AppFirewallIngressRuleCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// 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. +/// +/// A builder for the *firewall.ingressRules.batchUpdate* 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::BatchUpdateIngressRulesRequest; +/// # #[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 = BatchUpdateIngressRulesRequest::default(); +/// +/// // You can configure optional parameters by calling 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().firewall_ingress_rules_batch_update(req, "appsId") +/// .doit(); +/// # } +/// ``` +pub struct AppFirewallIngressRuleBatchUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _request: BatchUpdateIngressRulesRequest, + _apps_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppFirewallIngressRuleBatchUpdateCall<'a, C, A> {} + +impl<'a, C, A> AppFirewallIngressRuleBatchUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BatchUpdateIngressRulesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.firewall.ingressRules.batchUpdate", + 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}/firewall/ingressRules:batchUpdate"; + 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: BatchUpdateIngressRulesRequest) -> AppFirewallIngressRuleBatchUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules. + /// + /// 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) -> AppFirewallIngressRuleBatchUpdateCall<'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) -> AppFirewallIngressRuleBatchUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> AppFirewallIngressRuleBatchUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AppFirewallIngressRuleBatchUpdateCall<'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. @@ -7460,10 +8843,10 @@ impl<'a, C, A> AppRepairCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -7733,10 +9116,10 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut AppAuthorizedCertificateCreateCall<'a, C, A> where C: BorrowMut AppServiceVersionInstanceDebugCall<'a, C, A> where C: BorrowMut AppServiceGetCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -8851,10 +10234,10 @@ impl<'a, C, A> AppAuthorizedCertificateDeleteCall<'a, C, A> where C: BorrowMut AppAuthorizedCertificateDeleteCall<'a, C, A> where C: BorrowMut hub: &'a Appengine, _request: DomainMapping, _apps_id: String, + _override_strategy: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -8960,9 +10345,12 @@ impl<'a, C, A> AppDomainMappingCreateCall<'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())); params.push(("appsId", self._apps_id.to_string())); - for &field in ["alt", "appsId"].iter() { + if let Some(value) = self._override_strategy { + params.push(("overrideStrategy", value.to_string())); + } + for &field in ["alt", "appsId", "overrideStrategy"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9111,6 +10499,13 @@ impl<'a, C, A> AppDomainMappingCreateCall<'a, C, A> where C: BorrowMut AppDomainMappingCreateCall<'a, C, A> { + self._override_strategy = 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. /// @@ -9131,10 +10526,10 @@ impl<'a, C, A> AppDomainMappingCreateCall<'a, C, A> where C: BorrowMut AppDomainMappingCreateCall<'a, C, A> where C: BorrowMut AppDomainMappingPatchCall<'a, C, A> where C: BorrowMut 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. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -9769,9 +11164,9 @@ impl<'a, C, A> AppOperationGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.apps().locations_list("appsId") -/// .page_token("consetetur") -/// .page_size(-58) -/// .filter("nonumy") +/// .page_token("sadipscing") +/// .page_size(-66) +/// .filter("dolore") /// .doit(); /// # } /// ``` @@ -9981,10 +11376,10 @@ 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. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -10242,10 +11637,10 @@ impl<'a, C, A> AppDomainMappingDeleteCall<'a, C, A> where C: BorrowMut AppDomainMappingDeleteCall<'a, C, A> where C: BorrowMut AppServicePatchCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -10819,10 +12214,10 @@ impl<'a, C, A> AppServiceDeleteCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -11068,10 +12463,10 @@ 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. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -11141,7 +12536,7 @@ impl<'a, C, A> AppCreateCall<'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.apps().authorized_certificates_get("appsId", "authorizedCertificatesId") -/// .view("nonumy") +/// .view("aliquyam") /// .doit(); /// # } /// ``` @@ -11341,10 +12736,10 @@ impl<'a, C, A> AppAuthorizedCertificateGetCall<'a, C, A> where C: BorrowMut AppAuthorizedCertificateGetCall<'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().firewall_ingress_rules_get("appsId", "ingressRulesId") +/// .doit(); +/// # } +/// ``` +pub struct AppFirewallIngressRuleGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Appengine, + _apps_id: String, + _ingress_rules_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AppFirewallIngressRuleGetCall<'a, C, A> {} + +impl<'a, C, A> AppFirewallIngressRuleGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, FirewallRule)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.firewall.ingressRules.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(("ingressRulesId", self._ingress_rules_id.to_string())); + for &field in ["alt", "appsId", "ingressRulesId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in 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}/firewall/ingressRules/{ingressRulesId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{appsId}", "appsId"), ("{ingressRulesId}", "ingressRulesId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["ingressRulesId", "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 Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100. + /// + /// 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) -> AppFirewallIngressRuleGetCall<'a, C, A> { + self._apps_id = new_value.to_string(); + self + } + /// Part of `name`. See documentation of `appsId`. + /// + /// Sets the *ingress rules id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn ingress_rules_id(mut self, new_value: &str) -> AppFirewallIngressRuleGetCall<'a, C, A> { + self._ingress_rules_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> AppFirewallIngressRuleGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> AppFirewallIngressRuleGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> AppFirewallIngressRuleGetCall<'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 + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> 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 + } +} + + diff --git a/gen/appengine1_beta4-cli/Cargo.toml b/gen/appengine1_beta4-cli/Cargo.toml index c8f288ac20..3afef51739 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+20170914" +version = "1.0.6+20171208" 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+20170914" +version = "1.0.6+20171208" diff --git a/gen/appengine1_beta4-cli/README.md b/gen/appengine1_beta4-cli/README.md index 47e3ca14df..7f08687476 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 *20170914*. The CLI is at version *1.0.6*. +This documentation was generated from the *appengine* API at revision *20171208*. 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 aa03a2e071..49accfd7d3 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+20170914 +site_name: appengine v1.0.6+20171208 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 b7247f73bf..098ffefb0e 100644 --- a/gen/appengine1_beta4-cli/src/main.rs +++ b/gen/appengine1_beta4-cli/src/main.rs @@ -498,10 +498,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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 })), - "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())))); @@ -593,6 +593,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = 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 })), @@ -601,8 +603,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.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 })), @@ -616,12 +618,11 @@ impl<'n> Engine<'n> { "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, 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.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 })), "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.network-utilization.target-sent-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSec", 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 })), @@ -635,7 +636,8 @@ impl<'n> Engine<'n> { "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.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 })), "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 })), @@ -652,7 +654,7 @@ impl<'n> Engine<'n> { "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", "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"]); + 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-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", "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 } @@ -1153,6 +1155,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = 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 })), @@ -1161,8 +1165,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.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 })), @@ -1176,12 +1180,11 @@ impl<'n> Engine<'n> { "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, 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.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 })), "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.network-utilization.target-sent-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSec", 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 })), @@ -1195,7 +1198,8 @@ impl<'n> Engine<'n> { "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.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 })), "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 })), @@ -1212,7 +1216,7 @@ impl<'n> Engine<'n> { "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", "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"]); + 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-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", "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 } @@ -2278,7 +2282,7 @@ fn main() { let mut app = App::new("appengine1-beta4") .author("Sebastian Thiel ") - .version("1.0.6+20170914") + .version("1.0.6+20171208") .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 97764e9d01..ce810a71d8 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+20170914" +version = "1.0.6+20171208" 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+20170914" +documentation = "https://docs.rs/google-appengine1_beta4/1.0.6+20171208" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] diff --git a/gen/appengine1_beta4/README.md b/gen/appengine1_beta4/README.md index 3c88ac6a1f..82716c78d5 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+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*. +This documentation was generated from *appengine* crate version *1.0.6+20171208*, where *20171208* 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+20170914/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+20171208/google_appengine1_beta4/struct.Appengine.html) ... * apps - * [*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) + * [*create*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppLocationListCall.html), [*modules delete*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleDeleteCall.html), [*modules get*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleGetCall.html), [*modules list*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleListCall.html), [*modules patch*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModulePatchCall.html), [*modules versions create*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleVersionCreateCall.html), [*modules versions delete*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleVersionDeleteCall.html), [*modules versions get*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleVersionGetCall.html), [*modules versions instances debug*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleVersionInstanceDebugCall.html), [*modules versions instances delete*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleVersionInstanceDeleteCall.html), [*modules versions instances get*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleVersionInstanceGetCall.html), [*modules versions instances list*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleVersionInstanceListCall.html), [*modules versions list*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleVersionListCall.html), [*modules versions patch*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppModuleVersionPatchCall.html), [*operations get*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/struct.AppOperationListCall.html) and [*patch*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/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+20170914/google_appengine1_beta4/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/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+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)** + * creates [*Method Builders*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/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+20170914/google_appengine1_beta4/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/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+20170914/google_appengine1_beta4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/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+20170914/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+20171208/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+20170914/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+20171208/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+20170914/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+20171208/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+20170914/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+20171208/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/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+20170914/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+20171208/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/google_appengine1_beta4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/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+20170914/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+20171208/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+20170914/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+20171208/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+20170914/google_appengine1_beta4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1_beta4/1.0.6+20171208/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 74102029f9..33f5bcabb2 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+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*. +//! This documentation was generated from *appengine* crate version *1.0.6+20171208*, where *20171208* 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/). @@ -404,23 +404,25 @@ pub struct ListInstancesResponse { impl ResponseResult for ListInstancesResponse {} -/// Extra network settings. Only applicable for VM runtimes. +/// Response message for Modules.ListModules. /// -/// 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*). +/// +/// * [modules list apps](struct.AppModuleListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Network { - /// Tag to apply to the VM instance during creation. - #[serde(rename="instanceTag")] - pub instance_tag: Option, - /// List of ports, or port pairs, to forward from the virtual machine to the application container. - #[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. - pub name: Option, +pub struct ListModulesResponse { + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The modules belonging to the requested application. + pub modules: Option>, } -impl Part for Network {} +impl ResponseResult for ListModulesResponse {} /// An Application resource contains the top-level configuration of an App Engine application. @@ -431,8 +433,8 @@ impl Part for Network {} /// 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) +/// * [get apps](struct.AppGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Application { @@ -481,6 +483,9 @@ impl ResponseResult for Application {} /// #[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, @@ -650,40 +655,38 @@ 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, - /// User specified volumes. - pub volumes: Option>, + /// Number of CPU cores needed. + pub cpu: Option, /// Memory (GB) needed. #[serde(rename="memoryGb")] pub memory_gb: Option, - /// Number of CPU cores needed. - pub cpu: Option, } impl Part for Resources {} -/// Response message for Modules.ListModules. +/// Extra network settings. Only applicable for VM runtimes. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 list apps](struct.AppModuleListCall.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 ListModulesResponse { - /// Continuation token for fetching the next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The modules belonging to the requested application. - pub modules: Option>, +pub struct Network { + /// Tag to apply to the VM instance during creation. + #[serde(rename="instanceTag")] + pub instance_tag: Option, + /// List of ports, or port pairs, to forward from the virtual machine to the application container. + #[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. + pub name: Option, } -impl ResponseResult for ListModulesResponse {} +impl Part for Network {} /// 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: @@ -746,12 +749,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, - /// 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>, + /// 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, } impl Part for StaticFilesHandler {} @@ -766,15 +769,15 @@ pub struct NetworkUtilization { /// Target bytes received per second. #[serde(rename="targetReceivedBytesPerSec")] pub target_received_bytes_per_sec: Option, + /// Target packets sent per second. + #[serde(rename="targetSentPacketsPerSec")] + pub target_sent_packets_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, } impl Part for NetworkUtilization {} @@ -913,24 +916,26 @@ pub struct HealthCheck { impl Part for HealthCheck {} -/// Custom static error page to be served when an error occurs. +/// Identity-Aware Proxy /// /// 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, +pub struct IdentityAwareProxy { + /// OAuth2 client ID to use for the authentication flow. + #[serde(rename="oauth2ClientId")] + pub oauth2_client_id: Option, + /// 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. + pub enabled: Option, + /// 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 + #[serde(rename="oauth2ClientSecret")] + pub oauth2_client_secret: Option, + /// Hex-encoded SHA-256 hash of the client secret.@OutputOnly + #[serde(rename="oauth2ClientSecretSha256")] + pub oauth2_client_secret_sha256: Option, } -impl Part for ErrorHandler {} +impl Part for IdentityAwareProxy {} /// 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. @@ -960,26 +965,24 @@ pub struct StaticDirectoryHandler { impl Part for StaticDirectoryHandler {} -/// Identity-Aware Proxy +/// 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 IdentityAwareProxy { - /// OAuth2 client ID to use for the authentication flow. - #[serde(rename="oauth2ClientId")] - pub oauth2_client_id: Option, - /// 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. - pub enabled: Option, - /// 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 - #[serde(rename="oauth2ClientSecret")] - pub oauth2_client_secret: Option, - /// Hex-encoded SHA-256 hash of the client secret.@OutputOnly - #[serde(rename="oauth2ClientSecretSha256")] - pub oauth2_client_secret_sha256: Option, +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 IdentityAwareProxy {} +impl Part for ErrorHandler {} /// Automatic scaling is based on request rate, response latencies, and other application metrics. @@ -988,9 +991,9 @@ impl Part for IdentityAwareProxy {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AutomaticScaling { - /// 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, /// Target scaling by network usage. #[serde(rename="networkUtilization")] pub network_utilization: Option, @@ -1021,9 +1024,9 @@ pub struct AutomaticScaling { /// Minimum number of instances that should be maintained for this version. #[serde(rename="minTotalInstances")] pub min_total_instances: Option, - /// 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, } impl Part for AutomaticScaling {} @@ -1055,11 +1058,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 {} @@ -1085,6 +1088,22 @@ pub struct FileInfo { impl Part for FileInfo {} +/// 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). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EndpointsApiService { + /// Endpoints service configuration id as specified by the Service Management API. For example "2016-09-19r1"By default, the Endpoints service configuration id is fixed and config_id must be specified. To keep the Endpoints service configuration id updated with each rollout, specify RolloutStrategy.MANAGED and omit config_id. + #[serde(rename="configId")] + pub config_id: Option, + /// Endpoints service name which is the name of the "service" resource in the Service Management API. For example "myapi.endpoints.myproject.cloud.goog" + pub name: Option, +} + +impl Part for EndpointsApiService {} + + /// The response message for Operations.ListOperations. /// /// # Activities @@ -1117,9 +1136,9 @@ impl ResponseResult for ListOperationsResponse {} /// #[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, + /// 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, @@ -1131,8 +1150,8 @@ pub struct Instance { 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, + /// 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 name: Option, /// Number of errors since this instance was started.@OutputOnly @@ -1143,8 +1162,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, - /// Availability of the instance.@OutputOnly - pub availability: Option, + /// Relative name of the instance within the version. Example: instance-1.@OutputOnly + pub id: Option, /// Average latency (ms) over the last minute.@OutputOnly #[serde(rename="averageLatency")] pub average_latency: Option, @@ -1153,9 +1172,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, - /// 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, /// 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, @@ -1201,11 +1220,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, } @@ -1307,15 +1326,15 @@ 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 patch apps](struct.AppModulePatchCall.html) (request) /// * [modules get apps](struct.AppModuleGetCall.html) (response) +/// * [modules patch apps](struct.AppModulePatchCall.html) (request) /// #[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, + /// Mapping that defines fractional HTTP traffic diversion to different versions within the module. + pub split: Option, /// Full path to the Module resource in the API. Example: apps/myapp/modules/default.@OutputOnly pub name: Option, } diff --git a/gen/appengine1_beta5-cli/Cargo.toml b/gen/appengine1_beta5-cli/Cargo.toml index 9995037e75..4dcc284df5 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+20170914" +version = "1.0.6+20171208" 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+20170914" +version = "1.0.6+20171208" diff --git a/gen/appengine1_beta5-cli/README.md b/gen/appengine1_beta5-cli/README.md index 5439ac4777..94164c5064 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 *20170914*. The CLI is at version *1.0.6*. +This documentation was generated from the *appengine* API at revision *20171208*. 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 88dd94b96b..5f2d18feae 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+20170914 +site_name: appengine v1.0.6+20171208 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 4f13106da7..130ac4908d 100644 --- a/gen/appengine1_beta5-cli/src/main.rs +++ b/gen/appengine1_beta5-cli/src/main.rs @@ -77,10 +77,10 @@ impl<'n> Engine<'n> { "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.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", 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 })), + "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", 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())))); @@ -457,10 +457,10 @@ impl<'n> Engine<'n> { "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.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", 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 })), + "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", 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())))); @@ -809,9 +809,9 @@ 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 })), @@ -820,7 +820,10 @@ impl<'n> Engine<'n> { "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 })), - "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 })), "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 })), @@ -835,15 +838,15 @@ impl<'n> Engine<'n> { "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-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.network-utilization.target-sent-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSec", 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 })), @@ -859,10 +862,7 @@ impl<'n> Engine<'n> { "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 })), - "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 })), "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 })), @@ -1373,9 +1373,9 @@ 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 })), @@ -1384,7 +1384,10 @@ impl<'n> Engine<'n> { "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 })), - "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 })), "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 })), @@ -1399,15 +1402,15 @@ impl<'n> Engine<'n> { "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-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.network-utilization.target-sent-bytes-per-sec" => Some(("automaticScaling.networkUtilization.targetSentBytesPerSec", 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 })), @@ -1423,10 +1426,7 @@ impl<'n> Engine<'n> { "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 })), - "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 })), "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 })), @@ -2286,7 +2286,7 @@ fn main() { let mut app = App::new("appengine1-beta5") .author("Sebastian Thiel ") - .version("1.0.6+20170914") + .version("1.0.6+20171208") .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 919c6fa7c0..e51c27a76f 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+20170914" +version = "1.0.6+20171208" 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+20170914" +documentation = "https://docs.rs/google-appengine1_beta5/1.0.6+20171208" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] diff --git a/gen/appengine1_beta5/README.md b/gen/appengine1_beta5/README.md index c465d2defd..4baa6320a0 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+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*. +This documentation was generated from *appengine* crate version *1.0.6+20171208*, where *20171208* 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+20170914/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+20171208/google_appengine1_beta5/struct.Appengine.html) ... * apps - * [*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) + * [*create*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppPatchCall.html), [*services delete*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/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+20170914/google_appengine1_beta5/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/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+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)** + * creates [*Method Builders*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/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+20170914/google_appengine1_beta5/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/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+20170914/google_appengine1_beta5/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/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+20170914/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+20171208/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+20170914/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+20171208/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+20170914/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+20171208/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+20170914/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+20171208/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/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+20170914/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+20171208/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/google_appengine1_beta5/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/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+20170914/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+20171208/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+20170914/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+20171208/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+20170914/google_appengine1_beta5/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1_beta5/1.0.6+20171208/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 d5c1bb2031..11ad9c7ded 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+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*. +//! This documentation was generated from *appengine* crate version *1.0.6+20171208*, where *20171208* 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,8 +432,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 patch apps](struct.AppServicePatchCall.html) (request) /// * [services get apps](struct.AppServiceGetCall.html) (response) +/// * [services patch apps](struct.AppServicePatchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Service { @@ -474,20 +474,20 @@ pub struct Instance { 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, + /// Availability of the instance.@OutputOnly + pub availability: 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, + /// Number of errors since this instance was started.@OutputOnly + pub errors: Option, + /// Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly + pub name: 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, + /// Relative name of the instance within the version. Example: instance-1.@OutputOnly + pub id: Option, /// Average latency (ms) over the last minute.@OutputOnly #[serde(rename="averageLatency")] pub average_latency: Option, @@ -523,12 +523,12 @@ 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, - /// 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, /// 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, /// 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, @@ -555,8 +555,8 @@ 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, - /// 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, /// 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, @@ -566,8 +566,8 @@ pub struct Version { /// 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, - /// 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, /// 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. @@ -695,16 +695,16 @@ impl Part for CpuUtilization {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Resources { - /// Memory (GB) needed. - #[serde(rename="memoryGb")] - pub memory_gb: Option, + /// Volumes mounted within the app container. + pub volumes: Option>, /// Disk size (GB) needed. #[serde(rename="diskGb")] pub disk_gb: Option, /// Number of CPU cores needed. pub cpu: Option, - /// Volumes mounted within the app container. - pub volumes: Option>, + /// Memory (GB) needed. + #[serde(rename="memoryGb")] + pub memory_gb: Option, } impl Part for Resources {} @@ -770,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, - /// 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>, + /// 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, } impl Part for StaticFilesHandler {} @@ -793,12 +793,12 @@ pub struct NetworkUtilization { /// 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, + /// Target packets received per second. + #[serde(rename="targetReceivedPacketsPerSec")] + pub target_received_packets_per_sec: Option, } impl Part for NetworkUtilization {} @@ -937,48 +937,48 @@ 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. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct IdentityAwareProxy { - /// OAuth2 client ID to use for the authentication flow. - #[serde(rename="oauth2ClientId")] - pub oauth2_client_id: Option, + /// Hex-encoded SHA-256 hash of the client secret.@OutputOnly + #[serde(rename="oauth2ClientSecretSha256")] + pub oauth2_client_secret_sha256: Option, /// 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. pub enabled: Option, /// 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 #[serde(rename="oauth2ClientSecret")] pub oauth2_client_secret: Option, - /// Hex-encoded SHA-256 hash of the client secret.@OutputOnly - #[serde(rename="oauth2ClientSecretSha256")] - pub oauth2_client_secret_sha256: Option, + /// OAuth2 client ID to use for the authentication flow. + #[serde(rename="oauth2ClientId")] + pub oauth2_client_id: Option, } 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. @@ -991,18 +991,18 @@ pub struct AutomaticScaling { /// 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, @@ -1049,11 +1049,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 {} @@ -1085,7 +1085,7 @@ impl Part for FileInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct EndpointsApiService { - /// Endpoints service configuration id as specified by the Service Management API. For example "2016-09-19r1" + /// Endpoints service configuration id as specified by the Service Management API. For example "2016-09-19r1"By default, the Endpoints service configuration id is fixed and config_id must be specified. To keep the Endpoints service configuration id updated with each rollout, specify RolloutStrategy.MANAGED and omit config_id. #[serde(rename="configId")] pub config_id: Option, /// Endpoints service name which is the name of the "service" resource in the Service Management API. For example "myapi.endpoints.myproject.cloud.goog" @@ -1124,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) -/// * [get apps](struct.AppGetCall.html) (response) /// * [patch apps](struct.AppPatchCall.html) (request) +/// * [get apps](struct.AppGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Application { @@ -1292,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 {} @@ -2088,12 +2088,12 @@ impl<'a, C, A> AppServiceVersionInstanceListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionInstanceListCall<'a, C, A> @@ -2380,12 +2380,12 @@ impl<'a, C, A> AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionCreateCall<'a, C, A> @@ -2674,12 +2674,12 @@ impl<'a, C, A> AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> AppPatchCall<'a, C, A> @@ -2990,12 +2990,12 @@ impl<'a, C, A> AppServiceVersionInstanceDebugCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionInstanceDebugCall<'a, C, A> @@ -3251,12 +3251,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. - /// * *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) -> AppServiceGetCall<'a, C, A> @@ -3536,12 +3536,12 @@ 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. - /// * *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) -> AppServiceVersionInstanceDeleteCall<'a, C, A> @@ -3856,12 +3856,12 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionPatchCall<'a, C, A> @@ -4153,12 +4153,12 @@ impl<'a, C, A> AppServiceVersionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionListCall<'a, C, A> @@ -4414,12 +4414,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. - /// * *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) -> AppOperationGetCall<'a, C, A> @@ -4687,12 +4687,12 @@ impl<'a, C, A> AppServiceListCall<'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. - /// * *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) -> AppServiceListCall<'a, C, A> @@ -4972,12 +4972,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. - /// * *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) -> AppLocationListCall<'a, C, A> @@ -5257,12 +5257,12 @@ impl<'a, C, A> AppServiceVersionInstanceGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionInstanceGetCall<'a, C, A> @@ -5542,12 +5542,12 @@ impl<'a, C, A> AppOperationListCall<'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. - /// * *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) -> AppOperationListCall<'a, C, A> @@ -5815,12 +5815,12 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionDeleteCall<'a, C, A> @@ -6076,12 +6076,12 @@ impl<'a, C, A> AppLocationGetCall<'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. - /// * *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) -> AppLocationGetCall<'a, C, A> @@ -6392,12 +6392,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. - /// * *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) -> AppServicePatchCall<'a, C, A> @@ -6653,12 +6653,12 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> AppGetCall<'a, C, A> @@ -6914,12 +6914,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. - /// * *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) -> AppServiceDeleteCall<'a, C, A> @@ -7163,12 +7163,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. - /// * *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) -> AppCreateCall<'a, C, A> @@ -7448,12 +7448,12 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionGetCall<'a, C, A> diff --git a/gen/appsactivity1-cli/Cargo.toml b/gen/appsactivity1-cli/Cargo.toml index 56c6716391..a3ed35e04f 100644 --- a/gen/appsactivity1-cli/Cargo.toml +++ b/gen/appsactivity1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appsactivity1-cli" -version = "1.0.6+20170921" +version = "1.0.6+20171207" 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-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-appsactivity1] path = "../appsactivity1" -version = "1.0.6+20170921" +version = "1.0.6+20171207" diff --git a/gen/appsactivity1-cli/README.md b/gen/appsactivity1-cli/README.md index 332cc3233d..1cf00a5774 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 *20170921*. The CLI is at version *1.0.6*. +This documentation was generated from the *appsactivity* API at revision *20171207*. 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 da53271cf2..13b8c8a594 100644 --- a/gen/appsactivity1-cli/mkdocs.yml +++ b/gen/appsactivity1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appsactivity v1.0.6+20170921 +site_name: appsactivity v1.0.6+20171207 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 6da9f76ab4..633880591f 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+20170921") + .version("1.0.6+20171207") .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 74ae8824f9..ae418d1b9c 100644 --- a/gen/appsactivity1/Cargo.toml +++ b/gen/appsactivity1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appsactivity1" -version = "1.0.6+20170921" +version = "1.0.6+20171207" 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+20170921" +documentation = "https://docs.rs/google-appsactivity1/1.0.6+20171207" license = "MIT" keywords = ["appsactivity", "google", "protocol", "web", "api"] diff --git a/gen/appsactivity1/README.md b/gen/appsactivity1/README.md index 6c22ce75d3..70ac1b18a4 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+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*. +This documentation was generated from *appsactivity* crate version *1.0.6+20171207*, where *20171207* 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+20170921/google_appsactivity1/struct.Appsactivity.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appsactivity1/1.0.6+20171207/google_appsactivity1/struct.Appsactivity.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) +* [activities](https://docs.rs/google-appsactivity1/1.0.6+20171207/google_appsactivity1/struct.Activity.html) + * [*list*](https://docs.rs/google-appsactivity1/1.0.6+20171207/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+20170921/google_appsactivity1/struct.Appsactivity.html)** +* **[Hub](https://docs.rs/google-appsactivity1/1.0.6+20171207/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+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)** + * creates [*Method Builders*](https://docs.rs/google-appsactivity1/1.0.6+20171207/google_appsactivity1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appsactivity1/1.0.6+20171207/google_appsactivity1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appsactivity1/1.0.6+20171207/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+20170921/google_appsactivity1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appsactivity1/1.0.6+20171207/google_appsactivity1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appsactivity1/1.0.6+20170921/google_appsactivity1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appsactivity1/1.0.6+20171207/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+20170921/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+20171207/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+20170921/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+20171207/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+20170921/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+20171207/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+20170921/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+20171207/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appsactivity1/1.0.6+20171207/google_appsactivity1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appsactivity1/1.0.6+20171207/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+20170921/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+20171207/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appsactivity1/1.0.6+20171207/google_appsactivity1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appsactivity1/1.0.6+20171207/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+20170921/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+20171207/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+20170921/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+20171207/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+20170921/google_appsactivity1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appsactivity1/1.0.6+20171207/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 dc5477c18a..87a3167e25 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+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*. +//! This documentation was generated from *appsactivity* crate version *1.0.6+20171207*, where *20171207* 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 4f7a0c8c6d..4dec9c3ab8 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+20170925" +version = "1.0.6+20171207" 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+20170925" +version = "1.0.6+20171207" diff --git a/gen/appstate1-cli/README.md b/gen/appstate1-cli/README.md index d92e299c6d..2442debee7 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 *20170925*. The CLI is at version *1.0.6*. +This documentation was generated from the *App State* API at revision *20171207*. 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 93055086aa..ede271b0fa 100644 --- a/gen/appstate1-cli/mkdocs.yml +++ b/gen/appstate1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: App State v1.0.6+20170925 +site_name: App State v1.0.6+20171207 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 8cd12b1467..d8cad16f80 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+20170925") + .version("1.0.6+20171207") .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 952dfb31cd..2cf1735033 100644 --- a/gen/appstate1/Cargo.toml +++ b/gen/appstate1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appstate1" -version = "1.0.6+20170925" +version = "1.0.6+20171207" 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+20170925" +documentation = "https://docs.rs/google-appstate1/1.0.6+20171207" license = "MIT" keywords = ["appstate", "google", "protocol", "web", "api"] diff --git a/gen/appstate1/README.md b/gen/appstate1/README.md index 19c53a8aaf..306a14b0d1 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+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*. +This documentation was generated from *App State* crate version *1.0.6+20171207*, where *20171207* 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+20170925/google_appstate1/struct.AppState.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appstate1/1.0.6+20171207/google_appstate1/struct.AppState.html) ... * states - * [*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) + * [*clear*](https://docs.rs/google-appstate1/1.0.6+20171207/google_appstate1/struct.StateClearCall.html), [*delete*](https://docs.rs/google-appstate1/1.0.6+20171207/google_appstate1/struct.StateDeleteCall.html), [*get*](https://docs.rs/google-appstate1/1.0.6+20171207/google_appstate1/struct.StateGetCall.html), [*list*](https://docs.rs/google-appstate1/1.0.6+20171207/google_appstate1/struct.StateListCall.html) and [*update*](https://docs.rs/google-appstate1/1.0.6+20171207/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+20170925/google_appstate1/struct.AppState.html)** +* **[Hub](https://docs.rs/google-appstate1/1.0.6+20171207/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+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)** + * creates [*Method Builders*](https://docs.rs/google-appstate1/1.0.6+20171207/google_appstate1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appstate1/1.0.6+20171207/google_appstate1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appstate1/1.0.6+20171207/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+20170925/google_appstate1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appstate1/1.0.6+20171207/google_appstate1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appstate1/1.0.6+20170925/google_appstate1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appstate1/1.0.6+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appstate1/1.0.6+20171207/google_appstate1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appstate1/1.0.6+20171207/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+20170925/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+20171207/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appstate1/1.0.6+20171207/google_appstate1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appstate1/1.0.6+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/google_appstate1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appstate1/1.0.6+20171207/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 7b65c32787..c49eed9bc5 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+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*. +//! This documentation was generated from *App State* crate version *1.0.6+20171207*, where *20171207* 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 1cb9530946..597e60f1e9 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+20170917" +version = "1.0.6+20171202" 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+20170917" +version = "1.0.6+20171202" diff --git a/gen/bigquery2-cli/README.md b/gen/bigquery2-cli/README.md index 51d1ea25e1..54b334c871 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 *20170917*. The CLI is at version *1.0.6*. +This documentation was generated from the *bigquery* API at revision *20171202*. The CLI is at version *1.0.6*. ```bash bigquery2 [options] diff --git a/gen/bigquery2-cli/mkdocs.yml b/gen/bigquery2-cli/mkdocs.yml index e500a9d3ae..bafe5c9098 100644 --- a/gen/bigquery2-cli/mkdocs.yml +++ b/gen/bigquery2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: bigquery v1.0.6+20170917 +site_name: bigquery v1.0.6+20171202 site_url: http://byron.github.io/google-apis-rs/google-bigquery2-cli site_description: A complete library to interact with bigquery (protocol v2) diff --git a/gen/bigquery2-cli/src/main.rs b/gen/bigquery2-cli/src/main.rs index 7c259e2114..943012236e 100644 --- a/gen/bigquery2-cli/src/main.rs +++ b/gen/bigquery2-cli/src/main.rs @@ -709,11 +709,16 @@ impl<'n> Engine<'n> { "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.estimated-bytes-processed" => Some(("statistics.query.estimatedBytesProcessed", 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 })), "statistics.query.cache-hit" => Some(("statistics.query.cacheHit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "statistics.query.ddl-operation-performed" => Some(("statistics.query.ddlOperationPerformed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.billing-tier" => Some(("statistics.query.billingTier", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "statistics.query.ddl-target-table.project-id" => Some(("statistics.query.ddlTargetTable.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.query.ddl-target-table.table-id" => Some(("statistics.query.ddlTargetTable.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.query.ddl-target-table.dataset-id" => Some(("statistics.query.ddlTargetTable.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.num-dml-affected-rows" => Some(("statistics.query.numDmlAffectedRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.end-time" => Some(("statistics.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.extract.destination-uri-file-counts" => Some(("statistics.extract.destinationUriFileCounts", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), @@ -791,7 +796,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", "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"]); + 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", "ddl-operation-performed", "ddl-target-table", "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", "estimated-bytes-processed", "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 } @@ -2684,7 +2689,7 @@ fn main() { let mut app = App::new("bigquery2") .author("Sebastian Thiel ") - .version("1.0.6+20170917") + .version("1.0.6+20171202") .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 b238072f33..339fa7530e 100644 --- a/gen/bigquery2/Cargo.toml +++ b/gen/bigquery2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-bigquery2" -version = "1.0.6+20170917" +version = "1.0.6+20171202" 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+20170917" +documentation = "https://docs.rs/google-bigquery2/1.0.6+20171202" license = "MIT" keywords = ["bigquery", "google", "protocol", "web", "api"] diff --git a/gen/bigquery2/README.md b/gen/bigquery2/README.md index 19cfbdb2c2..64410f4f52 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+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*. +This documentation was generated from *bigquery* crate version *1.0.6+20171202*, where *20171202* 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+20170917/google_bigquery2/struct.Bigquery.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.Bigquery.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) +* [datasets](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.Dataset.html) + * [*delete*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.DatasetGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.DatasetInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.DatasetPatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.DatasetUpdateCall.html) +* [jobs](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.Job.html) + * [*cancel*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.JobCancelCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.JobGetCall.html), [*get query results*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.JobGetQueryResultCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.JobInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.JobListCall.html) and [*query*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.JobQueryCall.html) * projects - * [*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) + * [*get service account*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.ProjectGetServiceAccountCall.html) and [*list*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.ProjectListCall.html) * tabledata - * [*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) + * [*insert all*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.TabledataInsertAllCall.html) and [*list*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.TabledataListCall.html) +* [tables](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.Table.html) + * [*delete*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.TableGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.TableListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.TablePatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/struct.TableUpdateCall.html) Upload supported by ... -* [*insert jobs*](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/struct.JobInsertCall.html) +* [*insert jobs*](https://docs.rs/google-bigquery2/1.0.6+20171202/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+20170917/google_bigquery2/struct.Bigquery.html)** +* **[Hub](https://docs.rs/google-bigquery2/1.0.6+20171202/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+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)** + * creates [*Method Builders*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-bigquery2/1.0.6+20171202/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+20170917/google_bigquery2/trait.Part.html)** + * **[Parts](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-bigquery2/1.0.6+20170917/google_bigquery2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-bigquery2/1.0.6+20171202/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+20170917/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+20171202/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+20170917/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+20171202/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+20170917/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+20171202/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+20170917/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+20171202/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-bigquery2/1.0.6+20171202/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+20170917/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+20171202/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-bigquery2/1.0.6+20171202/google_bigquery2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-bigquery2/1.0.6+20171202/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+20170917/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+20171202/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+20170917/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+20171202/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+20170917/google_bigquery2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-bigquery2/1.0.6+20171202/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 0a3bcccb2e..24b239da4e 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+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*. +//! This documentation was generated from *bigquery* crate version *1.0.6+20171202*, where *20171202* 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/). @@ -505,7 +505,10 @@ pub struct JobStatistics2 { /// [Output-only] Describes execution plan for the query. #[serde(rename="queryPlan")] pub query_plan: Option>, - /// [Output-only, Experimental] The type of query statement, if valid. + /// [Output-only] The original estimate of bytes processed for the job. + #[serde(rename="estimatedBytesProcessed")] + pub estimated_bytes_processed: Option, + /// [Output-only, Experimental] The type of query statement, if valid. Possible values (new values might be added in the future): "SELECT": SELECT query. "INSERT": INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language "UPDATE": UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language "DELETE": DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language "CREATE_TABLE": CREATE [OR REPLACE] TABLE without AS SELECT. "CREATE_TABLE_AS_SELECT": CREATE [OR REPLACE] TABLE ... AS SELECT ... "DROP_TABLE": DROP TABLE query. "CREATE_VIEW": CREATE [OR REPLACE] VIEW ... AS SELECT ... "DROP_VIEW": DROP VIEW query. #[serde(rename="statementType")] pub statement_type: Option, /// [Output-only] Total bytes billed for the job. @@ -517,18 +520,24 @@ pub struct JobStatistics2 { /// [Output-only] Whether the query result was fetched from the query cache. #[serde(rename="cacheHit")] pub cache_hit: Option, - /// [Output-only, Experimental] Standard SQL only: list of undeclared query parameters detected during a dry run validation. - #[serde(rename="undeclaredQueryParameters")] - pub undeclared_query_parameters: Option>, - /// [Output-only, Experimental] Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list. - #[serde(rename="referencedTables")] - pub referenced_tables: Option>, - /// [Output-only] Billing tier for the job. - #[serde(rename="billingTier")] - pub billing_tier: Option, + /// [Output-only, Experimental] The DDL operation performed, possibly dependent on the pre-existence of the DDL target. Possible values (new values might be added in the future): "CREATE": The query created the DDL target. "SKIP": No-op. Example cases: the query is CREATE TABLE IF NOT EXISTS while the table already exists, or the query is DROP TABLE IF EXISTS while the table does not exist. "REPLACE": The query replaced the DDL target. Example case: the query is CREATE OR REPLACE TABLE, and the table already exists. "DROP": The query deleted the DDL target. + #[serde(rename="ddlOperationPerformed")] + pub ddl_operation_performed: Option, /// [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. #[serde(rename="numDmlAffectedRows")] pub num_dml_affected_rows: Option, + /// [Output-only, Experimental] Standard SQL only: list of undeclared query parameters detected during a dry run validation. + #[serde(rename="undeclaredQueryParameters")] + pub undeclared_query_parameters: Option>, + /// [Output-only] Billing tier for the job. + #[serde(rename="billingTier")] + pub billing_tier: Option, + /// [Output-only, Experimental] The DDL target table. Present only for CREATE/DROP TABLE/VIEW queries. + #[serde(rename="ddlTargetTable")] + pub ddl_target_table: Option, + /// [Output-only, Experimental] Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list. + #[serde(rename="referencedTables")] + pub referenced_tables: Option>, /// [Output-only, Experimental] The schema of the results. Present only for successful dry run of non-legacy SQL queries. pub schema: Option, } @@ -814,11 +823,14 @@ pub struct ExplainQueryStage { pub wait_ratio_avg: Option, /// Unique ID for stage within plan. pub id: Option, - /// Human-readable name for stage. - pub name: Option, + /// Number of parallel input segments completed. + #[serde(rename="completedParallelInputs")] + pub completed_parallel_inputs: 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, @@ -834,6 +846,9 @@ pub struct ExplainQueryStage { /// Relative amount of time the average shard spent reading input. #[serde(rename="readRatioAvg")] pub read_ratio_avg: Option, + /// Number of parallel input segments to be processed. + #[serde(rename="parallelInputs")] + pub parallel_inputs: Option, /// Relative amount of time the slowest shard spent reading input. #[serde(rename="readRatioMax")] pub read_ratio_max: Option, @@ -930,14 +945,20 @@ pub struct TableListTables { pub kind: Option, /// [Experimental] The labels associated with this table. You can use these to organize and group your tables. pub labels: Option>, + /// The time when this table was created, in milliseconds since the epoch. + #[serde(rename="creationTime")] + pub creation_time: 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 time-based partitioning for this table. + /// The time-based partitioning for this table. #[serde(rename="timePartitioning")] pub time_partitioning: Option, + /// [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed. + #[serde(rename="expirationTime")] + pub expiration_time: Option, /// The type of table. Possible values are: TABLE, VIEW. #[serde(rename="type")] pub type_: Option, @@ -1108,7 +1129,7 @@ pub struct JobConfigurationLoad { /// [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, - /// [Experimental] If specified, configures time-based partitioning for the destination table. + /// 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. @@ -1129,7 +1150,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 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. + /// Allows the schema of the destination 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 @@ -1671,7 +1692,7 @@ pub struct JobConfigurationQuery { /// 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. + /// 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. #[serde(rename="schemaUpdateOptions")] pub schema_update_options: Option>, /// [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE. @@ -1682,7 +1703,7 @@ pub struct JobConfigurationQuery { /// [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. + /// 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. @@ -1925,7 +1946,7 @@ pub struct Table { /// [Output-only] The size of this table in bytes, excluding any data in the streaming buffer. #[serde(rename="numBytes")] pub num_bytes: Option, - /// [Experimental] If specified, configures time-based partitioning for this table. + /// If specified, configures time-based partitioning for this table. #[serde(rename="timePartitioning")] pub time_partitioning: Option, /// [Output-only] The time when this table was last modified, in milliseconds since the epoch. diff --git a/gen/bigquerydatatransfer1-cli/Cargo.toml b/gen/bigquerydatatransfer1-cli/Cargo.toml index ef61d68a4c..c511b8c4ff 100644 --- a/gen/bigquerydatatransfer1-cli/Cargo.toml +++ b/gen/bigquerydatatransfer1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-bigquerydatatransfer1-cli" -version = "1.0.6+20170921" +version = "1.0.6+20171208" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-bigquerydatatransfer1] path = "../bigquerydatatransfer1" -version = "1.0.6+20170921" +version = "1.0.6+20171208" diff --git a/gen/bigquerydatatransfer1-cli/README.md b/gen/bigquerydatatransfer1-cli/README.md index 54ddfe7365..9ee2d410df 100644 --- a/gen/bigquerydatatransfer1-cli/README.md +++ b/gen/bigquerydatatransfer1-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 Data Transfer* API at revision *20170921*. The CLI is at version *1.0.6*. +This documentation was generated from the *BigQuery Data Transfer* API at revision *20171208*. The CLI is at version *1.0.6*. ```bash bigquerydatatransfer1 [options] diff --git a/gen/bigquerydatatransfer1-cli/mkdocs.yml b/gen/bigquerydatatransfer1-cli/mkdocs.yml index c80d0b255c..0e456762f6 100644 --- a/gen/bigquerydatatransfer1-cli/mkdocs.yml +++ b/gen/bigquerydatatransfer1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: BigQuery Data Transfer v1.0.6+20170921 +site_name: BigQuery Data Transfer v1.0.6+20171208 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) diff --git a/gen/bigquerydatatransfer1-cli/src/main.rs b/gen/bigquerydatatransfer1-cli/src/main.rs index cf18b6ac0a..a2c632708c 100644 --- a/gen/bigquerydatatransfer1-cli/src/main.rs +++ b/gen/bigquerydatatransfer1-cli/src/main.rs @@ -2322,10 +2322,8 @@ fn main() { 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."##), + If specified location and location of the destination bigquery dataset + do not match - the request will fail."##), Some(true), Some(false)), @@ -2545,7 +2543,7 @@ fn main() { Some(false)), ]), ("locations-transfer-configs-schedule-runs", - Some(r##"Creates transfer runs for a time range [range_start_time, range_end_time]. + Some(r##"Creates transfer runs for a time range [start_time, 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."##), @@ -2584,10 +2582,8 @@ fn main() { 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."##), + If specified location and location of the destination bigquery dataset + do not match - the request will fail."##), Some(true), Some(false)), @@ -2807,7 +2803,7 @@ fn main() { Some(false)), ]), ("transfer-configs-schedule-runs", - Some(r##"Creates transfer runs for a time range [range_start_time, range_end_time]. + Some(r##"Creates transfer runs for a time range [start_time, 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."##), @@ -2844,7 +2840,7 @@ fn main() { let mut app = App::new("bigquerydatatransfer1") .author("Sebastian Thiel ") - .version("1.0.6+20170921") + .version("1.0.6+20171208") .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") diff --git a/gen/bigquerydatatransfer1/Cargo.toml b/gen/bigquerydatatransfer1/Cargo.toml index be65a646e4..cc5df65542 100644 --- a/gen/bigquerydatatransfer1/Cargo.toml +++ b/gen/bigquerydatatransfer1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-bigquerydatatransfer1" -version = "1.0.6+20170921" +version = "1.0.6+20171208" 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" +documentation = "https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208" license = "MIT" keywords = ["bigquerydatatransfer", "google", "protocol", "web", "api"] diff --git a/gen/bigquerydatatransfer1/README.md b/gen/bigquerydatatransfer1/README.md index e3446744fc..9723aefb02 100644 --- a/gen/bigquerydatatransfer1/README.md +++ b/gen/bigquerydatatransfer1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *BigQuery Data Transfer* crate version *1.0.6+20171208*, where *20171208* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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) + * [*data sources check valid creds*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectDataSourceCheckValidCredCall.html), [*data sources get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectDataSourceGetCall.html), [*data sources list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectDataSourceListCall.html), [*locations data sources check valid creds*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceCheckValidCredCall.html), [*locations data sources get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceGetCall.html), [*locations data sources list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceListCall.html), [*locations get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationListCall.html), [*locations transfer configs create*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigCreateCall.html), [*locations transfer configs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigDeleteCall.html), [*locations transfer configs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigGetCall.html), [*locations transfer configs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigListCall.html), [*locations transfer configs patch*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigPatchCall.html), [*locations transfer configs runs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunDeleteCall.html), [*locations transfer configs runs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunGetCall.html), [*locations transfer configs runs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunListCall.html), [*locations transfer configs runs transfer logs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunTransferLogListCall.html), [*locations transfer configs schedule runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigScheduleRunCall.html), [*transfer configs create*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectTransferConfigCreateCall.html), [*transfer configs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectTransferConfigDeleteCall.html), [*transfer configs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectTransferConfigGetCall.html), [*transfer configs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectTransferConfigListCall.html), [*transfer configs patch*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectTransferConfigPatchCall.html), [*transfer configs runs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunDeleteCall.html), [*transfer configs runs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunGetCall.html), [*transfer configs runs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunListCall.html), [*transfer configs runs transfer logs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunTransferLogListCall.html) and [*transfer configs schedule runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/struct.ProjectTransferConfigScheduleRunCall.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-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/struct.BigQueryDataTransfer.html)** +* **[Hub](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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)** + * creates [*Method Builders*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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)** + * **[Parts](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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)** +* **[Activities](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/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-bigquerydatatransfer1/1.0.6+20170921/google_bigquerydatatransfer1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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). +[Hub Delegate](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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. +If such a method also supports a [Response Result](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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. +The [delegate trait](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/google_bigquerydatatransfer1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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 +Most optionals are are considered [Parts](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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. +Using [method builders](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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 +* [request values](https://docs.rs/google-bigquerydatatransfer1/1.0.6+20171208/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. diff --git a/gen/bigquerydatatransfer1/src/lib.rs b/gen/bigquerydatatransfer1/src/lib.rs index 4e49f17acd..d514a8594d 100644 --- a/gen/bigquerydatatransfer1/src/lib.rs +++ b/gen/bigquerydatatransfer1/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 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*. +//! This documentation was generated from *BigQuery Data Transfer* crate version *1.0.6+20171208*, where *20171208* 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/). @@ -386,8 +386,8 @@ impl<'a, C, A> BigQueryDataTransfer /// This type is used in activities, which are methods you may call on this type or where 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) +/// * [transfer configs schedule runs projects](struct.ProjectTransferConfigScheduleRunCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ScheduleTransferRunsResponse { @@ -410,11 +410,10 @@ impl ResponseResult for ScheduleTransferRunsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListDataSourcesResponse { - /// The next-pagination token. For multiple-page list results, + /// Output only. 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. @@ -530,10 +529,10 @@ impl RequestValue for CheckValidCredsRequest {} /// This type is used in activities, which are methods you may call on this type or where 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 runs delete projects](struct.ProjectLocationTransferConfigRunDeleteCall.html) (response) /// * [locations transfer configs delete projects](struct.ProjectLocationTransferConfigDeleteCall.html) (response) +/// * [transfer configs runs delete projects](struct.ProjectTransferConfigRunDeleteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } @@ -553,15 +552,13 @@ impl ResponseResult for Empty {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListTransferLogsResponse { - /// The next-pagination token. For multiple-page list results, + /// Output only. 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. + /// Output only. The stored pipeline transfer messages. #[serde(rename="transferMessages")] pub transfer_messages: Option>, } @@ -569,6 +566,77 @@ pub struct ListTransferLogsResponse { impl ResponseResult for ListTransferLogsResponse {} +/// 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 {} + + /// 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. @@ -598,8 +666,7 @@ pub struct TransferConfig { /// 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. + /// Output only. Data transfer modification time. Ignored by server on input. #[serde(rename="updateTime")] pub update_time: Option, /// The BigQuery target dataset id. @@ -628,32 +695,29 @@ pub struct TransferConfig { /// 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. + /// Output only. Region in which BigQuery dataset is located. #[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. + /// Output only. 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. + /// May be negative. Note, that this identifier is not stable. + /// It may change over time even for the same user. #[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. + /// Output only. State of the most recently updated transfer run. 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, + /// Output only. Next time when data transfer will run. + #[serde(rename="nextRunTime")] + pub next_run_time: Option, + /// Data transfer specific parameters. + pub params: Option>, } impl RequestValue for TransferConfig {} @@ -682,9 +746,6 @@ pub struct DataSourceParameter { 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 @@ -693,9 +754,9 @@ pub struct DataSourceParameter { /// 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>, + /// For integer and double values specifies minimum allowed value. + #[serde(rename="minValue")] + pub min_value: Option, /// Can parameter have multiple values. pub repeated: Option, /// Regular expression which can be used for parameter validation. @@ -712,6 +773,9 @@ pub struct DataSourceParameter { pub type_: Option, /// Cannot be changed after initial creation. pub immutable: Option, + /// All possible values for the parameter. + #[serde(rename="allowedValues")] + pub allowed_values: Option>, } impl Part for DataSourceParameter {} @@ -724,20 +788,18 @@ impl Part for DataSourceParameter {} /// This type is used in activities, which are methods you may call on this type or where 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) +/// * [locations transfer configs list projects](struct.ProjectLocationTransferConfigListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListTransferConfigsResponse { - /// The next-pagination token. For multiple-page list results, + /// Output only. 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. + /// Output only. The stored pipeline transfer configurations. #[serde(rename="transferConfigs")] pub transfer_configs: Option>, } @@ -771,8 +833,11 @@ pub struct DataSource { /// 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, + /// 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, /// Indicates the type of authorization. #[serde(rename="authorizationType")] pub authorization_type: Option, @@ -794,11 +859,8 @@ pub struct DataSource { /// 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 description string. + pub description: Option, /// User friendly data source name. #[serde(rename="displayName")] pub display_name: Option, @@ -833,19 +895,19 @@ impl ResponseResult for DataSource {} /// Represents a data transfer run. +/// Next id: 25 /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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) +/// * [locations transfer configs runs get projects](struct.ProjectLocationTransferConfigRunGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TransferRun { - /// Last time the data transfer run state was updated. - /// Output only. + /// Output only. Last time the data transfer run state was updated. #[serde(rename="updateTime")] pub update_time: Option, /// The BigQuery target dataset id. @@ -856,48 +918,42 @@ pub struct TransferRun { /// `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. + /// Output only. Describes the schedule of this transfer run if it was + /// created as part of a regular schedule. For batch transfer runs that are + /// scheduled manually, 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. + /// Output only. 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. + /// May be negative. Note, that this identifier is not stable. + /// It may change over time even for the same user. #[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, + /// Status of the transfer run. + #[serde(rename="errorStatus")] + pub error_status: Option, /// Data transfer specific parameters. pub params: Option>, + /// Output only. Time when transfer run was started. + /// Parameter ignored by server for input requests. + #[serde(rename="startTime")] + pub start_time: Option, + /// Output only. Data source id. + #[serde(rename="dataSourceId")] + pub data_source_id: 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. + /// Output only. Time when transfer run ended. + /// Parameter ignored by server for input requests. #[serde(rename="endTime")] pub end_time: Option, } @@ -912,20 +968,18 @@ impl ResponseResult for TransferRun {} /// This type is used in activities, which are methods you may call on this type or where 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) +/// * [transfer configs runs list projects](struct.ProjectTransferConfigRunListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListTransferRunsResponse { - /// The next-pagination token. For multiple-page list results, + /// Output only. 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. + /// Output only. The stored pipeline transfer runs. #[serde(rename="transferRuns")] pub transfer_runs: Option>, } @@ -940,8 +994,8 @@ impl ResponseResult for ListTransferRunsResponse {} /// This type is used in activities, which are methods you may call on this type or where 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) +/// * [transfer configs schedule runs projects](struct.ProjectTransferConfigScheduleRunCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ScheduleTransferRunsRequest { @@ -1062,23 +1116,15 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new data transfer configuration. + /// Get information about a location. /// /// # 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 { + /// * `name` - Resource name for the location. + pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, C, A> { + ProjectLocationGetCall { hub: self.hub, - _request: request, - _parent: parent.to_string(), - _authorization_code: Default::default(), + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1094,10 +1140,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// * `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. + /// If specified location and location of the destination bigquery dataset + /// do not match - the request will fail. pub fn locations_transfer_configs_create(&self, request: TransferConfig, parent: &str) -> ProjectLocationTransferConfigCreateCall<'a, C, A> { ProjectLocationTransferConfigCreateCall { hub: self.hub, @@ -1208,7 +1252,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates transfer runs for a time range [range_start_time, range_end_time]. + /// Creates transfer runs for a time range [start_time, 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. @@ -1297,15 +1341,21 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get information about a location. + /// Creates a new data transfer configuration. /// /// # Arguments /// - /// * `name` - Resource name for the location. - pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, C, A> { - ProjectLocationGetCall { + /// * `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} + /// If specified location and location of the destination bigquery dataset + /// do not match - the request will fail. + pub fn transfer_configs_create(&self, request: TransferConfig, parent: &str) -> ProjectTransferConfigCreateCall<'a, C, A> { + ProjectTransferConfigCreateCall { hub: self.hub, - _name: name.to_string(), + _request: request, + _parent: parent.to_string(), + _authorization_code: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1490,7 +1540,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates transfer runs for a time range [range_start_time, range_end_time]. + /// Creates transfer runs for a time range [start_time, 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. @@ -1834,17 +1884,17 @@ impl<'a, C, A> ProjectDataSourceGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectDataSourceGetCall<'a, C, A> @@ -2089,17 +2139,17 @@ impl<'a, C, A> ProjectLocationTransferConfigDeleteCall<'a, C, A> where C: Borrow /// /// # 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) -> ProjectLocationTransferConfigDeleteCall<'a, C, A> @@ -2134,9 +2184,9 @@ impl<'a, C, A> ProjectLocationTransferConfigDeleteCall<'a, C, A> where C: Borrow } -/// Creates a new data transfer configuration. +/// Get information about a location. /// -/// A builder for the *transferConfigs.create* method supported by a *project* resource. +/// A builder for the *locations.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -2148,7 +2198,6 @@ impl<'a, C, A> ProjectLocationTransferConfigDeleteCall<'a, C, A> where C: Borrow /// # 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}; @@ -2159,38 +2208,30 @@ impl<'a, C, A> ProjectLocationTransferConfigDeleteCall<'a, C, A> where C: Borrow /// # 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") +/// let result = hub.projects().locations_get("name") /// .doit(); /// # } /// ``` -pub struct ProjectTransferConfigCreateCall<'a, C, A> +pub struct ProjectLocationGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a BigQueryDataTransfer, - _request: TransferConfig, - _parent: String, - _authorization_code: Option, + _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectTransferConfigCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationGetCall<'a, C, A> {} -impl<'a, C, A> ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +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, TransferConfig)> { + 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}; @@ -2199,14 +2240,11 @@ impl<'a, C, A> ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut 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() { + 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)); @@ -2218,12 +2256,12 @@ impl<'a, C, A> ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut = 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); } @@ -2253,17 +2291,6 @@ impl<'a, C, A> ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut 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()); + 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 @@ -2391,7 +2378,7 @@ impl<'a, C, A> ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut ProjectTransferConfigCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2405,20 +2392,20 @@ impl<'a, C, A> ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTransferConfigCreateCall<'a, C, A> + 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 @@ -2438,7 +2425,7 @@ impl<'a, C, A> ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectTransferConfigCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -2484,7 +2471,7 @@ impl<'a, C, A> ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut ProjectLocationTransferConfigCreateCall<'a, C, A> where C: Borrow } /// 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. + /// If specified location and location of the destination bigquery dataset + /// do not match - the request will fail. /// /// Sets the *parent* path property to the given value. /// @@ -2721,17 +2706,17 @@ impl<'a, C, A> ProjectLocationTransferConfigCreateCall<'a, C, A> where C: Borrow /// /// # 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) -> ProjectLocationTransferConfigCreateCall<'a, C, A> @@ -2975,17 +2960,17 @@ impl<'a, C, A> ProjectTransferConfigRunGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTransferConfigRunGetCall<'a, C, A> @@ -3048,10 +3033,10 @@ impl<'a, C, A> ProjectTransferConfigRunGetCall<'a, C, A> where C: BorrowMut ProjectLocationTransferConfigRunListCall<'a, C, A> where C: Borro /// /// # 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) -> ProjectLocationTransferConfigRunListCall<'a, C, A> @@ -3540,17 +3525,17 @@ impl<'a, C, A> ProjectLocationDataSourceGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationDataSourceGetCall<'a, C, A> @@ -3794,17 +3779,17 @@ impl<'a, C, A> ProjectLocationTransferConfigRunGetCall<'a, C, A> where C: Borrow /// /// # 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) -> ProjectLocationTransferConfigRunGetCall<'a, C, A> @@ -4048,17 +4033,17 @@ impl<'a, C, A> ProjectLocationTransferConfigRunDeleteCall<'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. - /// * *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) -> ProjectLocationTransferConfigRunDeleteCall<'a, C, A> @@ -4093,7 +4078,7 @@ impl<'a, C, A> ProjectLocationTransferConfigRunDeleteCall<'a, C, A> where C: Bor } -/// Creates transfer runs for a time range [range_start_time, range_end_time]. +/// Creates transfer runs for a time range [start_time, 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. @@ -4336,17 +4321,17 @@ impl<'a, C, A> ProjectLocationTransferConfigScheduleRunCall<'a, C, A> where C: B /// /// # 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) -> ProjectLocationTransferConfigScheduleRunCall<'a, C, A> @@ -4590,17 +4575,17 @@ impl<'a, C, A> ProjectTransferConfigRunDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTransferConfigRunDeleteCall<'a, C, A> @@ -4664,8 +4649,8 @@ impl<'a, C, A> ProjectTransferConfigRunDeleteCall<'a, C, A> where C: BorrowMut ProjectDataSourceListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectDataSourceListCall<'a, C, A> @@ -4953,8 +4938,8 @@ impl<'a, C, A> ProjectDataSourceListCall<'a, C, A> where C: BorrowMut ProjectLocationTransferConfigPatchCall<'a, C, A> where C: BorrowM } /// 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. + /// 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= @@ -5202,17 +5187,17 @@ impl<'a, C, A> ProjectLocationTransferConfigPatchCall<'a, C, A> where C: BorrowM /// /// # 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) -> ProjectLocationTransferConfigPatchCall<'a, C, A> @@ -5247,9 +5232,9 @@ impl<'a, C, A> ProjectLocationTransferConfigPatchCall<'a, C, A> where C: BorrowM } -/// Get information about a location. +/// Creates a new data transfer configuration. /// -/// A builder for the *locations.get* method supported by a *project* resource. +/// A builder for the *transferConfigs.create* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -5261,6 +5246,7 @@ impl<'a, C, A> ProjectLocationTransferConfigPatchCall<'a, C, A> where C: BorrowM /// # 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}; @@ -5271,30 +5257,38 @@ impl<'a, C, A> ProjectLocationTransferConfigPatchCall<'a, C, A> where C: BorrowM /// # 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_get("name") +/// let result = hub.projects().transfer_configs_create(req, "parent") +/// .authorization_code("Lorem") /// .doit(); /// # } /// ``` -pub struct ProjectLocationGetCall<'a, C, A> +pub struct ProjectTransferConfigCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a BigQueryDataTransfer, - _name: String, + _request: TransferConfig, + _parent: String, + _authorization_code: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectTransferConfigCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +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, Location)> { + 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}; @@ -5303,11 +5297,14 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut 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() { + 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)); @@ -5319,12 +5316,12 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -5354,6 +5351,17 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> { - self._name = new_value.to_string(); + 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} + /// If specified location and location of the destination bigquery dataset + /// do not match - the request will fail. + /// + /// 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 @@ -5441,7 +5487,7 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectTransferConfigCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5455,20 +5501,20 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationGetCall<'a, C, A> + 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 @@ -5488,7 +5534,7 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectLocationGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectTransferConfigCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -5745,17 +5791,17 @@ impl<'a, C, A> ProjectLocationDataSourceCheckValidCredCall<'a, C, A> where C: Bo /// /// # 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) -> ProjectLocationDataSourceCheckValidCredCall<'a, C, A> @@ -5999,17 +6045,17 @@ impl<'a, C, A> ProjectTransferConfigGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTransferConfigGetCall<'a, C, A> @@ -6282,17 +6328,17 @@ impl<'a, C, A> ProjectLocationDataSourceListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationDataSourceListCall<'a, C, A> @@ -6536,17 +6582,17 @@ impl<'a, C, A> ProjectLocationTransferConfigGetCall<'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) -> ProjectLocationTransferConfigGetCall<'a, C, A> @@ -6834,17 +6880,17 @@ impl<'a, C, A> ProjectTransferConfigRunTransferLogListCall<'a, C, A> where C: Bo /// /// # 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) -> ProjectTransferConfigRunTransferLogListCall<'a, C, A> @@ -7131,17 +7177,17 @@ impl<'a, C, A> ProjectTransferConfigListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTransferConfigListCall<'a, C, A> @@ -7420,7 +7466,7 @@ impl<'a, C, A> ProjectTransferConfigPatchCall<'a, C, A> where C: BorrowMut&scope=&redirect_uri= @@ -7460,17 +7506,17 @@ impl<'a, C, A> ProjectTransferConfigPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTransferConfigPatchCall<'a, C, A> @@ -7750,17 +7796,17 @@ impl<'a, C, A> ProjectDataSourceCheckValidCredCall<'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) -> ProjectDataSourceCheckValidCredCall<'a, C, A> @@ -7795,7 +7841,7 @@ impl<'a, C, A> ProjectDataSourceCheckValidCredCall<'a, C, A> where C: BorrowMut< } -/// Creates transfer runs for a time range [range_start_time, range_end_time]. +/// Creates transfer runs for a time range [start_time, 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. @@ -8038,17 +8084,17 @@ impl<'a, C, A> ProjectTransferConfigScheduleRunCall<'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) -> ProjectTransferConfigScheduleRunCall<'a, C, A> @@ -8327,17 +8373,17 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationListCall<'a, C, A> @@ -8637,17 +8683,17 @@ impl<'a, C, A> ProjectTransferConfigRunListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTransferConfigRunListCall<'a, C, A> @@ -8934,17 +8980,17 @@ impl<'a, C, A> ProjectLocationTransferConfigListCall<'a, C, A> where C: BorrowMu /// /// # 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) -> ProjectLocationTransferConfigListCall<'a, C, A> @@ -9232,17 +9278,17 @@ impl<'a, C, A> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> whe /// /// # 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) -> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> @@ -9487,17 +9533,17 @@ impl<'a, C, A> ProjectTransferConfigDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTransferConfigDeleteCall<'a, C, A> diff --git a/gen/calendar3-cli/Cargo.toml b/gen/calendar3-cli/Cargo.toml index 0d197edd85..7fcb4261ef 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+20170919" +version = "1.0.6+20171205" 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+20170919" +version = "1.0.6+20171205" diff --git a/gen/calendar3-cli/README.md b/gen/calendar3-cli/README.md index b3e2c0d3fa..5c7b4a64f1 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 *20170919*. The CLI is at version *1.0.6*. +This documentation was generated from the *calendar* API at revision *20171205*. 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 bb803811e0..65130791a7 100644 --- a/gen/calendar3-cli/mkdocs.yml +++ b/gen/calendar3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: calendar v1.0.6+20170919 +site_name: calendar v1.0.6+20171205 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 f2691eb035..f332e50d9a 100644 --- a/gen/calendar3-cli/src/main.rs +++ b/gen/calendar3-cli/src/main.rs @@ -186,6 +186,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 { + "send-notifications" => { + call = call.send_notifications(arg_from_str(value.unwrap_or("false"), err, "send-notifications", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -199,6 +202,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(["send-notifications"].iter().map(|v|*v)); v } )); } } @@ -341,6 +345,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 { + "send-notifications" => { + call = call.send_notifications(arg_from_str(value.unwrap_or("false"), err, "send-notifications", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -354,6 +361,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(["send-notifications"].iter().map(|v|*v)); v } )); } } @@ -431,6 +439,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 { + "send-notifications" => { + call = call.send_notifications(arg_from_str(value.unwrap_or("false"), err, "send-notifications", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -444,6 +455,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(["send-notifications"].iter().map(|v|*v)); v } )); } } @@ -4386,7 +4398,7 @@ fn main() { let mut app = App::new("calendar3") .author("Sebastian Thiel ") - .version("1.0.6+20170919") + .version("1.0.6+20171205") .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 e06c8096a1..ba03d3c46d 100644 --- a/gen/calendar3/Cargo.toml +++ b/gen/calendar3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-calendar3" -version = "1.0.6+20170919" +version = "1.0.6+20171205" 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+20170919" +documentation = "https://docs.rs/google-calendar3/1.0.6+20171205" license = "MIT" keywords = ["calendar", "google", "protocol", "web", "api"] diff --git a/gen/calendar3/README.md b/gen/calendar3/README.md index dad4f6b1de..a3c4337d0e 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+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*. +This documentation was generated from *calendar* crate version *1.0.6+20171205*, where *20171205* 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+20170919/google_calendar3/struct.CalendarHub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarHub.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) +* [acl](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.Acl.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.AclDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.AclGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.AclInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.AclListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.AclPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.AclUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.AclWatchCall.html) +* [calendar list](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarList.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarListDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarListGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarListInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarListListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarListPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarListUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarListWatchCall.html) +* [calendars](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.Calendar.html) + * [*clear*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarClearCall.html), [*delete*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarInsertCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarPatchCall.html) and [*update*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarUpdateCall.html) +* [channels](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.Channel.html) + * [*stop*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.ChannelStopCall.html) * colors - * [*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) + * [*get*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.ColorGetCall.html) +* [events](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.Event.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventGetCall.html), [*import*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventImportCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventInsertCall.html), [*instances*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventInstanceCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventListCall.html), [*move*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventMoveCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventPatchCall.html), [*quick add*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventQuickAddCall.html), [*update*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventWatchCall.html) * freebusy - * [*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) + * [*query*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.FreebusyQueryCall.html) +* [settings](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.Setting.html) + * [*get*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.SettingGetCall.html), [*list*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.SettingListCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.SettingWatchCall.html) Subscription supported by ... -* [*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) +* [*list settings*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.SettingListCall.html) +* [*list events*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventListCall.html) +* [*list calendar list*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.CalendarListListCall.html) +* [*watch events*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventWatchCall.html) +* [*instances events*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.EventInstanceCall.html) +* [*watch settings*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.SettingWatchCall.html) +* [*watch acl*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.AclWatchCall.html) +* [*list acl*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/struct.AclListCall.html) +* [*watch calendar list*](https://docs.rs/google-calendar3/1.0.6+20171205/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+20170919/google_calendar3/struct.CalendarHub.html)** +* **[Hub](https://docs.rs/google-calendar3/1.0.6+20171205/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+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)** + * creates [*Method Builders*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-calendar3/1.0.6+20171205/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+20170919/google_calendar3/trait.Part.html)** + * **[Parts](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-calendar3/1.0.6+20170919/google_calendar3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-calendar3/1.0.6+20171205/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+20170919/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+20171205/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+20170919/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+20171205/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+20170919/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+20171205/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+20170919/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+20171205/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-calendar3/1.0.6+20171205/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+20170919/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+20171205/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-calendar3/1.0.6+20171205/google_calendar3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-calendar3/1.0.6+20171205/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+20170919/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+20171205/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+20170919/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+20171205/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+20170919/google_calendar3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-calendar3/1.0.6+20171205/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 5c63951ec4..50619904ea 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+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*. +//! This documentation was generated from *calendar* crate version *1.0.6+20171205*, where *20171205* 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). @@ -1955,6 +1955,7 @@ impl<'a, C, A> AclMethods<'a, C, A> { hub: self.hub, _request: request, _calendar_id: calendar_id.to_string(), + _send_notifications: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1976,6 +1977,7 @@ impl<'a, C, A> AclMethods<'a, C, A> { _request: request, _calendar_id: calendar_id.to_string(), _rule_id: rule_id.to_string(), + _send_notifications: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1997,6 +1999,7 @@ impl<'a, C, A> AclMethods<'a, C, A> { _request: request, _calendar_id: calendar_id.to_string(), _rule_id: rule_id.to_string(), + _send_notifications: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -7271,6 +7274,7 @@ impl<'a, C, A> AclWatchCall<'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.acl().insert(req, "calendarId") +/// .send_notifications(true) /// .doit(); /// # } /// ``` @@ -7280,6 +7284,7 @@ pub struct AclInsertCall<'a, C, A> hub: &'a CalendarHub, _request: AclRule, _calendar_id: String, + _send_notifications: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -7301,9 +7306,12 @@ impl<'a, C, A> AclInsertCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "calendar.acl.insert", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("calendarId", self._calendar_id.to_string())); - for &field in ["alt", "calendarId"].iter() { + if let Some(value) = self._send_notifications { + params.push(("sendNotifications", value.to_string())); + } + for &field in ["alt", "calendarId", "sendNotifications"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7452,6 +7460,13 @@ impl<'a, C, A> AclInsertCall<'a, C, A> where C: BorrowMut, A: oau self._calendar_id = new_value.to_string(); self } + /// Whether to send notifications about the calendar sharing change. Optional. The default is True. + /// + /// Sets the *send notifications* query property to the given value. + pub fn send_notifications(mut self, new_value: bool) -> AclInsertCall<'a, C, A> { + self._send_notifications = 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. /// @@ -7545,6 +7560,7 @@ impl<'a, C, A> AclInsertCall<'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.acl().update(req, "calendarId", "ruleId") +/// .send_notifications(false) /// .doit(); /// # } /// ``` @@ -7555,6 +7571,7 @@ pub struct AclUpdateCall<'a, C, A> _request: AclRule, _calendar_id: String, _rule_id: String, + _send_notifications: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -7576,10 +7593,13 @@ impl<'a, C, A> AclUpdateCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "calendar.acl.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(("calendarId", self._calendar_id.to_string())); params.push(("ruleId", self._rule_id.to_string())); - for &field in ["alt", "calendarId", "ruleId"].iter() { + if let Some(value) = self._send_notifications { + params.push(("sendNotifications", value.to_string())); + } + for &field in ["alt", "calendarId", "ruleId", "sendNotifications"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7738,6 +7758,13 @@ impl<'a, C, A> AclUpdateCall<'a, C, A> where C: BorrowMut, A: oau self._rule_id = new_value.to_string(); self } + /// Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. + /// + /// Sets the *send notifications* query property to the given value. + pub fn send_notifications(mut self, new_value: bool) -> AclUpdateCall<'a, C, A> { + self._send_notifications = 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. /// @@ -7831,6 +7858,7 @@ impl<'a, C, A> AclUpdateCall<'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.acl().patch(req, "calendarId", "ruleId") +/// .send_notifications(false) /// .doit(); /// # } /// ``` @@ -7841,6 +7869,7 @@ pub struct AclPatchCall<'a, C, A> _request: AclRule, _calendar_id: String, _rule_id: String, + _send_notifications: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -7862,10 +7891,13 @@ impl<'a, C, A> AclPatchCall<'a, C, A> where C: BorrowMut, A: oaut }; dlg.begin(MethodInfo { id: "calendar.acl.patch", http_method: hyper::method::Method::Patch }); - 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(("calendarId", self._calendar_id.to_string())); params.push(("ruleId", self._rule_id.to_string())); - for &field in ["alt", "calendarId", "ruleId"].iter() { + if let Some(value) = self._send_notifications { + params.push(("sendNotifications", value.to_string())); + } + for &field in ["alt", "calendarId", "ruleId", "sendNotifications"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8024,6 +8056,13 @@ impl<'a, C, A> AclPatchCall<'a, C, A> where C: BorrowMut, A: oaut self._rule_id = new_value.to_string(); self } + /// Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. + /// + /// Sets the *send notifications* query property to the given value. + pub fn send_notifications(mut self, new_value: bool) -> AclPatchCall<'a, C, A> { + self._send_notifications = 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. /// @@ -8111,10 +8150,10 @@ impl<'a, C, A> AclPatchCall<'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.acl().list("calendarId") -/// .sync_token("ea") -/// .show_deleted(false) -/// .page_token("rebum.") -/// .max_results(-33) +/// .sync_token("dolore") +/// .show_deleted(true) +/// .page_token("sed") +/// .max_results(-82) /// .doit(); /// # } /// ``` @@ -9607,8 +9646,8 @@ impl<'a, C, A> EventDeleteCall<'a, C, A> where C: BorrowMut, A: o /// // Values shown here are possibly random and not representative ! /// let result = hub.events().insert(req, "calendarId") /// .supports_attachments(true) -/// .send_notifications(false) -/// .max_attendees(-82) +/// .send_notifications(true) +/// .max_attendees(-59) /// .doit(); /// # } /// ``` @@ -9916,7 +9955,7 @@ impl<'a, C, A> EventInsertCall<'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.events().import(req, "calendarId") -/// .supports_attachments(true) +/// .supports_attachments(false) /// .doit(); /// # } /// ``` @@ -10196,15 +10235,15 @@ impl<'a, C, A> EventImportCall<'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.events().instances("calendarId", "eventId") -/// .time_zone("ipsum") -/// .time_min("aliquyam") -/// .time_max("dolores") +/// .time_zone("sit") +/// .time_min("diam") +/// .time_max("ut") /// .show_deleted(false) -/// .page_token("diam") -/// .original_start("ut") -/// .max_results(-70) -/// .max_attendees(-6) -/// .always_include_email(true) +/// .page_token("est") +/// .original_start("amet") +/// .max_results(-23) +/// .max_attendees(-13) +/// .always_include_email(false) /// .doit(); /// # } /// ``` @@ -10559,8 +10598,8 @@ impl<'a, C, A> EventInstanceCall<'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.events().get("calendarId", "eventId") -/// .time_zone("diam") -/// .max_attendees(-71) +/// .time_zone("clita") +/// .max_attendees(-37) /// .always_include_email(false) /// .doit(); /// # } @@ -10850,23 +10889,23 @@ impl<'a, C, A> EventGetCall<'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.events().list("calendarId") -/// .updated_min("invidunt") -/// .time_zone("ut") -/// .time_min("dolores") -/// .time_max("eos") -/// .sync_token("voluptua.") -/// .single_events(true) -/// .show_hidden_invitations(false) -/// .show_deleted(true) -/// .add_shared_extended_property("ea") -/// .q("ea") -/// .add_private_extended_property("et") -/// .page_token("dolor") -/// .order_by("diam") -/// .max_results(-62) -/// .max_attendees(-87) -/// .i_cal_uid("rebum.") -/// .always_include_email(true) +/// .updated_min("eos") +/// .time_zone("voluptua.") +/// .time_min("duo") +/// .time_max("sed") +/// .sync_token("aliquyam") +/// .single_events(false) +/// .show_hidden_invitations(true) +/// .show_deleted(false) +/// .add_shared_extended_property("dolor") +/// .q("diam") +/// .add_private_extended_property("kasd") +/// .page_token("invidunt") +/// .order_by("rebum.") +/// .max_results(-51) +/// .max_attendees(-63) +/// .i_cal_uid("invidunt") +/// .always_include_email(false) /// .doit(); /// # } /// ``` @@ -11322,9 +11361,9 @@ impl<'a, C, A> EventListCall<'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.events().patch(req, "calendarId", "eventId") -/// .supports_attachments(false) +/// .supports_attachments(true) /// .send_notifications(false) -/// .max_attendees(-96) +/// .max_attendees(-47) /// .always_include_email(true) /// .doit(); /// # } @@ -11937,8 +11976,8 @@ impl<'a, C, A> EventMoveCall<'a, C, A> where C: BorrowMut, A: oau /// let result = hub.events().update(req, "calendarId", "eventId") /// .supports_attachments(true) /// .send_notifications(true) -/// .max_attendees(-42) -/// .always_include_email(true) +/// .max_attendees(-51) +/// .always_include_email(false) /// .doit(); /// # } /// ``` @@ -12269,23 +12308,23 @@ impl<'a, C, A> EventUpdateCall<'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.events().watch(req, "calendarId") -/// .updated_min("amet.") -/// .time_zone("ipsum") +/// .updated_min("dolor") +/// .time_zone("sea") /// .time_min("ut") -/// .time_max("dolor") -/// .sync_token("sea") +/// .time_max("eirmod") +/// .sync_token("sanctus") /// .single_events(true) -/// .show_hidden_invitations(true) +/// .show_hidden_invitations(false) /// .show_deleted(true) -/// .add_shared_extended_property("voluptua.") -/// .q("dolor") -/// .add_private_extended_property("et") -/// .page_token("et") -/// .order_by("vero") -/// .max_results(-36) -/// .max_attendees(-30) -/// .i_cal_uid("et") -/// .always_include_email(false) +/// .add_shared_extended_property("et") +/// .q("vero") +/// .add_private_extended_property("ut") +/// .page_token("sed") +/// .order_by("et") +/// .max_results(-55) +/// .max_attendees(-20) +/// .i_cal_uid("dolore") +/// .always_include_email(true) /// .doit(); /// # } /// ``` diff --git a/gen/classroom1-cli/Cargo.toml b/gen/classroom1-cli/Cargo.toml index b8134eaf5f..39f068c03a 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+20170926" +version = "1.0.6+20171211" 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+20170926" +version = "1.0.6+20171211" diff --git a/gen/classroom1-cli/README.md b/gen/classroom1-cli/README.md index beb6cf8e26..0d37bac8ec 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 *20170926*. The CLI is at version *1.0.6*. +This documentation was generated from the *classroom* API at revision *20171211*. The CLI is at version *1.0.6*. ```bash classroom1 [options] diff --git a/gen/classroom1-cli/mkdocs.yml b/gen/classroom1-cli/mkdocs.yml index a046cfc8d7..222f4d097b 100644 --- a/gen/classroom1-cli/mkdocs.yml +++ b/gen/classroom1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: classroom v1.0.6+20170926 +site_name: classroom v1.0.6+20171211 site_url: http://byron.github.io/google-apis-rs/google-classroom1-cli site_description: A complete library to interact with classroom (protocol v1) diff --git a/gen/classroom1-cli/src/main.rs b/gen/classroom1-cli/src/main.rs index 1bb73b5f73..1af10d6906 100644 --- a/gen/classroom1-cli/src/main.rs +++ b/gen/classroom1-cli/src/main.rs @@ -266,14 +266,14 @@ impl<'n> Engine<'n> { 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 })), + "alternate-link" => Some(("alternateLink", 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 })), + "creator-user-id" => Some(("creatorUserId", 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 })), _ => { @@ -529,9 +529,9 @@ impl<'n> Engine<'n> { 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 })), - "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())))); @@ -617,14 +617,14 @@ impl<'n> Engine<'n> { 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 })), + "alternate-link" => Some(("alternateLink", 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 })), + "creator-user-id" => Some(("creatorUserId", 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 })), _ => { @@ -729,14 +729,14 @@ impl<'n> Engine<'n> { "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 })), + "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 })), + "due-date.year" => Some(("dueDate.year", JsonTypeInfo { jtype: JsonType::Int, 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 })), "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 })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, 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 })), @@ -995,9 +995,9 @@ impl<'n> Engine<'n> { 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 })), + "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())))); @@ -1096,14 +1096,14 @@ impl<'n> Engine<'n> { "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 })), + "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 })), + "due-date.year" => Some(("dueDate.year", JsonTypeInfo { jtype: JsonType::Int, 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 })), "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 })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, 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 })), @@ -2138,7 +2138,6 @@ 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.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 })), @@ -2146,6 +2145,7 @@ impl<'n> Engine<'n> { "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 })), + "course-id" => Some(("courseId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "student-work-folder.alternate-link" => Some(("studentWorkFolder.alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "student-work-folder.id" => Some(("studentWorkFolder.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "student-work-folder.title" => Some(("studentWorkFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2813,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 })), - "role" => Some(("role", 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 })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["course-id", "id", "role", "user-id"]); @@ -3262,11 +3262,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "invited-email-address" => Some(("invitedEmailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "invitation-id" => Some(("invitationId", 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 })), - "invitation-id" => Some(("invitationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "invited-email-address" => Some(("invitedEmailAddress", 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())))); @@ -3468,11 +3468,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "invited-email-address" => Some(("invitedEmailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "invitation-id" => Some(("invitationId", 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 })), - "invitation-id" => Some(("invitationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "invited-email-address" => Some(("invitedEmailAddress", 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())))); @@ -5679,20 +5679,20 @@ fn main() { 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. + * 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. + * 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."##), + * 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"##), @@ -6115,7 +6115,7 @@ fn main() { let mut app = App::new("classroom1") .author("Sebastian Thiel ") - .version("1.0.6+20170926") + .version("1.0.6+20171211") .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 eb33cb2d6c..3c8ea18720 100644 --- a/gen/classroom1/Cargo.toml +++ b/gen/classroom1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-classroom1" -version = "1.0.6+20170926" +version = "1.0.6+20171211" 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+20170926" +documentation = "https://docs.rs/google-classroom1/1.0.6+20171211" license = "MIT" keywords = ["classroom", "google", "protocol", "web", "api"] diff --git a/gen/classroom1/README.md b/gen/classroom1/README.md index 44a6c4f91d..ac8efea0b3 100644 --- a/gen/classroom1/README.md +++ b/gen/classroom1/README.md @@ -5,22 +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+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*. +This documentation was generated from *classroom* crate version *1.0.6+20171211*, where *20171211* 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+20170926/google_classroom1/struct.Classroom.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.Classroom.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) +* [courses](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.Course.html) + * [*aliases create*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseAliaseCreateCall.html), [*aliases delete*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseAliaseDeleteCall.html), [*aliases list*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseAliaseListCall.html), [*announcements create*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseAnnouncementCreateCall.html), [*announcements delete*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseAnnouncementDeleteCall.html), [*announcements get*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseAnnouncementGetCall.html), [*announcements list*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseAnnouncementListCall.html), [*announcements modify assignees*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseAnnouncementModifyAssigneeCall.html), [*announcements patch*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseAnnouncementPatchCall.html), [*course work create*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkCreateCall.html), [*course work delete*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkDeleteCall.html), [*course work get*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkGetCall.html), [*course work list*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkListCall.html), [*course work modify assignees*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkModifyAssigneeCall.html), [*course work patch*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkPatchCall.html), [*course work student submissions get*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkStudentSubmissionGetCall.html), [*course work student submissions list*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkStudentSubmissionListCall.html), [*course work student submissions modify attachments*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html), [*course work student submissions patch*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkStudentSubmissionPatchCall.html), [*course work student submissions reclaim*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkStudentSubmissionReclaimCall.html), [*course work student submissions return*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkStudentSubmissionReturnCall.html), [*course work student submissions turn in*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCourseWorkStudentSubmissionTurnInCall.html), [*create*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseGetCall.html), [*list*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseListCall.html), [*patch*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CoursePatchCall.html), [*students create*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseStudentCreateCall.html), [*students delete*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseStudentDeleteCall.html), [*students get*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseStudentGetCall.html), [*students list*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseStudentListCall.html), [*teachers create*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseTeacherCreateCall.html), [*teachers delete*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseTeacherDeleteCall.html), [*teachers get*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseTeacherGetCall.html), [*teachers list*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseTeacherListCall.html) and [*update*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.CourseUpdateCall.html) +* [invitations](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.Invitation.html) + * [*accept*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.InvitationAcceptCall.html), [*create*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.InvitationCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.InvitationDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.InvitationGetCall.html) and [*list*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.InvitationListCall.html) +* [registrations](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.Registration.html) + * [*create*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.RegistrationCreateCall.html) and [*delete*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.RegistrationDeleteCall.html) +* [user profiles](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.UserProfile.html) + * [*get*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.UserProfileGetCall.html), [*guardian invitations create*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.UserProfileGuardianInvitationCreateCall.html), [*guardian invitations get*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.UserProfileGuardianInvitationGetCall.html), [*guardian invitations list*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.UserProfileGuardianInvitationListCall.html), [*guardian invitations patch*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.UserProfileGuardianInvitationPatchCall.html), [*guardians delete*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.UserProfileGuardianDeleteCall.html), [*guardians get*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.UserProfileGuardianGetCall.html) and [*guardians list*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/struct.UserProfileGuardianListCall.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-classroom1/1.0.6+20170926/google_classroom1/struct.Classroom.html)** +* **[Hub](https://docs.rs/google-classroom1/1.0.6+20171211/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+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)** + * creates [*Method Builders*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-classroom1/1.0.6+20171211/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+20170926/google_classroom1/trait.Part.html)** + * **[Parts](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-classroom1/1.0.6+20170926/google_classroom1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/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-classroom1/1.0.6+20170926/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+20171211/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+20170926/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+20171211/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+20170926/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+20171211/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+20170926/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+20171211/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-classroom1/1.0.6+20171211/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+20170926/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+20171211/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-classroom1/1.0.6+20171211/google_classroom1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-classroom1/1.0.6+20171211/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+20170926/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+20171211/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+20170926/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+20171211/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+20170926/google_classroom1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-classroom1/1.0.6+20171211/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 e0bcc4e8d5..8d0619b380 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+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*. +//! This documentation was generated from *classroom* crate version *1.0.6+20171211*, where *20171211* 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/). @@ -275,6 +275,9 @@ pub enum Scope { /// View the profile photos of people in your classes ProfilePhoto, + /// View your course work and grades in Google Classroom + CourseworkMeReadonly, + /// View guardians for students in your Google Classroom classes GuardianlinkStudentReadonly, @@ -287,8 +290,8 @@ pub enum Scope { /// View your Google Classroom guardians GuardianlinkMeReadonly, - /// Manage your Google Classroom classes - Course, + /// Manage your course work and view your grades in Google Classroom + CourseworkMe, /// View your course work and grades in Google Classroom StudentSubmissionMeReadonly, @@ -296,12 +299,12 @@ pub enum Scope { /// View your Google Classroom class rosters RosterReadonly, + /// Manage your Google Classroom classes + Course, + /// View course work and grades for students in the Google Classroom classes you teach or administer CourseworkStudentReadonly, - /// View your course work and grades in Google Classroom - CourseworkMeReadonly, - /// View announcements in Google Classroom AnnouncementReadonly, @@ -311,8 +314,8 @@ pub enum Scope { /// View your Google Classroom classes CourseReadonly, - /// Manage your course work and view your grades in Google Classroom - CourseworkMe, + /// Receive notifications about your Google Classroom data + PushNotification, } impl AsRef for Scope { @@ -322,26 +325,27 @@ impl AsRef for Scope { 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::CourseworkMeReadonly => "https://www.googleapis.com/auth/classroom.coursework.me.readonly", 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::CourseworkMe => "https://www.googleapis.com/auth/classroom.coursework.me", Scope::StudentSubmissionMeReadonly => "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly", Scope::RosterReadonly => "https://www.googleapis.com/auth/classroom.rosters.readonly", + Scope::Course => "https://www.googleapis.com/auth/classroom.courses", Scope::CourseworkStudentReadonly => "https://www.googleapis.com/auth/classroom.coursework.students.readonly", - 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::CourseReadonly => "https://www.googleapis.com/auth/classroom.courses.readonly", - Scope::CourseworkMe => "https://www.googleapis.com/auth/classroom.coursework.me", + Scope::PushNotification => "https://www.googleapis.com/auth/classroom.push-notifications", } } } impl Default for Scope { fn default() -> Scope { - Scope::GuardianlinkStudentReadonly + Scope::CourseworkMeReadonly } } @@ -493,11 +497,12 @@ pub struct Announcement { /// Read-only. #[serde(rename="updateTime")] pub update_time: Option, - /// Identifier for the user that created the announcement. + /// Absolute link to this announcement in the Classroom web UI. + /// This is only populated if `state` is `PUBLISHED`. /// /// Read-only. - #[serde(rename="creatorUserId")] - pub creator_user_id: Option, + #[serde(rename="alternateLink")] + pub alternate_link: Option, /// Identifier of the course. /// /// Read-only. @@ -519,6 +524,11 @@ pub struct Announcement { /// If unspecified, the default value is `ALL_STUDENTS`. #[serde(rename="assigneeMode")] pub assignee_mode: Option, + /// Identifier for the user that created the announcement. + /// + /// Read-only. + #[serde(rename="creatorUserId")] + pub creator_user_id: Option, /// Status of this announcement. /// If unspecified, the default state is `DRAFT`. pub state: Option, @@ -526,12 +536,6 @@ pub struct Announcement { /// /// 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 @@ -643,14 +647,14 @@ impl Part for ShortAnswerSubmission {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Attachment { - /// Link attachment. - pub link: Option, - /// Google Drive file attachment. - #[serde(rename="driveFile")] - pub drive_file: Option, /// Youtube video attachment. #[serde(rename="youTubeVideo")] pub you_tube_video: Option, + /// Google Drive file attachment. + #[serde(rename="driveFile")] + pub drive_file: Option, + /// Link attachment. + pub link: Option, /// Google Forms attachment. pub form: Option

, } @@ -658,24 +662,27 @@ pub struct Attachment { impl Part for Attachment {} -/// 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 {} /// Request to return a student submission. @@ -798,27 +805,24 @@ pub struct CourseMaterialSet { impl Part for CourseMaterialSet {} -/// 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 {} /// Google Forms item. @@ -851,175 +855,28 @@ pub struct Form { impl Part for Form {} -/// A Course in Classroom. +/// 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*). /// -/// * [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) +/// * [course work modify assignees courses](struct.CourseCourseWorkModifyAssigneeCall.html) (request) /// #[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. - /// - /// 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, +pub struct ModifyCourseWorkAssigneesRequest { + /// 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, + /// Mode of the coursework describing whether it will be assigned to all + /// students or specified individual students. + #[serde(rename="assigneeMode")] + pub assignee_mode: Option, } -impl RequestValue for Course {} -impl Resource for Course {} -impl ResponseResult for Course {} +impl RequestValue for ModifyCourseWorkAssigneesRequest {} /// Additional details for assignments. @@ -1154,11 +1011,10 @@ impl ResponseResult for ListGuardiansResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DriveFile { - /// 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, /// URL of a thumbnail image of the Drive item. /// /// Read-only. @@ -1166,10 +1022,11 @@ pub struct DriveFile { pub thumbnail_url: Option, /// Drive API resource ID. pub id: Option, - /// 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, } impl Part for DriveFile {} @@ -1210,15 +1067,15 @@ impl Part for Link {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Student { + /// Global user information for the student. + /// + /// Read-only. + pub profile: Option, /// Identifier of the course. /// /// Read-only. #[serde(rename="courseId")] pub course_id: Option, - /// Global user information for the student. - /// - /// Read-only. - pub profile: Option, /// Information about a Drive Folder for this student's work in this course. /// Only visible to the student and domain administrators. /// @@ -1241,26 +1098,29 @@ impl RequestValue for Student {} impl ResponseResult for Student {} -/// Response when listing course work. +/// 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`. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -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>, +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, } -impl ResponseResult for ListAnnouncementsResponse {} +impl Part for Date {} /// Drive file that is used as material for course work. @@ -1280,17 +1140,27 @@ pub struct SharedDriveFile { impl Part for SharedDriveFile {} -/// Additional details for multiple-choice questions. +/// Response when listing student submissions. /// -/// 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*). +/// +/// * [course work student submissions list courses](struct.CourseCourseWorkStudentSubmissionListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MultipleChoiceQuestion { - /// Possible choices. - pub choices: Option>, +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 Part for MultipleChoiceQuestion {} +impl ResponseResult for ListStudentSubmissionsResponse {} /// Response when listing courses. @@ -1315,27 +1185,41 @@ pub struct ListCoursesResponse { impl ResponseResult for ListCoursesResponse {} -/// Response when listing guardian invitations. +/// 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*). /// -/// * [guardian invitations list user profiles](struct.UserProfileGuardianInvitationListCall.html) (response) +/// * [teachers create courses](struct.CourseTeacherCreateCall.html) (request|response) +/// * [teachers get courses](struct.CourseTeacherGetCall.html) (response) /// #[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 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, } -impl ResponseResult for ListGuardianInvitationsResponse {} +impl RequestValue for Teacher {} +impl ResponseResult for Teacher {} /// A material attached to a course as part of a material set. @@ -1511,29 +1395,26 @@ 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`. +/// 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 { - /// 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, +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 {} /// An invitation to join a course. @@ -1554,6 +1435,9 @@ 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 @@ -1564,9 +1448,6 @@ 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. @@ -1589,12 +1470,12 @@ 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 {} @@ -1627,40 +1508,30 @@ impl Part for IndividualStudentsOptions {} /// #[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, + /// 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, } impl RequestValue for ModifyAnnouncementAssigneesRequest {} -/// 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 {} /// A class of notifications that an application can register to receive. @@ -1773,10 +1644,16 @@ pub struct CourseWork { /// This must be a non-negative integer value. #[serde(rename="maxPoints")] pub max_points: Option, - /// Optional date, in UTC, that submissions for this this course work are due. - /// This must be specified if `due_time` is specified. - #[serde(rename="dueDate")] - pub due_date: Option, + /// Absolute link to this course work in the Classroom web UI. + /// This is only populated if `state` is `PUBLISHED`. + /// + /// Read-only. + #[serde(rename="alternateLink")] + pub alternate_link: Option, + /// Classroom-assigned identifier of this course work, unique per course. + /// + /// Read-only. + pub id: Option, /// Type of this course work. /// /// The type is set when the course work is created and cannot be changed. @@ -1786,26 +1663,24 @@ pub struct CourseWork { /// If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. #[serde(rename="submissionModificationMode")] pub submission_modification_mode: Option, - /// Absolute link to this course work in the Classroom web UI. - /// This is only populated if `state` is `PUBLISHED`. - /// - /// Read-only. - #[serde(rename="alternateLink")] - pub alternate_link: Option, /// Identifier for the user that created the coursework. /// /// Read-only. #[serde(rename="creatorUserId")] pub creator_user_id: Option, + /// Title of this course work. + /// The title must be a valid UTF-8 string containing between 1 and 3000 + /// characters. + pub title: Option, /// Timestamp when this course work was created. /// /// Read-only. #[serde(rename="creationTime")] pub creation_time: Option, - /// Classroom-assigned identifier of this course work, unique per course. - /// - /// Read-only. - pub id: Option, + /// Optional date, in UTC, that submissions for this this course work are due. + /// This must be specified if `due_time` is specified. + #[serde(rename="dueDate")] + pub due_date: Option, /// Status of this course work. /// If unspecified, the default state is `DRAFT`. pub state: Option, @@ -1813,10 +1688,6 @@ 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 @@ -1970,65 +1841,198 @@ pub struct CourseRosterChangesInfo { impl Part for CourseRosterChangesInfo {} -/// 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. +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 ResponseResult for ListGuardianInvitationsResponse {} + + +/// 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*). +/// +/// * [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 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="courseId")] - pub course_id: Option, - /// Global user information for the teacher. + #[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. - pub profile: Option, - /// Identifier of the user. + #[serde(rename="enrollmentCode")] + pub enrollment_code: Option, + /// Whether or not guardian notifications are enabled for this course. /// - /// When specified as a parameter of a request, this identifier can be one of - /// the following: + /// 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 - #[serde(rename="userId")] - pub user_id: Option, + /// + /// 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 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 {} +impl RequestValue for Course {} +impl Resource for Course {} +impl ResponseResult for Course {} /// Alternative identifier for a course. @@ -2165,15 +2169,16 @@ 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 get user profiles](struct.UserProfileGuardianInvitationGetCall.html) (response) /// * [guardian invitations patch user profiles](struct.UserProfileGuardianInvitationPatchCall.html) (request|response) +/// * [guardian invitations get user profiles](struct.UserProfileGuardianInvitationGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GuardianInvitation { - /// 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, /// ID of the student (in standard format) #[serde(rename="studentId")] pub student_id: Option, @@ -2182,13 +2187,12 @@ pub struct GuardianInvitation { /// Read-only. #[serde(rename="creationTime")] pub creation_time: 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, + /// Email address that the invitation was sent to. + /// This field is only visible to domain administrators. + #[serde(rename="invitedEmailAddress")] + pub invited_email_address: Option, } impl RequestValue for GuardianInvitation {} @@ -3569,45 +3573,6 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { } } - /// 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(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns a user profile. @@ -3793,6 +3758,45 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { _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(), + } + } } @@ -3855,20 +3859,20 @@ impl<'a, C, A> RegistrationMethods<'a, C, A> { /// 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. + /// * 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. + /// * 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. + /// * 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 /// @@ -4344,12 +4348,12 @@ impl<'a, C, A> CourseAnnouncementModifyAssigneeCall<'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) -> CourseAnnouncementModifyAssigneeCall<'a, C, A> @@ -4686,12 +4690,12 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> where C: Bor /// * *prettyPrint* (query-boolean) - Returns response 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) -> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> @@ -5012,12 +5016,12 @@ impl<'a, C, A> CourseAnnouncementListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseAnnouncementListCall<'a, C, A> @@ -5338,12 +5342,12 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B /// * *prettyPrint* (query-boolean) - Returns response 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) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> @@ -5595,12 +5599,12 @@ impl<'a, C, A> CourseGetCall<'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) -> CourseGetCall<'a, C, A> @@ -5885,12 +5889,12 @@ impl<'a, C, A> CourseUpdateCall<'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) -> CourseUpdateCall<'a, C, A> @@ -6160,12 +6164,12 @@ impl<'a, C, A> CourseStudentGetCall<'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) -> CourseStudentGetCall<'a, C, A> @@ -6435,12 +6439,12 @@ impl<'a, C, A> CourseTeacherGetCall<'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) -> CourseTeacherGetCall<'a, C, A> @@ -6762,12 +6766,12 @@ impl<'a, C, A> CourseCourseWorkListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkListCall<'a, C, A> @@ -7032,12 +7036,12 @@ impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkGetCall<'a, C, A> @@ -7391,12 +7395,12 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr /// * *prettyPrint* (query-boolean) - Returns response 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) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> @@ -7716,12 +7720,12 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionTurnInCall<'a, C, A> where C: Bo /// * *prettyPrint* (query-boolean) - Returns response 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) -> CourseCourseWorkStudentSubmissionTurnInCall<'a, C, A> @@ -8039,12 +8043,12 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> w /// * *prettyPrint* (query-boolean) - Returns response 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) -> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> @@ -8309,12 +8313,12 @@ impl<'a, C, A> CourseAnnouncementGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseAnnouncementGetCall<'a, C, A> @@ -8598,12 +8602,12 @@ impl<'a, C, A> CourseTeacherListCall<'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) -> CourseTeacherListCall<'a, C, A> @@ -8925,12 +8929,12 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReturnCall<'a, C, A> where C: Bo /// * *prettyPrint* (query-boolean) - Returns response 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) -> CourseCourseWorkStudentSubmissionReturnCall<'a, C, A> @@ -9215,12 +9219,12 @@ impl<'a, C, A> CourseAliaseListCall<'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) -> CourseAliaseListCall<'a, C, A> @@ -9514,12 +9518,12 @@ impl<'a, C, A> CourseCourseWorkCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkCreateCall<'a, C, A> @@ -9821,12 +9825,12 @@ impl<'a, C, A> CourseListCall<'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) -> CourseListCall<'a, C, A> @@ -10113,12 +10117,12 @@ impl<'a, C, A> CourseAnnouncementCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseAnnouncementCreateCall<'a, C, A> @@ -10440,12 +10444,12 @@ impl<'a, C, A> CourseAnnouncementPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseAnnouncementPatchCall<'a, C, A> @@ -10732,12 +10736,12 @@ impl<'a, C, A> CourseAliaseCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseAliaseCreateCall<'a, C, A> @@ -11042,12 +11046,12 @@ impl<'a, C, A> CourseStudentCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseStudentCreateCall<'a, C, A> @@ -11346,12 +11350,12 @@ impl<'a, C, A> CourseCourseWorkModifyAssigneeCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkModifyAssigneeCall<'a, C, A> @@ -11619,12 +11623,12 @@ impl<'a, C, A> CourseAliaseDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseAliaseDeleteCall<'a, C, A> @@ -11896,12 +11900,12 @@ impl<'a, C, A> CourseCourseWorkDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkDeleteCall<'a, C, A> @@ -12157,12 +12161,12 @@ impl<'a, C, A> CourseCreateCall<'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) -> CourseCreateCall<'a, C, A> @@ -12446,12 +12450,12 @@ impl<'a, C, A> CourseStudentListCall<'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) -> CourseStudentListCall<'a, C, A> @@ -12703,12 +12707,12 @@ impl<'a, C, A> CourseDeleteCall<'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) -> CourseDeleteCall<'a, C, A> @@ -13045,12 +13049,12 @@ impl<'a, C, A> CourseCourseWorkPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkPatchCall<'a, C, A> @@ -13367,12 +13371,12 @@ impl<'a, C, A> CoursePatchCall<'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) -> CoursePatchCall<'a, C, A> @@ -13642,12 +13646,12 @@ impl<'a, C, A> CourseStudentDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseStudentDeleteCall<'a, C, A> @@ -13919,12 +13923,12 @@ impl<'a, C, A> CourseTeacherDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseTeacherDeleteCall<'a, C, A> @@ -14215,12 +14219,12 @@ impl<'a, C, A> CourseTeacherCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseTeacherCreateCall<'a, C, A> @@ -14497,12 +14501,12 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionGetCall<'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) -> CourseCourseWorkStudentSubmissionGetCall<'a, C, A> @@ -14774,12 +14778,12 @@ impl<'a, C, A> CourseAnnouncementDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseAnnouncementDeleteCall<'a, C, A> @@ -15053,12 +15057,12 @@ impl<'a, C, A> UserProfileGuardianGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserProfileGuardianGetCall<'a, C, A> @@ -15362,12 +15366,12 @@ impl<'a, C, A> UserProfileGuardianInvitationCreateCall<'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) -> UserProfileGuardianInvitationCreateCall<'a, C, A> @@ -15402,288 +15406,6 @@ impl<'a, C, A> UserProfileGuardianInvitationCreateCall<'a, C, A> where C: Borrow } -/// 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 - } -} - - /// Returns a user profile. /// /// This method returns the following error codes: @@ -15904,12 +15626,12 @@ impl<'a, C, A> UserProfileGetCall<'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) -> UserProfileGetCall<'a, C, A> @@ -15995,7 +15717,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("sit") +/// .update_mask("aliquyam") /// .doit(); /// # } /// ``` @@ -16233,12 +15955,12 @@ impl<'a, C, A> UserProfileGuardianInvitationPatchCall<'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. - /// * *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) -> UserProfileGuardianInvitationPatchCall<'a, C, A> @@ -16507,12 +16229,12 @@ impl<'a, C, A> UserProfileGuardianInvitationGetCall<'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) -> UserProfileGuardianInvitationGetCall<'a, C, A> @@ -16594,9 +16316,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("est") -/// .page_size(-46) -/// .invited_email_address("accusam") +/// .page_token("ut") +/// .page_size(-70) +/// .invited_email_address("est") /// .doit(); /// # } /// ``` @@ -16829,12 +16551,12 @@ impl<'a, C, A> UserProfileGuardianListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserProfileGuardianListCall<'a, C, A> @@ -16912,10 +16634,10 @@ impl<'a, C, A> UserProfileGuardianListCall<'a, C, A> where C: BorrowMut UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu /// * *prettyPrint* (query-boolean) - Returns response 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) -> UserProfileGuardianInvitationListCall<'a, C, A> @@ -17203,6 +16925,288 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu } +/// 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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *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 + } +} + + /// Creates a `Registration`, causing Classroom to start sending notifications /// from the provided `feed` to the provided `destination`. /// @@ -17220,20 +17224,20 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu /// 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. +/// * 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. +/// * 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. +/// * 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 *create* method supported by a *registration* resource. /// It is not used directly, but through a `RegistrationMethods` instance. @@ -17311,7 +17315,7 @@ impl<'a, C, A> RegistrationCreateCall<'a, C, A> where C: BorrowMut RegistrationCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RegistrationCreateCall<'a, C, A> @@ -17457,7 +17461,7 @@ impl<'a, C, A> RegistrationCreateCall<'a, C, A> where C: BorrowMut RegistrationDeleteCall<'a, C, A> where C: BorrowMut RegistrationDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RegistrationDeleteCall<'a, C, A> @@ -17707,7 +17711,7 @@ impl<'a, C, A> RegistrationDeleteCall<'a, C, A> where C: BorrowMut InvitationDeleteCall<'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) -> InvitationDeleteCall<'a, C, A> @@ -18203,12 +18207,12 @@ impl<'a, C, A> InvitationCreateCall<'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) -> InvitationCreateCall<'a, C, A> @@ -18489,12 +18493,12 @@ impl<'a, C, A> InvitationListCall<'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) -> InvitationListCall<'a, C, A> @@ -18744,12 +18748,12 @@ impl<'a, C, A> InvitationGetCall<'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) -> InvitationGetCall<'a, C, A> @@ -19006,12 +19010,12 @@ impl<'a, C, A> InvitationAcceptCall<'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) -> InvitationAcceptCall<'a, C, A> diff --git a/gen/clouddebugger2-cli/Cargo.toml b/gen/clouddebugger2-cli/Cargo.toml index 4928a9c6fa..b610aaaf8c 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+20170919" +version = "1.0.6+20171016" 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+20170919" +version = "1.0.6+20171016" diff --git a/gen/clouddebugger2-cli/README.md b/gen/clouddebugger2-cli/README.md index 57ccd52f01..c6e79224c4 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 *20170919*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud Debugger* API at revision *20171016*. 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 4324b19321..a383c2f4aa 100644 --- a/gen/clouddebugger2-cli/mkdocs.yml +++ b/gen/clouddebugger2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Debugger v1.0.6+20170919 +site_name: Cloud Debugger v1.0.6+20171016 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 ae391374fd..f0b8bcb0c0 100644 --- a/gen/clouddebugger2-cli/src/main.rs +++ b/gen/clouddebugger2-cli/src/main.rs @@ -128,22 +128,22 @@ 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.final-time" => Some(("breakpoint.finalTime", 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 })), "breakpoint.labels" => Some(("breakpoint.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "breakpoint.final-time" => Some(("breakpoint.finalTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "breakpoint.create-time" => Some(("breakpoint.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "breakpoint.user-email" => Some(("breakpoint.userEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "breakpoint.id" => Some(("breakpoint.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "breakpoint.location.path" => Some(("breakpoint.location.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "breakpoint.location.line" => Some(("breakpoint.location.line", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "breakpoint.action" => Some(("breakpoint.action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "breakpoint.expressions" => Some(("breakpoint.expressions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "breakpoint.is-final-state" => Some(("breakpoint.isFinalState", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "breakpoint.id" => Some(("breakpoint.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "breakpoint.create-time" => Some(("breakpoint.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "breakpoint.condition" => Some(("breakpoint.condition", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "breakpoint", "condition", "create-time", "description", "expressions", "final-time", "format", "id", "is-error", "is-final-state", "labels", "line", "location", "log-level", "log-message-format", "parameters", "path", "refers-to", "status", "user-email"]); @@ -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,22 +508,22 @@ 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 })), + "final-time" => Some(("finalTime", 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 })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "final-time" => Some(("finalTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-email" => Some(("userEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.path" => Some(("location.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.line" => Some(("location.line", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "expressions" => Some(("expressions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-final-state" => Some(("isFinalState", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "condition" => Some(("condition", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "condition", "create-time", "description", "expressions", "final-time", "format", "id", "is-error", "is-final-state", "labels", "line", "location", "log-level", "log-message-format", "parameters", "path", "refers-to", "status", "user-email"]); @@ -1021,7 +1021,7 @@ fn main() { let mut app = App::new("clouddebugger2") .author("Sebastian Thiel ") - .version("1.0.6+20170919") + .version("1.0.6+20171016") .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 5dd64e4ff8..aa2ae0a8d5 100644 --- a/gen/clouddebugger2/Cargo.toml +++ b/gen/clouddebugger2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-clouddebugger2" -version = "1.0.6+20170919" +version = "1.0.6+20171016" 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+20170919" +documentation = "https://docs.rs/google-clouddebugger2/1.0.6+20171016" license = "MIT" keywords = ["clouddebugger", "google", "protocol", "web", "api"] diff --git a/gen/clouddebugger2/README.md b/gen/clouddebugger2/README.md index 6f8495c95c..6484805a01 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+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*. +This documentation was generated from *Cloud Debugger* crate version *1.0.6+20171016*, where *20171016* 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+20170919/google_clouddebugger2/struct.CloudDebugger.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/struct.CloudDebugger.html) ... * controller - * [*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) + * [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/struct.ControllerDebuggeeBreakpointListCall.html), [*debuggees breakpoints update*](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/struct.ControllerDebuggeeBreakpointUpdateCall.html) and [*debuggees register*](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/struct.ControllerDebuggeeRegisterCall.html) * debugger - * [*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) + * [*debuggees breakpoints delete*](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointDeleteCall.html), [*debuggees breakpoints get*](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointGetCall.html), [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointListCall.html), [*debuggees breakpoints set*](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointSetCall.html) and [*debuggees list*](https://docs.rs/google-clouddebugger2/1.0.6+20171016/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+20170919/google_clouddebugger2/struct.CloudDebugger.html)** +* **[Hub](https://docs.rs/google-clouddebugger2/1.0.6+20171016/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+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)** + * creates [*Method Builders*](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-clouddebugger2/1.0.6+20171016/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+20170919/google_clouddebugger2/trait.Part.html)** + * **[Parts](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-clouddebugger2/1.0.6+20170919/google_clouddebugger2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-clouddebugger2/1.0.6+20171016/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+20170919/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+20171016/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+20170919/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+20171016/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+20170919/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+20171016/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+20170919/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+20171016/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-clouddebugger2/1.0.6+20171016/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+20170919/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+20171016/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-clouddebugger2/1.0.6+20171016/google_clouddebugger2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-clouddebugger2/1.0.6+20171016/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+20170919/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+20171016/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+20170919/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+20171016/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+20170919/google_clouddebugger2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-clouddebugger2/1.0.6+20171016/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 42192429bc..c51a95f443 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+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*. +//! This documentation was generated from *Cloud Debugger* crate version *1.0.6+20171016*, where *20171016* 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). @@ -646,17 +646,17 @@ pub struct GerritSourceContext { /// A revision (commit) ID. #[serde(rename="revisionId")] pub revision_id: Option, - /// The full project name within the host. Projects may be nested, so - /// "project/subproject" is a valid project name. - /// The "repo name" is hostURI/project. - #[serde(rename="gerritProject")] - pub gerrit_project: Option, /// The URI of a running Gerrit instance. #[serde(rename="hostUri")] pub host_uri: Option, /// The name of an alias (branch, tag, etc.). #[serde(rename="aliasName")] pub alias_name: Option, + /// The full project name within the host. Projects may be nested, so + /// "project/subproject" is a valid project name. + /// The "repo name" is hostURI/project. + #[serde(rename="gerritProject")] + pub gerrit_project: Option, } impl Part for GerritSourceContext {} @@ -903,19 +903,19 @@ pub struct Breakpoint { /// and the referenced variable. #[serde(rename="variableTable")] pub variable_table: Option>, - /// E-mail address of the user that created this breakpoint - #[serde(rename="userEmail")] - pub user_email: Option, + /// Time this breakpoint was finalized as seen by the server in seconds + /// resolution. + #[serde(rename="finalTime")] + pub final_time: Option, /// Indicates the severity of the log. Only relevant when action is `LOG`. #[serde(rename="logLevel")] pub log_level: Option, /// A set of custom breakpoint properties, populated by the agent, to be /// displayed to the user. pub labels: Option>, - /// Time this breakpoint was finalized as seen by the server in seconds - /// resolution. - #[serde(rename="finalTime")] - pub final_time: Option, + /// E-mail address of the user that created this breakpoint + #[serde(rename="userEmail")] + pub user_email: Option, /// The stack at breakpoint time. #[serde(rename="stackFrames")] pub stack_frames: Option>, @@ -933,8 +933,9 @@ pub struct Breakpoint { /// will indicate an error and contain the error text. #[serde(rename="evaluatedExpressions")] pub evaluated_expressions: Option>, - /// Breakpoint identifier, unique in the scope of the debuggee. - pub id: Option, + /// Time this breakpoint was created by the server in seconds resolution. + #[serde(rename="createTime")] + pub create_time: Option, /// Condition that triggers the breakpoint. /// The condition is a compound boolean expression composed using expressions /// in a programming language at the source location. @@ -949,9 +950,8 @@ pub struct Breakpoint { /// `expressions` = `[ message.id, message.count ]`. #[serde(rename="logMessageFormat")] pub log_message_format: Option, - /// Time this breakpoint was created by the server in seconds resolution. - #[serde(rename="createTime")] - pub create_time: Option, + /// Breakpoint identifier, unique in the scope of the debuggee. + pub id: Option, /// Breakpoint source location. pub location: Option, /// Action that the agent should perform when the code at the @@ -1151,14 +1151,14 @@ impl ResponseResult for SetBreakpointResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct StatusMessage { - /// Status message text. - pub description: Option, - /// Reference to which the message applies. - #[serde(rename="refersTo")] - pub refers_to: Option, /// Distinguishes errors from informational messages. #[serde(rename="isError")] pub is_error: Option, + /// Reference to which the message applies. + #[serde(rename="refersTo")] + pub refers_to: Option, + /// Status message text. + pub description: Option, } impl Part for StatusMessage {} @@ -1720,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. - /// * *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) -> ControllerDebuggeeBreakpointUpdateCall<'a, C, A> @@ -1976,12 +1976,12 @@ impl<'a, C, A> ControllerDebuggeeRegisterCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ControllerDebuggeeRegisterCall<'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. - /// * *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) -> ControllerDebuggeeBreakpointListCall<'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> @@ -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. - /// * *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) -> DebuggerDebuggeeBreakpointDeleteCall<'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> @@ -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> @@ -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 index 50603edc5a..5b84b513cb 100644 --- a/gen/cloudfunctions1-cli/Cargo.toml +++ b/gen/cloudfunctions1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudfunctions1-cli" -version = "1.0.6+20170920" +version = "1.0.6+20171206" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-cloudfunctions1] path = "../cloudfunctions1" -version = "1.0.6+20170920" +version = "1.0.6+20171206" diff --git a/gen/cloudfunctions1-cli/README.md b/gen/cloudfunctions1-cli/README.md index 5d3271c25b..ca793ec474 100644 --- a/gen/cloudfunctions1-cli/README.md +++ b/gen/cloudfunctions1-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 Functions* API at revision *20170920*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud Functions* API at revision *20171206*. The CLI is at version *1.0.6*. ```bash cloudfunctions1 [options] @@ -33,6 +33,14 @@ cloudfunctions1 [options] get [-p ]... [-o ] list [-p ]... [-o ] projects + locations-functions-call (-r )... [-p ]... [-o ] + locations-functions-create (-r )... [-p ]... [-o ] + locations-functions-delete [-p ]... [-o ] + locations-functions-generate-download-url (-r )... [-p ]... [-o ] + locations-functions-generate-upload-url (-r )... [-p ]... [-o ] + locations-functions-get [-p ]... [-o ] + locations-functions-list [-p ]... [-o ] + locations-functions-patch (-r )... [-p ]... [-o ] locations-list [-p ]... [-o ] cloudfunctions1 --help diff --git a/gen/cloudfunctions1-cli/mkdocs.yml b/gen/cloudfunctions1-cli/mkdocs.yml index d549b13693..9496080f7d 100644 --- a/gen/cloudfunctions1-cli/mkdocs.yml +++ b/gen/cloudfunctions1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Functions v1.0.6+20170920 +site_name: Cloud Functions v1.0.6+20171206 site_url: http://byron.github.io/google-apis-rs/google-cloudfunctions1-cli site_description: A complete library to interact with Cloud Functions (protocol v1) @@ -11,6 +11,14 @@ pages: - ['index.md', 'Home'] - ['operations_get.md', 'Operations', 'Get'] - ['operations_list.md', 'Operations', 'List'] +- ['projects_locations-functions-call.md', 'Projects', 'Locations Functions Call'] +- ['projects_locations-functions-create.md', 'Projects', 'Locations Functions Create'] +- ['projects_locations-functions-delete.md', 'Projects', 'Locations Functions Delete'] +- ['projects_locations-functions-generate-download-url.md', 'Projects', 'Locations Functions Generate Download Url'] +- ['projects_locations-functions-generate-upload-url.md', 'Projects', 'Locations Functions Generate Upload Url'] +- ['projects_locations-functions-get.md', 'Projects', 'Locations Functions Get'] +- ['projects_locations-functions-list.md', 'Projects', 'Locations Functions List'] +- ['projects_locations-functions-patch.md', 'Projects', 'Locations Functions Patch'] - ['projects_locations-list.md', 'Projects', 'Locations List'] theme: readthedocs diff --git a/gen/cloudfunctions1-cli/src/main.rs b/gen/cloudfunctions1-cli/src/main.rs index e24d3d35a0..56cd89923e 100644 --- a/gen/cloudfunctions1-cli/src/main.rs +++ b/gen/cloudfunctions1-cli/src/main.rs @@ -163,6 +163,631 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_functions_call(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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" => Some(("data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["data"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CallFunctionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_functions_call(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_functions_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()[..] { + "event-trigger.event-type" => Some(("eventTrigger.eventType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-trigger.resource" => Some(("eventTrigger.resource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-trigger.service" => Some(("eventTrigger.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-repository.url" => Some(("sourceRepository.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-repository.deployed-url" => Some(("sourceRepository.deployedUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-upload-url" => Some(("sourceUploadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-trigger.url" => Some(("httpsTrigger.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-archive-url" => Some(("sourceArchiveUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "available-memory-mb" => Some(("availableMemoryMb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "version-id" => Some(("versionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entry-point" => Some(("entryPoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-account-email" => Some(("serviceAccountEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "timeout" => Some(("timeout", 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!["available-memory-mb", "deployed-url", "description", "entry-point", "event-trigger", "event-type", "https-trigger", "labels", "name", "resource", "service", "service-account-email", "source-archive-url", "source-repository", "source-upload-url", "status", "timeout", "update-time", "url", "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::CloudFunction = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_functions_create(request, opt.value_of("location").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_functions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_functions_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_functions_generate_download_url(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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-id" => Some(("versionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["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::GenerateDownloadUrlRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_functions_generate_download_url(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_functions_generate_upload_url(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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::GenerateUploadUrlRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_functions_generate_upload_url(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_functions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_functions_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_functions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_functions_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_functions_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()[..] { + "event-trigger.event-type" => Some(("eventTrigger.eventType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-trigger.resource" => Some(("eventTrigger.resource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-trigger.service" => Some(("eventTrigger.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-repository.url" => Some(("sourceRepository.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-repository.deployed-url" => Some(("sourceRepository.deployedUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-upload-url" => Some(("sourceUploadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-trigger.url" => Some(("httpsTrigger.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-archive-url" => Some(("sourceArchiveUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "available-memory-mb" => Some(("availableMemoryMb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "version-id" => Some(("versionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entry-point" => Some(("entryPoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-account-email" => Some(("serviceAccountEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "timeout" => Some(("timeout", 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!["available-memory-mb", "deployed-url", "description", "entry-point", "event-trigger", "event-type", "https-trigger", "labels", "name", "resource", "service", "service-account-email", "source-archive-url", "source-repository", "source-upload-url", "status", "timeout", "update-time", "url", "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::CloudFunction = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_functions_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_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("")); @@ -246,6 +871,30 @@ impl<'n> Engine<'n> { }, ("projects", Some(opt)) => { match opt.subcommand() { + ("locations-functions-call", Some(opt)) => { + call_result = self._projects_locations_functions_call(opt, dry_run, &mut err); + }, + ("locations-functions-create", Some(opt)) => { + call_result = self._projects_locations_functions_create(opt, dry_run, &mut err); + }, + ("locations-functions-delete", Some(opt)) => { + call_result = self._projects_locations_functions_delete(opt, dry_run, &mut err); + }, + ("locations-functions-generate-download-url", Some(opt)) => { + call_result = self._projects_locations_functions_generate_download_url(opt, dry_run, &mut err); + }, + ("locations-functions-generate-upload-url", Some(opt)) => { + call_result = self._projects_locations_functions_generate_upload_url(opt, dry_run, &mut err); + }, + ("locations-functions-get", Some(opt)) => { + call_result = self._projects_locations_functions_get(opt, dry_run, &mut err); + }, + ("locations-functions-list", Some(opt)) => { + call_result = self._projects_locations_functions_list(opt, dry_run, &mut err); + }, + ("locations-functions-patch", Some(opt)) => { + call_result = self._projects_locations_functions_patch(opt, dry_run, &mut err); + }, ("locations-list", Some(opt)) => { call_result = self._projects_locations_list(opt, dry_run, &mut err); }, @@ -393,7 +1042,234 @@ fn main() { ]), ]), - ("projects", "methods: 'locations-list'", vec![ + ("projects", "methods: 'locations-functions-call', 'locations-functions-create', 'locations-functions-delete', 'locations-functions-generate-download-url', 'locations-functions-generate-upload-url', 'locations-functions-get', 'locations-functions-list', 'locations-functions-patch' and 'locations-list'", vec![ + ("locations-functions-call", + Some(r##"Invokes synchronously deployed function. To be used for testing, very + limited traffic allowed."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli/projects_locations-functions-call", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the function to be called."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-functions-create", + Some(r##"Creates a new function. If a function with the given name already exists in + the specified project, the long running operation will return + `ALREADY_EXISTS` error."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli/projects_locations-functions-create", + vec![ + (Some(r##"location"##), + None, + Some(r##"The project and location in which the function should be created, specified + 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-functions-delete", + Some(r##"Deletes a function with the given name from the specified project. If the + given function is used by some trigger, the trigger will be updated to + remove this function."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli/projects_locations-functions-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the function which should 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)), + ]), + ("locations-functions-generate-download-url", + Some(r##"Returns a signed URL for downloading deployed function source code. + The URL is only valid for a limited period and should be used within + minutes after generation. + For more information about the signed URL usage see: + https://cloud.google.com/storage/docs/access-control/signed-urls"##), + "Details at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli/projects_locations-functions-generate-download-url", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of function for which source code Google Cloud Storage signed + URL should be generated."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-functions-generate-upload-url", + Some(r##"Returns a signed URL for uploading a function source code. + For more information about the signed URL usage see: + https://cloud.google.com/storage/docs/access-control/signed-urls + Once the function source code upload is complete, the used signed + URL should be provided in CreateFunction or UpdateFunction request + as a reference to the function source code."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli/projects_locations-functions-generate-upload-url", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The project and location in which the Google Cloud Storage signed URL + should be generated, specified 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-functions-get", + Some(r##"Returns a function with the given name from the requested project."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli/projects_locations-functions-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the function which details should be obtained."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-functions-list", + Some(r##"Returns a list of functions that belong to the requested project."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli/projects_locations-functions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The project and location from which the function should be listed, + specified in the format `projects/*/locations/*` + If you want to list functions in all locations, use "-" in place of a + 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-functions-patch", + Some(r##"Updates existing function."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli/projects_locations-functions-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"A user-defined name of the function. Function names must be unique + globally and match pattern `projects/*/locations/*/functions/*`"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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_cloudfunctions1_cli/projects_locations-list", @@ -422,7 +1298,7 @@ fn main() { let mut app = App::new("cloudfunctions1") .author("Sebastian Thiel ") - .version("1.0.6+20170920") + .version("1.0.6+20171206") .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") diff --git a/gen/cloudfunctions1/Cargo.toml b/gen/cloudfunctions1/Cargo.toml index ef3f7b0135..13bbfaefec 100644 --- a/gen/cloudfunctions1/Cargo.toml +++ b/gen/cloudfunctions1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudfunctions1" -version = "1.0.6+20170920" +version = "1.0.6+20171206" 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" +documentation = "https://docs.rs/google-cloudfunctions1/1.0.6+20171206" license = "MIT" keywords = ["cloudfunctions", "google", "protocol", "web", "api"] diff --git a/gen/cloudfunctions1/README.md b/gen/cloudfunctions1/README.md index 8527bacadf..62fecabf88 100644 --- a/gen/cloudfunctions1/README.md +++ b/gen/cloudfunctions1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Cloud Functions* crate version *1.0.6+20171206*, where *20171206* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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) +* [operations](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.Operation.html) + * [*get*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.OperationListCall.html) * projects - * [*locations list*](https://docs.rs/google-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/struct.ProjectLocationListCall.html) + * [*locations functions call*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.ProjectLocationFunctionCallCall.html), [*locations functions create*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.ProjectLocationFunctionCreateCall.html), [*locations functions delete*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.ProjectLocationFunctionDeleteCall.html), [*locations functions generate download url*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.ProjectLocationFunctionGenerateDownloadUrlCall.html), [*locations functions generate upload url*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.ProjectLocationFunctionGenerateUploadUrlCall.html), [*locations functions get*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.ProjectLocationFunctionGetCall.html), [*locations functions list*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.ProjectLocationFunctionListCall.html), [*locations functions patch*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.ProjectLocationFunctionPatchCall.html) and [*locations list*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/struct.ProjectLocationListCall.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-cloudfunctions1/1.0.6+20170920/google_cloudfunctions1/struct.CloudFunctions.html)** +* **[Hub](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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)** + * creates [*Method Builders*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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)** + * **[Parts](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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)** +* **[Activities](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -49,8 +49,11 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore +let r = hub.projects().locations_functions_patch(...).doit() let r = hub.operations().list(...).doit() let r = hub.operations().get(...).doit() +let r = hub.projects().locations_functions_delete(...).doit() +let r = hub.projects().locations_functions_create(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -123,17 +126,17 @@ match result { ``` ## 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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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). +[Hub Delegate](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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. +If such a method also supports a [Response Result](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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")`. @@ -143,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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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. +The [delegate trait](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/google_cloudfunctions1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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 +Most optionals are are considered [Parts](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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. +Using [method builders](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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 +* [request values](https://docs.rs/google-cloudfunctions1/1.0.6+20171206/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. diff --git a/gen/cloudfunctions1/src/lib.rs b/gen/cloudfunctions1/src/lib.rs index a2ee115fb4..0b9cb1be5a 100644 --- a/gen/cloudfunctions1/src/lib.rs +++ b/gen/cloudfunctions1/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 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*. +//! This documentation was generated from *Cloud Functions* crate version *1.0.6+20171206*, where *20171206* 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). @@ -14,7 +14,7 @@ //! * [operations](struct.Operation.html) //! * [*get*](struct.OperationGetCall.html) and [*list*](struct.OperationListCall.html) //! * projects -//! * [*locations list*](struct.ProjectLocationListCall.html) +//! * [*locations functions call*](struct.ProjectLocationFunctionCallCall.html), [*locations functions create*](struct.ProjectLocationFunctionCreateCall.html), [*locations functions delete*](struct.ProjectLocationFunctionDeleteCall.html), [*locations functions generate download url*](struct.ProjectLocationFunctionGenerateDownloadUrlCall.html), [*locations functions generate upload url*](struct.ProjectLocationFunctionGenerateUploadUrlCall.html), [*locations functions get*](struct.ProjectLocationFunctionGetCall.html), [*locations functions list*](struct.ProjectLocationFunctionListCall.html), [*locations functions patch*](struct.ProjectLocationFunctionPatchCall.html) and [*locations list*](struct.ProjectLocationListCall.html) //! //! //! @@ -49,8 +49,11 @@ //! Or specifically ... //! //! ```ignore +//! let r = hub.projects().locations_functions_patch(...).doit() //! let r = hub.operations().list(...).doit() //! let r = hub.operations().get(...).doit() +//! let r = hub.projects().locations_functions_delete(...).doit() +//! let r = hub.projects().locations_functions_create(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -364,6 +367,231 @@ impl<'a, C, A> CloudFunctions // ############ // SCHEMAS ### // ########## +/// Request for the `CallFunction` 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 functions call projects](struct.ProjectLocationFunctionCallCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CallFunctionRequest { + /// Input to be passed to the function. + pub data: Option, +} + +impl RequestValue for CallFunctionRequest {} + + +/// Describes EventTrigger, used to request events be sent from another +/// 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 EventTrigger { + /// Required. The type of event to observe. For example: + /// `providers/cloud.storage/eventTypes/object.change` and + /// `providers/cloud.pubsub/eventTypes/topic.publish`. + /// + /// Event types match pattern `providers/*/eventTypes/*.*`. + /// The pattern contains: + /// 1. namespace: For example, `cloud.storage` and + /// `google.firebase.analytics`. + /// 2. resource type: The type of resource on which event occurs. For + /// example, the Google Cloud Storage API includes the type `object`. + /// 3. action: The action that generates the event. For example, action for + /// a Google Cloud Storage Object is 'change'. + /// These parts are lower case. + #[serde(rename="eventType")] + pub event_type: Option, + /// Required. The resource(s) from which to observe events, for example, + /// `projects/_/buckets/myBucket`. + /// + /// Not all syntactically correct values are accepted by all services. For + /// example: + /// + /// 1. The authorization model must support it. Google Cloud Functions + /// only allows EventTriggers to be deployed that observe resources in the + /// same project as the `CloudFunction`. + /// 2. The resource type must match the pattern expected for an + /// `event_type`. For example, an `EventTrigger` that has an + /// `event_type` of "google.pubsub.topic.publish" should have a resource + /// that matches Google Cloud Pub/Sub topics. + /// + /// Additionally, some services may support short names when creating an + /// `EventTrigger`. These will always be returned in the normalized "long" + /// format. + /// + /// See each *service's* documentation for supported formats. + pub resource: Option, + /// The hostname of the service that should be observed. + /// + /// If no string is provided, the default service implementing the API will + /// be used. For example, `storage.googleapis.com` is the default for all + /// event types in the `google.storage` namespace. + pub service: Option, + /// Specifies policy for failed executions. + #[serde(rename="failurePolicy")] + pub failure_policy: Option, +} + +impl Part for EventTrigger {} + + +/// Describes the retry policy in case of function's execution failure. +/// A function execution will be retried on any failure. +/// A failed execution will be retried up to 7 days with an exponential backoff +/// (capped at 10 seconds). +/// Retried execution is charged as any other execution. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Retry { _never_set: Option } + +impl Part for Retry {} + + +/// Response of `GenerateSourceUploadUrl` 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 functions generate upload url projects](struct.ProjectLocationFunctionGenerateUploadUrlCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GenerateUploadUrlResponse { + /// The generated Google Cloud Storage signed URL that should be used for a + /// function source code upload. The uploaded file should be a zip archive + /// which contains a function. + #[serde(rename="uploadUrl")] + pub upload_url: Option, +} + +impl ResponseResult for GenerateUploadUrlResponse {} + + +/// 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. +/// +/// 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 {} + + +/// Response of `CallFunction` 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 functions call projects](struct.ProjectLocationFunctionCallCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CallFunctionResponse { + /// Execution id of function invocation. + #[serde(rename="executionId")] + pub execution_id: Option, + /// Result populated for successful execution of synchronous function. Will + /// not be populated if function does not return a result through context. + pub result: Option, + /// Either system or user-function generated error. Set if execution + /// was not successful. + pub error: Option, +} + +impl ResponseResult for CallFunctionResponse {} + + +/// 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*). +/// +/// * [locations functions patch projects](struct.ProjectLocationFunctionPatchCall.html) (response) +/// * [list operations](struct.OperationListCall.html) (none) +/// * [get operations](struct.OperationGetCall.html) (response) +/// * [locations functions delete projects](struct.ProjectLocationFunctionDeleteCall.html) (response) +/// * [locations functions create projects](struct.ProjectLocationFunctionCreateCall.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 `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: @@ -435,70 +663,6 @@ pub struct Status { 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 @@ -510,38 +674,226 @@ impl ResponseResult for Operation {} /// #[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 {} -/// A resource that represents Google Cloud Platform location. +/// Describes SourceRepository, used to represent parameters related to +/// source repository where a function is hosted. /// /// 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 +pub struct SourceRepository { + /// The URL pointing to the hosted repository where the function is defined. + /// There are supported Cloud Source Repository URLs in the following + /// formats: /// - /// {"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>, + /// To refer to a specific commit: + /// `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*` + /// To refer to a moveable alias (branch): + /// `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*` + /// In particular, to refer to HEAD use `master` moveable alias. + /// To refer to a specific fixed alias (tag): + /// `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*` + /// + /// You may omit `paths/*` if you want to use the main directory. + pub url: Option, + /// Output only. The URL pointing to the hosted repository where the function + /// were defined at the time of deployment. It always points to a specific + /// commit in the format described above. + #[serde(rename="deployedUrl")] + pub deployed_url: Option, } -impl Part for Location {} +impl Part for SourceRepository {} + + +/// Describes HttpsTrigger, could be used to connect web hooks to function. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpsTrigger { + /// Output only. The deployed url for the function. + pub url: Option, +} + +impl Part for HttpsTrigger {} + + +/// Request of `GenerateDownloadUrl` 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 functions generate download url projects](struct.ProjectLocationFunctionGenerateDownloadUrlCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GenerateDownloadUrlRequest { + /// The optional version of function. If not set, default, current version + /// is used. + #[serde(rename="versionId")] + pub version_id: Option, +} + +impl RequestValue for GenerateDownloadUrlRequest {} + + +/// Describes the policy in case of function's execution failure. +/// If empty, then defaults to ignoring failures (i.e. not retrying them). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FailurePolicy { + /// If specified, then the function will be retried in case of a failure. + pub retry: Option, +} + +impl Part for FailurePolicy {} + + +/// Response of `GenerateDownloadUrl` 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 functions generate download url projects](struct.ProjectLocationFunctionGenerateDownloadUrlCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GenerateDownloadUrlResponse { + /// The generated Google Cloud Storage signed URL that should be used for + /// function source code download. + #[serde(rename="downloadUrl")] + pub download_url: Option, +} + +impl ResponseResult for GenerateDownloadUrlResponse {} + + +/// Response for the `ListFunctions` 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 functions list projects](struct.ProjectLocationFunctionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListFunctionsResponse { + /// If not empty, indicates that there may be more functions that match + /// the request; this value should be passed in a new + /// google.cloud.functions.v1.ListFunctionsRequest + /// to get more functions. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The functions that match the request. + pub functions: Option>, +} + +impl ResponseResult for ListFunctionsResponse {} + + +/// Request of `GenerateSourceUploadUrl` 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 functions generate upload url projects](struct.ProjectLocationFunctionGenerateUploadUrlCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GenerateUploadUrlRequest { _never_set: Option } + +impl RequestValue for GenerateUploadUrlRequest {} + + +/// Describes a Cloud Function that contains user computation executed in +/// response to an event. It encapsulate function and triggers configurations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 functions patch projects](struct.ProjectLocationFunctionPatchCall.html) (request) +/// * [locations functions get projects](struct.ProjectLocationFunctionGetCall.html) (response) +/// * [locations functions create projects](struct.ProjectLocationFunctionCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CloudFunction { + /// A source that fires events in response to a condition in another service. + #[serde(rename="eventTrigger")] + pub event_trigger: Option, + /// Output only. Status of the function deployment. + pub status: Option, + /// Output only. The last update timestamp of a Cloud Function. + #[serde(rename="updateTime")] + pub update_time: Option, + /// User-provided description of a function. + pub description: Option, + /// **Beta Feature** + /// + /// The source repository where a function is hosted. + #[serde(rename="sourceRepository")] + pub source_repository: Option, + /// The Google Cloud Storage signed URL used for source uploading, generated + /// by google.cloud.functions.v1.GenerateUploadUrl + #[serde(rename="sourceUploadUrl")] + pub source_upload_url: Option, + /// An HTTPS endpoint type of source that can be triggered via URL. + #[serde(rename="httpsTrigger")] + pub https_trigger: Option, + /// The Google Cloud Storage URL, starting with gs://, pointing to the zip + /// archive which contains the function. + #[serde(rename="sourceArchiveUrl")] + pub source_archive_url: Option, + /// Labels associated with this Cloud Function. + pub labels: Option>, + /// The amount of memory in MB available for a function. + /// Defaults to 256MB. + #[serde(rename="availableMemoryMb")] + pub available_memory_mb: Option, + /// Output only. + /// The version identifier of the Cloud Function. Each deployment attempt + /// results in a new version of a function being created. + #[serde(rename="versionId")] + pub version_id: Option, + /// The name of the function (as defined in source code) that will be + /// executed. Defaults to the resource name suffix, if not specified. For + /// backward compatibility, if function with given name is not found, then the + /// system will try to use function named "function". + /// For Node.js this is name of a function exported by the module specified + /// in `source_location`. + #[serde(rename="entryPoint")] + pub entry_point: Option, + /// Output only. The email of the function's service account. + #[serde(rename="serviceAccountEmail")] + pub service_account_email: Option, + /// The function execution timeout. Execution is considered failed and + /// can be terminated if the function is not completed at the end of the + /// timeout period. Defaults to 60 seconds. + pub timeout: Option, + /// A user-defined name of the function. Function names must be unique + /// globally and match pattern `projects/*/locations/*/functions/*` + pub name: Option, +} + +impl RequestValue for CloudFunction {} +impl ResponseResult for CloudFunction {} @@ -588,6 +940,25 @@ 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(), + _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 @@ -612,25 +983,6 @@ impl<'a, C, A> OperationMethods<'a, C, A> { _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(), - } - } } @@ -659,7 +1011,7 @@ impl<'a, C, A> OperationMethods<'a, C, A> { /// ::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(...)` +/// // like `locations_functions_call(...)`, `locations_functions_create(...)`, `locations_functions_delete(...)`, `locations_functions_generate_download_url(...)`, `locations_functions_generate_upload_url(...)`, `locations_functions_get(...)`, `locations_functions_list(...)`, `locations_functions_patch(...)` and `locations_list(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -693,6 +1045,176 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a function with the given name from the specified project. If the + /// given function is used by some trigger, the trigger will be updated to + /// remove this function. + /// + /// # Arguments + /// + /// * `name` - The name of the function which should be deleted. + pub fn locations_functions_delete(&self, name: &str) -> ProjectLocationFunctionDeleteCall<'a, C, A> { + ProjectLocationFunctionDeleteCall { + 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 a function with the given name from the requested project. + /// + /// # Arguments + /// + /// * `name` - The name of the function which details should be obtained. + pub fn locations_functions_get(&self, name: &str) -> ProjectLocationFunctionGetCall<'a, C, A> { + ProjectLocationFunctionGetCall { + 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 function. If a function with the given name already exists in + /// the specified project, the long running operation will return + /// `ALREADY_EXISTS` error. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `location` - The project and location in which the function should be created, specified + /// in the format `projects/*/locations/*` + pub fn locations_functions_create(&self, request: CloudFunction, location: &str) -> ProjectLocationFunctionCreateCall<'a, C, A> { + ProjectLocationFunctionCreateCall { + hub: self.hub, + _request: request, + _location: location.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates existing function. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - A user-defined name of the function. Function names must be unique + /// globally and match pattern `projects/*/locations/*/functions/*` + pub fn locations_functions_patch(&self, request: CloudFunction, name: &str) -> ProjectLocationFunctionPatchCall<'a, C, A> { + ProjectLocationFunctionPatchCall { + 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: + /// + /// Returns a signed URL for uploading a function source code. + /// For more information about the signed URL usage see: + /// https://cloud.google.com/storage/docs/access-control/signed-urls + /// Once the function source code upload is complete, the used signed + /// URL should be provided in CreateFunction or UpdateFunction request + /// as a reference to the function source code. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The project and location in which the Google Cloud Storage signed URL + /// should be generated, specified in the format `projects/*/locations/* + pub fn locations_functions_generate_upload_url(&self, request: GenerateUploadUrlRequest, parent: &str) -> ProjectLocationFunctionGenerateUploadUrlCall<'a, C, A> { + ProjectLocationFunctionGenerateUploadUrlCall { + 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: + /// + /// Invokes synchronously deployed function. To be used for testing, very + /// limited traffic allowed. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the function to be called. + pub fn locations_functions_call(&self, request: CallFunctionRequest, name: &str) -> ProjectLocationFunctionCallCall<'a, C, A> { + ProjectLocationFunctionCallCall { + 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 a signed URL for downloading deployed function source code. + /// The URL is only valid for a limited period and should be used within + /// minutes after generation. + /// For more information about the signed URL usage see: + /// https://cloud.google.com/storage/docs/access-control/signed-urls + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of function for which source code Google Cloud Storage signed + /// URL should be generated. + pub fn locations_functions_generate_download_url(&self, request: GenerateDownloadUrlRequest, name: &str) -> ProjectLocationFunctionGenerateDownloadUrlCall<'a, C, A> { + ProjectLocationFunctionGenerateDownloadUrlCall { + 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 a list of functions that belong to the requested project. + /// + /// # Arguments + /// + /// * `parent` - The project and location from which the function should be listed, + /// specified in the format `projects/*/locations/*` + /// If you want to list functions in all locations, use "-" in place of a + /// location. + pub fn locations_functions_list(&self, parent: &str) -> ProjectLocationFunctionListCall<'a, C, A> { + ProjectLocationFunctionListCall { + 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(), + } + } } @@ -703,279 +1225,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // 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. @@ -1191,12 +1440,12 @@ impl<'a, C, A> OperationGetCall<'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) -> OperationGetCall<'a, C, A> @@ -1231,6 +1480,279 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, 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 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("sea") +/// .page_size(-90) +/// .name("dolores") +/// .filter("gubergren") +/// .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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing 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 + } +} + + /// Lists information about the supported locations for this service. /// /// A builder for the *locations.list* method supported by a *project* resource. @@ -1480,12 +2002,12 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationListCall<'a, C, A> @@ -1520,3 +2042,2242 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut::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_functions_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationFunctionDeleteCall<'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 ProjectLocationFunctionDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationFunctionDeleteCall<'a, C, 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.projects.locations.functions.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 function which should 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) -> ProjectLocationFunctionDeleteCall<'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) -> ProjectLocationFunctionDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationFunctionDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationFunctionDeleteCall<'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 function with the given name from the requested project. +/// +/// A builder for the *locations.functions.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_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_functions_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationFunctionGetCall<'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 ProjectLocationFunctionGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationFunctionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CloudFunction)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.functions.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 function which details should be obtained. + /// + /// 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) -> ProjectLocationFunctionGetCall<'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) -> ProjectLocationFunctionGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationFunctionGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationFunctionGetCall<'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 function. If a function with the given name already exists in +/// the specified project, the long running operation will return +/// `ALREADY_EXISTS` error. +/// +/// A builder for the *locations.functions.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_cloudfunctions1 as cloudfunctions1; +/// use cloudfunctions1::CloudFunction; +/// # #[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); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CloudFunction::default(); +/// +/// // You can configure optional parameters by calling the 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_functions_create(req, "location") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationFunctionCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudFunctions, + _request: CloudFunction, + _location: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationFunctionCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationFunctionCreateCall<'a, C, 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.projects.locations.functions.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("location", self._location.to_string())); + for &field in ["alt", "location"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+location}/functions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+location}", "location")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["location"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: CloudFunction) -> ProjectLocationFunctionCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The project and location in which the function should be created, specified + /// in the format `projects/*/locations/*` + /// + /// Sets the *location* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location(mut self, new_value: &str) -> ProjectLocationFunctionCreateCall<'a, C, A> { + self._location = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationFunctionCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationFunctionCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationFunctionCreateCall<'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 existing function. +/// +/// A builder for the *locations.functions.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_cloudfunctions1 as cloudfunctions1; +/// use cloudfunctions1::CloudFunction; +/// # #[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); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CloudFunction::default(); +/// +/// // You can configure optional parameters by calling the 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_functions_patch(req, "name") +/// .update_mask("diam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationFunctionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudFunctions, + _request: CloudFunction, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationFunctionPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationFunctionPatchCall<'a, C, 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.projects.locations.functions.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: CloudFunction) -> ProjectLocationFunctionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// A user-defined name of the function. Function names must be unique + /// globally and match pattern `projects/*/locations/*/functions/*` + /// + /// 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) -> ProjectLocationFunctionPatchCall<'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) -> ProjectLocationFunctionPatchCall<'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) -> ProjectLocationFunctionPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationFunctionPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationFunctionPatchCall<'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 signed URL for uploading a function source code. +/// For more information about the signed URL usage see: +/// https://cloud.google.com/storage/docs/access-control/signed-urls +/// Once the function source code upload is complete, the used signed +/// URL should be provided in CreateFunction or UpdateFunction request +/// as a reference to the function source code. +/// +/// A builder for the *locations.functions.generateUploadUrl* 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; +/// use cloudfunctions1::GenerateUploadUrlRequest; +/// # #[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); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = GenerateUploadUrlRequest::default(); +/// +/// // You can configure optional parameters by calling the 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_functions_generate_upload_url(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationFunctionGenerateUploadUrlCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudFunctions, + _request: GenerateUploadUrlRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationFunctionGenerateUploadUrlCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationFunctionGenerateUploadUrlCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GenerateUploadUrlResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.functions.generateUploadUrl", + 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}/functions:generateUploadUrl"; + 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: GenerateUploadUrlRequest) -> ProjectLocationFunctionGenerateUploadUrlCall<'a, C, A> { + self._request = new_value; + self + } + /// The project and location in which the Google Cloud Storage signed URL + /// should be generated, specified 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) -> ProjectLocationFunctionGenerateUploadUrlCall<'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) -> ProjectLocationFunctionGenerateUploadUrlCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationFunctionGenerateUploadUrlCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationFunctionGenerateUploadUrlCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Invokes synchronously deployed function. To be used for testing, very +/// limited traffic allowed. +/// +/// A builder for the *locations.functions.call* 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; +/// use cloudfunctions1::CallFunctionRequest; +/// # #[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); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CallFunctionRequest::default(); +/// +/// // You can configure optional parameters by calling the 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_functions_call(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationFunctionCallCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudFunctions, + _request: CallFunctionRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationFunctionCallCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationFunctionCallCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CallFunctionResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.functions.call", + 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}:call"; + 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: CallFunctionRequest) -> ProjectLocationFunctionCallCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the function to be called. + /// + /// 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) -> ProjectLocationFunctionCallCall<'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) -> ProjectLocationFunctionCallCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationFunctionCallCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationFunctionCallCall<'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 signed URL for downloading deployed function source code. +/// The URL is only valid for a limited period and should be used within +/// minutes after generation. +/// For more information about the signed URL usage see: +/// https://cloud.google.com/storage/docs/access-control/signed-urls +/// +/// A builder for the *locations.functions.generateDownloadUrl* 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; +/// use cloudfunctions1::GenerateDownloadUrlRequest; +/// # #[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); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = GenerateDownloadUrlRequest::default(); +/// +/// // You can configure optional parameters by calling the 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_functions_generate_download_url(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationFunctionGenerateDownloadUrlCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudFunctions, + _request: GenerateDownloadUrlRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationFunctionGenerateDownloadUrlCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationFunctionGenerateDownloadUrlCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GenerateDownloadUrlResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.functions.generateDownloadUrl", + 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}:generateDownloadUrl"; + 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: GenerateDownloadUrlRequest) -> ProjectLocationFunctionGenerateDownloadUrlCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of function for which source code Google Cloud Storage signed + /// URL should be generated. + /// + /// 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) -> ProjectLocationFunctionGenerateDownloadUrlCall<'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) -> ProjectLocationFunctionGenerateDownloadUrlCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationFunctionGenerateDownloadUrlCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationFunctionGenerateDownloadUrlCall<'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 functions that belong to the requested project. +/// +/// A builder for the *locations.functions.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_functions_list("parent") +/// .page_token("aliquyam") +/// .page_size(-9) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationFunctionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudFunctions, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationFunctionListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationFunctionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListFunctionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.functions.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}/functions"; + 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 project and location from which the function should be listed, + /// specified in the format `projects/*/locations/*` + /// If you want to list functions in all locations, use "-" in place of a + /// location. + /// + /// 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) -> ProjectLocationFunctionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The value returned by the last + /// `ListFunctionsResponse`; indicates that + /// this is a continuation of a prior `ListFunctions` 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) -> ProjectLocationFunctionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of functions to return per call. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationFunctionListCall<'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) -> ProjectLocationFunctionListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationFunctionListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationFunctionListCall<'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/cloudiot1-cli/Cargo.toml b/gen/cloudiot1-cli/Cargo.toml new file mode 100644 index 0000000000..408208b386 --- /dev/null +++ b/gen/cloudiot1-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-cloudiot1-cli" +version = "1.0.6+20171204" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Iot (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudiot1-cli" +homepage = "https://cloud.google.com/iot" +documentation = "http://byron.github.io/google-apis-rs/google_cloudiot1_cli" +license = "MIT" +keywords = ["cloudiot", "google", "cli"] + +[[bin]] +name = "cloudiot1" + +[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-cloudiot1] +path = "../cloudiot1" +version = "1.0.6+20171204" diff --git a/gen/cloudiot1-cli/LICENSE.md b/gen/cloudiot1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/cloudiot1-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/cloudiot1-cli/README.md b/gen/cloudiot1-cli/README.md new file mode 100644 index 0000000000..8b61d862e2 --- /dev/null +++ b/gen/cloudiot1-cli/README.md @@ -0,0 +1,129 @@ + +The `cloudiot1` command-line interface *(CLI)* allows to use most features of the *Google Cloud Iot* 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 Iot* API can be found at the +[official documentation site](https://cloud.google.com/iot). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-cloudiot1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudiot1-cli). + +# Usage + +This documentation was generated from the *Cloud Iot* API at revision *20171204*. The CLI is at version *1.0.6*. + +```bash +cloudiot1 [options] + projects + locations-registries-create (-r )... [-p ]... [-o ] + locations-registries-delete [-p ]... [-o ] + locations-registries-devices-config-versions-list [-p ]... [-o ] + locations-registries-devices-create (-r )... [-p ]... [-o ] + locations-registries-devices-delete [-p ]... [-o ] + locations-registries-devices-get [-p ]... [-o ] + locations-registries-devices-list [-p ]... [-o ] + locations-registries-devices-modify-cloud-to-device-config (-r )... [-p ]... [-o ] + locations-registries-devices-patch (-r )... [-p ]... [-o ] + locations-registries-devices-states-list [-p ]... [-o ] + locations-registries-get [-p ]... [-o ] + locations-registries-get-iam-policy (-r )... [-p ]... [-o ] + locations-registries-list [-p ]... [-o ] + locations-registries-patch (-r )... [-p ]... [-o ] + locations-registries-set-iam-policy (-r )... [-p ]... [-o ] + locations-registries-test-iam-permissions (-r )... [-p ]... [-o ] + cloudiot1 --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 `cloudiot1-`. 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/cloudiot1-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/cloudiot1-secret.json`, assuming that the required *cloudiot* 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. `cloudiot1 --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/cloudiot1-cli/mkdocs.yml b/gen/cloudiot1-cli/mkdocs.yml new file mode 100644 index 0000000000..51e11aadaf --- /dev/null +++ b/gen/cloudiot1-cli/mkdocs.yml @@ -0,0 +1,32 @@ +site_name: Cloud Iot v1.0.6+20171204 +site_url: http://byron.github.io/google-apis-rs/google-cloudiot1-cli +site_description: A complete library to interact with Cloud Iot (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/cloudiot1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_locations-registries-create.md', 'Projects', 'Locations Registries Create'] +- ['projects_locations-registries-delete.md', 'Projects', 'Locations Registries Delete'] +- ['projects_locations-registries-devices-config-versions-list.md', 'Projects', 'Locations Registries Devices Config Versions List'] +- ['projects_locations-registries-devices-create.md', 'Projects', 'Locations Registries Devices Create'] +- ['projects_locations-registries-devices-delete.md', 'Projects', 'Locations Registries Devices Delete'] +- ['projects_locations-registries-devices-get.md', 'Projects', 'Locations Registries Devices Get'] +- ['projects_locations-registries-devices-list.md', 'Projects', 'Locations Registries Devices List'] +- ['projects_locations-registries-devices-modify-cloud-to-device-config.md', 'Projects', 'Locations Registries Devices Modify Cloud To Device Config'] +- ['projects_locations-registries-devices-patch.md', 'Projects', 'Locations Registries Devices Patch'] +- ['projects_locations-registries-devices-states-list.md', 'Projects', 'Locations Registries Devices States List'] +- ['projects_locations-registries-get.md', 'Projects', 'Locations Registries Get'] +- ['projects_locations-registries-get-iam-policy.md', 'Projects', 'Locations Registries Get Iam Policy'] +- ['projects_locations-registries-list.md', 'Projects', 'Locations Registries List'] +- ['projects_locations-registries-patch.md', 'Projects', 'Locations Registries Patch'] +- ['projects_locations-registries-set-iam-policy.md', 'Projects', 'Locations Registries Set Iam Policy'] +- ['projects_locations-registries-test-iam-permissions.md', 'Projects', 'Locations Registries Test Iam Permissions'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/cloudiot1-cli/src/cmn.rs b/gen/cloudiot1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/cloudiot1-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/cloudiot1-cli/src/main.rs b/gen/cloudiot1-cli/src/main.rs new file mode 100644 index 0000000000..e7db34880d --- /dev/null +++ b/gen/cloudiot1-cli/src/main.rs @@ -0,0 +1,1917 @@ +// 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_cloudiot1 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::CloudIot>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_locations_registries_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()[..] { + "http-config.http-enabled-state" => Some(("httpConfig.httpEnabledState", 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 })), + "mqtt-config.mqtt-enabled-state" => Some(("mqttConfig.mqttEnabledState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state-notification-config.pubsub-topic-name" => Some(("stateNotificationConfig.pubsubTopicName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["http-config", "http-enabled-state", "id", "mqtt-config", "mqtt-enabled-state", "name", "pubsub-topic-name", "state-notification-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::DeviceRegistry = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_registries_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_registries_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_registries_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_registries_devices_config_versions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_registries_devices_config_versions_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 { + "num-versions" => { + call = call.num_versions(arg_from_str(value.unwrap_or("-0"), err, "num-versions", "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(["num-versions"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_registries_devices_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()[..] { + "last-state-time" => Some(("lastStateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-event-time" => Some(("lastEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-error-time" => Some(("lastErrorTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "num-id" => Some(("numId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-heartbeat-time" => Some(("lastHeartbeatTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-config-ack-time" => Some(("lastConfigAckTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state.update-time" => Some(("state.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state.binary-data" => Some(("state.binaryData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-config-send-time" => Some(("lastConfigSendTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-error-status.message" => Some(("lastErrorStatus.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-error-status.code" => Some(("lastErrorStatus.code", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "blocked" => Some(("blocked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.version" => Some(("config.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.cloud-update-time" => Some(("config.cloudUpdateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.binary-data" => Some(("config.binaryData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.device-ack-time" => Some(("config.deviceAckTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata" => Some(("metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["binary-data", "blocked", "cloud-update-time", "code", "config", "device-ack-time", "id", "last-config-ack-time", "last-config-send-time", "last-error-status", "last-error-time", "last-event-time", "last-heartbeat-time", "last-state-time", "message", "metadata", "name", "num-id", "state", "update-time", "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::Device = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_registries_devices_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_registries_devices_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_registries_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 _projects_locations_registries_devices_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_registries_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 { + "field-mask" => { + call = call.field_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(["field-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_registries_devices_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_registries_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")); + }, + "field-mask" => { + call = call.field_mask(value.unwrap_or("")); + }, + "device-num-ids" => { + call = call.add_device_num_ids(value.unwrap_or("")); + }, + "device-ids" => { + call = call.add_device_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(["device-num-ids", "page-token", "field-mask", "page-size", "device-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 _projects_locations_registries_devices_modify_cloud_to_device_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()[..] { + "version-to-update" => Some(("versionToUpdate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "binary-data" => Some(("binaryData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["binary-data", "version-to-update"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ModifyCloudToDeviceConfigRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_registries_devices_modify_cloud_to_device_config(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_registries_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()[..] { + "last-state-time" => Some(("lastStateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-event-time" => Some(("lastEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-error-time" => Some(("lastErrorTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "num-id" => Some(("numId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-heartbeat-time" => Some(("lastHeartbeatTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-config-ack-time" => Some(("lastConfigAckTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state.update-time" => Some(("state.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state.binary-data" => Some(("state.binaryData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-config-send-time" => Some(("lastConfigSendTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-error-status.message" => Some(("lastErrorStatus.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-error-status.code" => Some(("lastErrorStatus.code", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "blocked" => Some(("blocked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.version" => Some(("config.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.cloud-update-time" => Some(("config.cloudUpdateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.binary-data" => Some(("config.binaryData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.device-ack-time" => Some(("config.deviceAckTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata" => Some(("metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["binary-data", "blocked", "cloud-update-time", "code", "config", "device-ack-time", "id", "last-config-ack-time", "last-config-send-time", "last-error-status", "last-error-time", "last-event-time", "last-heartbeat-time", "last-state-time", "message", "metadata", "name", "num-id", "state", "update-time", "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::Device = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_registries_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 _projects_locations_registries_devices_states_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_registries_devices_states_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 { + "num-states" => { + call = call.num_states(arg_from_str(value.unwrap_or("-0"), err, "num-states", "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(["num-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 _projects_locations_registries_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_registries_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_registries_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_registries_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_registries_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_registries_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_registries_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()[..] { + "http-config.http-enabled-state" => Some(("httpConfig.httpEnabledState", 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 })), + "mqtt-config.mqtt-enabled-state" => Some(("mqttConfig.mqttEnabledState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state-notification-config.pubsub-topic-name" => Some(("stateNotificationConfig.pubsubTopicName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["http-config", "http-enabled-state", "id", "mqtt-config", "mqtt-enabled-state", "name", "pubsub-topic-name", "state-notification-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::DeviceRegistry = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_registries_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_registries_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_registries_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_registries_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_registries_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-registries-create", Some(opt)) => { + call_result = self._projects_locations_registries_create(opt, dry_run, &mut err); + }, + ("locations-registries-delete", Some(opt)) => { + call_result = self._projects_locations_registries_delete(opt, dry_run, &mut err); + }, + ("locations-registries-devices-config-versions-list", Some(opt)) => { + call_result = self._projects_locations_registries_devices_config_versions_list(opt, dry_run, &mut err); + }, + ("locations-registries-devices-create", Some(opt)) => { + call_result = self._projects_locations_registries_devices_create(opt, dry_run, &mut err); + }, + ("locations-registries-devices-delete", Some(opt)) => { + call_result = self._projects_locations_registries_devices_delete(opt, dry_run, &mut err); + }, + ("locations-registries-devices-get", Some(opt)) => { + call_result = self._projects_locations_registries_devices_get(opt, dry_run, &mut err); + }, + ("locations-registries-devices-list", Some(opt)) => { + call_result = self._projects_locations_registries_devices_list(opt, dry_run, &mut err); + }, + ("locations-registries-devices-modify-cloud-to-device-config", Some(opt)) => { + call_result = self._projects_locations_registries_devices_modify_cloud_to_device_config(opt, dry_run, &mut err); + }, + ("locations-registries-devices-patch", Some(opt)) => { + call_result = self._projects_locations_registries_devices_patch(opt, dry_run, &mut err); + }, + ("locations-registries-devices-states-list", Some(opt)) => { + call_result = self._projects_locations_registries_devices_states_list(opt, dry_run, &mut err); + }, + ("locations-registries-get", Some(opt)) => { + call_result = self._projects_locations_registries_get(opt, dry_run, &mut err); + }, + ("locations-registries-get-iam-policy", Some(opt)) => { + call_result = self._projects_locations_registries_get_iam_policy(opt, dry_run, &mut err); + }, + ("locations-registries-list", Some(opt)) => { + call_result = self._projects_locations_registries_list(opt, dry_run, &mut err); + }, + ("locations-registries-patch", Some(opt)) => { + call_result = self._projects_locations_registries_patch(opt, dry_run, &mut err); + }, + ("locations-registries-set-iam-policy", Some(opt)) => { + call_result = self._projects_locations_registries_set_iam_policy(opt, dry_run, &mut err); + }, + ("locations-registries-test-iam-permissions", Some(opt)) => { + call_result = self._projects_locations_registries_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, "cloudiot1-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: "cloudiot1", + 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::CloudIot::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-registries-create', 'locations-registries-delete', 'locations-registries-devices-config-versions-list', 'locations-registries-devices-create', 'locations-registries-devices-delete', 'locations-registries-devices-get', 'locations-registries-devices-list', 'locations-registries-devices-modify-cloud-to-device-config', 'locations-registries-devices-patch', 'locations-registries-devices-states-list', 'locations-registries-get', 'locations-registries-get-iam-policy', 'locations-registries-list', 'locations-registries-patch', 'locations-registries-set-iam-policy' and 'locations-registries-test-iam-permissions'", vec![ + ("locations-registries-create", + Some(r##"Creates a device registry that contains devices."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The project and cloud region where this device registry must be created. + For example, `projects/example-project/locations/us-central1`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-registries-delete", + Some(r##"Deletes a device registry configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the device registry. For example, + `projects/example-project/locations/us-central1/registries/my-registry`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-registries-devices-config-versions-list", + Some(r##"Lists the last few versions of the device configuration in descending + order (i.e.: newest first)."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-devices-config-versions-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the device. For example, + `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + `projects/p0/locations/us-central1/registries/registry0/devices/{num_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-registries-devices-create", + Some(r##"Creates a device in a device registry."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-devices-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The name of the device registry where this device should be created. + For example, + `projects/example-project/locations/us-central1/registries/my-registry`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-registries-devices-delete", + Some(r##"Deletes a device."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-devices-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the device. For example, + `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + `projects/p0/locations/us-central1/registries/registry0/devices/{num_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-registries-devices-get", + Some(r##"Gets details about a device."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-devices-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the device. For example, + `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + `projects/p0/locations/us-central1/registries/registry0/devices/{num_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-registries-devices-list", + Some(r##"List devices in a device registry."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-devices-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The device registry path. Required. For example, + `projects/my-project/locations/us-central1/registries/my-registry`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-registries-devices-modify-cloud-to-device-config", + Some(r##"Modifies the configuration for the device, which is eventually sent from + the Cloud IoT Core servers. Returns the modified configuration version and + its metadata."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-devices-modify-cloud-to-device-config", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the device. For example, + `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + `projects/p0/locations/us-central1/registries/registry0/devices/{num_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-registries-devices-patch", + Some(r##"Updates a device."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-devices-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource path name. For example, + `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or + `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. + When `name` is populated as a response from the service, it always ends + in the device numeric 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-registries-devices-states-list", + Some(r##"Lists the last few versions of the device state in descending order (i.e.: + newest first)."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-devices-states-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the device. For example, + `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + `projects/p0/locations/us-central1/registries/registry0/devices/{num_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-registries-get", + Some(r##"Gets a device registry configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the device registry. For example, + `projects/example-project/locations/us-central1/registries/my-registry`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-registries-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_cloudiot1_cli/projects_locations-registries-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-registries-list", + Some(r##"Lists device registries."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The project and cloud region path. For example, + `projects/example-project/locations/us-central1`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-registries-patch", + Some(r##"Updates a device registry configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudiot1_cli/projects_locations-registries-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource path name. For example, + `projects/example-project/locations/us-central1/registries/my-registry`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-registries-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_cloudiot1_cli/projects_locations-registries-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-registries-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_cloudiot1_cli/projects_locations-registries-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("cloudiot1") + .author("Sebastian Thiel ") + .version("1.0.6+20171204") + .about("Registers and manages IoT (Internet of Things) devices that connect to the Google Cloud Platform. + ") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudiot1_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/cloudiot1/Cargo.toml b/gen/cloudiot1/Cargo.toml new file mode 100644 index 0000000000..1e5dc49913 --- /dev/null +++ b/gen/cloudiot1/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-cloudiot1" +version = "1.0.6+20171204" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud Iot (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudiot1" +homepage = "https://cloud.google.com/iot" +documentation = "https://docs.rs/google-cloudiot1/1.0.6+20171204" +license = "MIT" +keywords = ["cloudiot", "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/cloudiot1/LICENSE.md b/gen/cloudiot1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/cloudiot1/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/cloudiot1/README.md b/gen/cloudiot1/README.md new file mode 100644 index 0000000000..ce78ac10cb --- /dev/null +++ b/gen/cloudiot1/README.md @@ -0,0 +1,183 @@ + +The `google-cloudiot1` library allows access to all features of the *Google Cloud Iot* service. + +This documentation was generated from *Cloud Iot* crate version *1.0.6+20171204*, where *20171204* is the exact revision of the *cloudiot:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Cloud Iot* *v1* API can be found at the +[official documentation site](https://cloud.google.com/iot). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.CloudIot.html) ... + +* projects + * [*locations registries create*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryCreateCall.html), [*locations registries delete*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryDeleteCall.html), [*locations registries devices config versions list*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryDeviceConfigVersionListCall.html), [*locations registries devices create*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryDeviceCreateCall.html), [*locations registries devices delete*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryDeviceDeleteCall.html), [*locations registries devices get*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryDeviceGetCall.html), [*locations registries devices list*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryDeviceListCall.html), [*locations registries devices modify cloud to device config*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall.html), [*locations registries devices patch*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryDevicePatchCall.html), [*locations registries devices states list*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryDeviceStateListCall.html), [*locations registries get*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryGetCall.html), [*locations registries get iam policy*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryGetIamPolicyCall.html), [*locations registries list*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryListCall.html), [*locations registries patch*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryPatchCall.html), [*locations registries set iam policy*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistrySetIamPolicyCall.html) and [*locations registries test iam permissions*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.ProjectLocationRegistryTestIamPermissionCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/struct.CloudIot.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/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_registries_devices_create(...).doit() +let r = hub.projects().locations_registries_devices_patch(...).doit() +let r = hub.projects().locations_registries_devices_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-cloudiot1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_cloudiot1 as cloudiot1; +use cloudiot1::Device; +use cloudiot1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use cloudiot1::CloudIot; + +// 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 = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +// As the method needs a request, you would usually fill it with the desired information +// into the 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.projects().locations_registries_devices_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-cloudiot1/1.0.6+20171204/google_cloudiot1/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-cloudiot1/1.0.6+20171204/google_cloudiot1/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-cloudiot1/1.0.6+20171204/google_cloudiot1/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-cloudiot1/1.0.6+20171204/google_cloudiot1/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-cloudiot1/1.0.6+20171204/google_cloudiot1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/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-cloudiot1/1.0.6+20171204/google_cloudiot1/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-cloudiot1/1.0.6+20171204/google_cloudiot1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudiot1/1.0.6+20171204/google_cloudiot1/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-cloudiot1/1.0.6+20171204/google_cloudiot1/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-cloudiot1/1.0.6+20171204/google_cloudiot1/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-cloudiot1/1.0.6+20171204/google_cloudiot1/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 **cloudiot1** 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/cloudiot1/src/cmn.rs b/gen/cloudiot1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/cloudiot1/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/cloudiot1/src/lib.rs b/gen/cloudiot1/src/lib.rs new file mode 100644 index 0000000000..cdf919bbc7 --- /dev/null +++ b/gen/cloudiot1/src/lib.rs @@ -0,0 +1,6192 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Cloud Iot* crate version *1.0.6+20171204*, where *20171204* is the exact revision of the *cloudiot:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Cloud Iot* *v1* API can be found at the +//! [official documentation site](https://cloud.google.com/iot). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudiot1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.CloudIot.html) ... +//! +//! * projects +//! * [*locations registries create*](struct.ProjectLocationRegistryCreateCall.html), [*locations registries delete*](struct.ProjectLocationRegistryDeleteCall.html), [*locations registries devices config versions list*](struct.ProjectLocationRegistryDeviceConfigVersionListCall.html), [*locations registries devices create*](struct.ProjectLocationRegistryDeviceCreateCall.html), [*locations registries devices delete*](struct.ProjectLocationRegistryDeviceDeleteCall.html), [*locations registries devices get*](struct.ProjectLocationRegistryDeviceGetCall.html), [*locations registries devices list*](struct.ProjectLocationRegistryDeviceListCall.html), [*locations registries devices modify cloud to device config*](struct.ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall.html), [*locations registries devices patch*](struct.ProjectLocationRegistryDevicePatchCall.html), [*locations registries devices states list*](struct.ProjectLocationRegistryDeviceStateListCall.html), [*locations registries get*](struct.ProjectLocationRegistryGetCall.html), [*locations registries get iam policy*](struct.ProjectLocationRegistryGetIamPolicyCall.html), [*locations registries list*](struct.ProjectLocationRegistryListCall.html), [*locations registries patch*](struct.ProjectLocationRegistryPatchCall.html), [*locations registries set iam policy*](struct.ProjectLocationRegistrySetIamPolicyCall.html) and [*locations registries test iam permissions*](struct.ProjectLocationRegistryTestIamPermissionCall.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.CloudIot.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_registries_devices_create(...).doit() +//! let r = hub.projects().locations_registries_devices_patch(...).doit() +//! let r = hub.projects().locations_registries_devices_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-cloudiot1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_cloudiot1 as cloudiot1; +//! use cloudiot1::Device; +//! use cloudiot1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use cloudiot1::CloudIot; +//! +//! // 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 = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +//! // As the method needs a request, you would usually fill it with the desired information +//! // into the 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.projects().locations_registries_devices_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 { + /// Register and manage devices in the Google Cloud IoT service + Full, + + /// View and manage your data across Google Cloud Platform services + CloudPlatform, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::Full => "https://www.googleapis.com/auth/cloudiot", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Full + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all CloudIot 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_cloudiot1 as cloudiot1; +/// use cloudiot1::Device; +/// use cloudiot1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudiot1::CloudIot; +/// +/// // 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 = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the 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.projects().locations_registries_devices_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 CloudIot { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for CloudIot {} + +impl<'a, C, A> CloudIot + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> CloudIot { + CloudIot { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://cloudiot.googleapis.com/".to_string(), + _root_url: "https://cloudiot.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://cloudiot.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://cloudiot.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 configuration to forward telemetry events. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EventNotificationConfig { + /// A Cloud Pub/Sub topic name. For example, + /// `projects/myProject/topics/deviceEvents`. + #[serde(rename="pubsubTopicName")] + pub pubsub_topic_name: Option, +} + +impl Part for EventNotificationConfig {} + + +/// Response for `ListDeviceStates`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 registries devices states list projects](struct.ProjectLocationRegistryDeviceStateListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDeviceStatesResponse { + /// The last few device states. States are listed in descending order of server + /// update time, starting from the most recent one. + #[serde(rename="deviceStates")] + pub device_states: Option>, +} + +impl ResponseResult for ListDeviceStatesResponse {} + + +/// 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 registries get iam policy projects](struct.ProjectLocationRegistryGetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetIamPolicyRequest { _never_set: Option } + +impl RequestValue for GetIamPolicyRequest {} + + +/// 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 registries test iam permissions projects](struct.ProjectLocationRegistryTestIamPermissionCall.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 registries set iam policy projects](struct.ProjectLocationRegistrySetIamPolicyCall.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 server-stored registry credential used to validate device credentials. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegistryCredential { + /// A public key certificate used to verify the device credentials. + #[serde(rename="publicKeyCertificate")] + pub public_key_certificate: Option, +} + +impl Part for RegistryCredential {} + + +/// 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 {} + + +/// 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 {} + + +/// The configuration of MQTT for a device registry. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MqttConfig { + /// If enabled, allows connections using the MQTT protocol. Otherwise, MQTT + /// connections to this registry will fail. + #[serde(rename="mqttEnabledState")] + pub mqtt_enabled_state: Option, +} + +impl Part for MqttConfig {} + + +/// The device configuration. Eventually delivered to 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*). +/// +/// * [locations registries devices modify cloud to device config projects](struct.ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeviceConfig { + /// [Output only] The version of this update. The version number is assigned by + /// the server, and is always greater than 0 after device creation. The + /// version must be 0 on the `CreateDevice` request if a `config` is + /// specified; the response of `CreateDevice` will always have a value of 1. + pub version: Option, + /// [Output only] The time at which this configuration version was updated in + /// Cloud IoT Core. This timestamp is set by the server. + #[serde(rename="cloudUpdateTime")] + pub cloud_update_time: Option, + /// The device configuration data. + #[serde(rename="binaryData")] + pub binary_data: Option, + /// [Output only] The time at which Cloud IoT Core received the + /// acknowledgment from the device, indicating that the device has received + /// this configuration version. If this field is not present, the device has + /// not yet acknowledged that it received this version. Note that when + /// the config was sent to the device, many config versions may have been + /// available in Cloud IoT Core while the device was disconnected, and on + /// connection, only the latest version is sent to the device. Some + /// versions may never be sent to the device, and therefore are never + /// acknowledged. This timestamp is set by Cloud IoT Core. + #[serde(rename="deviceAckTime")] + pub device_ack_time: Option, +} + +impl ResponseResult for DeviceConfig {} + + +/// Response for `ListDeviceRegistries`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 registries list projects](struct.ProjectLocationRegistryListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDeviceRegistriesResponse { + /// If not empty, indicates that there may be more registries that match the + /// request; this value should be passed in a new + /// `ListDeviceRegistriesRequest`. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The registries that matched the query. + #[serde(rename="deviceRegistries")] + pub device_registries: Option>, +} + +impl ResponseResult for ListDeviceRegistriesResponse {} + + +/// Response for `ListDevices`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 registries devices list projects](struct.ProjectLocationRegistryDeviceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDevicesResponse { + /// If not empty, indicates that there may be more devices that match the + /// request; this value should be passed in a new `ListDevicesRequest`. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The devices that match the request. + pub devices: Option>, +} + +impl ResponseResult for ListDevicesResponse {} + + +/// 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 registries get iam policy projects](struct.ProjectLocationRegistryGetIamPolicyCall.html) (response) +/// * [locations registries set iam policy projects](struct.ProjectLocationRegistrySetIamPolicyCall.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 {} + + +/// The device state, as reported by 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 DeviceState { + /// [Output only] The time at which this state version was updated in Cloud + /// IoT Core. + #[serde(rename="updateTime")] + pub update_time: Option, + /// The device state data. + #[serde(rename="binaryData")] + pub binary_data: Option, +} + +impl Part for DeviceState {} + + +/// Details of an X.509 certificate. For informational purposes 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 X509CertificateDetails { + /// The time the certificate becomes valid. + #[serde(rename="startTime")] + pub start_time: Option, + /// The algorithm used to sign the certificate. + #[serde(rename="signatureAlgorithm")] + pub signature_algorithm: Option, + /// The entity the certificate and public key belong to. + pub subject: Option, + /// The time the certificate becomes invalid. + #[serde(rename="expiryTime")] + pub expiry_time: Option, + /// The type of public key in the certificate. + #[serde(rename="publicKeyType")] + pub public_key_type: Option, + /// The entity that signed the certificate. + pub issuer: Option, +} + +impl Part for X509CertificateDetails {} + + +/// 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 public key certificate format and 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 PublicKeyCertificate { + /// [Output only] The certificate details. Used only for X.509 certificates. + #[serde(rename="x509Details")] + pub x509_details: Option, + /// The certificate data. + pub certificate: Option, + /// The certificate format. + pub format: Option, +} + +impl Part for PublicKeyCertificate {} + + +/// 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 registries test iam permissions projects](struct.ProjectLocationRegistryTestIamPermissionCall.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 {} + + +/// A container for a group of 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*). +/// +/// * [locations registries patch projects](struct.ProjectLocationRegistryPatchCall.html) (request|response) +/// * [locations registries create projects](struct.ProjectLocationRegistryCreateCall.html) (request|response) +/// * [locations registries get projects](struct.ProjectLocationRegistryGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeviceRegistry { + /// The DeviceService (HTTP) configuration for this device registry. + #[serde(rename="httpConfig")] + pub http_config: Option, + /// The configuration for notification of telemetry events received from the + /// device. All telemetry events that were successfully published by the + /// device and acknowledged by Cloud IoT Core are guaranteed to be + /// delivered to Cloud Pub/Sub. Only the first configuration is used. If you + /// try to publish a device telemetry event using MQTT without specifying a + /// Cloud Pub/Sub topic for the device's registry, the connection closes + /// automatically. If you try to do so using an HTTP connection, an error + /// is returned. + #[serde(rename="eventNotificationConfigs")] + pub event_notification_configs: Option>, + /// The resource path name. For example, + /// `projects/example-project/locations/us-central1/registries/my-registry`. + pub name: Option, + /// The configuration for notification of new states received from the device. + /// State updates are guaranteed to be stored in the state history, but + /// notifications to Cloud Pub/Sub are not guaranteed. For example, if + /// permissions are misconfigured or the specified topic doesn't exist, no + /// notification will be published but the state will still be stored in Cloud + /// IoT Core. + #[serde(rename="stateNotificationConfig")] + pub state_notification_config: Option, + /// The credentials used to verify the device credentials. No more than 10 + /// credentials can be bound to a single registry at a time. The verification + /// process occurs at the time of device creation or update. If this field is + /// empty, no verification is performed. Otherwise, the credentials of a newly + /// created device or added credentials of an updated device should be signed + /// with one of these registry credentials. + /// + /// Note, however, that existing devices will never be affected by + /// modifications to this list of credentials: after a device has been + /// successfully created in a registry, it should be able to connect even if + /// its registry credentials are revoked, deleted, or modified. + pub credentials: Option>, + /// The identifier of this device registry. For example, `myRegistry`. + pub id: Option, + /// The MQTT configuration for this device registry. + #[serde(rename="mqttConfig")] + pub mqtt_config: Option, +} + +impl RequestValue for DeviceRegistry {} +impl ResponseResult for DeviceRegistry {} + + +/// Response for `ListDeviceConfigVersions`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 registries devices config versions list projects](struct.ProjectLocationRegistryDeviceConfigVersionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDeviceConfigVersionsResponse { + /// The device configuration for the last few versions. Versions are listed + /// in decreasing order, starting from the most recent one. + #[serde(rename="deviceConfigs")] + pub device_configs: Option>, +} + +impl ResponseResult for ListDeviceConfigVersionsResponse {} + + +/// The configuration for notification of new states received from 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 StateNotificationConfig { + /// A Cloud Pub/Sub topic name. For example, + /// `projects/myProject/topics/deviceEvents`. + #[serde(rename="pubsubTopicName")] + pub pubsub_topic_name: Option, +} + +impl Part for StateNotificationConfig {} + + +/// A public key format and 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 PublicKeyCredential { + /// The key data. + pub key: Option, + /// The format of the key. + pub format: Option, +} + +impl Part for PublicKeyCredential {} + + +/// A server-stored device credential used for authentication. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeviceCredential { + /// A public key used to verify the signature of JSON Web Tokens (JWTs). + /// When adding a new device credential, either via device creation or via + /// modifications, this public key credential may be required to be signed by + /// one of the registry level certificates. More specifically, if the + /// registry contains at least one certificate, any new device credential + /// must be signed by one of the registry certificates. As a result, + /// when the registry contains certificates, only X.509 certificates are + /// accepted as device credentials. However, if the registry does + /// not contain a certificate, self-signed certificates and public keys will + /// be accepted. New device credentials must be different from every + /// registry-level certificate. + #[serde(rename="publicKey")] + pub public_key: Option, + /// [Optional] The time at which this credential becomes invalid. This + /// credential will be ignored for new client authentication requests after + /// this timestamp; however, it will not be automatically deleted. + #[serde(rename="expirationTime")] + pub expiration_time: Option, +} + +impl Part for DeviceCredential {} + + +/// The configuration of the HTTP bridge for a device registry. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpConfig { + /// If enabled, allows devices to use DeviceService via the HTTP protocol. + /// Otherwise, any requests to DeviceService will fail for this registry. + #[serde(rename="httpEnabledState")] + pub http_enabled_state: Option, +} + +impl Part for HttpConfig {} + + +/// 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 {} + + +/// 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 {} + + +/// 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 registries devices delete projects](struct.ProjectLocationRegistryDeviceDeleteCall.html) (response) +/// * [locations registries delete projects](struct.ProjectLocationRegistryDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// The device 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*). +/// +/// * [locations registries devices create projects](struct.ProjectLocationRegistryDeviceCreateCall.html) (request|response) +/// * [locations registries devices patch projects](struct.ProjectLocationRegistryDevicePatchCall.html) (request|response) +/// * [locations registries devices get projects](struct.ProjectLocationRegistryDeviceGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Device { + /// [Output only] The last time a state event was received. Timestamps are + /// periodically collected and written to storage; they may be stale by a few + /// minutes. + #[serde(rename="lastStateTime")] + pub last_state_time: Option, + /// The resource path name. For example, + /// `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or + /// `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. + /// When `name` is populated as a response from the service, it always ends + /// in the device numeric ID. + pub name: Option, + /// [Output only] The last time a telemetry event was received. Timestamps are + /// periodically collected and written to storage; they may be stale by a few + /// minutes. + #[serde(rename="lastEventTime")] + pub last_event_time: Option, + /// [Output only] The time the most recent error occurred, such as a failure to + /// publish to Cloud Pub/Sub. This field is the timestamp of + /// 'last_error_status'. + #[serde(rename="lastErrorTime")] + pub last_error_time: Option, + /// [Output only] A server-defined unique numeric ID for the device. This is a + /// more compact way to identify devices, and it is globally unique. + #[serde(rename="numId")] + pub num_id: Option, + /// [Output only] The state most recently received from the device. If no state + /// has been reported, this field is not present. + pub state: Option, + /// [Output only] The last time a cloud-to-device config version acknowledgment + /// was received from the device. This field is only for configurations + /// sent through MQTT. + #[serde(rename="lastConfigAckTime")] + pub last_config_ack_time: Option, + /// The metadata key-value pairs assigned to the device. This metadata is not + /// interpreted or indexed by Cloud IoT Core. It can be used to add contextual + /// information for the device. + /// + /// Keys must conform to the regular expression [a-zA-Z0-9-_]+ and be less than + /// 128 bytes in length. + /// + /// Values are free-form strings. Each value must be less than or equal to 32 + /// KB in size. + /// + /// The total size of all keys and values must be less than 256 KB, and the + /// maximum number of key-value pairs is 500. + pub metadata: Option>, + /// [Output only] The last time a heartbeat was received. Timestamps are + /// periodically collected and written to storage; they may be stale by a few + /// minutes. This field is only for devices connecting through MQTT. + #[serde(rename="lastHeartbeatTime")] + pub last_heartbeat_time: Option, + /// [Output only] The error message of the most recent error, such as a failure + /// to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this + /// field. If no errors have occurred, this field has an empty message + /// and the status code 0 == OK. Otherwise, this field is expected to have a + /// status code other than OK. + #[serde(rename="lastErrorStatus")] + pub last_error_status: Option, + /// The credentials used to authenticate this device. To allow credential + /// rotation without interruption, multiple device credentials can be bound to + /// this device. No more than 3 credentials can be bound to a single device at + /// a time. When new credentials are added to a device, they are verified + /// against the registry credentials. For details, see the description of the + /// `DeviceRegistry.credentials` field. + pub credentials: Option>, + /// If a device is blocked, connections or requests from this device will fail. + /// Can be used to temporarily prevent the device from connecting if, for + /// example, the sensor is generating bad data and needs maintenance. + pub blocked: Option, + /// The most recent device configuration, which is eventually sent from + /// Cloud IoT Core to the device. If not present on creation, the + /// configuration will be initialized with an empty payload and version value + /// of `1`. To update this field after creation, use the + /// `DeviceManager.ModifyCloudToDeviceConfig` method. + pub config: Option, + /// The user-defined device identifier. The device ID must be unique + /// within a device registry. + pub id: Option, + /// [Output only] The last time a cloud-to-device config version was sent to + /// the device. + #[serde(rename="lastConfigSendTime")] + pub last_config_send_time: Option, +} + +impl RequestValue for Device {} +impl ResponseResult for Device {} + + +/// Request for `ModifyCloudToDeviceConfig`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 registries devices modify cloud to device config projects](struct.ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ModifyCloudToDeviceConfigRequest { + /// The version number to update. If this value is zero, it will not check the + /// version number of the server and will always update the current version; + /// otherwise, this update will fail if the version number found on the server + /// does not match this version number. This is used to support multiple + /// simultaneous updates without losing data. + #[serde(rename="versionToUpdate")] + pub version_to_update: Option, + /// The configuration data for the device. + #[serde(rename="binaryData")] + pub binary_data: Option, +} + +impl RequestValue for ModifyCloudToDeviceConfigRequest {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `CloudIot` 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_cloudiot1 as cloudiot1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudiot1::CloudIot; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudIot::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_registries_create(...)`, `locations_registries_delete(...)`, `locations_registries_devices_config_versions_list(...)`, `locations_registries_devices_create(...)`, `locations_registries_devices_delete(...)`, `locations_registries_devices_get(...)`, `locations_registries_devices_list(...)`, `locations_registries_devices_modify_cloud_to_device_config(...)`, `locations_registries_devices_patch(...)`, `locations_registries_devices_states_list(...)`, `locations_registries_get(...)`, `locations_registries_get_iam_policy(...)`, `locations_registries_list(...)`, `locations_registries_patch(...)`, `locations_registries_set_iam_policy(...)` and `locations_registries_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 CloudIot, +} + +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: + /// + /// List devices in a device registry. + /// + /// # Arguments + /// + /// * `parent` - The device registry path. Required. For example, + /// `projects/my-project/locations/us-central1/registries/my-registry`. + pub fn locations_registries_devices_list(&self, parent: &str) -> ProjectLocationRegistryDeviceListCall<'a, C, A> { + ProjectLocationRegistryDeviceListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _field_mask: Default::default(), + _device_num_ids: Default::default(), + _device_ids: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the last few versions of the device configuration in descending + /// order (i.e.: newest first). + /// + /// # Arguments + /// + /// * `name` - The name of the device. For example, + /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + pub fn locations_registries_devices_config_versions_list(&self, name: &str) -> ProjectLocationRegistryDeviceConfigVersionListCall<'a, C, A> { + ProjectLocationRegistryDeviceConfigVersionListCall { + hub: self.hub, + _name: name.to_string(), + _num_versions: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a device registry configuration. + /// + /// # Arguments + /// + /// * `name` - The name of the device registry. For example, + /// `projects/example-project/locations/us-central1/registries/my-registry`. + pub fn locations_registries_delete(&self, name: &str) -> ProjectLocationRegistryDeleteCall<'a, C, A> { + ProjectLocationRegistryDeleteCall { + 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 a device registry configuration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource path name. For example, + /// `projects/example-project/locations/us-central1/registries/my-registry`. + pub fn locations_registries_patch(&self, request: DeviceRegistry, name: &str) -> ProjectLocationRegistryPatchCall<'a, C, A> { + ProjectLocationRegistryPatchCall { + 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 device registries. + /// + /// # Arguments + /// + /// * `parent` - The project and cloud region path. For example, + /// `projects/example-project/locations/us-central1`. + pub fn locations_registries_list(&self, parent: &str) -> ProjectLocationRegistryListCall<'a, C, A> { + ProjectLocationRegistryListCall { + 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 device registry that contains devices. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The project and cloud region where this device registry must be created. + /// For example, `projects/example-project/locations/us-central1`. + pub fn locations_registries_create(&self, request: DeviceRegistry, parent: &str) -> ProjectLocationRegistryCreateCall<'a, C, A> { + ProjectLocationRegistryCreateCall { + 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 device in a device registry. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the device registry where this device should be created. + /// For example, + /// `projects/example-project/locations/us-central1/registries/my-registry`. + pub fn locations_registries_devices_create(&self, request: Device, parent: &str) -> ProjectLocationRegistryDeviceCreateCall<'a, C, A> { + ProjectLocationRegistryDeviceCreateCall { + 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: + /// + /// Modifies the configuration for the device, which is eventually sent from + /// the Cloud IoT Core servers. Returns the modified configuration version and + /// its metadata. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the device. For example, + /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + pub fn locations_registries_devices_modify_cloud_to_device_config(&self, request: ModifyCloudToDeviceConfigRequest, name: &str) -> ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'a, C, A> { + ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall { + 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 + /// + /// * `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_registries_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectLocationRegistryGetIamPolicyCall<'a, C, A> { + ProjectLocationRegistryGetIamPolicyCall { + 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 device. + /// + /// # Arguments + /// + /// * `name` - The name of the device. For example, + /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + pub fn locations_registries_devices_delete(&self, name: &str) -> ProjectLocationRegistryDeviceDeleteCall<'a, C, A> { + ProjectLocationRegistryDeviceDeleteCall { + 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_registries_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationRegistrySetIamPolicyCall<'a, C, A> { + ProjectLocationRegistrySetIamPolicyCall { + 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 details about a device. + /// + /// # Arguments + /// + /// * `name` - The name of the device. For example, + /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + pub fn locations_registries_devices_get(&self, name: &str) -> ProjectLocationRegistryDeviceGetCall<'a, C, A> { + ProjectLocationRegistryDeviceGetCall { + hub: self.hub, + _name: name.to_string(), + _field_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 last few versions of the device state in descending order (i.e.: + /// newest first). + /// + /// # Arguments + /// + /// * `name` - The name of the device. For example, + /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + pub fn locations_registries_devices_states_list(&self, name: &str) -> ProjectLocationRegistryDeviceStateListCall<'a, C, A> { + ProjectLocationRegistryDeviceStateListCall { + hub: self.hub, + _name: name.to_string(), + _num_states: 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 registry configuration. + /// + /// # Arguments + /// + /// * `name` - The name of the device registry. For example, + /// `projects/example-project/locations/us-central1/registries/my-registry`. + pub fn locations_registries_get(&self, name: &str) -> ProjectLocationRegistryGetCall<'a, C, A> { + ProjectLocationRegistryGetCall { + 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 locations_registries_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationRegistryTestIamPermissionCall<'a, C, A> { + ProjectLocationRegistryTestIamPermissionCall { + 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 device. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource path name. For example, + /// `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or + /// `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. + /// When `name` is populated as a response from the service, it always ends + /// in the device numeric ID. + pub fn locations_registries_devices_patch(&self, request: Device, name: &str) -> ProjectLocationRegistryDevicePatchCall<'a, C, A> { + ProjectLocationRegistryDevicePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// List devices in a device registry. +/// +/// A builder for the *locations.registries.devices.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_cloudiot1 as cloudiot1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_registries_devices_list("parent") +/// .page_token("accusam") +/// .page_size(-8) +/// .field_mask("justo") +/// .add_device_num_ids("amet.") +/// .add_device_ids("erat") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryDeviceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _parent: String, + _page_token: Option, + _page_size: Option, + _field_mask: Option, + _device_num_ids: Vec, + _device_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryDeviceListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryDeviceListCall<'a, C, 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: "cloudiot.projects.locations.registries.devices.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._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._field_mask { + params.push(("fieldMask", value.to_string())); + } + if self._device_num_ids.len() > 0 { + for f in self._device_num_ids.iter() { + params.push(("deviceNumIds", f.to_string())); + } + } + if self._device_ids.len() > 0 { + for f in self._device_ids.iter() { + params.push(("deviceIds", f.to_string())); + } + } + for &field in ["alt", "parent", "pageToken", "pageSize", "fieldMask", "deviceNumIds", "deviceIds"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in 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::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 device registry path. Required. For example, + /// `projects/my-project/locations/us-central1/registries/my-registry`. + /// + /// 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) -> ProjectLocationRegistryDeviceListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The value returned by the last `ListDevicesResponse`; indicates + /// that this is a continuation of a prior `ListDevices` 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) -> ProjectLocationRegistryDeviceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of devices to return in the response. If this value + /// is zero, the service will select a default size. A call may return fewer + /// objects than requested, but if there is a non-empty `page_token`, it + /// indicates that more entries are available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationRegistryDeviceListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The fields of the `Device` resource to be returned in the response. The + /// fields `id`, and `num_id` are always returned by default, along with any + /// other fields specified. + /// + /// Sets the *field mask* query property to the given value. + pub fn field_mask(mut self, new_value: &str) -> ProjectLocationRegistryDeviceListCall<'a, C, A> { + self._field_mask = Some(new_value.to_string()); + self + } + /// A list of device numerical ids. If empty, it will ignore this field. This + /// field cannot hold more than 10,000 entries. + /// + /// Append the given value to the *device num ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_device_num_ids(mut self, new_value: &str) -> ProjectLocationRegistryDeviceListCall<'a, C, A> { + self._device_num_ids.push(new_value.to_string()); + self + } + /// A list of device string identifiers. If empty, it will ignore this field. + /// For example, `['device0', 'device12']`. This field cannot hold more than + /// 10,000 entries. + /// + /// Append the given value to the *device ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_device_ids(mut self, new_value: &str) -> ProjectLocationRegistryDeviceListCall<'a, C, A> { + self._device_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) -> ProjectLocationRegistryDeviceListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryDeviceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryDeviceListCall<'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 last few versions of the device configuration in descending +/// order (i.e.: newest first). +/// +/// A builder for the *locations.registries.devices.configVersions.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_cloudiot1 as cloudiot1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_registries_devices_config_versions_list("name") +/// .num_versions(-9) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryDeviceConfigVersionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _name: String, + _num_versions: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryDeviceConfigVersionListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryDeviceConfigVersionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListDeviceConfigVersionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudiot.projects.locations.registries.devices.configVersions.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 let Some(value) = self._num_versions { + params.push(("numVersions", value.to_string())); + } + for &field in ["alt", "name", "numVersions"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in 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}/configVersions"; + 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 device. For example, + /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_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) -> ProjectLocationRegistryDeviceConfigVersionListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The number of versions to list. Versions are listed in decreasing order of + /// the version number. The maximum number of versions retained is 10. If this + /// value is zero, it will return all the versions available. + /// + /// Sets the *num versions* query property to the given value. + pub fn num_versions(mut self, new_value: i32) -> ProjectLocationRegistryDeviceConfigVersionListCall<'a, C, A> { + self._num_versions = 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) -> ProjectLocationRegistryDeviceConfigVersionListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryDeviceConfigVersionListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryDeviceConfigVersionListCall<'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 registry configuration. +/// +/// A builder for the *locations.registries.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_cloudiot1 as cloudiot1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_registries_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryDeleteCall<'a, C, 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: "cloudiot.projects.locations.registries.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 device registry. For example, + /// `projects/example-project/locations/us-central1/registries/my-registry`. + /// + /// 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) -> ProjectLocationRegistryDeleteCall<'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) -> ProjectLocationRegistryDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryDeleteCall<'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 registry configuration. +/// +/// A builder for the *locations.registries.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_cloudiot1 as cloudiot1; +/// use cloudiot1::DeviceRegistry; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = DeviceRegistry::default(); +/// +/// // You can configure optional parameters by calling the 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_registries_patch(req, "name") +/// .update_mask("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _request: DeviceRegistry, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DeviceRegistry)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudiot.projects.locations.registries.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: DeviceRegistry) -> ProjectLocationRegistryPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource path name. For example, + /// `projects/example-project/locations/us-central1/registries/my-registry`. + /// + /// 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) -> ProjectLocationRegistryPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Only updates the `device_registry` fields indicated by this mask. + /// The field mask must not be empty, and it must not contain fields that + /// are immutable or only set by the server. + /// Mutable top-level fields: `event_notification_config`, `http_config`, + /// `mqtt_config`, and `state_notification_config`. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationRegistryPatchCall<'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) -> ProjectLocationRegistryPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryPatchCall<'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 device registries. +/// +/// A builder for the *locations.registries.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_cloudiot1 as cloudiot1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_registries_list("parent") +/// .page_token("aliquyam") +/// .page_size(-66) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListDeviceRegistriesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudiot.projects.locations.registries.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}/registries"; + 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 project and cloud region path. For example, + /// `projects/example-project/locations/us-central1`. + /// + /// 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) -> ProjectLocationRegistryListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The value returned by the last `ListDeviceRegistriesResponse`; indicates + /// that this is a continuation of a prior `ListDeviceRegistries` 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) -> ProjectLocationRegistryListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of registries to return in the response. If this value + /// is zero, the service will select a default size. A call may return fewer + /// objects than requested, but if there is a non-empty `page_token`, it + /// indicates that more entries are available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationRegistryListCall<'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) -> ProjectLocationRegistryListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryListCall<'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 device registry that contains devices. +/// +/// A builder for the *locations.registries.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_cloudiot1 as cloudiot1; +/// use cloudiot1::DeviceRegistry; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = DeviceRegistry::default(); +/// +/// // You can configure optional parameters by calling the 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_registries_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _request: DeviceRegistry, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DeviceRegistry)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudiot.projects.locations.registries.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}/registries"; + 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: DeviceRegistry) -> ProjectLocationRegistryCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The project and cloud region where this device registry must be created. + /// For example, `projects/example-project/locations/us-central1`. + /// + /// 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) -> ProjectLocationRegistryCreateCall<'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) -> ProjectLocationRegistryCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryCreateCall<'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 device in a device registry. +/// +/// A builder for the *locations.registries.devices.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_cloudiot1 as cloudiot1; +/// use cloudiot1::Device; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the 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.projects().locations_registries_devices_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryDeviceCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _request: Device, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryDeviceCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryDeviceCreateCall<'a, C, 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: "cloudiot.projects.locations.registries.devices.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}/devices"; + 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: Device) -> ProjectLocationRegistryDeviceCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the device registry where this device should be created. + /// For example, + /// `projects/example-project/locations/us-central1/registries/my-registry`. + /// + /// 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) -> ProjectLocationRegistryDeviceCreateCall<'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) -> ProjectLocationRegistryDeviceCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryDeviceCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryDeviceCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Modifies the configuration for the device, which is eventually sent from +/// the Cloud IoT Core servers. Returns the modified configuration version and +/// its metadata. +/// +/// A builder for the *locations.registries.devices.modifyCloudToDeviceConfig* 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_cloudiot1 as cloudiot1; +/// use cloudiot1::ModifyCloudToDeviceConfigRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ModifyCloudToDeviceConfigRequest::default(); +/// +/// // You can configure optional parameters by calling the 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_registries_devices_modify_cloud_to_device_config(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _request: ModifyCloudToDeviceConfigRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DeviceConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudiot.projects.locations.registries.devices.modifyCloudToDeviceConfig", + 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}:modifyCloudToDeviceConfig"; + 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: ModifyCloudToDeviceConfigRequest) -> ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the device. For example, + /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_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) -> ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'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) -> ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'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.registries.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_cloudiot1 as cloudiot1; +/// use cloudiot1::GetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the 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_registries_get_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _request: GetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryGetIamPolicyCall<'a, C, 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: "cloudiot.projects.locations.registries.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) -> ProjectLocationRegistryGetIamPolicyCall<'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) -> ProjectLocationRegistryGetIamPolicyCall<'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) -> ProjectLocationRegistryGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryGetIamPolicyCall<'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. +/// +/// A builder for the *locations.registries.devices.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_cloudiot1 as cloudiot1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_registries_devices_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryDeviceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryDeviceDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryDeviceDeleteCall<'a, C, 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: "cloudiot.projects.locations.registries.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::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 device. For example, + /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_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) -> ProjectLocationRegistryDeviceDeleteCall<'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) -> ProjectLocationRegistryDeviceDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryDeviceDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryDeviceDeleteCall<'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.registries.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_cloudiot1 as cloudiot1; +/// use cloudiot1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the 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_registries_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistrySetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistrySetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistrySetIamPolicyCall<'a, C, 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: "cloudiot.projects.locations.registries.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) -> ProjectLocationRegistrySetIamPolicyCall<'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) -> ProjectLocationRegistrySetIamPolicyCall<'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) -> ProjectLocationRegistrySetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistrySetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistrySetIamPolicyCall<'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 details about a device. +/// +/// A builder for the *locations.registries.devices.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_cloudiot1 as cloudiot1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_registries_devices_get("name") +/// .field_mask("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryDeviceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _name: String, + _field_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryDeviceGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryDeviceGetCall<'a, C, 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: "cloudiot.projects.locations.registries.devices.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._field_mask { + params.push(("fieldMask", value.to_string())); + } + for &field in ["alt", "name", "fieldMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in 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 device. For example, + /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_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) -> ProjectLocationRegistryDeviceGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The fields of the `Device` resource to be returned in the response. If the + /// field mask is unset or empty, all fields are returned. + /// + /// Sets the *field mask* query property to the given value. + pub fn field_mask(mut self, new_value: &str) -> ProjectLocationRegistryDeviceGetCall<'a, C, A> { + self._field_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) -> ProjectLocationRegistryDeviceGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryDeviceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryDeviceGetCall<'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 last few versions of the device state in descending order (i.e.: +/// newest first). +/// +/// A builder for the *locations.registries.devices.states.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_cloudiot1 as cloudiot1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_registries_devices_states_list("name") +/// .num_states(-70) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryDeviceStateListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _name: String, + _num_states: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryDeviceStateListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryDeviceStateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListDeviceStatesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudiot.projects.locations.registries.devices.states.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 let Some(value) = self._num_states { + params.push(("numStates", value.to_string())); + } + for &field in ["alt", "name", "numStates"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in 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}/states"; + 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 device. For example, + /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_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) -> ProjectLocationRegistryDeviceStateListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The number of states to list. States are listed in descending order of + /// update time. The maximum number of states retained is 10. If this + /// value is zero, it will return all the states available. + /// + /// Sets the *num states* query property to the given value. + pub fn num_states(mut self, new_value: i32) -> ProjectLocationRegistryDeviceStateListCall<'a, C, A> { + self._num_states = 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) -> ProjectLocationRegistryDeviceStateListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryDeviceStateListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryDeviceStateListCall<'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 registry configuration. +/// +/// A builder for the *locations.registries.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_cloudiot1 as cloudiot1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_registries_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DeviceRegistry)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudiot.projects.locations.registries.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 device registry. For example, + /// `projects/example-project/locations/us-central1/registries/my-registry`. + /// + /// 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) -> ProjectLocationRegistryGetCall<'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) -> ProjectLocationRegistryGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryGetCall<'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 *locations.registries.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_cloudiot1 as cloudiot1; +/// use cloudiot1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the 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_registries_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryTestIamPermissionCall<'a, C, 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: "cloudiot.projects.locations.registries.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) -> ProjectLocationRegistryTestIamPermissionCall<'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) -> ProjectLocationRegistryTestIamPermissionCall<'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) -> ProjectLocationRegistryTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryTestIamPermissionCall<'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 *locations.registries.devices.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_cloudiot1 as cloudiot1; +/// use cloudiot1::Device; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudiot1::CloudIot; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIot::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the 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.projects().locations_registries_devices_patch(req, "name") +/// .update_mask("eos") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRegistryDevicePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIot, + _request: Device, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRegistryDevicePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRegistryDevicePatchCall<'a, C, 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: "cloudiot.projects.locations.registries.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::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: Device) -> ProjectLocationRegistryDevicePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource path name. For example, + /// `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or + /// `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. + /// When `name` is populated as a response from the service, it always ends + /// in the device numeric 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) -> ProjectLocationRegistryDevicePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Only updates the `device` fields indicated by this mask. + /// The field mask must not be empty, and it must not contain fields that + /// are immutable or only set by the server. + /// Mutable top-level fields: `credentials`, `enabled_state`, and `metadata` + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationRegistryDevicePatchCall<'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) -> ProjectLocationRegistryDevicePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectLocationRegistryDevicePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRegistryDevicePatchCall<'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 index c8d46f384a..66a88f90a6 100644 --- a/gen/cloudkms1-cli/Cargo.toml +++ b/gen/cloudkms1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudkms1-cli" -version = "1.0.6+20170919" +version = "1.0.6+20171201" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-cloudkms1] path = "../cloudkms1" -version = "1.0.6+20170919" +version = "1.0.6+20171201" diff --git a/gen/cloudkms1-cli/README.md b/gen/cloudkms1-cli/README.md index eede77a603..f57f717be5 100644 --- a/gen/cloudkms1-cli/README.md +++ b/gen/cloudkms1-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 KMS* API at revision *20170919*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud KMS* API at revision *20171201*. The CLI is at version *1.0.6*. ```bash cloudkms1 [options] diff --git a/gen/cloudkms1-cli/mkdocs.yml b/gen/cloudkms1-cli/mkdocs.yml index 1c96382d1d..7d07437081 100644 --- a/gen/cloudkms1-cli/mkdocs.yml +++ b/gen/cloudkms1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud KMS v1.0.6+20170919 +site_name: Cloud KMS v1.0.6+20171201 site_url: http://byron.github.io/google-apis-rs/google-cloudkms1-cli site_description: A complete library to interact with Cloud KMS (protocol v1) diff --git a/gen/cloudkms1-cli/src/main.rs b/gen/cloudkms1-cli/src/main.rs index ab49da2a99..c804a43522 100644 --- a/gen/cloudkms1-cli/src/main.rs +++ b/gen/cloudkms1-cli/src/main.rs @@ -121,8 +121,8 @@ impl<'n> Engine<'n> { 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 })), + "create-time" => Some(("createTime", 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())))); @@ -1205,8 +1205,8 @@ impl<'n> Engine<'n> { 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.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, 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 })), _ => { @@ -1626,8 +1626,8 @@ impl<'n> Engine<'n> { 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.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, 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 })), _ => { @@ -2695,7 +2695,7 @@ fn main() { let mut app = App::new("cloudkms1") .author("Sebastian Thiel ") - .version("1.0.6+20170919") + .version("1.0.6+20171201") .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") diff --git a/gen/cloudkms1/Cargo.toml b/gen/cloudkms1/Cargo.toml index 14768f7939..9b75a233fd 100644 --- a/gen/cloudkms1/Cargo.toml +++ b/gen/cloudkms1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudkms1" -version = "1.0.6+20170919" +version = "1.0.6+20171201" 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" +documentation = "https://docs.rs/google-cloudkms1/1.0.6+20171201" license = "MIT" keywords = ["cloudkms", "google", "protocol", "web", "api"] diff --git a/gen/cloudkms1/README.md b/gen/cloudkms1/README.md index 61e1b588f3..a55d684673 100644 --- a/gen/cloudkms1/README.md +++ b/gen/cloudkms1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Cloud KMS* crate version *1.0.6+20171201*, where *20171201* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudkms1/1.0.6+20171201/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) + * [*locations get*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationGetCall.html), [*locations key rings create*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCreateCall.html), [*locations key rings crypto keys create*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCreateCall.html), [*locations key rings crypto keys crypto key versions create*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall.html), [*locations key rings crypto keys crypto key versions destroy*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html), [*locations key rings crypto keys crypto key versions get*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall.html), [*locations key rings crypto keys crypto key versions list*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall.html), [*locations key rings crypto keys crypto key versions patch*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall.html), [*locations key rings crypto keys crypto key versions restore*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html), [*locations key rings crypto keys decrypt*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html), [*locations key rings crypto keys encrypt*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html), [*locations key rings crypto keys get*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyGetCall.html), [*locations key rings crypto keys get iam policy*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyGetIamPolicyCall.html), [*locations key rings crypto keys list*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyListCall.html), [*locations key rings crypto keys patch*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyPatchCall.html), [*locations key rings crypto keys set iam policy*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html), [*locations key rings crypto keys test iam permissions*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.html), [*locations key rings crypto keys update primary version*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html), [*locations key rings get*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingGetCall.html), [*locations key rings get iam policy*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingGetIamPolicyCall.html), [*locations key rings list*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingListCall.html), [*locations key rings set iam policy*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingSetIamPolicyCall.html), [*locations key rings test iam permissions*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationKeyRingTestIamPermissionCall.html) and [*locations list*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/struct.ProjectLocationListCall.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-cloudkms1/1.0.6+20170919/google_cloudkms1/struct.CloudKMS.html)** +* **[Hub](https://docs.rs/google-cloudkms1/1.0.6+20171201/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)** + * creates [*Method Builders*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudkms1/1.0.6+20171201/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)** + * **[Parts](https://docs.rs/google-cloudkms1/1.0.6+20171201/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)** +* **[Activities](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/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-cloudkms1/1.0.6+20170919/google_cloudkms1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudkms1/1.0.6+20171201/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). +[Hub Delegate](https://docs.rs/google-cloudkms1/1.0.6+20171201/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudkms1/1.0.6+20171201/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. +If such a method also supports a [Response Result](https://docs.rs/google-cloudkms1/1.0.6+20171201/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudkms1/1.0.6+20171201/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. +The [delegate trait](https://docs.rs/google-cloudkms1/1.0.6+20171201/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudkms1/1.0.6+20171201/google_cloudkms1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudkms1/1.0.6+20171201/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 +Most optionals are are considered [Parts](https://docs.rs/google-cloudkms1/1.0.6+20171201/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. +Using [method builders](https://docs.rs/google-cloudkms1/1.0.6+20171201/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 +* [request values](https://docs.rs/google-cloudkms1/1.0.6+20171201/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. diff --git a/gen/cloudkms1/src/lib.rs b/gen/cloudkms1/src/lib.rs index 66adfc22df..faf789de2b 100644 --- a/gen/cloudkms1/src/lib.rs +++ b/gen/cloudkms1/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 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*. +//! This documentation was generated from *Cloud KMS* crate version *1.0.6+20171201*, where *20171201* 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/). @@ -383,12 +383,12 @@ pub struct ListCryptoKeysResponse { /// 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>, + /// The total number of CryptoKeys that matched the query. + #[serde(rename="totalSize")] + pub total_size: Option, } impl ResponseResult for ListCryptoKeysResponse {} @@ -517,12 +517,12 @@ impl RequestValue for SetIamPolicyRequest {} /// #[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, + /// Output only. The time at which this KeyRing was created. + #[serde(rename="createTime")] + pub create_time: Option, } impl RequestValue for KeyRing {} @@ -701,8 +701,6 @@ 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 @@ -714,6 +712,8 @@ 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, /// no description provided #[serde(rename="iamOwned")] pub iam_owned: Option, @@ -789,7 +789,8 @@ impl ResponseResult for ListCryptoKeyVersionsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CryptoKey { - /// Labels with user defined metadata. + /// Labels with user-defined metadata. For more information, see + /// [Labeling Keys](/kms/docs/labeling-keys). pub labels: Option>, /// Output only. The resource name for this CryptoKey in the format /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`. @@ -998,9 +999,10 @@ impl RequestValue for DecryptRequest {} /// #[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, + /// 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. /// @@ -1010,10 +1012,9 @@ pub struct Expr { /// 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, + /// 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 {} @@ -1922,12 +1923,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, 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. - /// * *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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> @@ -2220,12 +2221,12 @@ impl<'a, C, A> ProjectLocationKeyRingCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationKeyRingCreateCall<'a, C, A> @@ -2502,12 +2503,12 @@ impl<'a, C, A> ProjectLocationKeyRingListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationKeyRingListCall<'a, C, A> @@ -2797,12 +2798,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> @@ -3085,12 +3086,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> where C: Bor /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> @@ -3338,12 +3339,12 @@ impl<'a, C, A> ProjectLocationKeyRingGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationKeyRingGetCall<'a, C, A> @@ -3592,12 +3593,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyGetCall<'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. - /// * *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) -> ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> @@ -3881,12 +3882,12 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationListCall<'a, C, A> @@ -4172,12 +4173,12 @@ impl<'a, C, A> ProjectLocationKeyRingTestIamPermissionCall<'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. - /// * *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) -> ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> @@ -4428,12 +4429,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> where C /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> @@ -4712,12 +4713,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, 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. - /// * *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) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> @@ -5009,12 +5010,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyPatchCall<'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. - /// * *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) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> @@ -5294,12 +5295,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> where C: Bor /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> @@ -5550,12 +5551,12 @@ impl<'a, C, A> ProjectLocationKeyRingGetIamPolicyCall<'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. - /// * *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) -> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> @@ -5836,12 +5837,12 @@ impl<'a, C, A> ProjectLocationKeyRingSetIamPolicyCall<'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. - /// * *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) -> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> @@ -6089,12 +6090,12 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationGetCall<'a, C, A> @@ -6380,12 +6381,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> wh /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> @@ -6663,12 +6664,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, 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. - /// * *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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> @@ -6945,12 +6946,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> where C: Borrow /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> @@ -7234,12 +7235,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> @@ -7487,12 +7488,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, 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. - /// * *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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> @@ -7773,12 +7774,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> where C /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> @@ -8063,12 +8064,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> @@ -8363,12 +8364,12 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> where C: Borr /// * *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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> diff --git a/gen/cloudresourcemanager1-cli/Cargo.toml b/gen/cloudresourcemanager1-cli/Cargo.toml index d7776a946c..3f86f6c283 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+20170920" +version = "1.0.6+20171206" 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+20170920" +version = "1.0.6+20171206" diff --git a/gen/cloudresourcemanager1-cli/README.md b/gen/cloudresourcemanager1-cli/README.md index a6839aa5d4..a1617a5b7b 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 *20170920*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud Resource Manager* API at revision *20171206*. 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 5ee27d1f36..a2cb432e27 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+20170920 +site_name: Cloud Resource Manager v1.0.6+20171206 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 f1c393e54f..c09c405daf 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 })), - "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 })), + "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "project-number" => Some(("projectNumber", 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 })), - "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 })), + "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "project-number" => Some(("projectNumber", 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())))); @@ -4445,7 +4445,7 @@ fn main() { let mut app = App::new("cloudresourcemanager1") .author("Sebastian Thiel ") - .version("1.0.6+20170920") + .version("1.0.6+20171206") .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 4cbb6f071c..22ac9d86e0 100644 --- a/gen/cloudresourcemanager1/Cargo.toml +++ b/gen/cloudresourcemanager1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudresourcemanager1" -version = "1.0.6+20170920" +version = "1.0.6+20171206" 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+20170920" +documentation = "https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206" license = "MIT" keywords = ["cloudresourcemanager", "google", "protocol", "web", "api"] diff --git a/gen/cloudresourcemanager1/README.md b/gen/cloudresourcemanager1/README.md index ab73e1f7a7..609a4ca68e 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+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*. +This documentation was generated from *Cloud Resource Manager* crate version *1.0.6+20171206*, where *20171206* 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+20170920/google_cloudresourcemanager1/struct.CloudResourceManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.CloudResourceManager.html) ... * folders - * [*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) + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.FolderClearOrgPolicyCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.FolderGetEffectiveOrgPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.FolderGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.FolderListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.FolderListOrgPolicyCall.html) and [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.FolderSetOrgPolicyCall.html) +* [liens](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.Lien.html) + * [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.LienCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.LienDeleteCall.html) and [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.LienListCall.html) +* [operations](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.Operation.html) + * [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OperationGetCall.html) +* [organizations](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.Organization.html) + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OrganizationClearOrgPolicyCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OrganizationGetCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OrganizationGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OrganizationGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OrganizationGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OrganizationListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OrganizationListOrgPolicyCall.html), [*search*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OrganizationSearchCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OrganizationSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OrganizationSetOrgPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.OrganizationTestIamPermissionCall.html) +* [projects](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.Project.html) + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectClearOrgPolicyCall.html), [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectGetAncestryCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectGetOrgPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectListCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectListOrgPolicyCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectSetOrgPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/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+20170920/google_cloudresourcemanager1/struct.CloudResourceManager.html)** +* **[Hub](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/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+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)** + * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/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+20170920/google_cloudresourcemanager1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudresourcemanager1/1.0.6+20170920/google_cloudresourcemanager1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/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+20170920/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+20171206/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+20170920/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+20171206/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+20170920/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+20171206/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+20170920/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+20171206/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/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+20170920/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+20171206/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/google_cloudresourcemanager1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/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+20170920/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+20171206/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+20170920/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+20171206/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+20170920/google_cloudresourcemanager1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudresourcemanager1/1.0.6+20171206/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 3afa31a8e5..d1841bb9c3 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+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*. +//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.6+20171206*, where *20171206* 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,77 +450,44 @@ pub struct SetIamPolicyRequest { impl RequestValue for SetIamPolicyRequest {} -/// A Lien represents an encumbrance on the actions that can be performed 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*). -/// -/// * [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 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, -} - -impl RequestValue for Lien {} -impl Resource for Lien {} -impl ResponseResult for Lien {} - - -/// Ignores policies set above this resource and restores the -/// `constraint_default` enforcement behavior of the specific `Constraint` at -/// this resource. -/// -/// Suppose that `constraint_default` is set to `ALLOW` for the -/// `Constraint` `constraints/serviceuser.services`. Suppose that organization -/// foo.com sets a `Policy` at their Organization resource node that restricts -/// the allowed service activations to deny all service activations. They -/// could then set a `Policy` with the `policy_type` `restore_default` on -/// several experimental projects, restoring the `constraint_default` -/// enforcement of the `Constraint` for only those projects, allowing those -/// projects to have all services activated. +/// 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 RestoreDefault { _never_set: 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 RestoreDefault {} +impl Part for Binding {} /// Defines an Identity and Access Management (IAM) policy. It is used to @@ -724,20 +691,42 @@ pub struct TestIamPermissionsResponse { impl ResponseResult for TestIamPermissionsResponse {} -/// 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 response returned from the ListAvailableOrgPolicyConstraints method. @@ -766,6 +755,28 @@ 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, @@ -966,24 +977,64 @@ pub struct BooleanPolicy { impl Part for BooleanPolicy {} -/// Response from the GetAncestry method. +/// 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*). /// -/// * [get ancestry projects](struct.ProjectGetAncestryCall.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 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 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, + /// 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 GetAncestryResponse {} +impl ResponseResult for OrgPolicy {} /// The request sent to the SetOrgPolicyRequest method. @@ -1110,60 +1161,40 @@ pub struct Constraint { /// Mutable. #[serde(rename="displayName")] pub display_name: 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, /// Detailed description of what this `Constraint` controls as well as how and /// where it is enforced. /// /// Mutable. pub description: 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, } impl Part for Constraint {} -/// A `Constraint` that is either enforced or not. -/// -/// For example a constraint `constraints/compute.disableSerialPortAccess`. -/// If it is enforced on a VM instance, serial port connections will not be -/// opened to that instance. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BooleanConstraint { _never_set: Option } - -impl Part for BooleanConstraint {} - - -/// The request sent to the ClearOrgPolicy method. +/// 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*). /// -/// * [clear org policy folders](struct.FolderClearOrgPolicyCall.html) (request) -/// * [clear org policy organizations](struct.OrganizationClearOrgPolicyCall.html) (request) -/// * [clear org policy projects](struct.ProjectClearOrgPolicyCall.html) (request) +/// * [get ancestry projects](struct.ProjectGetAncestryCall.html) (response) /// #[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, +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 RequestValue for ClearOrgPolicyRequest {} +impl ResponseResult for GetAncestryResponse {} /// A Project is a high-level Google Cloud Platform entity. It is a @@ -1236,17 +1267,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. @@ -1276,6 +1307,29 @@ 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. /// @@ -1326,42 +1380,20 @@ impl Resource for Organization {} impl ResponseResult for Organization {} -/// 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 request sent to the GetOrgPolicy method. @@ -1455,66 +1487,56 @@ pub struct ListOrgPoliciesRequest { impl RequestValue for ListOrgPoliciesRequest {} -/// The response message for Liens.ListLiens. +/// A Lien represents an encumbrance on the actions that can be performed 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*). /// -/// * [list liens](struct.LienListCall.html) (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 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>, +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, } -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 {} +impl RequestValue for Lien {} +impl Resource for Lien {} +impl ResponseResult for Lien {} /// Specifies the audit configuration for a service. @@ -1586,32 +1608,6 @@ 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 @@ -1715,68 +1711,30 @@ pub struct GetEffectiveOrgPolicyRequest { impl RequestValue for GetEffectiveOrgPolicyRequest {} -/// Defines a Cloud Organization `Policy` which is used to specify `Constraints` -/// for configurations of Cloud Platform resources. +/// 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*). /// -/// * [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) +/// * [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 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 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 OrgPolicy {} +impl ResponseResult for ListOrgPoliciesResponse {} /// The entity that owns an Organization. The lifetime of the Organization and @@ -3118,12 +3076,12 @@ impl<'a, C, A> FolderClearOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> FolderClearOrgPolicyCall<'a, C, A> @@ -3404,12 +3362,12 @@ impl<'a, C, A> FolderGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> FolderGetEffectiveOrgPolicyCall<'a, C, A> @@ -3688,12 +3646,12 @@ impl<'a, C, A> FolderListAvailableOrgPolicyConstraintCall<'a, C, A> where C: Bor /// * *prettyPrint* (query-boolean) - Returns response 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) -> FolderListAvailableOrgPolicyConstraintCall<'a, C, A> @@ -3977,12 +3935,12 @@ impl<'a, C, A> FolderGetOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> FolderGetOrgPolicyCall<'a, C, A> @@ -4265,12 +4223,12 @@ impl<'a, C, A> FolderSetOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> FolderSetOrgPolicyCall<'a, C, A> @@ -4549,12 +4507,12 @@ impl<'a, C, A> FolderListOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> FolderListOrgPolicyCall<'a, C, A> @@ -4838,12 +4796,12 @@ impl<'a, C, A> OrganizationGetOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationGetOrgPolicyCall<'a, C, A> @@ -5122,12 +5080,12 @@ impl<'a, C, A> OrganizationListAvailableOrgPolicyConstraintCall<'a, C, A> where /// * *prettyPrint* (query-boolean) - Returns response 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) -> OrganizationListAvailableOrgPolicyConstraintCall<'a, C, A> @@ -5406,12 +5364,12 @@ impl<'a, C, A> OrganizationListOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationListOrgPolicyCall<'a, C, A> @@ -5696,12 +5654,12 @@ impl<'a, C, A> OrganizationSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSetIamPolicyCall<'a, C, A> @@ -5949,12 +5907,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. - /// * *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) -> OrganizationGetCall<'a, C, A> @@ -6235,12 +6193,12 @@ impl<'a, C, A> OrganizationGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMu /// * *prettyPrint* (query-boolean) - Returns response 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) -> OrganizationGetEffectiveOrgPolicyCall<'a, C, A> @@ -6488,12 +6446,12 @@ impl<'a, C, A> OrganizationSearchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSearchCall<'a, C, A> @@ -6778,12 +6736,12 @@ impl<'a, C, A> OrganizationGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationGetIamPolicyCall<'a, C, A> @@ -7067,12 +7025,12 @@ impl<'a, C, A> OrganizationTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationTestIamPermissionCall<'a, C, A> @@ -7355,12 +7313,12 @@ impl<'a, C, A> OrganizationSetOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSetOrgPolicyCall<'a, C, A> @@ -7639,12 +7597,12 @@ impl<'a, C, A> OrganizationClearOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationClearOrgPolicyCall<'a, C, A> @@ -7892,12 +7850,12 @@ impl<'a, C, A> LienCreateCall<'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. - /// * *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) -> LienCreateCall<'a, C, A> @@ -8149,12 +8107,12 @@ impl<'a, C, A> LienDeleteCall<'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. - /// * *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) -> LienDeleteCall<'a, C, A> @@ -8406,12 +8364,12 @@ impl<'a, C, A> LienListCall<'a, C, A> where C: BorrowMut, A: oaut /// * *prettyPrint* (query-boolean) - Returns response 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) -> LienListCall<'a, C, A> @@ -8680,12 +8638,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. - /// * *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) -> ProjectDeleteCall<'a, C, A> @@ -8965,12 +8923,12 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGetIamPolicyCall<'a, C, A> @@ -9223,12 +9181,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. - /// * *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) -> ProjectCreateCall<'a, C, A> @@ -9512,12 +9470,12 @@ impl<'a, C, A> ProjectGetOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGetOrgPolicyCall<'a, C, A> @@ -9800,12 +9758,12 @@ impl<'a, C, A> ProjectSetOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSetOrgPolicyCall<'a, C, A> @@ -10084,12 +10042,12 @@ impl<'a, C, A> ProjectClearOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectClearOrgPolicyCall<'a, C, A> @@ -10372,12 +10330,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. - /// * *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) -> ProjectUndeleteCall<'a, C, A> @@ -10656,12 +10614,12 @@ impl<'a, C, A> ProjectListOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectListOrgPolicyCall<'a, C, A> @@ -10939,12 +10897,12 @@ impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTestIamPermissionCall<'a, C, A> @@ -11223,12 +11181,12 @@ impl<'a, C, A> ProjectListAvailableOrgPolicyConstraintCall<'a, C, A> where C: Bo /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectListAvailableOrgPolicyConstraintCall<'a, C, A> @@ -11477,12 +11435,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. - /// * *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) -> ProjectGetCall<'a, C, A> @@ -11766,12 +11724,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. - /// * *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) -> ProjectListCall<'a, C, A> @@ -12052,12 +12010,12 @@ impl<'a, C, A> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> @@ -12337,12 +12295,12 @@ impl<'a, C, A> ProjectGetAncestryCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGetAncestryCall<'a, C, A> @@ -12622,12 +12580,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. - /// * *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) -> ProjectUpdateCall<'a, C, A> @@ -12944,12 +12902,12 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSetIamPolicyCall<'a, C, A> @@ -13199,12 +13157,12 @@ impl<'a, C, A> OperationGetCall<'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) -> OperationGetCall<'a, C, A> diff --git a/gen/cloudresourcemanager1_beta1-cli/Cargo.toml b/gen/cloudresourcemanager1_beta1-cli/Cargo.toml index c8a7b6cf3d..1eb4dcc875 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+20170920" +version = "1.0.6+20171206" 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+20170920" +version = "1.0.6+20171206" diff --git a/gen/cloudresourcemanager1_beta1-cli/README.md b/gen/cloudresourcemanager1_beta1-cli/README.md index 75803e9b6e..ef86d46487 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 *20170920*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud Resource Manager* API at revision *20171206*. 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 1425a88ce4..9fa0909fed 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+20170920 +site_name: Cloud Resource Manager v1.0.6+20171206 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 885a6b0bf7..7d3d5adc3c 100644 --- a/gen/cloudresourcemanager1_beta1-cli/src/main.rs +++ b/gen/cloudresourcemanager1_beta1-cli/src/main.rs @@ -1964,7 +1964,7 @@ fn main() { let mut app = App::new("cloudresourcemanager1-beta1") .author("Sebastian Thiel ") - .version("1.0.6+20170920") + .version("1.0.6+20171206") .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 d33641303a..7265d1f958 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+20170920" +version = "1.0.6+20171206" 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+20170920" +documentation = "https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206" license = "MIT" keywords = ["cloudresourcemanager", "google", "protocol", "web", "api"] diff --git a/gen/cloudresourcemanager1_beta1/README.md b/gen/cloudresourcemanager1_beta1/README.md index 51e26ffdc2..70090aba26 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+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*. +This documentation was generated from *Cloud Resource Manager* crate version *1.0.6+20171206*, where *20171206* 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+20170920/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+20171206/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.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) +* [organizations](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.Organization.html) + * [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.OrganizationGetCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.OrganizationGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.OrganizationListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.OrganizationSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.OrganizationTestIamPermissionCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.OrganizationUpdateCall.html) +* [projects](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.Project.html) + * [*create*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.ProjectGetAncestryCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.ProjectGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.ProjectListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.ProjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/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+20170920/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html)** +* **[Hub](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/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+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)** + * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/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+20170920/google_cloudresourcemanager1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/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+20170920/google_cloudresourcemanager1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/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+20170920/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+20171206/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+20170920/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+20171206/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+20170920/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+20171206/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+20170920/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+20171206/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/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+20170920/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+20171206/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/google_cloudresourcemanager1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/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+20170920/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+20171206/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+20170920/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+20171206/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+20170920/google_cloudresourcemanager1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.6+20171206/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 9459f9b4cd..bde08eedd2 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+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*. +//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.6+20171206*, where *20171206* 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). @@ -584,9 +584,9 @@ impl RequestValue for GetAncestryRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// 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>, /// `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 @@ -598,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, - /// Associates a list of `members` to a `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>, /// Version of the `Policy`. The default version is 0. pub version: Option, } diff --git a/gen/cloudtasks2_beta2-cli/Cargo.toml b/gen/cloudtasks2_beta2-cli/Cargo.toml index 0f9f7c5e30..6d55bbb420 100644 --- a/gen/cloudtasks2_beta2-cli/Cargo.toml +++ b/gen/cloudtasks2_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudtasks2_beta2-cli" -version = "1.0.6+20170926" +version = "1.0.6+20171208" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-cloudtasks2_beta2] path = "../cloudtasks2_beta2" -version = "1.0.6+20170926" +version = "1.0.6+20171208" diff --git a/gen/cloudtasks2_beta2-cli/README.md b/gen/cloudtasks2_beta2-cli/README.md index 1529623b25..70ab891858 100644 --- a/gen/cloudtasks2_beta2-cli/README.md +++ b/gen/cloudtasks2_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 *Cloud Tasks* API at revision *20170926*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud Tasks* API at revision *20171208*. The CLI is at version *1.0.6*. ```bash cloudtasks2-beta2 [options] diff --git a/gen/cloudtasks2_beta2-cli/mkdocs.yml b/gen/cloudtasks2_beta2-cli/mkdocs.yml index 1a027b2cd8..34bc9acd77 100644 --- a/gen/cloudtasks2_beta2-cli/mkdocs.yml +++ b/gen/cloudtasks2_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Tasks v1.0.6+20170926 +site_name: Cloud Tasks v1.0.6+20171208 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) diff --git a/gen/cloudtasks2_beta2-cli/src/main.rs b/gen/cloudtasks2_beta2-cli/src/main.rs index 781e471d2e..070a2c5408 100644 --- a/gen/cloudtasks2_beta2-cli/src/main.rs +++ b/gen/cloudtasks2_beta2-cli/src/main.rs @@ -184,27 +184,23 @@ impl<'n> Engine<'n> { 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 })), + "rate-limits.max-tasks-dispatched-per-second" => Some(("rateLimits.maxTasksDispatchedPerSecond", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "rate-limits.max-burst-size" => Some(("rateLimits.maxBurstSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "rate-limits.max-concurrent-tasks" => Some(("rateLimits.maxConcurrentTasks", JsonTypeInfo { jtype: JsonType::Int, 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 })), + "state" => Some(("state", 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.max-retry-duration" => Some(("retryConfig.maxRetryDuration", JsonTypeInfo { jtype: JsonType::String, 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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-http-target", "app-engine-routing-override", "host", "instance", "max-attempts", "max-backoff", "max-burst-size", "max-concurrent-tasks", "max-doublings", "max-retry-duration", "max-tasks-dispatched-per-second", "min-backoff", "name", "purge-time", "rate-limits", "retry-config", "service", "state", "unlimited-attempts", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -538,27 +534,23 @@ impl<'n> Engine<'n> { 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 })), + "rate-limits.max-tasks-dispatched-per-second" => Some(("rateLimits.maxTasksDispatchedPerSecond", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "rate-limits.max-burst-size" => Some(("rateLimits.maxBurstSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "rate-limits.max-concurrent-tasks" => Some(("rateLimits.maxConcurrentTasks", JsonTypeInfo { jtype: JsonType::Int, 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 })), + "state" => Some(("state", 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.max-retry-duration" => Some(("retryConfig.maxRetryDuration", JsonTypeInfo { jtype: JsonType::String, 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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-http-target", "app-engine-routing-override", "host", "instance", "max-attempts", "max-backoff", "max-burst-size", "max-concurrent-tasks", "max-doublings", "max-retry-duration", "max-tasks-dispatched-per-second", "min-backoff", "name", "purge-time", "rate-limits", "retry-config", "service", "state", "unlimited-attempts", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1179,20 +1171,10 @@ impl<'n> Engine<'n> { "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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-http-request", "app-engine-routing", "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", "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 } @@ -1538,9 +1520,9 @@ impl<'n> Engine<'n> { 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 })), + "lease-duration" => Some(("leaseDuration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["new-lease-duration", "response-view", "schedule-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["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 } @@ -1983,11 +1965,11 @@ fn main() { ("locations-queues-create", Some(r##"Creates a queue. - WARNING: This method is only available to whitelisted - users. Using this method carries some risk. Read + WARNING: Using this method may have unintended side effects if you are + using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + 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)."##), + carefully before using this method."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-create", vec![ (Some(r##"parent"##), @@ -2029,11 +2011,11 @@ fn main() { 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 + WARNING: Using this method may have unintended side effects if you are + using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + 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)."##), + carefully before using this method."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-delete", vec![ (Some(r##"name"##), @@ -2090,8 +2072,7 @@ fn main() { Authorization requires the following [Google IAM](/iam) permission on the specified resource parent: - * `cloudtasks.queues.getIamPolicy` - "##), + * `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"##), @@ -2152,11 +2133,11 @@ fn main() { 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 + WARNING: Using this method may have unintended side effects if you are + using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + 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)."##), + carefully before using this method."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-patch", vec![ (Some(r##"name"##), @@ -2166,13 +2147,16 @@ fn main() { 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. + * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + hyphens (-), colons (:), or periods (.). + For more information, see + [Identifying projects](/resource-manager/docs/creating-managing-projects#identifying_projects) + * `LOCATION_ID` is the canonical ID for the queue's location. + The list of available locations can be obtained by calling + google.cloud.location.Locations.ListLocations. + For more information, see https://cloud.google.com/about/locations/. + * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + hyphens (-). The maximum length is 100 characters. Caller-specified and required in CreateQueueRequest, after which it becomes output only."##), @@ -2204,14 +2188,8 @@ fn main() { 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)."##), + Queue.state; if paused it will be set to + Queue.State.PAUSED."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-pause", vec![ (Some(r##"name"##), @@ -2281,15 +2259,9 @@ fn main() { 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). + Queue.State.PAUSED or Queue.State.DISABLED. The state of + a queue is stored in Queue.state; after calling this method it + will be set to Queue.State.RUNNING. WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS @@ -2328,11 +2300,13 @@ fn main() { Some(r##"Sets the access control policy for a Queue. Replaces any existing policy. + Note: The Cloud Console does not check queue-level IAM permissions yet. + Project-level permissions are required to use the Cloud Console. + Authorization requires the following [Google IAM](/iam) permission on the specified resource parent: - * `cloudtasks.queues.setIamPolicy` - "##), + * `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"##), @@ -2372,7 +2346,12 @@ fn main() { 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."##), + CloudTasks.GetTask, or CloudTasks.ListTasks. + + To acknowledge 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."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-acknowledge", vec![ (Some(r##"name"##), @@ -2445,7 +2424,12 @@ fn main() { 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."##), + Tasks cannot be updated after creation; there is no UpdateTask command. + + * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + the maximum task size is 100KB. + * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this + the maximum task size is 1MB."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-create", vec![ (Some(r##"parent"##), @@ -2573,7 +2557,12 @@ fn main() { 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."##), + PullTasksRequest.response_view to Task.View.FULL. + + A maximum of 10 qps of CloudTasks.PullTasks requests are allowed per + queue. google.rpc.Code.RESOURCE_EXHAUSTED is returned when this limit + is exceeded. google.rpc.Code.RESOURCE_EXHAUSTED is also returned when + RateLimits.max_tasks_dispatched_per_second is exceeded."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-pull", vec![ (Some(r##"name"##), @@ -2647,7 +2636,7 @@ fn main() { dispatched now. When this method is called, Cloud Tasks will dispatch the task to its - target, even if the queue is Queue.QueueState.PAUSED. + target, even if the queue is Queue.State.PAUSED. The dispatched task is returned. That is, the task that is returned contains the Task.task_status after the task is dispatched but @@ -2663,7 +2652,9 @@ fn main() { 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."##), + already running. + + CloudTasks.RunTask cannot be called on pull tasks."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli/projects_locations-queues-tasks-run", vec![ (Some(r##"name"##), @@ -2700,8 +2691,7 @@ fn main() { 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. - "##), + 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"##), @@ -2735,7 +2725,7 @@ fn main() { let mut app = App::new("cloudtasks2-beta2") .author("Sebastian Thiel ") - .version("1.0.6+20170926") + .version("1.0.6+20171208") .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") diff --git a/gen/cloudtasks2_beta2/Cargo.toml b/gen/cloudtasks2_beta2/Cargo.toml index 037468b766..3e628a10de 100644 --- a/gen/cloudtasks2_beta2/Cargo.toml +++ b/gen/cloudtasks2_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudtasks2_beta2" -version = "1.0.6+20170926" +version = "1.0.6+20171208" 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" +documentation = "https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208" license = "MIT" keywords = ["cloudtasks", "google", "protocol", "web", "api"] diff --git a/gen/cloudtasks2_beta2/README.md b/gen/cloudtasks2_beta2/README.md index d0c6ce65e8..73ad5d2c2a 100644 --- a/gen/cloudtasks2_beta2/README.md +++ b/gen/cloudtasks2_beta2/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Cloud Tasks* crate version *1.0.6+20171208*, where *20171208* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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) + * [*locations get*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationListCall.html), [*locations queues create*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueCreateCall.html), [*locations queues delete*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueDeleteCall.html), [*locations queues get*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueGetCall.html), [*locations queues get iam policy*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueGetIamPolicyCall.html), [*locations queues list*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueListCall.html), [*locations queues patch*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueuePatchCall.html), [*locations queues pause*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueuePauseCall.html), [*locations queues purge*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueuePurgeCall.html), [*locations queues resume*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueResumeCall.html), [*locations queues set iam policy*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueSetIamPolicyCall.html), [*locations queues tasks acknowledge*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskAcknowledgeCall.html), [*locations queues tasks cancel lease*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskCancelLeaseCall.html), [*locations queues tasks create*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskCreateCall.html), [*locations queues tasks delete*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskDeleteCall.html), [*locations queues tasks get*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskGetCall.html), [*locations queues tasks list*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskListCall.html), [*locations queues tasks pull*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskPullCall.html), [*locations queues tasks renew lease*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskRenewLeaseCall.html), [*locations queues tasks run*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskRunCall.html) and [*locations queues test iam permissions*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/struct.ProjectLocationQueueTestIamPermissionCall.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-cloudtasks2_beta2/1.0.6+20170926/google_cloudtasks2_beta2/struct.CloudTasks.html)** +* **[Hub](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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)** + * creates [*Method Builders*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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)** + * **[Parts](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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)** +* **[Activities](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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. @@ -128,17 +128,17 @@ match result { ``` ## 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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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). +[Hub Delegate](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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. +If such a method also supports a [Response Result](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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. +The [delegate trait](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/google_cloudtasks2_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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 +Most optionals are are considered [Parts](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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. +Using [method builders](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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 +* [request values](https://docs.rs/google-cloudtasks2_beta2/1.0.6+20171208/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. diff --git a/gen/cloudtasks2_beta2/src/lib.rs b/gen/cloudtasks2_beta2/src/lib.rs index ddf3c739c6..022c0a3744 100644 --- a/gen/cloudtasks2_beta2/src/lib.rs +++ b/gen/cloudtasks2_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud 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*. +//! This documentation was generated from *Cloud Tasks* crate version *1.0.6+20171208*, where *20171208* 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/). @@ -384,28 +384,20 @@ pub struct PullTasksRequest { /// /// 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 (`\`). + /// PullMessage.tag is equal to ``. `` must be less than + /// 500 bytes. /// - /// 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. + /// When `filter` is set to `tag_function=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` + /// * `filter = "tag=" tag | "tag_function=" 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, @@ -463,10 +455,16 @@ impl RequestValue for PullTasksRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PullMessage { - /// A meta-data tag for this task. + /// The task's tag. /// - /// This value is used by CloudTasks.PullTasks calls when - /// PullTasksRequest.filter is `tag=`. + /// Tags allow similar tasks to be processed in a batch. If you label + /// tasks with a tag, your task worker can pull tasks + /// with the same tag using PullTasksRequest.filter. For example, + /// if you want to aggregate the events associated with a specific + /// user once a day, you could tag tasks with the user ID. + /// + /// The task's tag can only be set when the + /// task is created. /// /// The tag must be less than 500 bytes. pub tag: Option, @@ -527,7 +525,7 @@ 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. + /// It can contain a path and query string arguments. /// 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")] @@ -586,9 +584,7 @@ pub struct AppEngineHttpRequest { /// /// 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 + /// with error code 405 (Method Not Allowed). 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. @@ -606,31 +602,23 @@ impl Part for AppEngineHttpRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AttemptStatus { - /// Output only. - /// - /// The time that this attempt was scheduled. + /// 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. + /// 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. + /// 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. + /// Output only. The time that this attempt was dispatched. /// /// `dispatch_time` will be truncated to the nearest microsecond. #[serde(rename="dispatchTime")] @@ -655,16 +643,6 @@ 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. /// @@ -751,9 +729,9 @@ pub struct AppEngineRouting { /// [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. + /// Output only. The host that the task is sent to. /// - /// The host that the task is sent to. For more information, see + /// For more information, see /// [How Requests are Routed](/appengine/docs/standard/python/how-requests-are-routed). /// /// The host is constructed as: @@ -843,28 +821,25 @@ pub struct AppEngineRouting { impl Part for AppEngineRouting {} -/// Deprecated. Use AppEngineHttpRequest. +/// The response message for Locations.ListLocations. /// -/// 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*). +/// +/// * [locations list projects](struct.ProjectLocationListCall.html) (response) /// #[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, +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 Part for AppEngineTaskTarget {} +impl ResponseResult for ListLocationsResponse {} /// A resource that represents Google Cloud Platform location. @@ -1078,69 +1053,6 @@ pub struct SetIamPolicyRequest { 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 @@ -1174,17 +1086,18 @@ pub struct Task { /// 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. + /// * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + /// hyphens (-), colons (:), or periods (.). + /// For more information, see + /// [Identifying projects](/resource-manager/docs/creating-managing-projects#identifying_projects) + /// * `LOCATION_ID` is the canonical ID for the task's location. + /// The list of available locations can be obtained by calling + /// google.cloud.location.Locations.ListLocations. + /// For more information, see https://cloud.google.com/about/locations/. + /// * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + /// hyphens (-). The maximum length is 100 characters. + /// * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + /// hyphens (-), or underscores (_). The maximum length is 500 characters. /// /// Optionally caller-specified in CreateTaskRequest. pub name: Option, @@ -1200,29 +1113,17 @@ pub struct Task { /// `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. + /// Output only. The view specifies which subset of the Task has + /// been returned. + pub view: 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, + /// Output only. The task status. + #[serde(rename="taskStatus")] + pub task_status: Option, } impl ResponseResult for Task {} @@ -1292,17 +1193,13 @@ impl ResponseResult for ListTasksResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TaskStatus { - /// Output only. - /// - /// The status of the task's last attempt. + /// 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. + /// 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. @@ -1311,15 +1208,13 @@ pub struct TaskStatus { /// [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). #[serde(rename="firstAttemptStatus")] pub first_attempt_status: Option, - /// Output only. + /// Output only. The number of attempts dispatched. /// - /// The number of attempts dispatched. This count includes tasks which have - /// been dispatched but haven't received a response. + /// 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. + /// Output only. The number of attempts which have received a response. /// /// This field is not calculated for /// [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). @@ -1348,25 +1243,58 @@ impl Part for TaskStatus {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Queue { + /// Output only. The state of the 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 `state`. + pub state: 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, /// 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. + /// * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + /// hyphens (-), colons (:), or periods (.). + /// For more information, see + /// [Identifying projects](/resource-manager/docs/creating-managing-projects#identifying_projects) + /// * `LOCATION_ID` is the canonical ID for the queue's location. + /// The list of available locations can be obtained by calling + /// google.cloud.location.Locations.ListLocations. + /// For more information, see https://cloud.google.com/about/locations/. + /// * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + /// hyphens (-). 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, + /// Rate limits for task dispatches. + /// + /// Queue.rate_limits and Queue.retry_config are related because they + /// both control task attempts however they control how tasks are attempted in + /// different ways: + /// + /// * Queue.rate_limits controls the total rate of dispatches from a queue + /// (i.e. all traffic dispatched from the queue, regardless of whether the + /// dispatch is from a first attempt or a retry). + /// * Queue.retry_config controls what happens to particular a task after + /// its first attempt fails. That is, Queue.retry_config controls task + /// retries (the second attempt, third attempt, etc). + #[serde(rename="rateLimits")] + pub rate_limits: Option, /// App Engine HTTP target. /// /// An App Engine queue is a queue that has an AppEngineHttpTarget. @@ -1377,34 +1305,6 @@ pub struct Queue { /// 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 @@ -1476,19 +1376,70 @@ pub struct GetIamPolicyRequest { _never_set: Option } impl RequestValue for GetIamPolicyRequest {} -/// Deprecated. Use PullMessage. +/// Request message for CloudTasks.CreateTask. /// -/// 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*). +/// +/// * [locations queues tasks create projects](struct.ProjectLocationQueueTaskCreateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PullTaskTarget { - /// Deprecated. Use PullMessage.tag. - pub tag: Option, - /// Deprecated. Use PullMessage.payload. - pub payload: Option, +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. + /// + /// If Task.schedule_time is not set or is in the past then Cloud + /// Tasks will set it to the current time. + /// + /// Task De-duplication: + /// + /// Explicitly specifying a task ID enables task de-duplication. If + /// a task's ID is identical to that of an existing task or a task + /// that was deleted or completed recently then the call will fail + /// with google.rpc.Code.ALREADY_EXISTS. If the task's queue was + /// created using Cloud Tasks, then another task with the same name + /// can't be created for ~1hour after the original task was deleted + /// or completed. If the task's queue was created using queue.yaml or + /// queue.xml, then another task with the same name can't be created + /// for ~9days after the original task was deleted or completed. + /// + /// 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. + pub task: Option, } -impl Part for PullTaskTarget {} +impl RequestValue for CreateTaskRequest {} /// Request message for acknowledging a task using @@ -1555,26 +1506,78 @@ pub struct RenewLeaseRequest { /// /// /// 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, + /// `lease_duration` will be truncated to the nearest second. + #[serde(rename="leaseDuration")] + pub lease_duration: Option, } impl RequestValue for RenewLeaseRequest {} -/// Deprecated. Use AppEngineTarget. +/// Rate limits. +/// +/// This message determines the maximum rate that tasks can be dispatched by a +/// queue, regardless of whether the dispatch is a first task attempt or a retry. /// /// 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, +pub struct RateLimits { + /// 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. + /// In addition to the `max_tasks_dispatched_per_second` limit, a maximum of + /// 10 QPS of CloudTasks.PullTasks requests are allowed per queue. + /// + /// 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. + /// + /// 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 + /// RateLimits.max_tasks_dispatched_per_second is 1, this + /// field is 10; otherwise this field is + /// RateLimits.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 concurrent 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 + /// concurrent 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="maxConcurrentTasks")] + pub max_concurrent_tasks: Option, } -impl Part for AppEngineQueueConfig {} +impl Part for RateLimits {} /// App Engine HTTP target. @@ -1648,65 +1651,6 @@ pub struct Binding { 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 @@ -1740,27 +1684,6 @@ 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 @@ -1792,13 +1715,7 @@ 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. +/// These settings determine how a failed task attempt is retried. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1811,6 +1728,25 @@ pub struct RetryConfig { /// `max_attempts - 1` retries). Must be > 0. #[serde(rename="maxAttempts")] pub max_attempts: Option, + /// If positive, `max_retry_duration` specifies the time limit for retrying a + /// failed task, measured from when the task was first attempted. Once + /// `max_retry_duration` time has passed *and* the task has been attempted + /// RetryConfig.max_attempts times, no further attempts will be made and + /// the task will be deleted. + /// + /// If zero, then the task age is unlimited. + /// + /// * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + /// this field is 0 seconds by default. + /// * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this + /// field is output only and always 0. + /// + /// `max_retry_duration` will be truncated to the nearest second. + /// + /// This field has the same meaning as + /// [task_age_limit in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). + #[serde(rename="maxRetryDuration")] + pub max_retry_duration: Option, /// The minimum amount of time to wait before retrying a task after /// it fails. /// @@ -1820,27 +1756,34 @@ pub struct RetryConfig { /// field is output only and always 0. /// /// `min_backoff` will be truncated to the nearest second. + /// + /// This field has the same meaning as + /// [min_backoff_seconds in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). #[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. + /// The time between retries will double `max_doublings` times. /// - /// If zero, then the task age is unlimited. This field is zero by default. + /// A task's retry interval starts at RetryConfig.min_backoff, + /// then doubles `max_doublings` times, then increases linearly, and + /// finally retries retries at intervals of + /// RetryConfig.max_backoff up to max_attempts times. /// - /// `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 example, if RetryConfig.min_backoff is 10s, + /// RetryConfig.max_backoff is 300s, and `max_doublings` is 3, + /// then the a task will first be retried in 10s. The retry interval + /// will double three times, and then increase linearly by 2^3 * 10s. + /// Finally, the task will retry at intervals of + /// RetryConfig.max_backoff until the task has been attempted + /// `max_attempts` times. Thus, the requests will retry at 10s, 20s, + /// 40s, 80s, 160s, 240s, 300s, 300s, .... /// /// * 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. + /// + /// This field has the same meaning as + /// [max_doublings in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). #[serde(rename="maxDoublings")] pub max_doublings: Option, /// The maximum amount of time to wait before retrying a task after @@ -1852,6 +1795,9 @@ pub struct RetryConfig { /// is output only and always 0. /// /// `max_backoff` will be truncated to the nearest second. + /// + /// This field has the same meaning as + /// [max_backoff_seconds in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). #[serde(rename="maxBackoff")] pub max_backoff: Option, /// If true, then the number of attempts is unlimited. @@ -1963,11 +1909,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// 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 + /// WARNING: Using this method may have unintended side effects if you are + /// using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + /// 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). + /// carefully before using this method. /// /// # Arguments /// @@ -1989,12 +1935,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy for a Queue. Replaces any existing /// policy. /// + /// Note: The Cloud Console does not check queue-level IAM permissions yet. + /// Project-level permissions are required to use the Cloud Console. + /// /// Authorization requires the following [Google IAM](/iam) permission on the /// specified resource parent: /// /// * `cloudtasks.queues.setIamPolicy` /// - /// /// # Arguments /// /// * `request` - No description provided. @@ -2018,11 +1966,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// 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 + /// WARNING: Using this method may have unintended side effects if you are + /// using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + /// 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). + /// carefully before using this method. /// /// # Arguments /// @@ -2030,13 +1978,16 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// * `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. + /// * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + /// hyphens (-), colons (:), or periods (.). + /// For more information, see + /// [Identifying projects](/resource-manager/docs/creating-managing-projects#identifying_projects) + /// * `LOCATION_ID` is the canonical ID for the queue's location. + /// The list of available locations can be obtained by calling + /// google.cloud.location.Locations.ListLocations. + /// For more information, see https://cloud.google.com/about/locations/. + /// * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + /// hyphens (-). 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> { @@ -2055,11 +2006,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// Creates a queue. /// - /// WARNING: This method is only available to whitelisted - /// users. Using this method carries some risk. Read + /// WARNING: Using this method may have unintended side effects if you are + /// using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + /// 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). + /// carefully before using this method. /// /// # Arguments /// @@ -2111,6 +2062,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// Tasks cannot be updated after creation; there is no UpdateTask command. /// + /// * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + /// the maximum task size is 100KB. + /// * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this + /// the maximum task size is 1MB. + /// /// # Arguments /// /// * `request` - No description provided. @@ -2167,6 +2123,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// payloads in the PullTasksResponse, set /// PullTasksRequest.response_view to Task.View.FULL. /// + /// A maximum of 10 qps of CloudTasks.PullTasks requests are allowed per + /// queue. google.rpc.Code.RESOURCE_EXHAUSTED is returned when this limit + /// is exceeded. google.rpc.Code.RESOURCE_EXHAUSTED is also returned when + /// RateLimits.max_tasks_dispatched_per_second is exceeded. + /// /// # Arguments /// /// * `request` - No description provided. @@ -2199,6 +2160,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// not be returned by a later CloudTasks.PullTasks, /// CloudTasks.GetTask, or CloudTasks.ListTasks. /// + /// To acknowledge 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. + /// /// # Arguments /// /// * `request` - No description provided. @@ -2221,15 +2187,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// 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). + /// Queue.State.PAUSED or Queue.State.DISABLED. The state of + /// a queue is stored in Queue.state; after calling this method it + /// will be set to Queue.State.RUNNING. /// /// WARNING: Resuming many high-QPS queues at the same time can /// lead to target overloading. If you are resuming high-QPS @@ -2312,7 +2272,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// dispatched now. /// /// When this method is called, Cloud Tasks will dispatch the task to its - /// target, even if the queue is Queue.QueueState.PAUSED. + /// target, even if the queue is Queue.State.PAUSED. /// /// The dispatched task is returned. That is, the task that is returned /// contains the Task.task_status after the task is dispatched but @@ -2330,6 +2290,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// CloudTasks.RunTask is called on task that is dispatched or /// already running. /// + /// CloudTasks.RunTask cannot be called on pull tasks. + /// /// # Arguments /// /// * `request` - No description provided. @@ -2355,14 +2317,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// 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). + /// Queue.state; if paused it will be set to + /// Queue.State.PAUSED. /// /// # Arguments /// @@ -2392,7 +2348,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `cloudtasks.queues.getIamPolicy` /// - /// /// # Arguments /// /// * `request` - No description provided. @@ -2481,7 +2436,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// UIs and command-line tools, not for authorization checking. This operation /// may "fail open" without warning. /// - /// /// # Arguments /// /// * `request` - No description provided. @@ -2767,10 +2721,10 @@ impl<'a, C, A> ProjectLocationQueueTaskGetCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskListCall<'a, C, A> { @@ -3104,10 +3057,10 @@ impl<'a, C, A> ProjectLocationQueueTaskListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationQueueDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationQueueSetIamPolicyCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3713,11 +3668,11 @@ impl<'a, C, A> ProjectLocationQueueSetIamPolicyCall<'a, C, A> where C: BorrowMut /// 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 +/// WARNING: Using this method may have unintended side effects if you are +/// using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. +/// 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). +/// carefully before using this method. /// /// A builder for the *locations.queues.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -3936,13 +3891,16 @@ impl<'a, C, A> ProjectLocationQueuePatchCall<'a, C, A> where C: BorrowMut ProjectLocationQueuePatchCall<'a, C, A> where C: BorrowMut ProjectLocationQueuePatchCall<'a, C, A> where C: BorrowMut ProjectLocationQueueCreateCall<'a, C, A> where C: BorrowMut ProjectLocationQueueGetCall<'a, C, A> where C: BorrowMut ProjectLocationQueueGetCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskCreateCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskPullCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskPullCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskAcknowledgeCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5737,15 +5710,9 @@ impl<'a, C, A> ProjectLocationQueueTaskAcknowledgeCall<'a, C, A> where C: Borrow /// 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). +/// Queue.State.PAUSED or Queue.State.DISABLED. The state of +/// a queue is stored in Queue.state; after calling this method it +/// will be set to Queue.State.RUNNING. /// /// WARNING: Resuming many high-QPS queues at the same time can /// lead to target overloading. If you are resuming high-QPS @@ -5992,10 +5959,10 @@ impl<'a, C, A> ProjectLocationQueueResumeCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskCancelLeaseCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6599,10 +6566,10 @@ impl<'a, C, A> ProjectLocationQueueListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskRunCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskRunCall<'a, C, A> where C: BorrowMut ProjectLocationQueuePauseCall<'a, C, A> where C: BorrowMut ProjectLocationQueuePauseCall<'a, C, A> where C: BorrowMut ProjectLocationQueueGetIamPolicyCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -7756,10 +7718,10 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskRenewLeaseCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -8336,10 +8298,10 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTestIamPermissionCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -8920,10 +8881,10 @@ impl<'a, C, A> ProjectLocationQueuePurgeCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Container (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/container1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-container1] path = "../container1" -version = "1.0.6+20170915" +version = "1.0.6+20171111" diff --git a/gen/container1-cli/README.md b/gen/container1-cli/README.md index 54878c8814..1557bc52c3 100644 --- a/gen/container1-cli/README.md +++ b/gen/container1-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 *Container* API at revision *20170915*. The CLI is at version *1.0.6*. +This documentation was generated from the *Container* API at revision *20171111*. The CLI is at version *1.0.6*. ```bash container1 [options] diff --git a/gen/container1-cli/mkdocs.yml b/gen/container1-cli/mkdocs.yml index 24177ddd80..88a79d9dc4 100644 --- a/gen/container1-cli/mkdocs.yml +++ b/gen/container1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Container v1.0.6+20170915 +site_name: Container v1.0.6+20171111 site_url: http://byron.github.io/google-apis-rs/google-container1-cli site_description: A complete library to interact with Container (protocol v1) diff --git a/gen/container1-cli/src/main.rs b/gen/container1-cli/src/main.rs index f3f2343a4d..1237551ed8 100644 --- a/gen/container1-cli/src/main.rs +++ b/gen/container1-cli/src/main.rs @@ -252,9 +252,9 @@ impl<'n> Engine<'n> { "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.legacy-abac.enabled" => Some(("cluster.legacyAbac.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.enable-kubernetes-alpha" => Some(("cluster.enableKubernetesAlpha", 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.zone" => Some(("cluster.zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.instance-group-urls" => Some(("cluster.instanceGroupUrls", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "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 })), @@ -264,11 +264,12 @@ impl<'n> Engine<'n> { "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.ip-allocation-policy.services-secondary-range-name" => Some(("cluster.ipAllocationPolicy.servicesSecondaryRangeName", 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.logging-service" => Some(("cluster.loggingService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.status-message" => Some(("cluster.statusMessage", 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.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 })), @@ -277,18 +278,17 @@ impl<'n> Engine<'n> { "cluster.master-auth.username" => Some(("cluster.masterAuth.username", 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.master-auth.password" => Some(("cluster.masterAuth.password", 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.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.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.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.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 })), @@ -303,7 +303,7 @@ impl<'n> Engine<'n> { "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.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.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-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"]); @@ -1841,9 +1841,9 @@ impl<'n> Engine<'n> { "update.username" => Some(("update.username", 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 })), + "update.password" => Some(("update.password", 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 })), _ => { 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())))); @@ -3884,7 +3884,7 @@ fn main() { let mut app = App::new("container1") .author("Sebastian Thiel ") - .version("1.0.6+20170915") + .version("1.0.6+20171111") .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 f3d43d8e25..32be38df74 100644 --- a/gen/container1/Cargo.toml +++ b/gen/container1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-container1" -version = "1.0.6+20170915" +version = "1.0.6+20171111" authors = ["Sebastian Thiel "] 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+20170915" +documentation = "https://docs.rs/google-container1/1.0.6+20171111" license = "MIT" keywords = ["container", "google", "protocol", "web", "api"] diff --git a/gen/container1/README.md b/gen/container1/README.md index a6792f1bde..3bb98b721e 100644 --- a/gen/container1/README.md +++ b/gen/container1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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+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*. +This documentation was generated from *Container* crate version *1.0.6+20171111*, where *20171111* 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 [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+20170915/google_container1/struct.Container.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.Container.html) ... * projects - * [*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) + * [*zones clusters addons*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterAddonCall.html), [*zones clusters complete ip rotation*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterCompleteIpRotationCall.html), [*zones clusters create*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterGetCall.html), [*zones clusters legacy abac*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterLegacyAbacCall.html), [*zones clusters list*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterListCall.html), [*zones clusters locations*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterLocationCall.html), [*zones clusters logging*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterLoggingCall.html), [*zones clusters master*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterMasterCall.html), [*zones clusters monitoring*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterMonitoringCall.html), [*zones clusters node pools autoscaling*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterNodePoolAutoscalingCall.html), [*zones clusters node pools create*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterNodePoolCreateCall.html), [*zones clusters node pools delete*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterNodePoolDeleteCall.html), [*zones clusters node pools get*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterNodePoolGetCall.html), [*zones clusters node pools list*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterNodePoolListCall.html), [*zones clusters node pools rollback*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterNodePoolRollbackCall.html), [*zones clusters node pools set management*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterNodePoolSetManagementCall.html), [*zones clusters node pools set size*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterNodePoolSetSizeCall.html), [*zones clusters node pools update*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterNodePoolUpdateCall.html), [*zones clusters resource labels*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterResourceLabelCall.html), [*zones clusters set maintenance policy*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterSetMaintenancePolicyCall.html), [*zones clusters set master auth*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterSetMasterAuthCall.html), [*zones clusters set network policy*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterSetNetworkPolicyCall.html), [*zones clusters start ip rotation*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterStartIpRotationCall.html), [*zones clusters update*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneClusterUpdateCall.html), [*zones get serverconfig*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneGetServerconfigCall.html), [*zones operations cancel*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneOperationCancelCall.html), [*zones operations get*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](https://docs.rs/google-container1/1.0.6+20171111/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+20170915/google_container1/struct.Container.html)** +* **[Hub](https://docs.rs/google-container1/1.0.6+20171111/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+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)** + * creates [*Method Builders*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-container1/1.0.6+20171111/google_container1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-container1/1.0.6+20171111/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+20170915/google_container1/trait.Part.html)** + * **[Parts](https://docs.rs/google-container1/1.0.6+20171111/google_container1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-container1/1.0.6+20170915/google_container1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-container1/1.0.6+20171111/google_container1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -52,7 +52,7 @@ 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_set_master_auth(...).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() @@ -67,7 +67,7 @@ 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_addons(...).doit() let r = hub.projects().zones_clusters_complete_ip_rotation(...).doit() let r = hub.projects().zones_clusters_resource_labels(...).doit() ``` @@ -144,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+20170915/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+20171111/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+20170915/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+20171111/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+20170915/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+20171111/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+20170915/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+20171111/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-container1/1.0.6+20171111/google_container1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-container1/1.0.6+20171111/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+20170915/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+20171111/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-container1/1.0.6+20171111/google_container1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-container1/1.0.6+20171111/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+20170915/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+20171111/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+20170915/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+20171111/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+20170915/google_container1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-container1/1.0.6+20171111/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 020ad20a1f..e66e43a086 100644 --- a/gen/container1/src/lib.rs +++ b/gen/container1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Container* crate version *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*. +//! This documentation was generated from *Container* crate version *1.0.6+20171111*, where *20171111* 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 //! [official documentation site](https://cloud.google.com/container-engine/). @@ -52,7 +52,7 @@ //! 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_set_master_auth(...).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() @@ -67,7 +67,7 @@ //! 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_addons(...).doit() //! let r = hub.projects().zones_clusters_complete_ip_rotation(...).doit() //! let r = hub.projects().zones_clusters_resource_labels(...).doit() //! ``` @@ -727,20 +727,23 @@ pub struct MaintenancePolicy { impl Part for MaintenancePolicy {} -/// Configuration options for the NetworkPolicy feature. -/// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ +/// CreateClusterRequest creates a cluster. /// -/// 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*). +/// +/// * [zones clusters create projects](struct.ProjectZoneClusterCreateCall.html) (request) /// #[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, +pub struct CreateClusterRequest { + /// A [cluster + /// resource](/container-engine/reference/rest/v1/projects.zones.clusters) + pub cluster: Option, } -impl Part for NetworkPolicy {} +impl RequestValue for CreateClusterRequest {} /// SetNodePoolManagementRequest sets the node management properties of a node @@ -832,20 +835,33 @@ pub struct SetAddonsConfigRequest { 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. +/// SetLabelsRequest sets the Google Cloud Platform labels on a Google Container +/// Engine cluster, which will in turn set them for Google Compute Engine +/// resources used by that cluster /// -/// 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*). +/// +/// * [zones clusters resource labels projects](struct.ProjectZoneClusterResourceLabelCall.html) (request) /// #[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, +pub struct SetLabelsRequest { + /// The fingerprint of the previous set of labels for this resource, + /// used to detect conflicts. The fingerprint is initially generated by + /// Container 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. + #[serde(rename="labelFingerprint")] + pub label_fingerprint: Option, + /// The labels to set for that cluster. + #[serde(rename="resourceLabels")] + pub resource_labels: Option>, } -impl Part for HttpLoadBalancing {} +impl RequestValue for SetLabelsRequest {} /// Configuration for the legacy Attribute Based Access Control authorization @@ -979,75 +995,6 @@ pub struct ClientCertificateConfig { 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 @@ -1066,33 +1013,20 @@ pub struct UpdateClusterRequest { impl RequestValue for UpdateClusterRequest {} -/// SetLabelsRequest sets the Google Cloud Platform labels on a Google Container -/// Engine cluster, which will in turn set them for Google Compute Engine -/// resources used by that cluster +/// 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. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 resource labels projects](struct.ProjectZoneClusterResourceLabelCall.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 SetLabelsRequest { - /// The fingerprint of the previous set of labels for this resource, - /// used to detect conflicts. The fingerprint is initially generated by - /// Container 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. - #[serde(rename="labelFingerprint")] - pub label_fingerprint: Option, - /// The labels to set for that cluster. - #[serde(rename="resourceLabels")] - pub resource_labels: Option>, +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 RequestValue for SetLabelsRequest {} +impl Part for HttpLoadBalancing {} /// ListClustersResponse is the result of ListClustersRequest. @@ -1106,13 +1040,13 @@ impl RequestValue for SetLabelsRequest {} /// #[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>, + /// A list of clusters in the project in the specified zone, or + /// across all ones. + pub clusters: Option>, } impl ResponseResult for ListClustersResponse {} @@ -1256,15 +1190,15 @@ pub struct NodePool { pub management: Option, /// The name of the node pool. pub name: Option, - /// [Output only] The resource URLs of [instance - /// groups](/compute/docs/instance-groups/) associated with this - /// node pool. + /// [Output only] The resource URLs of the [managed instance + /// groups](/compute/docs/instance-groups/creating-groups-of-managed-instances) + /// associated with this node pool. #[serde(rename="instanceGroupUrls")] pub instance_group_urls: Option>, /// Autoscaler configuration for this NodePool. Autoscaler is enabled /// only if a valid configuration is present. pub autoscaling: Option, - /// [Output only] The version of the Kubernetes of this node. + /// The version of the Kubernetes of this node. pub version: Option, /// The initial node count for the pool. You must ensure that your /// Compute Engine resource quota @@ -1286,23 +1220,20 @@ pub struct NodePool { impl ResponseResult for NodePool {} -/// CreateClusterRequest creates a cluster. +/// Configuration options for the NetworkPolicy feature. +/// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CreateClusterRequest { - /// A [cluster - /// resource](/container-engine/reference/rest/v1/projects.zones.clusters) - pub cluster: Option, +pub struct NetworkPolicy { + /// Whether network policy is enabled on the cluster. + pub enabled: Option, + /// The selected network policy provider. + pub provider: Option, } -impl RequestValue for CreateClusterRequest {} +impl Part for NetworkPolicy {} /// CompleteIPRotationRequest moves the cluster master back into single-IP mode. @@ -1388,13 +1319,13 @@ impl RequestValue for SetLegacyAbacRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AcceleratorConfig { + /// The number of the accelerator cards exposed to an instance. + #[serde(rename="acceleratorCount")] + pub accelerator_count: Option, /// 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 {} @@ -1447,14 +1378,14 @@ pub struct MasterAuth { /// 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, + /// 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, } impl Part for MasterAuth {} @@ -1493,42 +1424,40 @@ pub struct Cluster { /// [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, + /// 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 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. + /// [Output only] The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + pub zone: Option, + /// Deprecated. Use node_pools.instance_group_urls. #[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 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] The current status of this cluster. pub status: Option, /// An optional description of this cluster. @@ -1578,6 +1507,13 @@ pub struct Cluster { /// [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/`. @@ -1588,21 +1524,17 @@ pub struct Cluster { /// [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: + /// The logging service the cluster should use to write logs. + /// Currently available options: /// - /// * 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, + /// * `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, + /// 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 @@ -1631,13 +1563,10 @@ pub struct Cluster { /// [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, + /// 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] Server-defined URL for the resource. #[serde(rename="selfLink")] pub self_link: Option, @@ -1657,7 +1586,7 @@ impl ResponseResult for Cluster {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SetMasterAuthRequest { - /// The exact form of action to be taken on the master auth + /// The exact form of action to be taken on the master auth. pub action: Option, /// A description of the update. pub update: Option, @@ -1764,9 +1693,11 @@ pub struct IPAllocationPolicy { /// 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, + /// 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, /// 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 @@ -1776,11 +1707,9 @@ pub struct IPAllocationPolicy { /// 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, + /// This field is deprecated, use services_ipv4_cidr_block. + #[serde(rename="servicesIpv4Cidr")] + pub services_ipv4_cidr: Option, } impl Part for IPAllocationPolicy {} @@ -1821,6 +1750,75 @@ pub struct SetNodePoolSizeRequest { impl RequestValue for SetNodePoolSizeRequest {} +/// 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 set master auth projects](struct.ProjectZoneClusterSetMasterAuthCall.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 addons projects](struct.ProjectZoneClusterAddonCall.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 {} + + /// CidrBlock contains an optional name and one CIDR block. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2941,10 +2939,10 @@ impl<'a, C, A> ProjectZoneOperationCancelCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolCreateCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3555,10 +3553,10 @@ impl<'a, C, A> ProjectZoneClusterMonitoringCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolRollbackCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4159,10 +4157,10 @@ impl<'a, C, A> ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectZoneGetServerconfigCall<'a, C, A> where C: BorrowMut ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut ProjectZoneClusterAddonCall<'a, C, A> where C: BorrowMut ProjectZoneClusterStartIpRotationCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5650,10 +5648,10 @@ impl<'a, C, A> ProjectZoneClusterCreateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolSetManagementCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6245,10 +6243,10 @@ impl<'a, C, A> ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut ProjectZoneOperationGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterLoggingCall<'a, C, A> where C: BorrowMut ProjectZoneClusterUpdateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolAutoscalingCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -8038,10 +8036,10 @@ impl<'a, C, A> ProjectZoneClusterNodePoolSetSizeCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -8345,10 +8343,10 @@ impl<'a, C, A> ProjectZoneClusterSetMaintenancePolicyCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -8633,10 +8631,10 @@ impl<'a, C, A> ProjectZoneClusterNodePoolDeleteCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -8940,10 +8938,10 @@ impl<'a, C, A> ProjectZoneClusterLocationCall<'a, C, A> where C: BorrowMut ProjectZoneClusterGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterMasterCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolUpdateCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -10149,10 +10147,10 @@ impl<'a, C, A> ProjectZoneClusterSetNetworkPolicyCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -10437,10 +10435,10 @@ impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterSetMasterAuthCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -11053,10 +11051,10 @@ impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -11360,10 +11358,10 @@ impl<'a, C, A> ProjectZoneClusterResourceLabelCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -11623,10 +11621,10 @@ impl<'a, C, A> ProjectZoneOperationListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Shopping Content (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-content2] path = "../content2" -version = "1.0.6+20170926" +version = "1.0.6+20171207" diff --git a/gen/content2-cli/README.md b/gen/content2-cli/README.md index 978a09e440..c5d452f231 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 *20170926*. The CLI is at version *1.0.6*. +This documentation was generated from the *Shopping Content* API at revision *20171207*. The CLI is at version *1.0.6*. ```bash content2 [options] @@ -77,7 +77,9 @@ content2 [options] list [-p ]... [-o ] refund (-r )... [-p ]... [-o ] returnlineitem (-r )... [-p ]... [-o ] + setlineitemmetadata (-r )... [-p ]... [-o ] shiplineitems (-r )... [-p ]... [-o ] + updatelineitemshippingdetails (-r )... [-p ]... [-o ] updatemerchantorderid (-r )... [-p ]... [-o ] updateshipment (-r )... [-p ]... [-o ] products diff --git a/gen/content2-cli/mkdocs.yml b/gen/content2-cli/mkdocs.yml index 97f1386b7d..fa62746d70 100644 --- a/gen/content2-cli/mkdocs.yml +++ b/gen/content2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Shopping Content v1.0.6+20170926 +site_name: Shopping Content v1.0.6+20171207 site_url: http://byron.github.io/google-apis-rs/google-content2-cli site_description: A complete library to interact with Shopping Content (protocol v2) @@ -50,7 +50,9 @@ pages: - ['orders_list.md', 'Orders', 'List'] - ['orders_refund.md', 'Orders', 'Refund'] - ['orders_returnlineitem.md', 'Orders', 'Returnlineitem'] +- ['orders_setlineitemmetadata.md', 'Orders', 'Setlineitemmetadata'] - ['orders_shiplineitems.md', 'Orders', 'Shiplineitems'] +- ['orders_updatelineitemshippingdetails.md', 'Orders', 'Updatelineitemshippingdetails'] - ['orders_updatemerchantorderid.md', 'Orders', 'Updatemerchantorderid'] - ['orders_updateshipment.md', 'Orders', 'Updateshipment'] - ['products_custombatch.md', 'Products', 'Custombatch'] diff --git a/gen/content2-cli/src/main.rs b/gen/content2-cli/src/main.rs index d18e14e842..94e5fe79e4 100644 --- a/gen/content2-cli/src/main.rs +++ b/gen/content2-cli/src/main.rs @@ -373,10 +373,12 @@ impl<'n> Engine<'n> { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "adult-content" => Some(("adultContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "website-url" => Some(("websiteUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "google-my-business-link.status" => Some(("googleMyBusinessLink.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "google-my-business-link.gmb-email" => Some(("googleMyBusinessLink.gmbEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "seller-id" => Some(("sellerId", 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!["adult-content", "id", "kind", "name", "reviews-url", "seller-id", "website-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["adult-content", "gmb-email", "google-my-business-link", "id", "kind", "name", "reviews-url", "seller-id", "status", "website-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -527,10 +529,12 @@ impl<'n> Engine<'n> { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "adult-content" => Some(("adultContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "website-url" => Some(("websiteUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "google-my-business-link.status" => Some(("googleMyBusinessLink.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "google-my-business-link.gmb-email" => Some(("googleMyBusinessLink.gmbEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "seller-id" => Some(("sellerId", 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!["adult-content", "id", "kind", "name", "reviews-url", "seller-id", "website-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["adult-content", "gmb-email", "google-my-business-link", "id", "kind", "name", "reviews-url", "seller-id", "status", "website-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -622,10 +626,12 @@ impl<'n> Engine<'n> { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "adult-content" => Some(("adultContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "website-url" => Some(("websiteUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "google-my-business-link.status" => Some(("googleMyBusinessLink.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "google-my-business-link.gmb-email" => Some(("googleMyBusinessLink.gmbEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "seller-id" => Some(("sellerId", 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!["adult-content", "id", "kind", "name", "reviews-url", "seller-id", "website-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["adult-content", "gmb-email", "google-my-business-link", "id", "kind", "name", "reviews-url", "seller-id", "status", "website-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2478,15 +2484,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "reason" => Some(("reason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-pretax.currency" => Some(("amountPretax.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-pretax.value" => Some(("amountPretax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "quantity" => Some(("quantity", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "amount.currency" => Some(("amount.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "amount.value" => Some(("amount.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reason" => Some(("reason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reason-text" => Some(("reasonText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "line-item-id" => Some(("lineItemId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-tax.currency" => Some(("amountTax.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-tax.value" => Some(("amountTax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "quantity" => Some(("quantity", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["amount", "currency", "line-item-id", "operation-id", "quantity", "reason", "reason-text", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["amount", "amount-pretax", "amount-tax", "currency", "line-item-id", "operation-id", "product-id", "quantity", "reason", "reason-text", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2573,6 +2584,7 @@ impl<'n> Engine<'n> { "test-order.customer.full-name" => Some(("testOrder.customer.fullName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-order.customer.email" => Some(("testOrder.customer.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-order.kind" => Some(("testOrder.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-order.notification-mode" => Some(("testOrder.notificationMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-order.predefined-delivery-address" => Some(("testOrder.predefinedDeliveryAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-order.shipping-cost.currency" => Some(("testOrder.shippingCost.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-order.shipping-cost.value" => Some(("testOrder.shippingCost.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2586,7 +2598,7 @@ impl<'n> Engine<'n> { "test-order.payment-method.predefined-billing-address" => Some(("testOrder.paymentMethod.predefinedBillingAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "template-name" => Some(("templateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "customer", "email", "expiration-month", "expiration-year", "explicit-marketing-preference", "full-name", "kind", "last-four-digits", "payment-method", "predefined-billing-address", "predefined-delivery-address", "shipping-cost", "shipping-cost-tax", "shipping-option", "template-name", "test-order", "type", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "customer", "email", "expiration-month", "expiration-year", "explicit-marketing-preference", "full-name", "kind", "last-four-digits", "notification-mode", "payment-method", "predefined-billing-address", "predefined-delivery-address", "shipping-cost", "shipping-cost-tax", "shipping-option", "template-name", "test-order", "type", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2983,13 +2995,17 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "amount-pretax.currency" => Some(("amountPretax.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-pretax.value" => Some(("amountPretax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "amount.currency" => Some(("amount.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "amount.value" => Some(("amount.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reason-text" => Some(("reasonText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reason" => Some(("reason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-tax.currency" => Some(("amountTax.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-tax.value" => Some(("amountTax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["amount", "currency", "operation-id", "reason", "reason-text", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["amount", "amount-pretax", "amount-tax", "currency", "operation-id", "reason", "reason-text", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3072,13 +3088,14 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "quantity" => Some(("quantity", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reason" => Some(("reason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reason-text" => Some(("reasonText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "line-item-id" => Some(("lineItemId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "quantity" => Some(("quantity", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["line-item-id", "operation-id", "quantity", "reason", "reason-text"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["line-item-id", "operation-id", "product-id", "quantity", "reason", "reason-text"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3138,6 +3155,93 @@ impl<'n> Engine<'n> { } } + fn _orders_setlineitemmetadata(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "line-item-id" => Some(("lineItemId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["line-item-id", "operation-id", "product-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::OrdersSetLineItemMetadataRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.orders().setlineitemmetadata(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("order-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_shiplineitems(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -3226,6 +3330,95 @@ impl<'n> Engine<'n> { } } + fn _orders_updatelineitemshippingdetails(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "deliver-by-date" => Some(("deliverByDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ship-by-date" => Some(("shipByDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "line-item-id" => Some(("lineItemId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["deliver-by-date", "line-item-id", "operation-id", "product-id", "ship-by-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::OrdersUpdateLineItemShippingDetailsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.orders().updatelineitemshippingdetails(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("order-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_updatemerchantorderid(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -4634,9 +4827,15 @@ impl<'n> Engine<'n> { ("returnlineitem", Some(opt)) => { call_result = self._orders_returnlineitem(opt, dry_run, &mut err); }, + ("setlineitemmetadata", Some(opt)) => { + call_result = self._orders_setlineitemmetadata(opt, dry_run, &mut err); + }, ("shiplineitems", Some(opt)) => { call_result = self._orders_shiplineitems(opt, dry_run, &mut err); }, + ("updatelineitemshippingdetails", Some(opt)) => { + call_result = self._orders_updatelineitemshippingdetails(opt, dry_run, &mut err); + }, ("updatemerchantorderid", Some(opt)) => { call_result = self._orders_updatemerchantorderid(opt, dry_run, &mut err); }, @@ -4815,12 +5014,12 @@ fn main() { Some(false)), ]), ("claimwebsite", - 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."##), + Some(r##"Claims the website of a Merchant Center sub-account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_claimwebsite", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -4865,12 +5064,12 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes a Merchant Center sub-account. This method can only be called for multi-client accounts."##), + Some(r##"Deletes a Merchant Center sub-account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_delete", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. This must be a multi-client account, and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -4887,12 +5086,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), + Some(r##"Retrieves a Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_get", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -4915,12 +5114,12 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Creates a Merchant Center sub-account. This method can only be called for multi-client accounts."##), + Some(r##"Creates a Merchant Center sub-account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_insert", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. This must be a multi-client account."##), Some(true), Some(false)), @@ -4943,12 +5142,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts."##), + Some(r##"Lists the sub-accounts in your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_list", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. This must be a multi-client account."##), Some(true), Some(false)), @@ -4965,12 +5164,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics."##), + Some(r##"Updates a Merchant Center 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"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -4999,12 +5198,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), + Some(r##"Updates a Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_update", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -5058,12 +5257,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), + Some(r##"Retrieves the status of a Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accountstatuses_get", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -5086,12 +5285,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the statuses of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts."##), + Some(r##"Lists the statuses of the sub-accounts in your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accountstatuses_list", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. This must be a multi-client account."##), Some(true), Some(false)), @@ -5133,12 +5332,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), + Some(r##"Retrieves the tax settings of the account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounttax_get", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -5161,12 +5360,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the tax settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts."##), + Some(r##"Lists the tax settings of the sub-accounts in your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounttax_list", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. This must be a multi-client account."##), Some(true), Some(false)), @@ -5183,12 +5382,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics."##), + Some(r##"Updates the tax settings of the 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"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -5217,12 +5416,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), + Some(r##"Updates the tax settings of the account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounttax_update", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -5276,18 +5475,18 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes a datafeed configuration 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."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_delete", vec![ (Some(r##"merchant-id"##), None, - None, + Some(r##"The ID of the account that manages the datafeed. This account cannot be a multi-client account."##), Some(true), Some(false)), (Some(r##"datafeed-id"##), None, - None, + Some(r##"The ID of the datafeed."##), Some(true), Some(false)), @@ -5298,18 +5497,18 @@ fn main() { Some(true)), ]), ("get", - Some(r##"Retrieves a datafeed configuration 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."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_get", vec![ (Some(r##"merchant-id"##), None, - None, + Some(r##"The ID of the account that manages the datafeed. This account cannot be a multi-client account."##), Some(true), Some(false)), (Some(r##"datafeed-id"##), None, - None, + Some(r##"The ID of the datafeed."##), Some(true), Some(false)), @@ -5326,12 +5525,12 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Registers a datafeed configuration 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."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_insert", vec![ (Some(r##"merchant-id"##), None, - None, + Some(r##"The ID of the account that manages the datafeed. This account cannot be a multi-client account."##), Some(true), Some(false)), @@ -5354,12 +5553,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Lists the datafeeds in your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_list", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the datafeeds. This account cannot be a multi-client account."##), Some(true), Some(false)), @@ -5376,18 +5575,18 @@ fn main() { Some(false)), ]), ("patch", - 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."##), + Some(r##"Updates a datafeed configuration of your Merchant Center account. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_patch", vec![ (Some(r##"merchant-id"##), None, - None, + Some(r##"The ID of the account that manages the datafeed. This account cannot be a multi-client account."##), Some(true), Some(false)), (Some(r##"datafeed-id"##), None, - None, + Some(r##"The ID of the datafeed."##), Some(true), Some(false)), @@ -5410,18 +5609,18 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates a datafeed configuration 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."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_update", vec![ (Some(r##"merchant-id"##), None, - None, + Some(r##"The ID of the account that manages the datafeed. This account cannot be a multi-client account."##), Some(true), Some(false)), (Some(r##"datafeed-id"##), None, - None, + Some(r##"The ID of the datafeed."##), Some(true), Some(false)), @@ -5469,18 +5668,18 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Retrieves the status of a datafeed from your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeedstatuses_get", vec![ (Some(r##"merchant-id"##), None, - None, + Some(r##"The ID of the account that manages the datafeed. This account cannot be a multi-client account."##), Some(true), Some(false)), (Some(r##"datafeed-id"##), None, - None, + Some(r##"The ID of the datafeed."##), Some(true), Some(false)), @@ -5497,12 +5696,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Lists the statuses of the datafeeds in your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeedstatuses_list", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the datafeeds. This account cannot be a multi-client account."##), Some(true), Some(false)), @@ -5522,7 +5721,7 @@ fn main() { ("inventory", "methods: 'custombatch' and 'set'", vec![ ("custombatch", - Some(r##"Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. This method can only be called for non-multi-client accounts."##), + Some(r##"Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/inventory_custombatch", vec![ (Some(r##"kv"##), @@ -5544,12 +5743,12 @@ fn main() { Some(false)), ]), ("set", - Some(r##"Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product. This method can only be called for non-multi-client accounts."##), + Some(r##"Updates price and availability of a product in your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/inventory_set", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that contains the product. This account cannot be a multi-client account."##), Some(true), Some(false)), @@ -5561,7 +5760,7 @@ fn main() { (Some(r##"product-id"##), None, - Some(r##"The ID of the product for which to update price and availability."##), + Some(r##"The REST id of the product for which to update price and availability."##), Some(true), Some(false)), @@ -5585,14 +5784,14 @@ fn main() { ]), ]), - ("orders", "methods: 'acknowledge', 'advancetestorder', 'cancel', 'cancellineitem', 'createtestorder', 'custombatch', 'get', 'getbymerchantorderid', 'gettestordertemplate', 'list', 'refund', 'returnlineitem', 'shiplineitems', 'updatemerchantorderid' and 'updateshipment'", vec![ + ("orders", "methods: 'acknowledge', 'advancetestorder', 'cancel', 'cancellineitem', 'createtestorder', 'custombatch', 'get', 'getbymerchantorderid', 'gettestordertemplate', 'list', 'refund', 'returnlineitem', 'setlineitemmetadata', 'shiplineitems', 'updatelineitemshippingdetails', 'updatemerchantorderid' and 'updateshipment'", vec![ ("acknowledge", - Some(r##"Marks an order as acknowledged. This method can only be called for non-multi-client accounts."##), + Some(r##"Marks an order as acknowledged."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_acknowledge", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5621,12 +5820,12 @@ fn main() { Some(false)), ]), ("advancetestorder", - Some(r##"Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts."##), + Some(r##"Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment"."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_advancetestorder", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5649,12 +5848,12 @@ fn main() { Some(false)), ]), ("cancel", - Some(r##"Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts."##), + Some(r##"Cancels all line items in an order, making a full refund."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_cancel", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5683,12 +5882,12 @@ fn main() { Some(false)), ]), ("cancellineitem", - Some(r##"Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts."##), + Some(r##"Cancels a line item, making a full refund."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_cancellineitem", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5717,12 +5916,12 @@ fn main() { Some(false)), ]), ("createtestorder", - Some(r##"Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts."##), + Some(r##"Sandbox only. Creates a test order."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_createtestorder", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that should manage the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5745,7 +5944,7 @@ fn main() { Some(false)), ]), ("custombatch", - Some(r##"Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts."##), + Some(r##"Retrieves or modifies multiple orders in a single request."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_custombatch", vec![ (Some(r##"kv"##), @@ -5767,12 +5966,12 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Retrieves an order from your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_get", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5795,12 +5994,12 @@ fn main() { Some(false)), ]), ("getbymerchantorderid", - Some(r##"Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts."##), + Some(r##"Retrieves an order using merchant order id."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_getbymerchantorderid", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5823,12 +6022,12 @@ fn main() { Some(false)), ]), ("gettestordertemplate", - Some(r##"Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for non-multi-client accounts."##), + Some(r##"Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_gettestordertemplate", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that should manage the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5851,12 +6050,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Lists the orders in your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_list", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5873,12 +6072,12 @@ fn main() { Some(false)), ]), ("refund", - Some(r##"Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts."##), + Some(r##"Refund a portion of the order, up to the full amount paid."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_refund", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5907,12 +6106,46 @@ fn main() { Some(false)), ]), ("returnlineitem", - Some(r##"Returns a line item. This method can only be called for non-multi-client accounts."##), + Some(r##"Returns a line item."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_returnlineitem", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), + Some(true), + Some(false)), + + (Some(r##"order-id"##), + None, + Some(r##"The ID of the order."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("setlineitemmetadata", + Some(r##"Sets (overrides) merchant provided annotations on the line item."##), + "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_setlineitemmetadata", + vec![ + (Some(r##"merchant-id"##), + None, + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5941,12 +6174,46 @@ fn main() { Some(false)), ]), ("shiplineitems", - Some(r##"Marks line item(s) as shipped. This method can only be called for non-multi-client accounts."##), + Some(r##"Marks line item(s) as shipped."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_shiplineitems", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), + Some(true), + Some(false)), + + (Some(r##"order-id"##), + None, + Some(r##"The ID of the order."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("updatelineitemshippingdetails", + Some(r##"Updates ship by and delivery by dates for a line item."##), + "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_updatelineitemshippingdetails", + vec![ + (Some(r##"merchant-id"##), + None, + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -5975,12 +6242,12 @@ fn main() { Some(false)), ]), ("updatemerchantorderid", - Some(r##"Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts."##), + Some(r##"Updates the merchant order ID for a given order."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_updatemerchantorderid", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -6009,12 +6276,12 @@ fn main() { Some(false)), ]), ("updateshipment", - Some(r##"Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts."##), + Some(r##"Updates a shipment's status, carrier, and/or tracking ID."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_updateshipment", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -6046,7 +6313,7 @@ fn main() { ("products", "methods: 'custombatch', 'delete', 'get', 'insert' and 'list'", vec![ ("custombatch", - Some(r##"Retrieves, inserts, and deletes multiple products in a single request. This method can only be called for non-multi-client accounts."##), + Some(r##"Retrieves, inserts, and deletes multiple products in a single request."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/products_custombatch", vec![ (Some(r##"kv"##), @@ -6068,18 +6335,18 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes a product from your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Deletes a product from your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/products_delete", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that contains the product. This account cannot be a multi-client account."##), Some(true), Some(false)), (Some(r##"product-id"##), None, - Some(r##"The ID of the product."##), + Some(r##"The REST id of the product."##), Some(true), Some(false)), @@ -6090,18 +6357,18 @@ fn main() { Some(true)), ]), ("get", - Some(r##"Retrieves a product from your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Retrieves a product from your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/products_get", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that contains the product. This account cannot be a multi-client account."##), Some(true), Some(false)), (Some(r##"product-id"##), None, - Some(r##"The ID of the product."##), + Some(r##"The REST id of the product."##), Some(true), Some(false)), @@ -6118,12 +6385,12 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. This method can only be called for non-multi-client accounts."##), + Some(r##"Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/products_insert", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that contains the product. This account cannot be a multi-client account."##), Some(true), Some(false)), @@ -6146,12 +6413,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the products in your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Lists the products in your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/products_list", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that contains the products. This account cannot be a multi-client account."##), Some(true), Some(false)), @@ -6171,7 +6438,7 @@ fn main() { ("productstatuses", "methods: 'custombatch', 'get' and 'list'", vec![ ("custombatch", - Some(r##"Gets the statuses of multiple products in a single request. This method can only be called for non-multi-client accounts."##), + Some(r##"Gets the statuses of multiple products in a single request."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/productstatuses_custombatch", vec![ (Some(r##"kv"##), @@ -6193,18 +6460,18 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Gets the status of a product from your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Gets the status of a product from your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/productstatuses_get", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that contains the product. This account cannot be a multi-client account."##), Some(true), Some(false)), (Some(r##"product-id"##), None, - Some(r##"The ID of the product."##), + Some(r##"The REST id of the product."##), Some(true), Some(false)), @@ -6221,12 +6488,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the statuses of the products in your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Lists the statuses of the products in your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/productstatuses_list", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that contains the products. This account cannot be a multi-client account."##), Some(true), Some(false)), @@ -6268,12 +6535,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), + Some(r##"Retrieves the shipping settings of the account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/shippingsettings_get", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -6318,12 +6585,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts."##), + Some(r##"Lists the shipping settings of the sub-accounts in your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/shippingsettings_list", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. This must be a multi-client account."##), Some(true), Some(false)), @@ -6340,12 +6607,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics."##), + Some(r##"Updates the shipping settings of the 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"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -6374,12 +6641,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account."##), + Some(r##"Updates the shipping settings of the account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/shippingsettings_update", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), Some(true), Some(false)), @@ -6413,7 +6680,7 @@ fn main() { let mut app = App::new("content2") .author("Sebastian Thiel ") - .version("1.0.6+20170926") + .version("1.0.6+20171207") .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 a036e7eea6..569bc86fdf 100644 --- a/gen/content2/Cargo.toml +++ b/gen/content2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-content2" -version = "1.0.6+20170926" +version = "1.0.6+20171207" 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+20170926" +documentation = "https://docs.rs/google-content2/1.0.6+20171207" license = "MIT" keywords = ["content", "google", "protocol", "web", "api"] diff --git a/gen/content2/README.md b/gen/content2/README.md index a8f6161686..68783ad849 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+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*. +This documentation was generated from *Shopping Content* crate version *1.0.6+20171207*, where *20171207* 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+20170926/google_content2/struct.ShoppingContent.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ShoppingContent.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) +* [accounts](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.Account.html) + * [*authinfo*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountAuthinfoCall.html), [*claimwebsite*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountClaimwebsiteCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountUpdateCall.html) * accountstatuses - * [*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) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccountstatuseListCall.html) * accounttax - * [*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) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccounttaxCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccounttaxGetCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccounttaxListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccounttaxPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.AccounttaxUpdateCall.html) +* [datafeeds](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.Datafeed.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.DatafeedCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.DatafeedDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.DatafeedGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.DatafeedInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.DatafeedListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.DatafeedPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.DatafeedUpdateCall.html) * datafeedstatuses - * [*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) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.DatafeedstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.DatafeedstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.DatafeedstatuseListCall.html) +* [inventory](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.Inventory.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.InventoryCustombatchCall.html) and [*set*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.InventorySetCall.html) +* [orders](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.Order.html) + * [*acknowledge*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderCancellineitemCall.html), [*createtestorder*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderCreatetestorderCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderGettestordertemplateCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderRefundCall.html), [*returnlineitem*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderReturnlineitemCall.html), [*setlineitemmetadata*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderSetlineitemmetadataCall.html), [*shiplineitems*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderShiplineitemCall.html), [*updatelineitemshippingdetails*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderUpdatelineitemshippingdetailCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.OrderUpdateshipmentCall.html) +* [products](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.Product.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ProductCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ProductDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ProductGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ProductInsertCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ProductListCall.html) * productstatuses - * [*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) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ProductstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ProductstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ProductstatuseListCall.html) * shippingsettings - * [*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) + * [*custombatch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ShippingsettingCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ShippingsettingGetCall.html), [*getsupportedcarriers*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ShippingsettingGetsupportedcarrierCall.html), [*list*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ShippingsettingListCall.html), [*patch*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/struct.ShippingsettingPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.6+20171207/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+20170926/google_content2/struct.ShoppingContent.html)** +* **[Hub](https://docs.rs/google-content2/1.0.6+20171207/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+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)** + * creates [*Method Builders*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-content2/1.0.6+20171207/google_content2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-content2/1.0.6+20171207/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+20170926/google_content2/trait.Part.html)** + * **[Parts](https://docs.rs/google-content2/1.0.6+20171207/google_content2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-content2/1.0.6+20170926/google_content2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-content2/1.0.6+20171207/google_content2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -72,14 +72,16 @@ let r = hub.orders().advancetestorder(...).doit() let r = hub.orders().updatemerchantorderid(...).doit() let r = hub.orders().returnlineitem(...).doit() let r = hub.orders().gettestordertemplate(...).doit() +let r = hub.orders().setlineitemmetadata(...).doit() +let r = hub.orders().updatelineitemshippingdetails(...).doit() +let r = hub.orders().shiplineitems(...).doit() let r = hub.orders().createtestorder(...).doit() let r = hub.orders().refund(...).doit() let r = hub.orders().custombatch(...).doit() -let r = hub.orders().cancellineitem(...).doit() let r = hub.orders().getbymerchantorderid(...).doit() let r = hub.orders().acknowledge(...).doit() let r = hub.orders().cancel(...).doit() -let r = hub.orders().shiplineitems(...).doit() +let r = hub.orders().cancellineitem(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -155,17 +157,17 @@ match result { ``` ## Handling Errors -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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-content2/1.0.6+20171207/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+20170926/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+20171207/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+20170926/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+20171207/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+20170926/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+20171207/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 +177,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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-content2/1.0.6+20171207/google_content2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-content2/1.0.6+20171207/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+20170926/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+20171207/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-content2/1.0.6+20171207/google_content2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-content2/1.0.6+20171207/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+20170926/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+20171207/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+20170926/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+20171207/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+20170926/google_content2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-content2/1.0.6+20171207/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 c105564ffd..2358a5ceff 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+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*. +//! This documentation was generated from *Shopping Content* crate version *1.0.6+20171207*, where *20171207* 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). @@ -24,7 +24,7 @@ //! * [inventory](struct.Inventory.html) //! * [*custombatch*](struct.InventoryCustombatchCall.html) and [*set*](struct.InventorySetCall.html) //! * [orders](struct.Order.html) -//! * [*acknowledge*](struct.OrderAcknowledgeCall.html), [*advancetestorder*](struct.OrderAdvancetestorderCall.html), [*cancel*](struct.OrderCancelCall.html), [*cancellineitem*](struct.OrderCancellineitemCall.html), [*createtestorder*](struct.OrderCreatetestorderCall.html), [*custombatch*](struct.OrderCustombatchCall.html), [*get*](struct.OrderGetCall.html), [*getbymerchantorderid*](struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](struct.OrderGettestordertemplateCall.html), [*list*](struct.OrderListCall.html), [*refund*](struct.OrderRefundCall.html), [*returnlineitem*](struct.OrderReturnlineitemCall.html), [*shiplineitems*](struct.OrderShiplineitemCall.html), [*updatemerchantorderid*](struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](struct.OrderUpdateshipmentCall.html) +//! * [*acknowledge*](struct.OrderAcknowledgeCall.html), [*advancetestorder*](struct.OrderAdvancetestorderCall.html), [*cancel*](struct.OrderCancelCall.html), [*cancellineitem*](struct.OrderCancellineitemCall.html), [*createtestorder*](struct.OrderCreatetestorderCall.html), [*custombatch*](struct.OrderCustombatchCall.html), [*get*](struct.OrderGetCall.html), [*getbymerchantorderid*](struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](struct.OrderGettestordertemplateCall.html), [*list*](struct.OrderListCall.html), [*refund*](struct.OrderRefundCall.html), [*returnlineitem*](struct.OrderReturnlineitemCall.html), [*setlineitemmetadata*](struct.OrderSetlineitemmetadataCall.html), [*shiplineitems*](struct.OrderShiplineitemCall.html), [*updatelineitemshippingdetails*](struct.OrderUpdatelineitemshippingdetailCall.html), [*updatemerchantorderid*](struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](struct.OrderUpdateshipmentCall.html) //! * [products](struct.Product.html) //! * [*custombatch*](struct.ProductCustombatchCall.html), [*delete*](struct.ProductDeleteCall.html), [*get*](struct.ProductGetCall.html), [*insert*](struct.ProductInsertCall.html) and [*list*](struct.ProductListCall.html) //! * productstatuses @@ -72,14 +72,16 @@ //! let r = hub.orders().updatemerchantorderid(...).doit() //! let r = hub.orders().returnlineitem(...).doit() //! let r = hub.orders().gettestordertemplate(...).doit() +//! let r = hub.orders().setlineitemmetadata(...).doit() +//! let r = hub.orders().updatelineitemshippingdetails(...).doit() +//! let r = hub.orders().shiplineitems(...).doit() //! let r = hub.orders().createtestorder(...).doit() //! let r = hub.orders().refund(...).doit() //! let r = hub.orders().custombatch(...).doit() -//! let r = hub.orders().cancellineitem(...).doit() //! let r = hub.orders().getbymerchantorderid(...).doit() //! let r = hub.orders().acknowledge(...).doit() //! let r = hub.orders().cancel(...).doit() -//! let r = hub.orders().shiplineitems(...).doit() +//! let r = hub.orders().cancellineitem(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -546,6 +548,60 @@ pub struct AccountUser { impl Part for AccountUser {} +/// 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*). +/// +/// * [updatelineitemshippingdetails orders](struct.OrderUpdatelineitemshippingdetailCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersUpdateLineItemShippingDetailsRequest { + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, + /// Updated delivery by date, in ISO 8601 format. If not specified only ship by date is updated. + #[serde(rename="deliverByDate")] + pub deliver_by_date: Option, + /// The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, + /// The ID of the line item to set metadata. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// Updated ship by date, in ISO 8601 format. If not specified only deliver by date is updated. + #[serde(rename="shipByDate")] + pub ship_by_date: Option, +} + +impl RequestValue for OrdersUpdateLineItemShippingDetailsRequest {} + + +/// 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 OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails { + /// Updated delivery by date, in ISO 8601 format. If not specified only ship by date is updated. + #[serde(rename="deliverByDate")] + pub deliver_by_date: Option, + /// The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, + /// The ID of the line item to set metadata. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// Updated ship by date, in ISO 8601 format. If not specified only deliver by date is updated. + #[serde(rename="shipByDate")] + pub ship_by_date: Option, +} + +impl Part for OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails {} + + /// A batch entry encoding a single non-batch products response. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -665,6 +721,42 @@ pub struct TestOrderCustomer { impl Part for TestOrderCustomer {} +/// 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 OrderAddress { + /// City, town or commune. May also include dependent localities or sublocalities (e.g. neighborhoods or suburbs). + pub locality: Option, + /// CLDR country code (e.g. "US"). + pub country: Option, + /// Strings representing the lines of the printed label for mailing the order, for example: + /// John Smith + /// 1600 Amphitheatre Parkway + /// Mountain View, CA, 94043 + /// United States + #[serde(rename="fullAddress")] + pub full_address: Option>, + /// Street-level part of the address. + #[serde(rename="streetAddress")] + pub street_address: Option>, + /// Postal Code or ZIP (e.g. "94043"). + #[serde(rename="postalCode")] + pub postal_code: Option, + /// Name of the recipient. + #[serde(rename="recipientName")] + pub recipient_name: Option, + /// Whether the address is a post office box. + #[serde(rename="isPostOfficeBox")] + pub is_post_office_box: Option, + /// Top-level administrative subdivision of the country (e.g. "CA"). + pub region: Option, +} + +impl Part for OrderAddress {} + + /// There is no detailed description. /// /// # Activities @@ -740,6 +832,9 @@ pub struct Account { /// The merchant's website. #[serde(rename="websiteUrl")] pub website_url: Option, + /// The GMB account which is linked or in the process of being linked with the Merchant Center accounnt. + #[serde(rename="googleMyBusinessLink")] + pub google_my_business_link: Option, /// Client-specific, locally-unique, internal ID for the child account. #[serde(rename="sellerId")] pub seller_id: Option, @@ -774,6 +869,21 @@ pub struct OrdersGetByMerchantOrderIdResponse { impl ResponseResult for OrdersGetByMerchantOrderIdResponse {} +/// 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 OrderMerchantProvidedAnnotation { + /// Key for additional merchant provided (as key-value pairs) annotation about the line item. + pub key: Option, + /// Value for additional merchant provided (as key-value pairs) annotation about the line item. + pub value: Option, +} + +impl Part for OrderMerchantProvidedAnnotation {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -848,12 +958,12 @@ impl ResponseResult for OrdersListResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Headers { - /// be "infinity". For example [{"value": "10", "currency": "USD"}, {"value": "500", "currency": "USD"}, {"value": "infinity", "currency": "USD"}] represents the headers "<= $10", " $500". All prices within a service must have the same currency. Must be non-empty. Can only be set if all other fields are not set. + /// A list of inclusive order price upper bounds. The last price's value can be "infinity". For example [{"value": "10", "currency": "USD"}, {"value": "500", "currency": "USD"}, {"value": "infinity", "currency": "USD"}] represents the headers "<= $10", " $500". All prices within a service must have the same currency. Must be non-empty. Can only be set if all other fields are not set. pub prices: Option>, /// A list of postal group names. The last value can be "all other locations". Example: ["zone 1", "zone 2", "all other locations"]. The referred postal code groups must match the delivery country of the service. Must be non-empty. Can only be set if all other fields are not set. #[serde(rename="postalCodeGroupNames")] pub postal_code_group_names: Option>, - /// be "infinity". For example [{"value": "10", "unit": "kg"}, {"value": "50", "unit": "kg"}, {"value": "infinity", "unit": "kg"}] represents the headers "<= 10kg", " 50kg". All weights within a service must have the same unit. Must be non-empty. Can only be set if all other fields are not set. + /// A list of inclusive order weight upper bounds. The last weight's value can be "infinity". For example [{"value": "10", "unit": "kg"}, {"value": "50", "unit": "kg"}, {"value": "infinity", "unit": "kg"}] represents the headers "<= 10kg", " 50kg". All weights within a service must have the same unit. Must be non-empty. Can only be set if all other fields are not set. pub weights: Option>, /// A list of location ID sets. Must be non-empty. Can only be set if all other fields are not set. pub locations: Option>, @@ -871,7 +981,10 @@ impl Part for Headers {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrderShipmentLineItemShipment { - /// The id of the line item that is shipped. + /// The ID of the product to ship. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, + /// The id of the line item that is shipped. Either lineItemId or productId is required. #[serde(rename="lineItemId")] pub line_item_id: Option, /// The quantity that is shipped. @@ -941,9 +1054,9 @@ pub struct OrdersCustomBatchRequestEntry { /// The ID of the order. Required for all methods beside getByMerchantOrderId. #[serde(rename="orderId")] pub order_id: Option, - /// An entry ID, unique within the batch request. - #[serde(rename="batchId")] - pub batch_id: Option, + /// Required for updateLineItemShippingDate method. + #[serde(rename="updateLineItemShippingDetails")] + pub update_line_item_shipping_details: Option, /// Required for shipLineItems method. #[serde(rename="shipLineItems")] pub ship_line_items: Option, @@ -953,12 +1066,18 @@ pub struct OrdersCustomBatchRequestEntry { /// The ID of the managing account. #[serde(rename="merchantId")] pub merchant_id: Option, + /// Required for setLineItemMetadata method. + #[serde(rename="setLineItemMetadata")] + pub set_line_item_metadata: Option, /// The merchant order id. Required for updateMerchantOrderId and getByMerchantOrderId methods. #[serde(rename="merchantOrderId")] pub merchant_order_id: Option, /// Required for cancelLineItem method. #[serde(rename="cancelLineItem")] pub cancel_line_item: Option, + /// An entry ID, unique within the batch request. + #[serde(rename="batchId")] + pub batch_id: Option, /// Required for refund method. pub refund: Option, /// Required for cancel method. @@ -976,6 +1095,27 @@ pub struct OrdersCustomBatchRequestEntry { impl Part for OrdersCustomBatchRequestEntry {} +/// 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*). +/// +/// * [setlineitemmetadata orders](struct.OrderSetlineitemmetadataCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersSetLineItemMetadataResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersSetLineItemMetadataResponse". + pub kind: Option, + /// The status of the execution. + #[serde(rename="executionStatus")] + pub execution_status: Option, +} + +impl ResponseResult for OrdersSetLineItemMetadataResponse {} + + /// A batch entry encoding a single non-batch products request. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1006,13 +1146,19 @@ impl Part for ProductsCustomBatchRequestEntry {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersCustomBatchRequestEntryRefund { + /// The reason for the refund. + pub reason: Option, /// The amount that is refunded. pub amount: Option, /// The explanation of the reason. #[serde(rename="reasonText")] pub reason_text: Option, - /// The reason for the refund. - pub reason: Option, + /// Tax amount that correspond to refund amount in amountPretax. + #[serde(rename="amountTax")] + pub amount_tax: Option, + /// The amount that is refunded. Either amount or amountPretax and amountTax should be filled. + #[serde(rename="amountPretax")] + pub amount_pretax: Option, } impl Part for OrdersCustomBatchRequestEntryRefund {} @@ -1366,6 +1512,27 @@ pub struct OrdersShipLineItemsRequest { impl RequestValue for OrdersShipLineItemsRequest {} +/// 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*). +/// +/// * [updatelineitemshippingdetails orders](struct.OrderUpdatelineitemshippingdetailCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersUpdateLineItemShippingDetailsResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersUpdateLineItemShippingDetailsResponse". + pub kind: Option, + /// The status of the execution. + #[serde(rename="executionStatus")] + pub execution_status: Option, +} + +impl ResponseResult for OrdersUpdateLineItemShippingDetailsResponse {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1526,38 +1693,29 @@ impl ResponseResult for OrdersShipLineItemsResponse {} /// 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*). +/// +/// * [setlineitemmetadata orders](struct.OrderSetlineitemmetadataCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrderAddress { - /// City, town or commune. May also include dependent localities or sublocalities (e.g. neighborhoods or suburbs). - pub locality: Option, - /// CLDR country code (e.g. "US"). - pub country: Option, - /// Strings representing the lines of the printed label for mailing the order, for example: - /// John Smith - /// 1600 Amphitheatre Parkway - /// Mountain View, CA, 94043 - /// United States - #[serde(rename="fullAddress")] - pub full_address: Option>, - /// Street-level part of the address. - #[serde(rename="streetAddress")] - pub street_address: Option>, - /// Postal Code or ZIP (e.g. "94043"). - #[serde(rename="postalCode")] - pub postal_code: Option, - /// Name of the recipient. - #[serde(rename="recipientName")] - pub recipient_name: Option, - /// Whether the address is a post office box. - #[serde(rename="isPostOfficeBox")] - pub is_post_office_box: Option, - /// Top-level administrative subdivision of the country (e.g. "CA"). - pub region: Option, +pub struct OrdersSetLineItemMetadataRequest { + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, + /// no description provided + pub annotations: Option>, + /// The ID of the line item to set metadata. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, } -impl Part for OrderAddress {} +impl RequestValue for OrdersSetLineItemMetadataRequest {} /// There is no detailed description. @@ -1681,19 +1839,28 @@ impl RequestValue for InventoryCustomBatchRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersCancelLineItemRequest { + /// The ID of the product to cancel. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, /// Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order. pub amount: Option, + /// Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order. + #[serde(rename="amountPretax")] + pub amount_pretax: Option, /// The explanation of the reason. #[serde(rename="reasonText")] pub reason_text: Option, - /// The ID of the line item to cancel. + /// The ID of the line item to cancel. Either lineItemId or productId is required. #[serde(rename="lineItemId")] pub line_item_id: Option, + /// The reason for the cancellation. + pub reason: Option, + /// Tax amount that correspond to cancellation amount in amountPretax. + #[serde(rename="amountTax")] + pub amount_tax: Option, /// The ID of the operation. Unique across all operations for a given order. #[serde(rename="operationId")] pub operation_id: Option, - /// The reason for the cancellation. - pub reason: Option, /// The quantity to cancel. pub quantity: Option, } @@ -1820,6 +1987,8 @@ pub struct OrderLineItem { /// Number of items shipped. #[serde(rename="quantityShipped")] pub quantity_shipped: Option, + /// Annotations that are attached to the line item. + pub annotations: Option>, /// Number of items returned. #[serde(rename="quantityReturned")] pub quantity_returned: Option, @@ -2471,13 +2640,19 @@ impl RequestValue for DatafeedstatusesCustomBatchRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersRefundRequest { - /// The amount that is refunded. - pub amount: Option, + /// The amount that is refunded. Either amount or amountPretax and amountTax should be filled. + #[serde(rename="amountPretax")] + pub amount_pretax: Option, /// The explanation of the reason. #[serde(rename="reasonText")] pub reason_text: Option, /// The reason for the refund. pub reason: Option, + /// Tax amount that correspond to refund amount in amountPretax. + #[serde(rename="amountTax")] + pub amount_tax: Option, + /// The amount that is refunded. + pub amount: Option, /// The ID of the operation. Unique across all operations for a given order. #[serde(rename="operationId")] pub operation_id: Option, @@ -2535,16 +2710,25 @@ impl ResponseResult for DatafeedsListResponse {} pub struct OrdersCustomBatchRequestEntryCancelLineItem { /// Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order. pub amount: Option, + /// Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order. + #[serde(rename="amountPretax")] + pub amount_pretax: Option, /// The explanation of the reason. #[serde(rename="reasonText")] pub reason_text: Option, - /// The reason for the cancellation. - pub reason: Option, - /// The ID of the line item to cancel. + /// The ID of the line item to cancel. Either lineItemId or productId is required. #[serde(rename="lineItemId")] pub line_item_id: Option, + /// The reason for the cancellation. + pub reason: Option, + /// Tax amount that correspond to cancellation amount in amountPretax. + #[serde(rename="amountTax")] + pub amount_tax: Option, /// The quantity to cancel. pub quantity: Option, + /// The ID of the product to cancel. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, } impl Part for OrdersCustomBatchRequestEntryCancelLineItem {} @@ -2580,7 +2764,10 @@ pub struct OrdersCustomBatchRequestEntryReturnLineItem { /// The explanation of the reason. #[serde(rename="reasonText")] pub reason_text: Option, - /// The ID of the line item to return. + /// The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, + /// The ID of the line item to return. Either lineItemId or productId is required. #[serde(rename="lineItemId")] pub line_item_id: Option, /// The quantity to return. @@ -2734,6 +2921,22 @@ pub struct OrderLineItemProduct { impl Part for OrderLineItemProduct {} +/// 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 AccountGoogleMyBusinessLink { + /// Status of the link between this Merchant Center account and the GMB account. + pub status: Option, + /// The GMB email address. + #[serde(rename="gmbEmail")] + pub gmb_email: Option, +} + +impl Part for AccountGoogleMyBusinessLink {} + + /// Datafeed configuration data. /// /// # Activities @@ -2758,7 +2961,7 @@ pub struct Datafeed { pub content_type: Option, /// A descriptive name of the data feed. pub name: Option, - /// [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. + /// [DEPRECATED] Please use targets[].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. @@ -2766,13 +2969,13 @@ pub struct Datafeed { /// Fetch schedule for the feed file. #[serde(rename="fetchSchedule")] pub fetch_schedule: Option, - /// [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. + /// [DEPRECATED] Please use targets[].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, - /// [DEPRECATED] Please use target.includedDestination instead. The list of intended destinations (corresponds to checked check boxes in Merchant Center). + /// [DEPRECATED] Please use targets[].includedDestinations 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. @@ -2804,6 +3007,9 @@ pub struct TestOrder { /// Line items that are ordered. At least one line item must be provided. #[serde(rename="lineItems")] pub line_items: Option>, + /// Determines if test order must be pulled by merchant or pushed to merchant via push integration. + #[serde(rename="notificationMode")] + pub notification_mode: Option, /// Identifier of one of the predefined delivery addresses for the delivery. #[serde(rename="predefinedDeliveryAddress")] pub predefined_delivery_address: Option, @@ -3031,26 +3237,20 @@ pub struct OrderShipment { /// 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" + /// - "emsy" + /// - "ont" + /// - "deliv" /// - "dynamex" /// - "lasership" - /// - "smartpost" - /// - "fedex smartpost" /// - "mpx" - /// - "uds" - /// - "united delivery service" + /// - "uds" pub carrier: Option, /// The tracking id for the shipment. #[serde(rename="trackingId")] @@ -3371,17 +3571,20 @@ impl Part for OrderPromotion {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersReturnLineItemRequest { - /// The ID of the operation. Unique across all operations for a given order. - #[serde(rename="operationId")] - pub operation_id: Option, /// The reason for the return. pub reason: Option, /// The explanation of the reason. #[serde(rename="reasonText")] pub reason_text: Option, - /// The ID of the line item to return. + /// The ID of the line item to return. Either lineItemId or productId is required. #[serde(rename="lineItemId")] pub line_item_id: Option, + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, + /// The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, /// The quantity to return. pub quantity: Option, } @@ -3489,223 +3692,23 @@ pub struct OrdersCustomBatchResponse { impl ResponseResult for OrdersCustomBatchResponse {} -/// Product data. +/// 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*). -/// -/// * [delete products](struct.ProductDeleteCall.html) (none) -/// * [custombatch products](struct.ProductCustombatchCall.html) (none) -/// * [get products](struct.ProductGetCall.html) (response) -/// * [list products](struct.ProductListCall.html) (none) -/// * [insert products](struct.ProductInsertCall.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 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. - #[serde(rename="adwordsLabels")] - pub adwords_labels: Option>, - /// Shared identifier for all variants of the same product. - #[serde(rename="itemGroupId")] - pub item_group_id: Option, - /// Date on which the item should expire, as specified upon insertion, in ISO 8601 format. The actual expiration date in Google Shopping is exposed in productstatuses as googleExpirationDate and might be earlier if expirationDate is too far in the future. - #[serde(rename="expirationDate")] - pub expiration_date: Option, - /// Availability status of the item. - pub availability: Option, - /// Used to group items in an arbitrary way. Only for CPA%, discouraged otherwise. - #[serde(rename="adwordsGrouping")] - pub adwords_grouping: Option, - /// Specifies the intended destinations for the product. - pub destinations: Option>, - /// The CLDR territory code for the item. - #[serde(rename="targetCountry")] - pub target_country: Option, - /// Custom label 4 for custom grouping of items in a Shopping campaign. - #[serde(rename="customLabel4")] - pub custom_label4: Option, - /// Title of the item. - pub title: Option, - /// Additional categories of the item (formatted as in products feed specification). - #[serde(rename="additionalProductTypes")] - pub additional_product_types: Option>, - /// Whether an item is available for purchase only online. - #[serde(rename="onlineOnly")] - pub online_only: Option, - /// Link to a mobile-optimized version of the landing page. - #[serde(rename="mobileLink")] - pub mobile_link: Option, - /// The unique ID of a promotion. - #[serde(rename="promotionIds")] - pub promotion_ids: Option>, - /// Specifies the intended aspects for the product. - pub aspects: Option>, - /// Height of the item for shipping. - #[serde(rename="shippingHeight")] - pub shipping_height: Option, - /// The two-letter ISO 639-1 language code for the item. - #[serde(rename="contentLanguage")] - pub content_language: Option, - /// Manufacturer Part Number (MPN) of the item. - pub mpn: Option, - /// Date range during which the item is on sale (see products feed specification). - #[serde(rename="salePriceEffectiveDate")] - pub sale_price_effective_date: Option, - /// Brand of the item. - pub brand: Option, - /// The material of which the item is made. - pub material: Option, - /// URL directly linking to your item's page on your website. - pub link: Option, - /// Allows advertisers to override the item URL when the product is shown within the context of Product Ads. - #[serde(rename="adwordsRedirect")] - pub adwords_redirect: Option, - /// The energy efficiency class as defined in EU directive 2010/30/EU. - #[serde(rename="energyEfficiencyClass")] - pub energy_efficiency_class: Option, - /// System in which the size is specified. Recommended for apparel items. - #[serde(rename="sizeSystem")] - pub size_system: Option, - /// The cut of the item. Recommended for apparel items. - #[serde(rename="sizeType")] - pub size_type: Option, - /// Custom label 3 for custom grouping of items in a Shopping campaign. - #[serde(rename="customLabel3")] - pub custom_label3: Option, - /// Custom label 2 for custom grouping of items in a Shopping campaign. - #[serde(rename="customLabel2")] - pub custom_label2: Option, - /// Condition or state of the item. - pub condition: Option, - /// Custom label 0 for custom grouping of items in a Shopping campaign. - #[serde(rename="customLabel0")] - pub custom_label0: Option, - /// Identifies what kind of resource this is. Value: the fixed string "content#product". - pub kind: Option, - /// Number and amount of installments to pay for an item. Brazil only. - pub installment: Option, - /// Size of the item. - pub sizes: Option>, - /// Target gender of the item. - pub gender: Option, - /// Tax information. - pub taxes: Option>, - /// False when the item does not have unique product identifiers appropriate to its category, such as GTIN, MPN, and brand. Required according to the Unique Product Identifier Rules for all target countries except for Canada. - #[serde(rename="identifierExists")] - pub identifier_exists: Option, - /// Advertised sale price of the item. - #[serde(rename="salePrice")] - pub sale_price: Option, - /// Your category of the item (formatted as in products feed specification). - #[serde(rename="productType")] - pub product_type: Option, - /// Advertiser-specified recommendations. - #[serde(rename="displayAdsSimilarIds")] - pub display_ads_similar_ids: Option>, - /// Custom label 1 for custom grouping of items in a Shopping campaign. - #[serde(rename="customLabel1")] - pub custom_label1: Option, - /// Target age group of the item. - #[serde(rename="ageGroup")] - pub age_group: Option, - /// Title of an item for dynamic remarketing campaigns. - #[serde(rename="displayAdsTitle")] - pub display_ads_title: Option, - /// Additional URLs of images of the item. - #[serde(rename="additionalImageLinks")] - pub additional_image_links: Option>, - /// 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. - #[serde(rename="shippingLabel")] - pub shipping_label: Option, - /// Google's category of the item (see Google product taxonomy). - #[serde(rename="googleProductCategory")] - pub google_product_category: Option, - /// The number of identical products in a merchant-defined multipack. - pub multipack: Option, - /// An identifier for an item for dynamic remarketing campaigns. - #[serde(rename="displayAdsId")] - pub display_ads_id: Option, - /// Offer margin for dynamic remarketing campaigns. - #[serde(rename="displayAdsValue")] - pub display_ads_value: Option, - /// The REST id of the product. - pub id: Option, - /// Width of the item for shipping. - #[serde(rename="shippingWidth")] - pub shipping_width: Option, - /// The item's pattern (e.g. polka dots). - pub pattern: Option, - /// The measure and dimension of an item. - #[serde(rename="unitPricingMeasure")] - pub unit_pricing_measure: Option, - /// A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the feed specification in its generic form (e.g., { "name": "size type", "type": "text", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API. - #[serde(rename="customAttributes")] - pub custom_attributes: Option>, - /// The day a pre-ordered product becomes available for delivery, in ISO 8601 format. - #[serde(rename="availabilityDate")] - pub availability_date: Option, - /// Whether the item is a merchant-defined bundle. A bundle is a custom grouping of different products sold by a merchant for a single price. - #[serde(rename="isBundle")] - pub is_bundle: Option, - /// The item's channel (online or local). - pub channel: Option, - /// Description of the item. - pub description: Option, - /// Read-only warnings. - pub warnings: Option>, - /// Price of the item. - pub price: Option, - /// Length of the item for shipping. - #[serde(rename="shippingLength")] - pub shipping_length: Option, - /// The quantity of the product that is reserved for sell-on-google ads. - #[serde(rename="sellOnGoogleQuantity")] - pub sell_on_google_quantity: Option, - /// URL directly to your item's landing page for dynamic remarketing campaigns. - #[serde(rename="displayAdsLink")] - pub display_ads_link: Option, - /// The read-only list of intended destinations which passed validation. - #[serde(rename="validatedDestinations")] - pub validated_destinations: Option>, - /// A list of custom (merchant-provided) custom attribute groups. - #[serde(rename="customGroups")] - pub custom_groups: Option>, - /// Loyalty points that users receive after purchasing the item. Japan only. - #[serde(rename="loyaltyPoints")] - pub loyalty_points: Option, - /// The preference of the denominator of the unit price. - #[serde(rename="unitPricingBaseMeasure")] - pub unit_pricing_base_measure: Option, - /// Shipping rules. - pub shipping: Option>, - /// Weight of the item for shipping. - #[serde(rename="shippingWeight")] - pub shipping_weight: Option, - /// URL of an image of the item. - #[serde(rename="imageLink")] - pub image_link: Option, - /// Set to true if the item is targeted towards adults. - pub adult: Option, +pub struct OrdersCustomBatchRequestEntrySetLineItemMetadata { + /// no description provided + pub annotations: Option>, + /// The ID of the line item to set metadata. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, } -impl RequestValue for Product {} -impl Resource for Product {} -impl ResponseResult for Product {} +impl Part for OrdersCustomBatchRequestEntrySetLineItemMetadata {} /// There is no detailed description. @@ -3848,14 +3851,16 @@ impl Part for DatafeedsCustomBatchRequestEntry {} /// * [updatemerchantorderid orders](struct.OrderUpdatemerchantorderidCall.html) (none) /// * [returnlineitem orders](struct.OrderReturnlineitemCall.html) (none) /// * [gettestordertemplate orders](struct.OrderGettestordertemplateCall.html) (none) +/// * [setlineitemmetadata orders](struct.OrderSetlineitemmetadataCall.html) (none) +/// * [updatelineitemshippingdetails orders](struct.OrderUpdatelineitemshippingdetailCall.html) (none) +/// * [shiplineitems orders](struct.OrderShiplineitemCall.html) (none) /// * [createtestorder orders](struct.OrderCreatetestorderCall.html) (none) /// * [refund orders](struct.OrderRefundCall.html) (none) /// * [custombatch orders](struct.OrderCustombatchCall.html) (none) -/// * [cancellineitem orders](struct.OrderCancellineitemCall.html) (none) /// * [getbymerchantorderid orders](struct.OrderGetbymerchantorderidCall.html) (none) /// * [acknowledge orders](struct.OrderAcknowledgeCall.html) (none) /// * [cancel orders](struct.OrderCancelCall.html) (none) -/// * [shiplineitems orders](struct.OrderShiplineitemCall.html) (none) +/// * [cancellineitem orders](struct.OrderCancellineitemCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Order { @@ -4163,6 +4168,227 @@ pub struct ProductstatusesCustomBatchResponseEntry { impl Part for ProductstatusesCustomBatchResponseEntry {} +/// Product data. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete products](struct.ProductDeleteCall.html) (none) +/// * [custombatch products](struct.ProductCustombatchCall.html) (none) +/// * [get products](struct.ProductGetCall.html) (response) +/// * [list products](struct.ProductListCall.html) (none) +/// * [insert products](struct.ProductInsertCall.html) (request|response) +/// +#[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. + #[serde(rename="adwordsLabels")] + pub adwords_labels: Option>, + /// Shared identifier for all variants of the same product. + #[serde(rename="itemGroupId")] + pub item_group_id: Option, + /// Date on which the item should expire, as specified upon insertion, in ISO 8601 format. The actual expiration date in Google Shopping is exposed in productstatuses as googleExpirationDate and might be earlier if expirationDate is too far in the future. + #[serde(rename="expirationDate")] + pub expiration_date: Option, + /// Availability status of the item. + pub availability: Option, + /// Used to group items in an arbitrary way. Only for CPA%, discouraged otherwise. + #[serde(rename="adwordsGrouping")] + pub adwords_grouping: Option, + /// Specifies the intended destinations for the product. + pub destinations: Option>, + /// The CLDR territory code for the item. + #[serde(rename="targetCountry")] + pub target_country: Option, + /// Custom label 4 for custom grouping of items in a Shopping campaign. + #[serde(rename="customLabel4")] + pub custom_label4: Option, + /// Title of the item. + pub title: Option, + /// Additional categories of the item (formatted as in products feed specification). + #[serde(rename="additionalProductTypes")] + pub additional_product_types: Option>, + /// Whether an item is available for purchase only online. + #[serde(rename="onlineOnly")] + pub online_only: Option, + /// Link to a mobile-optimized version of the landing page. + #[serde(rename="mobileLink")] + pub mobile_link: Option, + /// The unique ID of a promotion. + #[serde(rename="promotionIds")] + pub promotion_ids: Option>, + /// Specifies the intended aspects for the product. + pub aspects: Option>, + /// Height of the item for shipping. + #[serde(rename="shippingHeight")] + pub shipping_height: Option, + /// The two-letter ISO 639-1 language code for the item. + #[serde(rename="contentLanguage")] + pub content_language: Option, + /// Manufacturer Part Number (MPN) of the item. + pub mpn: Option, + /// Date range during which the item is on sale (see products feed specification). + #[serde(rename="salePriceEffectiveDate")] + pub sale_price_effective_date: Option, + /// Brand of the item. + pub brand: Option, + /// The material of which the item is made. + pub material: Option, + /// URL directly linking to your item's page on your website. + pub link: Option, + /// Allows advertisers to override the item URL when the product is shown within the context of Product Ads. + #[serde(rename="adwordsRedirect")] + pub adwords_redirect: Option, + /// The energy efficiency class as defined in EU directive 2010/30/EU. + #[serde(rename="energyEfficiencyClass")] + pub energy_efficiency_class: Option, + /// System in which the size is specified. Recommended for apparel items. + #[serde(rename="sizeSystem")] + pub size_system: Option, + /// The cut of the item. Recommended for apparel items. + #[serde(rename="sizeType")] + pub size_type: Option, + /// Custom label 3 for custom grouping of items in a Shopping campaign. + #[serde(rename="customLabel3")] + pub custom_label3: Option, + /// Custom label 2 for custom grouping of items in a Shopping campaign. + #[serde(rename="customLabel2")] + pub custom_label2: Option, + /// Condition or state of the item. + pub condition: Option, + /// Custom label 0 for custom grouping of items in a Shopping campaign. + #[serde(rename="customLabel0")] + pub custom_label0: Option, + /// Identifies what kind of resource this is. Value: the fixed string "content#product". + pub kind: Option, + /// Number and amount of installments to pay for an item. Brazil only. + pub installment: Option, + /// Size of the item. + pub sizes: Option>, + /// Target gender of the item. + pub gender: Option, + /// Tax information. + pub taxes: Option>, + /// False when the item does not have unique product identifiers appropriate to its category, such as GTIN, MPN, and brand. Required according to the Unique Product Identifier Rules for all target countries except for Canada. + #[serde(rename="identifierExists")] + pub identifier_exists: Option, + /// Advertised sale price of the item. + #[serde(rename="salePrice")] + pub sale_price: Option, + /// Your category of the item (formatted as in products feed specification). + #[serde(rename="productType")] + pub product_type: Option, + /// Advertiser-specified recommendations. + #[serde(rename="displayAdsSimilarIds")] + pub display_ads_similar_ids: Option>, + /// Custom label 1 for custom grouping of items in a Shopping campaign. + #[serde(rename="customLabel1")] + pub custom_label1: Option, + /// Target age group of the item. + #[serde(rename="ageGroup")] + pub age_group: Option, + /// Title of an item for dynamic remarketing campaigns. + #[serde(rename="displayAdsTitle")] + pub display_ads_title: Option, + /// Additional URLs of images of the item. + #[serde(rename="additionalImageLinks")] + pub additional_image_links: Option>, + /// A unique identifier for 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. + /// Note: Content API methods that operate on products take the REST id of the product, not this identifier. + #[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. + #[serde(rename="shippingLabel")] + pub shipping_label: Option, + /// Google's category of the item (see Google product taxonomy). + #[serde(rename="googleProductCategory")] + pub google_product_category: Option, + /// The number of identical products in a merchant-defined multipack. + pub multipack: Option, + /// An identifier for an item for dynamic remarketing campaigns. + #[serde(rename="displayAdsId")] + pub display_ads_id: Option, + /// Offer margin for dynamic remarketing campaigns. + #[serde(rename="displayAdsValue")] + pub display_ads_value: Option, + /// The REST id of the product. Content API methods that operate on products take this as their productId parameter. + /// The REST id for a product is of the form channel:contentLanguage:targetCountry:offerId. + pub id: Option, + /// Width of the item for shipping. + #[serde(rename="shippingWidth")] + pub shipping_width: Option, + /// The item's pattern (e.g. polka dots). + pub pattern: Option, + /// The measure and dimension of an item. + #[serde(rename="unitPricingMeasure")] + pub unit_pricing_measure: Option, + /// A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the feed specification in its generic form (e.g., { "name": "size type", "type": "text", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API. + #[serde(rename="customAttributes")] + pub custom_attributes: Option>, + /// The day a pre-ordered product becomes available for delivery, in ISO 8601 format. + #[serde(rename="availabilityDate")] + pub availability_date: Option, + /// Whether the item is a merchant-defined bundle. A bundle is a custom grouping of different products sold by a merchant for a single price. + #[serde(rename="isBundle")] + pub is_bundle: Option, + /// The item's channel (online or local). + pub channel: Option, + /// Description of the item. + pub description: Option, + /// Read-only warnings. + pub warnings: Option>, + /// Price of the item. + pub price: Option, + /// Length of the item for shipping. + #[serde(rename="shippingLength")] + pub shipping_length: Option, + /// The quantity of the product that is reserved for sell-on-google ads. + #[serde(rename="sellOnGoogleQuantity")] + pub sell_on_google_quantity: Option, + /// URL directly to your item's landing page for dynamic remarketing campaigns. + #[serde(rename="displayAdsLink")] + pub display_ads_link: Option, + /// The read-only list of intended destinations which passed validation. + #[serde(rename="validatedDestinations")] + pub validated_destinations: Option>, + /// A list of custom (merchant-provided) custom attribute groups. + #[serde(rename="customGroups")] + pub custom_groups: Option>, + /// Loyalty points that users receive after purchasing the item. Japan only. + #[serde(rename="loyaltyPoints")] + pub loyalty_points: Option, + /// The preference of the denominator of the unit price. + #[serde(rename="unitPricingBaseMeasure")] + pub unit_pricing_base_measure: Option, + /// Shipping rules. + pub shipping: Option>, + /// Weight of the item for shipping. + #[serde(rename="shippingWeight")] + pub shipping_weight: Option, + /// URL of an image of the item. + #[serde(rename="imageLink")] + pub image_link: Option, + /// Set to true if the item is targeted towards adults. + pub adult: Option, +} + +impl RequestValue for Product {} +impl Resource for Product {} +impl ResponseResult for Product {} + + /// A batch entry encoding a single non-batch accounttax response. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4398,12 +4624,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. + /// Updates the tax settings of the account. This method supports patch semantics. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account for which to get/update account tax settings. pub fn patch(&self, request: AccountTax, merchant_id: &str, account_id: &str) -> AccounttaxPatchCall<'a, C, A> { AccounttaxPatchCall { @@ -4420,11 +4646,11 @@ impl<'a, C, A> AccounttaxMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the tax settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. + /// Lists the tax settings of the sub-accounts in your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. This must be a multi-client account. pub fn list(&self, merchant_id: &str) -> AccounttaxListCall<'a, C, A> { AccounttaxListCall { hub: self.hub, @@ -4439,12 +4665,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + /// Updates the tax settings of the account. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account for which to get/update account tax settings. pub fn update(&self, request: AccountTax, merchant_id: &str, account_id: &str) -> AccounttaxUpdateCall<'a, C, A> { AccounttaxUpdateCall { @@ -4461,11 +4687,11 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + /// Retrieves the tax settings of the account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account for which to get/update account tax settings. pub fn get(&self, merchant_id: &str, account_id: &str) -> AccounttaxGetCall<'a, C, A> { AccounttaxGetCall { @@ -4522,12 +4748,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. + /// Updates the shipping settings of the account. This method supports patch semantics. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account for which to get/update shipping settings. pub fn patch(&self, request: ShippingSettings, merchant_id: &str, account_id: &str) -> ShippingsettingPatchCall<'a, C, A> { ShippingsettingPatchCall { @@ -4561,11 +4787,11 @@ impl<'a, C, A> ShippingsettingMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. + /// Lists the shipping settings of the sub-accounts in your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. This must be a multi-client account. pub fn list(&self, merchant_id: &str) -> ShippingsettingListCall<'a, C, A> { ShippingsettingListCall { hub: self.hub, @@ -4598,12 +4824,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + /// Updates the shipping settings of the account. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account for which to get/update shipping settings. pub fn update(&self, request: ShippingSettings, merchant_id: &str, account_id: &str) -> ShippingsettingUpdateCall<'a, C, A> { ShippingsettingUpdateCall { @@ -4620,11 +4846,11 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + /// Retrieves the shipping settings of the account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account for which to get/update shipping settings. pub fn get(&self, merchant_id: &str, account_id: &str) -> ShippingsettingGetCall<'a, C, A> { ShippingsettingGetCall { @@ -4696,12 +4922,12 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a datafeed configuration 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. /// /// # Arguments /// - /// * `merchantId` - No description provided. - /// * `datafeedId` - No description provided. + /// * `merchantId` - The ID of the account that manages the datafeed. This account cannot be a multi-client account. + /// * `datafeedId` - The ID of the datafeed. pub fn get(&self, merchant_id: &str, datafeed_id: &str) -> DatafeedGetCall<'a, C, A> { DatafeedGetCall { hub: self.hub, @@ -4715,13 +4941,13 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// 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. + /// Updates a datafeed configuration of your Merchant Center account. This method supports patch semantics. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - No description provided. - /// * `datafeedId` - No description provided. + /// * `merchantId` - The ID of the account that manages the datafeed. This account cannot be a multi-client account. + /// * `datafeedId` - The ID of the datafeed. pub fn patch(&self, request: Datafeed, merchant_id: &str, datafeed_id: &str) -> DatafeedPatchCall<'a, C, A> { DatafeedPatchCall { hub: self.hub, @@ -4737,12 +4963,12 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a datafeed configuration 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. /// /// # Arguments /// - /// * `merchantId` - No description provided. - /// * `datafeedId` - No description provided. + /// * `merchantId` - The ID of the account that manages the datafeed. This account cannot be a multi-client account. + /// * `datafeedId` - The ID of the datafeed. pub fn delete(&self, merchant_id: &str, datafeed_id: &str) -> DatafeedDeleteCall<'a, C, A> { DatafeedDeleteCall { hub: self.hub, @@ -4757,12 +4983,12 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Registers a datafeed configuration 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. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - No description provided. + /// * `merchantId` - The ID of the account that manages the datafeed. This account cannot be a multi-client account. pub fn insert(&self, request: Datafeed, merchant_id: &str) -> DatafeedInsertCall<'a, C, A> { DatafeedInsertCall { hub: self.hub, @@ -4777,11 +5003,11 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Lists the datafeeds in your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the datafeeds. This account cannot be a multi-client account. pub fn list(&self, merchant_id: &str) -> DatafeedListCall<'a, C, A> { DatafeedListCall { hub: self.hub, @@ -4796,13 +5022,13 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a datafeed configuration 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. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - No description provided. - /// * `datafeedId` - No description provided. + /// * `merchantId` - The ID of the account that manages the datafeed. This account cannot be a multi-client account. + /// * `datafeedId` - The ID of the datafeed. pub fn update(&self, request: Datafeed, merchant_id: &str, datafeed_id: &str) -> DatafeedUpdateCall<'a, C, A> { DatafeedUpdateCall { hub: self.hub, @@ -4860,11 +5086,11 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + /// Retrieves the status of a Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account. pub fn get(&self, merchant_id: &str, account_id: &str) -> AccountstatuseGetCall<'a, C, A> { AccountstatuseGetCall { @@ -4893,11 +5119,11 @@ impl<'a, C, A> AccountstatuseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the statuses of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. + /// Lists the statuses of the sub-accounts in your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. This must be a multi-client account. pub fn list(&self, merchant_id: &str) -> AccountstatuseListCall<'a, C, A> { AccountstatuseListCall { hub: self.hub, @@ -4954,12 +5180,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + /// Updates a Merchant Center account. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account. pub fn update(&self, request: Account, merchant_id: &str, account_id: &str) -> AccountUpdateCall<'a, C, A> { AccountUpdateCall { @@ -4988,12 +5214,12 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. + /// Updates a Merchant Center account. This method supports patch semantics. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account. pub fn patch(&self, request: Account, merchant_id: &str, account_id: &str) -> AccountPatchCall<'a, C, A> { AccountPatchCall { @@ -5010,11 +5236,11 @@ 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 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. + /// Claims the website of a Merchant Center sub-account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account whose website is claimed. pub fn claimwebsite(&self, merchant_id: &str, account_id: &str) -> AccountClaimwebsiteCall<'a, C, A> { AccountClaimwebsiteCall { @@ -5030,11 +5256,11 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. + /// Lists the sub-accounts in your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. This must be a multi-client account. pub fn list(&self, merchant_id: &str) -> AccountListCall<'a, C, A> { AccountListCall { hub: self.hub, @@ -5049,11 +5275,11 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a Merchant Center sub-account. This method can only be called for multi-client accounts. + /// Deletes a Merchant Center sub-account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. This must be a multi-client account, and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account. pub fn delete(&self, merchant_id: &str, account_id: &str) -> AccountDeleteCall<'a, C, A> { AccountDeleteCall { @@ -5088,11 +5314,11 @@ 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + /// Retrieves a Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// * `accountId` - The ID of the account. pub fn get(&self, merchant_id: &str, account_id: &str) -> AccountGetCall<'a, C, A> { AccountGetCall { @@ -5107,12 +5333,12 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a Merchant Center sub-account. This method can only be called for multi-client accounts. + /// Creates a Merchant Center sub-account. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the managing account. This must be a multi-client account. pub fn insert(&self, request: Account, merchant_id: &str) -> AccountInsertCall<'a, C, A> { AccountInsertCall { hub: self.hub, @@ -5169,7 +5395,7 @@ impl<'a, C, A> InventoryMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. This method can only be called for non-multi-client accounts. + /// Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. /// /// # Arguments /// @@ -5187,14 +5413,14 @@ impl<'a, C, A> InventoryMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product. This method can only be called for non-multi-client accounts. + /// Updates price and availability of a product in your Merchant Center account. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that contains the product. This account cannot be a multi-client account. /// * `storeCode` - The code of the store for which to update price and availability. Use online to update price and availability of an online product. - /// * `productId` - The ID of the product for which to update price and availability. + /// * `productId` - The REST id of the product for which to update price and availability. pub fn set(&self, request: InventorySetRequest, merchant_id: &str, store_code: &str, product_id: &str) -> InventorySetCall<'a, C, A> { InventorySetCall { hub: self.hub, @@ -5253,12 +5479,12 @@ impl<'a, C, A> ProductstatuseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the status of a product from your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Gets the status of a product from your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. - /// * `productId` - The ID of the product. + /// * `merchantId` - The ID of the account that contains the product. This account cannot be a multi-client account. + /// * `productId` - The REST id of the product. pub fn get(&self, merchant_id: &str, product_id: &str) -> ProductstatuseGetCall<'a, C, A> { ProductstatuseGetCall { hub: self.hub, @@ -5273,11 +5499,11 @@ impl<'a, C, A> ProductstatuseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the statuses of the products in your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Lists the statuses of the products in your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that contains the products. This account cannot be a multi-client account. pub fn list(&self, merchant_id: &str) -> ProductstatuseListCall<'a, C, A> { ProductstatuseListCall { hub: self.hub, @@ -5294,7 +5520,7 @@ impl<'a, C, A> ProductstatuseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the statuses of multiple products in a single request. This method can only be called for non-multi-client accounts. + /// Gets the statuses of multiple products in a single request. /// /// # Arguments /// @@ -5354,11 +5580,11 @@ impl<'a, C, A> ProductMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the products in your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Lists the products in your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that contains the products. This account cannot be a multi-client account. pub fn list(&self, merchant_id: &str) -> ProductListCall<'a, C, A> { ProductListCall { hub: self.hub, @@ -5374,12 +5600,12 @@ impl<'a, C, A> ProductMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a product from your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Retrieves a product from your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. - /// * `productId` - The ID of the product. + /// * `merchantId` - The ID of the account that contains the product. This account cannot be a multi-client account. + /// * `productId` - The REST id of the product. pub fn get(&self, merchant_id: &str, product_id: &str) -> ProductGetCall<'a, C, A> { ProductGetCall { hub: self.hub, @@ -5393,12 +5619,12 @@ impl<'a, C, A> ProductMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a product from your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Deletes a product from your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. - /// * `productId` - The ID of the product. + /// * `merchantId` - The ID of the account that contains the product. This account cannot be a multi-client account. + /// * `productId` - The REST id of the product. pub fn delete(&self, merchant_id: &str, product_id: &str) -> ProductDeleteCall<'a, C, A> { ProductDeleteCall { hub: self.hub, @@ -5413,7 +5639,7 @@ impl<'a, C, A> ProductMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves, inserts, and deletes multiple products in a single request. This method can only be called for non-multi-client accounts. + /// Retrieves, inserts, and deletes multiple products in a single request. /// /// # Arguments /// @@ -5431,12 +5657,12 @@ impl<'a, C, A> ProductMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. This method can only be called for non-multi-client accounts. + /// Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that contains the product. This account cannot be a multi-client account. pub fn insert(&self, request: Product, merchant_id: &str) -> ProductInsertCall<'a, C, A> { ProductInsertCall { hub: self.hub, @@ -5493,12 +5719,12 @@ impl<'a, C, A> DatafeedstatuseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Retrieves the status of a datafeed from your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - No description provided. - /// * `datafeedId` - No description provided. + /// * `merchantId` - The ID of the account that manages the datafeed. This account cannot be a multi-client account. + /// * `datafeedId` - The ID of the datafeed. pub fn get(&self, merchant_id: &str, datafeed_id: &str) -> DatafeedstatuseGetCall<'a, C, A> { DatafeedstatuseGetCall { hub: self.hub, @@ -5514,11 +5740,11 @@ impl<'a, C, A> DatafeedstatuseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Lists the statuses of the datafeeds in your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the datafeeds. This account cannot be a multi-client account. pub fn list(&self, merchant_id: &str) -> DatafeedstatuseListCall<'a, C, A> { DatafeedstatuseListCall { hub: self.hub, @@ -5572,7 +5798,7 @@ impl<'a, C, A> DatafeedstatuseMethods<'a, C, A> { /// ::default(), None); /// let mut hub = ShoppingContent::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(...)`, `advancetestorder(...)`, `cancel(...)`, `cancellineitem(...)`, `createtestorder(...)`, `custombatch(...)`, `get(...)`, `getbymerchantorderid(...)`, `gettestordertemplate(...)`, `list(...)`, `refund(...)`, `returnlineitem(...)`, `shiplineitems(...)`, `updatemerchantorderid(...)` and `updateshipment(...)` +/// // like `acknowledge(...)`, `advancetestorder(...)`, `cancel(...)`, `cancellineitem(...)`, `createtestorder(...)`, `custombatch(...)`, `get(...)`, `getbymerchantorderid(...)`, `gettestordertemplate(...)`, `list(...)`, `refund(...)`, `returnlineitem(...)`, `setlineitemmetadata(...)`, `shiplineitems(...)`, `updatelineitemshippingdetails(...)`, `updatemerchantorderid(...)` and `updateshipment(...)` /// // to build up your call. /// let rb = hub.orders(); /// # } @@ -5589,11 +5815,11 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Lists the orders in your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. pub fn list(&self, merchant_id: &str) -> OrderListCall<'a, C, A> { OrderListCall { hub: self.hub, @@ -5613,11 +5839,11 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for non-multi-client accounts. + /// Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that should manage the order. This cannot be a multi-client account. /// * `templateName` - The name of the template to retrieve. pub fn gettestordertemplate(&self, merchant_id: &str, template_name: &str) -> OrderGettestordertemplateCall<'a, C, A> { OrderGettestordertemplateCall { @@ -5632,15 +5858,17 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Updates ship by and delivery by dates for a line item. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `request` - No description provided. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. - pub fn get(&self, merchant_id: &str, order_id: &str) -> OrderGetCall<'a, C, A> { - OrderGetCall { + pub fn updatelineitemshippingdetails(&self, request: OrdersUpdateLineItemShippingDetailsRequest, merchant_id: &str, order_id: &str) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> { + OrderUpdatelineitemshippingdetailCall { hub: self.hub, + _request: request, _merchant_id: merchant_id.to_string(), _order_id: order_id.to_string(), _delegate: Default::default(), @@ -5651,12 +5879,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts. + /// Refund a portion of the order, up to the full amount paid. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order to refund. pub fn refund(&self, request: OrdersRefundRequest, merchant_id: &str, order_id: &str) -> OrderRefundCall<'a, C, A> { OrderRefundCall { @@ -5672,12 +5900,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Marks an order as acknowledged. This method can only be called for non-multi-client accounts. + /// Marks an order as acknowledged. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. pub fn acknowledge(&self, request: OrdersAcknowledgeRequest, merchant_id: &str, order_id: &str) -> OrderAcknowledgeCall<'a, C, A> { OrderAcknowledgeCall { @@ -5693,12 +5921,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts. + /// Updates the merchant order ID for a given order. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. pub fn updatemerchantorderid(&self, request: OrdersUpdateMerchantOrderIdRequest, merchant_id: &str, order_id: &str) -> OrderUpdatemerchantorderidCall<'a, C, A> { OrderUpdatemerchantorderidCall { @@ -5714,11 +5942,11 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts. + /// Retrieves an order using merchant order id. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `merchantOrderId` - The merchant order id to be looked for. pub fn getbymerchantorderid(&self, merchant_id: &str, merchant_order_id: &str) -> OrderGetbymerchantorderidCall<'a, C, A> { OrderGetbymerchantorderidCall { @@ -5733,12 +5961,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts. + /// Sandbox only. Creates a test order. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that should manage the order. This cannot be a multi-client account. pub fn createtestorder(&self, request: OrdersCreateTestOrderRequest, merchant_id: &str) -> OrderCreatetestorderCall<'a, C, A> { OrderCreatetestorderCall { hub: self.hub, @@ -5752,12 +5980,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a line item. This method can only be called for non-multi-client accounts. + /// Returns a line item. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. pub fn returnlineitem(&self, request: OrdersReturnLineItemRequest, merchant_id: &str, order_id: &str) -> OrderReturnlineitemCall<'a, C, A> { OrderReturnlineitemCall { @@ -5773,7 +6001,28 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts. + /// Marks line item(s) as shipped. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. + /// * `orderId` - The ID of the order. + pub fn shiplineitems(&self, request: OrdersShipLineItemsRequest, merchant_id: &str, order_id: &str) -> OrderShiplineitemCall<'a, C, A> { + OrderShiplineitemCall { + hub: self.hub, + _request: request, + _merchant_id: merchant_id.to_string(), + _order_id: order_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves or modifies multiple orders in a single request. /// /// # Arguments /// @@ -5790,12 +6039,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts. + /// Cancels a line item, making a full refund. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. pub fn cancellineitem(&self, request: OrdersCancelLineItemRequest, merchant_id: &str, order_id: &str) -> OrderCancellineitemCall<'a, C, A> { OrderCancellineitemCall { @@ -5811,17 +6060,15 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Marks line item(s) as shipped. This method can only be called for non-multi-client accounts. + /// Retrieves an order from your Merchant Center account. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. - pub fn shiplineitems(&self, request: OrdersShipLineItemsRequest, merchant_id: &str, order_id: &str) -> OrderShiplineitemCall<'a, C, A> { - OrderShiplineitemCall { + pub fn get(&self, merchant_id: &str, order_id: &str) -> OrderGetCall<'a, C, A> { + OrderGetCall { hub: self.hub, - _request: request, _merchant_id: merchant_id.to_string(), _order_id: order_id.to_string(), _delegate: Default::default(), @@ -5832,12 +6079,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts. + /// Updates a shipment's status, carrier, and/or tracking ID. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. pub fn updateshipment(&self, request: OrdersUpdateShipmentRequest, merchant_id: &str, order_id: &str) -> OrderUpdateshipmentCall<'a, C, A> { OrderUpdateshipmentCall { @@ -5853,11 +6100,11 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts. + /// Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the test order to modify. pub fn advancetestorder(&self, merchant_id: &str, order_id: &str) -> OrderAdvancetestorderCall<'a, C, A> { OrderAdvancetestorderCall { @@ -5872,12 +6119,33 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. + /// Sets (overrides) merchant provided annotations on the line item. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. + /// * `orderId` - The ID of the order. + pub fn setlineitemmetadata(&self, request: OrdersSetLineItemMetadataRequest, merchant_id: &str, order_id: &str) -> OrderSetlineitemmetadataCall<'a, C, A> { + OrderSetlineitemmetadataCall { + hub: self.hub, + _request: request, + _merchant_id: merchant_id.to_string(), + _order_id: order_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Cancels all line items in an order, making a full refund. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order to cancel. pub fn cancel(&self, request: OrdersCancelRequest, merchant_id: &str, order_id: &str) -> OrderCancelCall<'a, C, A> { OrderCancelCall { @@ -6153,7 +6421,7 @@ impl<'a, C, A> AccounttaxCustombatchCall<'a, C, A> where C: BorrowMut AccounttaxPatchCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// /// Sets the *merchant id* path property to the given value. /// @@ -6451,7 +6719,7 @@ impl<'a, C, A> AccounttaxPatchCall<'a, C, A> where C: BorrowMut, } -/// Lists the tax settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. +/// Lists the tax settings of the sub-accounts in your Merchant Center account. /// /// A builder for the *list* method supported by a *accounttax* resource. /// It is not used directly, but through a `AccounttaxMethods` instance. @@ -6635,7 +6903,7 @@ impl<'a, C, A> AccounttaxListCall<'a, C, A> where C: BorrowMut, A } - /// The ID of the managing account. + /// The ID of the managing account. This must be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -6718,7 +6986,7 @@ impl<'a, C, A> 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +/// Updates the tax settings of the account. /// /// A builder for the *update* method supported by a *accounttax* resource. /// It is not used directly, but through a `AccounttaxMethods` instance. @@ -6930,7 +7198,7 @@ impl<'a, C, A> AccounttaxUpdateCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// /// Sets the *merchant id* path property to the given value. /// @@ -7016,7 +7284,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +/// Retrieves the tax settings of the account. /// /// A builder for the *get* method supported by a *accounttax* resource. /// It is not used directly, but through a `AccounttaxMethods` instance. @@ -7192,7 +7460,7 @@ impl<'a, C, A> AccounttaxGetCall<'a, C, A> where C: BorrowMut, A: } - /// The ID of the managing account. + /// The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// /// Sets the *merchant id* path property to the given value. /// @@ -7271,7 +7539,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. +/// Updates the shipping settings of the 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. @@ -7483,7 +7751,7 @@ impl<'a, C, A> ShippingsettingPatchCall<'a, C, A> where C: BorrowMut ShippingsettingGetsupportedcarrierCall<'a, C, A> where C: BorrowM } -/// Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. +/// Lists the shipping settings of the sub-accounts in your Merchant Center account. /// /// A builder for the *list* method supported by a *shippingsetting* resource. /// It is not used directly, but through a `ShippingsettingMethods` instance. @@ -7996,7 +8264,7 @@ impl<'a, C, A> ShippingsettingListCall<'a, C, A> where C: BorrowMut ShippingsettingCustombatchCall<'a, C, A> where C: BorrowMut ShippingsettingUpdateCall<'a, C, A> where C: BorrowMut ShippingsettingUpdateCall<'a, C, A> where C: BorrowMut ShippingsettingGetCall<'a, C, A> where C: BorrowMut DatafeedCustombatchCall<'a, C, A> where C: BorrowMut DatafeedGetCall<'a, C, A> where C: BorrowMut, A: o } + /// The ID of the account that manages the datafeed. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -9321,6 +9590,7 @@ impl<'a, C, A> DatafeedGetCall<'a, C, A> where C: BorrowMut, A: o self._merchant_id = new_value.to_string(); self } + /// The ID of the datafeed. /// /// Sets the *datafeed id* path property to the given value. /// @@ -9389,7 +9659,7 @@ impl<'a, C, A> DatafeedGetCall<'a, C, A> where C: BorrowMut, A: o } -/// 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. +/// Updates a datafeed configuration of your Merchant Center account. 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. @@ -9601,6 +9871,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } + /// The ID of the account that manages the datafeed. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -9610,6 +9881,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: self._merchant_id = new_value.to_string(); self } + /// The ID of the datafeed. /// /// Sets the *datafeed id* path property to the given value. /// @@ -9685,7 +9957,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes a datafeed configuration 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. /// /// A builder for the *delete* method supported by a *datafeed* resource. /// It is not used directly, but through a `DatafeedMethods` instance. @@ -9855,6 +10127,7 @@ impl<'a, C, A> DatafeedDeleteCall<'a, C, A> where C: BorrowMut, A } + /// The ID of the account that manages the datafeed. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -9864,6 +10137,7 @@ impl<'a, C, A> DatafeedDeleteCall<'a, C, A> where C: BorrowMut, A self._merchant_id = new_value.to_string(); self } + /// The ID of the datafeed. /// /// Sets the *datafeed id* path property to the given value. /// @@ -9939,7 +10213,7 @@ impl<'a, C, A> DatafeedDeleteCall<'a, C, A> where C: BorrowMut, A } -/// Registers a datafeed configuration 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. /// /// A builder for the *insert* method supported by a *datafeed* resource. /// It is not used directly, but through a `DatafeedMethods` instance. @@ -10149,6 +10423,7 @@ impl<'a, C, A> DatafeedInsertCall<'a, C, A> where C: BorrowMut, A self._request = new_value; self } + /// The ID of the account that manages the datafeed. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -10224,7 +10499,7 @@ impl<'a, C, A> DatafeedInsertCall<'a, C, A> where C: BorrowMut, A } -/// Lists the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. +/// Lists the datafeeds in your Merchant Center account. /// /// A builder for the *list* method supported by a *datafeed* resource. /// It is not used directly, but through a `DatafeedMethods` instance. @@ -10408,7 +10683,7 @@ impl<'a, C, A> DatafeedListCall<'a, C, A> where C: BorrowMut, A: } - /// The ID of the managing account. + /// The ID of the account that manages the datafeeds. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -10491,7 +10766,7 @@ impl<'a, C, A> DatafeedListCall<'a, C, A> where C: BorrowMut, A: } -/// Updates a datafeed configuration 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. /// /// A builder for the *update* method supported by a *datafeed* resource. /// It is not used directly, but through a `DatafeedMethods` instance. @@ -10703,6 +10978,7 @@ impl<'a, C, A> DatafeedUpdateCall<'a, C, A> where C: BorrowMut, A self._request = new_value; self } + /// The ID of the account that manages the datafeed. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -10712,6 +10988,7 @@ impl<'a, C, A> DatafeedUpdateCall<'a, C, A> where C: BorrowMut, A self._merchant_id = new_value.to_string(); self } + /// The ID of the datafeed. /// /// Sets the *datafeed id* path property to the given value. /// @@ -10787,7 +11064,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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +/// Retrieves the status of a Merchant Center account. /// /// A builder for the *get* method supported by a *accountstatuse* resource. /// It is not used directly, but through a `AccountstatuseMethods` instance. @@ -10963,7 +11240,7 @@ impl<'a, C, A> AccountstatuseGetCall<'a, C, A> where C: BorrowMut } - /// The ID of the managing account. + /// The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// /// Sets the *merchant id* path property to the given value. /// @@ -11281,7 +11558,7 @@ impl<'a, C, A> AccountstatuseCustombatchCall<'a, C, A> where C: BorrowMut AccountstatuseListCall<'a, C, A> where C: BorrowMut AccountstatuseListCall<'a, C, A> where C: BorrowMut AccountUpdateCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// /// Sets the *merchant id* path property to the given value. /// @@ -12056,7 +12333,7 @@ impl<'a, C, A> 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 for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. +/// Updates a Merchant Center 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. @@ -12268,7 +12545,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// /// Sets the *merchant id* path property to the given value. /// @@ -12354,7 +12631,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 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. +/// Claims the website of a Merchant Center sub-account. /// /// A builder for the *claimwebsite* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -12535,7 +12812,7 @@ impl<'a, C, A> AccountClaimwebsiteCall<'a, C, A> where C: BorrowMut AccountClaimwebsiteCall<'a, C, A> where C: BorrowMut AccountListCall<'a, C, A> where C: BorrowMut, A: o } - /// The ID of the managing account. + /// The ID of the managing account. This must be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -12888,7 +13165,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o } -/// Deletes a Merchant Center sub-account. This method can only be called for multi-client accounts. +/// Deletes a Merchant Center sub-account. /// /// A builder for the *delete* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -13063,7 +13340,7 @@ impl<'a, C, A> AccountDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// The ID of the managing account. + /// The ID of the managing account. This must be a multi-client account, and accountId must be the ID of a sub-account of this account. /// /// Sets the *merchant id* path property to the given value. /// @@ -13083,7 +13360,7 @@ 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. + /// Flag to delete sub-accounts with products. The default value is false. /// /// Sets the *force* query property to the given value. pub fn force(mut self, new_value: bool) -> AccountDeleteCall<'a, C, A> { @@ -13409,7 +13686,7 @@ impl<'a, C, A> AccountCustombatchCall<'a, C, A> where C: BorrowMut AccountGetCall<'a, C, A> where C: BorrowMut, A: oa } - /// The ID of the managing account. + /// The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. /// /// Sets the *merchant id* path property to the given value. /// @@ -13664,7 +13941,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Creates a Merchant Center sub-account. This method can only be called for multi-client accounts. +/// Creates a Merchant Center sub-account. /// /// A builder for the *insert* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -13874,7 +14151,7 @@ impl<'a, C, A> AccountInsertCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the managing account. This must be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -13950,7 +14227,7 @@ impl<'a, C, A> AccountInsertCall<'a, C, A> where C: BorrowMut, A: } -/// Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. This method can only be called for non-multi-client accounts. +/// Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. /// /// A builder for the *custombatch* method supported by a *inventory* resource. /// It is not used directly, but through a `InventoryMethods` instance. @@ -14203,7 +14480,7 @@ impl<'a, C, A> InventoryCustombatchCall<'a, C, A> where C: BorrowMut InventorySetCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the account that contains the product. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -14437,7 +14714,7 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: self._store_code = new_value.to_string(); self } - /// The ID of the product for which to update price and availability. + /// The REST id of the product for which to update price and availability. /// /// Sets the *product id* path property to the given value. /// @@ -14513,7 +14790,7 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: } -/// Gets the status of a product from your Merchant Center account. This method can only be called for non-multi-client accounts. +/// Gets the status of a product from your Merchant Center account. /// /// A builder for the *get* method supported by a *productstatuse* resource. /// It is not used directly, but through a `ProductstatuseMethods` instance. @@ -14694,7 +14971,7 @@ impl<'a, C, A> ProductstatuseGetCall<'a, C, A> where C: BorrowMut } - /// The ID of the managing account. + /// The ID of the account that contains the product. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -14704,7 +14981,7 @@ impl<'a, C, A> ProductstatuseGetCall<'a, C, A> where C: BorrowMut self._merchant_id = new_value.to_string(); self } - /// The ID of the product. + /// The REST id of the product. /// /// Sets the *product id* path property to the given value. /// @@ -14780,7 +15057,7 @@ impl<'a, C, A> ProductstatuseGetCall<'a, C, A> where C: BorrowMut } -/// Lists the statuses of the products in your Merchant Center account. This method can only be called for non-multi-client accounts. +/// Lists the statuses of the products in your Merchant Center account. /// /// A builder for the *list* method supported by a *productstatuse* resource. /// It is not used directly, but through a `ProductstatuseMethods` instance. @@ -14974,7 +15251,7 @@ impl<'a, C, A> ProductstatuseListCall<'a, C, A> where C: BorrowMut ProductstatuseListCall<'a, C, A> where C: BorrowMut ProductstatuseCustombatchCall<'a, C, A> where C: BorrowMut ProductListCall<'a, C, A> where C: BorrowMut, A: o } - /// The ID of the managing account. + /// The ID of the account that contains the products. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -15603,7 +15880,7 @@ impl<'a, C, A> ProductListCall<'a, C, A> where C: BorrowMut, A: o } -/// Retrieves a product from your Merchant Center account. This method can only be called for non-multi-client accounts. +/// Retrieves a product from your Merchant Center account. /// /// A builder for the *get* method supported by a *product* resource. /// It is not used directly, but through a `ProductMethods` instance. @@ -15779,7 +16056,7 @@ impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oa } - /// The ID of the managing account. + /// The ID of the account that contains the product. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -15789,7 +16066,7 @@ impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oa self._merchant_id = new_value.to_string(); self } - /// The ID of the product. + /// The REST id of the product. /// /// Sets the *product id* path property to the given value. /// @@ -15858,7 +16135,7 @@ impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Deletes a product from your Merchant Center account. This method can only be called for non-multi-client accounts. +/// Deletes a product from your Merchant Center account. /// /// A builder for the *delete* method supported by a *product* resource. /// It is not used directly, but through a `ProductMethods` instance. @@ -16028,7 +16305,7 @@ impl<'a, C, A> ProductDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// The ID of the managing account. + /// The ID of the account that contains the product. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -16038,7 +16315,7 @@ impl<'a, C, A> ProductDeleteCall<'a, C, A> where C: BorrowMut, A: self._merchant_id = new_value.to_string(); self } - /// The ID of the product. + /// The REST id of the product. /// /// Sets the *product id* path property to the given value. /// @@ -16114,7 +16391,7 @@ impl<'a, C, A> ProductDeleteCall<'a, C, A> where C: BorrowMut, A: } -/// Retrieves, inserts, and deletes multiple products in a single request. This method can only be called for non-multi-client accounts. +/// Retrieves, inserts, and deletes multiple products in a single request. /// /// A builder for the *custombatch* method supported by a *product* resource. /// It is not used directly, but through a `ProductMethods` instance. @@ -16367,7 +16644,7 @@ impl<'a, C, A> ProductCustombatchCall<'a, C, A> where C: BorrowMut ProductInsertCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the account that contains the product. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -16653,7 +16930,7 @@ impl<'a, C, A> ProductInsertCall<'a, C, A> where C: BorrowMut, A: } -/// Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. +/// Retrieves the status of a datafeed from your Merchant Center account. /// /// A builder for the *get* method supported by a *datafeedstatuse* resource. /// It is not used directly, but through a `DatafeedstatuseMethods` instance. @@ -16839,6 +17116,7 @@ impl<'a, C, A> DatafeedstatuseGetCall<'a, C, A> where C: BorrowMut DatafeedstatuseGetCall<'a, C, A> where C: BorrowMut DatafeedstatuseGetCall<'a, C, A> where C: BorrowMut DatafeedstatuseListCall<'a, C, A> where C: BorrowMut DatafeedstatuseCustombatchCall<'a, C, A> where C: BorrowMut OrderListCall<'a, C, A> where C: BorrowMut, A: oau } - /// The ID of the managing account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -17768,7 +18047,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau } -/// Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for non-multi-client accounts. +/// Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. /// /// A builder for the *gettestordertemplate* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -17944,7 +18223,7 @@ impl<'a, C, A> OrderGettestordertemplateCall<'a, C, A> where C: BorrowMut OrderGettestordertemplateCall<'a, C, A> where C: BorrowMut OrderGettestordertemplateCall<'a, C, A> where C: BorrowMut OrderGettestordertemplateCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = OrdersUpdateLineItemShippingDetailsRequest::default(); +/// /// // You can configure optional parameters by calling 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("merchantId", "orderId") +/// let result = hub.orders().updatelineitemshippingdetails(req, "merchantId", "orderId") /// .doit(); /// # } /// ``` -pub struct OrderGetCall<'a, C, A> +pub struct OrderUpdatelineitemshippingdetailCall<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, + _request: OrdersUpdateLineItemShippingDetailsRequest, _merchant_id: String, _order_id: String, _delegate: Option<&'a mut Delegate>, @@ -18065,13 +18351,13 @@ pub struct OrderGetCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrderGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrderUpdatelineitemshippingdetailCall<'a, C, A> {} -impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrderUpdatelineitemshippingdetailCall<'a, C, 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)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersUpdateLineItemShippingDetailsResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -18079,9 +18365,9 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "content.orders.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "content.orders.updatelineitemshippingdetails", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); params.push(("orderId", self._order_id.to_string())); for &field in ["alt", "merchantId", "orderId"].iter() { @@ -18096,7 +18382,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}"; + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/updateLineItemShippingDetails"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18128,6 +18414,17 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut url.push_str(&url::form_urlencoded::serialize(params)); } + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -18144,11 +18441,15 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut } }; let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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::Post, &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() @@ -18199,13 +18500,22 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut } - /// The ID of the managing account. + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: OrdersUpdateLineItemShippingDetailsRequest) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderGetCall<'a, C, A> { + pub fn merchant_id(mut self, new_value: &str) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> { self._merchant_id = new_value.to_string(); self } @@ -18215,7 +18525,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn order_id(mut self, new_value: &str) -> OrderGetCall<'a, C, A> { + pub fn order_id(mut self, new_value: &str) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> { self._order_id = new_value.to_string(); self } @@ -18225,7 +18535,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut /// It should be used to handle progress information, and to 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> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -18246,7 +18556,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which 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> + pub fn param(mut self, name: T, value: T) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -18266,7 +18576,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing 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> + pub fn add_scope(mut self, scope: T) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -18278,7 +18588,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut } -/// Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts. +/// Refund a portion of the order, up to the full amount paid. /// /// A builder for the *refund* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -18485,7 +18795,7 @@ impl<'a, C, A> OrderRefundCall<'a, C, A> where C: BorrowMut, A: o self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -18564,7 +18874,7 @@ impl<'a, C, A> OrderRefundCall<'a, C, A> where C: BorrowMut, A: o } -/// Marks an order as acknowledged. This method can only be called for non-multi-client accounts. +/// Marks an order as acknowledged. /// /// A builder for the *acknowledge* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -18771,7 +19081,7 @@ impl<'a, C, A> OrderAcknowledgeCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -18850,7 +19160,7 @@ impl<'a, C, A> OrderAcknowledgeCall<'a, C, A> where C: BorrowMut, } -/// Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts. +/// Updates the merchant order ID for a given order. /// /// A builder for the *updatemerchantorderid* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -19057,7 +19367,7 @@ impl<'a, C, A> OrderUpdatemerchantorderidCall<'a, C, A> where C: BorrowMut OrderUpdatemerchantorderidCall<'a, C, A> where C: BorrowMut OrderGetbymerchantorderidCall<'a, C, A> where C: BorrowMut OrderGetbymerchantorderidCall<'a, C, A> where C: BorrowMut OrderCreatetestorderCall<'a, C, A> where C: BorrowMut OrderCreatetestorderCall<'a, C, A> where C: BorrowMut OrderReturnlineitemCall<'a, C, A> where C: BorrowMut OrderReturnlineitemCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = OrdersShipLineItemsRequest::default(); +/// +/// // You can configure optional parameters by calling 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().shiplineitems(req, "merchantId", "orderId") +/// .doit(); +/// # } +/// ``` +pub struct OrderShiplineitemCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _request: OrdersShipLineItemsRequest, + _merchant_id: String, + _order_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderShiplineitemCall<'a, C, A> {} + +impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersShipLineItemsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.orders.shiplineitems", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("orderId", self._order_id.to_string())); + for &field in ["alt", "merchantId", "orderId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/shipLineItems"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["orderId", "merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: OrdersShipLineItemsRequest) -> OrderShiplineitemCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the account that manages the order. This cannot be a multi-client account. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> OrderShiplineitemCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The ID of the order. + /// + /// Sets the *order id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn order_id(mut self, new_value: &str) -> OrderShiplineitemCall<'a, C, A> { + self._order_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrderShiplineitemCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> OrderShiplineitemCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> OrderShiplineitemCall<'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 or modifies multiple orders in a single request. /// /// A builder for the *custombatch* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -20192,7 +20788,7 @@ impl<'a, C, A> OrderCustombatchCall<'a, C, A> where C: BorrowMut, } -/// Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts. +/// Cancels a line item, making a full refund. /// /// A builder for the *cancellineitem* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -20399,7 +20995,7 @@ impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut OrderCancellineitemCall<'a, C, A> where C: BorrowMut OrderCancellineitemCall<'a, C, A> where C: BorrowMut OrderCancellineitemCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = OrdersShipLineItemsRequest::default(); -/// /// // You can configure optional parameters by calling 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().shiplineitems(req, "merchantId", "orderId") +/// let result = hub.orders().get("merchantId", "orderId") /// .doit(); /// # } /// ``` -pub struct OrderShiplineitemCall<'a, C, A> +pub struct OrderGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, - _request: OrdersShipLineItemsRequest, _merchant_id: String, _order_id: String, _delegate: Option<&'a mut Delegate>, @@ -20527,13 +21116,13 @@ pub struct OrderShiplineitemCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrderShiplineitemCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrderGetCall<'a, C, A> {} -impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +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, OrdersShipLineItemsResponse)> { + 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; @@ -20541,9 +21130,9 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "content.orders.shiplineitems", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "content.orders.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); params.push(("orderId", self._order_id.to_string())); for &field in ["alt", "merchantId", "orderId"].iter() { @@ -20558,7 +21147,7 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/shipLineItems"; + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20590,17 +21179,6 @@ impl<'a, C, A> OrderShiplineitemCall<'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 { @@ -20617,15 +21195,11 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut } }; let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).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) + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -20676,22 +21250,13 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut } - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: OrdersShipLineItemsRequest) -> OrderShiplineitemCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the managing account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderShiplineitemCall<'a, C, A> { + pub fn merchant_id(mut self, new_value: &str) -> OrderGetCall<'a, C, A> { self._merchant_id = new_value.to_string(); self } @@ -20701,7 +21266,7 @@ impl<'a, C, A> OrderShiplineitemCall<'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 order_id(mut self, new_value: &str) -> OrderShiplineitemCall<'a, C, A> { + pub fn order_id(mut self, new_value: &str) -> OrderGetCall<'a, C, A> { self._order_id = new_value.to_string(); self } @@ -20711,7 +21276,7 @@ impl<'a, C, A> OrderShiplineitemCall<'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) -> OrderShiplineitemCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrderGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -20732,7 +21297,7 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderShiplineitemCall<'a, C, A> + 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 @@ -20752,7 +21317,7 @@ impl<'a, C, A> OrderShiplineitemCall<'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) -> OrderShiplineitemCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrderGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -20764,7 +21329,7 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut } -/// Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts. +/// Updates a shipment's status, carrier, and/or tracking ID. /// /// A builder for the *updateshipment* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -20971,7 +21536,7 @@ impl<'a, C, A> OrderUpdateshipmentCall<'a, C, A> where C: BorrowMut OrderUpdateshipmentCall<'a, C, A> where C: BorrowMut OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = OrdersSetLineItemMetadataRequest::default(); +/// +/// // You can configure optional parameters by calling 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().setlineitemmetadata(req, "merchantId", "orderId") +/// .doit(); +/// # } +/// ``` +pub struct OrderSetlineitemmetadataCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _request: OrdersSetLineItemMetadataRequest, + _merchant_id: String, + _order_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderSetlineitemmetadataCall<'a, C, A> {} + +impl<'a, C, A> OrderSetlineitemmetadataCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersSetLineItemMetadataResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.orders.setlineitemmetadata", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("orderId", self._order_id.to_string())); + for &field in ["alt", "merchantId", "orderId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/setLineItemMetadata"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["orderId", "merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: OrdersSetLineItemMetadataRequest) -> OrderSetlineitemmetadataCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the account that manages the order. This cannot be a multi-client account. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> OrderSetlineitemmetadataCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The ID of the order. + /// + /// Sets the *order id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn order_id(mut self, new_value: &str) -> OrderSetlineitemmetadataCall<'a, C, A> { + self._order_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrderSetlineitemmetadataCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> OrderSetlineitemmetadataCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> OrderSetlineitemmetadataCall<'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 all line items in an order, making a full refund. /// /// A builder for the *cancel* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -21512,7 +22363,7 @@ impl<'a, C, A> OrderCancelCall<'a, C, A> where C: BorrowMut, A: o self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// diff --git a/gen/content2_sandbox-cli/Cargo.toml b/gen/content2_sandbox-cli/Cargo.toml index d43b2c7921..28d00c3665 100644 --- a/gen/content2_sandbox-cli/Cargo.toml +++ b/gen/content2_sandbox-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-content2_sandbox-cli" -version = "1.0.6+20170926" +version = "1.0.6+20171207" 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-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-content2_sandbox] path = "../content2_sandbox" -version = "1.0.6+20170926" +version = "1.0.6+20171207" diff --git a/gen/content2_sandbox-cli/README.md b/gen/content2_sandbox-cli/README.md index 56df43a8db..1bcf9a3af1 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 *20170926*. The CLI is at version *1.0.6*. +This documentation was generated from the *Shopping Content* API at revision *20171207*. The CLI is at version *1.0.6*. ```bash content2-sandbox [options] @@ -42,7 +42,9 @@ content2-sandbox [options] list [-p ]... [-o ] refund (-r )... [-p ]... [-o ] returnlineitem (-r )... [-p ]... [-o ] + setlineitemmetadata (-r )... [-p ]... [-o ] shiplineitems (-r )... [-p ]... [-o ] + updatelineitemshippingdetails (-r )... [-p ]... [-o ] updatemerchantorderid (-r )... [-p ]... [-o ] updateshipment (-r )... [-p ]... [-o ] content2-sandbox --help diff --git a/gen/content2_sandbox-cli/mkdocs.yml b/gen/content2_sandbox-cli/mkdocs.yml index f609d0e5d9..4618bf4e43 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+20170926 +site_name: Shopping Content v1.0.6+20171207 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) @@ -21,7 +21,9 @@ pages: - ['orders_list.md', 'Orders', 'List'] - ['orders_refund.md', 'Orders', 'Refund'] - ['orders_returnlineitem.md', 'Orders', 'Returnlineitem'] +- ['orders_setlineitemmetadata.md', 'Orders', 'Setlineitemmetadata'] - ['orders_shiplineitems.md', 'Orders', 'Shiplineitems'] +- ['orders_updatelineitemshippingdetails.md', 'Orders', 'Updatelineitemshippingdetails'] - ['orders_updatemerchantorderid.md', 'Orders', 'Updatemerchantorderid'] - ['orders_updateshipment.md', 'Orders', 'Updateshipment'] diff --git a/gen/content2_sandbox-cli/src/main.rs b/gen/content2_sandbox-cli/src/main.rs index b508b375dc..2bf7c02101 100644 --- a/gen/content2_sandbox-cli/src/main.rs +++ b/gen/content2_sandbox-cli/src/main.rs @@ -293,15 +293,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "reason" => Some(("reason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-pretax.currency" => Some(("amountPretax.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-pretax.value" => Some(("amountPretax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "quantity" => Some(("quantity", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "amount.currency" => Some(("amount.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "amount.value" => Some(("amount.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reason" => Some(("reason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reason-text" => Some(("reasonText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "line-item-id" => Some(("lineItemId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-tax.currency" => Some(("amountTax.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-tax.value" => Some(("amountTax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "quantity" => Some(("quantity", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["amount", "currency", "line-item-id", "operation-id", "quantity", "reason", "reason-text", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["amount", "amount-pretax", "amount-tax", "currency", "line-item-id", "operation-id", "product-id", "quantity", "reason", "reason-text", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -388,6 +393,7 @@ impl<'n> Engine<'n> { "test-order.customer.full-name" => Some(("testOrder.customer.fullName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-order.customer.email" => Some(("testOrder.customer.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-order.kind" => Some(("testOrder.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-order.notification-mode" => Some(("testOrder.notificationMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-order.predefined-delivery-address" => Some(("testOrder.predefinedDeliveryAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-order.shipping-cost.currency" => Some(("testOrder.shippingCost.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-order.shipping-cost.value" => Some(("testOrder.shippingCost.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -401,7 +407,7 @@ impl<'n> Engine<'n> { "test-order.payment-method.predefined-billing-address" => Some(("testOrder.paymentMethod.predefinedBillingAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "template-name" => Some(("templateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "customer", "email", "expiration-month", "expiration-year", "explicit-marketing-preference", "full-name", "kind", "last-four-digits", "payment-method", "predefined-billing-address", "predefined-delivery-address", "shipping-cost", "shipping-cost-tax", "shipping-option", "template-name", "test-order", "type", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "customer", "email", "expiration-month", "expiration-year", "explicit-marketing-preference", "full-name", "kind", "last-four-digits", "notification-mode", "payment-method", "predefined-billing-address", "predefined-delivery-address", "shipping-cost", "shipping-cost-tax", "shipping-option", "template-name", "test-order", "type", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -798,13 +804,17 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "amount-pretax.currency" => Some(("amountPretax.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-pretax.value" => Some(("amountPretax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "amount.currency" => Some(("amount.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "amount.value" => Some(("amount.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reason-text" => Some(("reasonText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reason" => Some(("reason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-tax.currency" => Some(("amountTax.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "amount-tax.value" => Some(("amountTax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["amount", "currency", "operation-id", "reason", "reason-text", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["amount", "amount-pretax", "amount-tax", "currency", "operation-id", "reason", "reason-text", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -887,13 +897,14 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "quantity" => Some(("quantity", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reason" => Some(("reason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reason-text" => Some(("reasonText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "line-item-id" => Some(("lineItemId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "quantity" => Some(("quantity", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["line-item-id", "operation-id", "quantity", "reason", "reason-text"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["line-item-id", "operation-id", "product-id", "quantity", "reason", "reason-text"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -953,6 +964,93 @@ impl<'n> Engine<'n> { } } + fn _orders_setlineitemmetadata(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "line-item-id" => Some(("lineItemId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["line-item-id", "operation-id", "product-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::OrdersSetLineItemMetadataRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.orders().setlineitemmetadata(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("order-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_shiplineitems(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1041,6 +1139,95 @@ impl<'n> Engine<'n> { } } + fn _orders_updatelineitemshippingdetails(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "deliver-by-date" => Some(("deliverByDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ship-by-date" => Some(("shipByDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "line-item-id" => Some(("lineItemId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "operation-id" => Some(("operationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["deliver-by-date", "line-item-id", "operation-id", "product-id", "ship-by-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::OrdersUpdateLineItemShippingDetailsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.orders().updatelineitemshippingdetails(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("order-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_updatemerchantorderid(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1259,9 +1446,15 @@ impl<'n> Engine<'n> { ("returnlineitem", Some(opt)) => { call_result = self._orders_returnlineitem(opt, dry_run, &mut err); }, + ("setlineitemmetadata", Some(opt)) => { + call_result = self._orders_setlineitemmetadata(opt, dry_run, &mut err); + }, ("shiplineitems", Some(opt)) => { call_result = self._orders_shiplineitems(opt, dry_run, &mut err); }, + ("updatelineitemshippingdetails", Some(opt)) => { + call_result = self._orders_updatelineitemshippingdetails(opt, dry_run, &mut err); + }, ("updatemerchantorderid", Some(opt)) => { call_result = self._orders_updatemerchantorderid(opt, dry_run, &mut err); }, @@ -1356,14 +1549,14 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("orders", "methods: 'acknowledge', 'advancetestorder', 'cancel', 'cancellineitem', 'createtestorder', 'custombatch', 'get', 'getbymerchantorderid', 'gettestordertemplate', 'list', 'refund', 'returnlineitem', 'shiplineitems', 'updatemerchantorderid' and 'updateshipment'", vec![ + ("orders", "methods: 'acknowledge', 'advancetestorder', 'cancel', 'cancellineitem', 'createtestorder', 'custombatch', 'get', 'getbymerchantorderid', 'gettestordertemplate', 'list', 'refund', 'returnlineitem', 'setlineitemmetadata', 'shiplineitems', 'updatelineitemshippingdetails', 'updatemerchantorderid' and 'updateshipment'", vec![ ("acknowledge", - Some(r##"Marks an order as acknowledged. This method can only be called for non-multi-client accounts."##), + Some(r##"Marks an order as acknowledged."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_acknowledge", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1392,12 +1585,12 @@ fn main() { Some(false)), ]), ("advancetestorder", - Some(r##"Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts."##), + Some(r##"Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment"."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_advancetestorder", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1420,12 +1613,12 @@ fn main() { Some(false)), ]), ("cancel", - Some(r##"Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts."##), + Some(r##"Cancels all line items in an order, making a full refund."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_cancel", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1454,12 +1647,12 @@ fn main() { Some(false)), ]), ("cancellineitem", - Some(r##"Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts."##), + Some(r##"Cancels a line item, making a full refund."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_cancellineitem", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1488,12 +1681,12 @@ fn main() { Some(false)), ]), ("createtestorder", - Some(r##"Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts."##), + Some(r##"Sandbox only. Creates a test order."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_createtestorder", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that should manage the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1516,7 +1709,7 @@ fn main() { Some(false)), ]), ("custombatch", - Some(r##"Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts."##), + Some(r##"Retrieves or modifies multiple orders in a single request."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_custombatch", vec![ (Some(r##"kv"##), @@ -1538,12 +1731,12 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Retrieves an order from your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_get", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1566,12 +1759,12 @@ fn main() { Some(false)), ]), ("getbymerchantorderid", - Some(r##"Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts."##), + Some(r##"Retrieves an order using merchant order id."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_getbymerchantorderid", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1594,12 +1787,12 @@ fn main() { Some(false)), ]), ("gettestordertemplate", - Some(r##"Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for non-multi-client accounts."##), + Some(r##"Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_gettestordertemplate", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that should manage the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1622,12 +1815,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts."##), + Some(r##"Lists the orders in your Merchant Center account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_list", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1644,12 +1837,12 @@ fn main() { Some(false)), ]), ("refund", - Some(r##"Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts."##), + Some(r##"Refund a portion of the order, up to the full amount paid."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_refund", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1678,12 +1871,46 @@ fn main() { Some(false)), ]), ("returnlineitem", - Some(r##"Returns a line item. This method can only be called for non-multi-client accounts."##), + Some(r##"Returns a line item."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_returnlineitem", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), + Some(true), + Some(false)), + + (Some(r##"order-id"##), + None, + Some(r##"The ID of the order."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("setlineitemmetadata", + Some(r##"Sets (overrides) merchant provided annotations on the line item."##), + "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_setlineitemmetadata", + vec![ + (Some(r##"merchant-id"##), + None, + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1712,12 +1939,46 @@ fn main() { Some(false)), ]), ("shiplineitems", - Some(r##"Marks line item(s) as shipped. This method can only be called for non-multi-client accounts."##), + Some(r##"Marks line item(s) as shipped."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_shiplineitems", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), + Some(true), + Some(false)), + + (Some(r##"order-id"##), + None, + Some(r##"The ID of the order."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("updatelineitemshippingdetails", + Some(r##"Updates ship by and delivery by dates for a line item."##), + "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_updatelineitemshippingdetails", + vec![ + (Some(r##"merchant-id"##), + None, + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1746,12 +2007,12 @@ fn main() { Some(false)), ]), ("updatemerchantorderid", - Some(r##"Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts."##), + Some(r##"Updates the merchant order ID for a given order."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_updatemerchantorderid", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1780,12 +2041,12 @@ fn main() { Some(false)), ]), ("updateshipment", - Some(r##"Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts."##), + Some(r##"Updates a shipment's status, carrier, and/or tracking ID."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_updateshipment", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account."##), + Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), Some(true), Some(false)), @@ -1819,7 +2080,7 @@ fn main() { let mut app = App::new("content2-sandbox") .author("Sebastian Thiel ") - .version("1.0.6+20170926") + .version("1.0.6+20171207") .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 121f2badfb..7e589f59dc 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+20170926" +version = "1.0.6+20171207" 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+20170926" +documentation = "https://docs.rs/google-content2_sandbox/1.0.6+20171207" license = "MIT" keywords = ["content", "google", "protocol", "web", "api"] diff --git a/gen/content2_sandbox/README.md b/gen/content2_sandbox/README.md index fdbceb191c..2da69016c7 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+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*. +This documentation was generated from *Shopping Content* crate version *1.0.6+20171207*, where *20171207* 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+20170926/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+20171207/google_content2_sandbox/struct.ShoppingContent.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) +* [orders](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.Order.html) + * [*acknowledge*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderCancellineitemCall.html), [*createtestorder*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderCreatetestorderCall.html), [*custombatch*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderGettestordertemplateCall.html), [*list*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderRefundCall.html), [*returnlineitem*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderReturnlineitemCall.html), [*setlineitemmetadata*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderSetlineitemmetadataCall.html), [*shiplineitems*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderShiplineitemCall.html), [*updatelineitemshippingdetails*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderUpdatelineitemshippingdetailCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/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+20170926/google_content2_sandbox/struct.ShoppingContent.html)** +* **[Hub](https://docs.rs/google-content2_sandbox/1.0.6+20171207/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+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)** + * creates [*Method Builders*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-content2_sandbox/1.0.6+20171207/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+20170926/google_content2_sandbox/trait.Part.html)** + * **[Parts](https://docs.rs/google-content2_sandbox/1.0.6+20171207/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+20170926/google_content2_sandbox/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-content2_sandbox/1.0.6+20171207/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. @@ -54,14 +54,16 @@ let r = hub.orders().advancetestorder(...).doit() let r = hub.orders().updatemerchantorderid(...).doit() let r = hub.orders().returnlineitem(...).doit() let r = hub.orders().gettestordertemplate(...).doit() +let r = hub.orders().setlineitemmetadata(...).doit() +let r = hub.orders().updatelineitemshippingdetails(...).doit() +let r = hub.orders().shiplineitems(...).doit() let r = hub.orders().createtestorder(...).doit() let r = hub.orders().refund(...).doit() let r = hub.orders().custombatch(...).doit() -let r = hub.orders().cancellineitem(...).doit() let r = hub.orders().getbymerchantorderid(...).doit() let r = hub.orders().acknowledge(...).doit() let r = hub.orders().cancel(...).doit() -let r = hub.orders().shiplineitems(...).doit() +let r = hub.orders().cancellineitem(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -137,17 +139,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+20170926/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+20171207/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+20170926/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+20171207/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+20170926/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+20171207/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+20170926/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+20171207/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 +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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-content2_sandbox/1.0.6+20171207/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+20170926/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+20171207/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-content2_sandbox/1.0.6+20171207/google_content2_sandbox/trait.RequestValue.html) and +[decodable](https://docs.rs/google-content2_sandbox/1.0.6+20171207/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+20170926/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+20171207/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+20170926/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+20171207/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+20170926/google_content2_sandbox/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-content2_sandbox/1.0.6+20171207/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 18c94179f9..7c55bd3167 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+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*. +//! This documentation was generated from *Shopping Content* crate version *1.0.6+20171207*, where *20171207* 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). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.ShoppingContent.html) ... //! //! * [orders](struct.Order.html) -//! * [*acknowledge*](struct.OrderAcknowledgeCall.html), [*advancetestorder*](struct.OrderAdvancetestorderCall.html), [*cancel*](struct.OrderCancelCall.html), [*cancellineitem*](struct.OrderCancellineitemCall.html), [*createtestorder*](struct.OrderCreatetestorderCall.html), [*custombatch*](struct.OrderCustombatchCall.html), [*get*](struct.OrderGetCall.html), [*getbymerchantorderid*](struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](struct.OrderGettestordertemplateCall.html), [*list*](struct.OrderListCall.html), [*refund*](struct.OrderRefundCall.html), [*returnlineitem*](struct.OrderReturnlineitemCall.html), [*shiplineitems*](struct.OrderShiplineitemCall.html), [*updatemerchantorderid*](struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](struct.OrderUpdateshipmentCall.html) +//! * [*acknowledge*](struct.OrderAcknowledgeCall.html), [*advancetestorder*](struct.OrderAdvancetestorderCall.html), [*cancel*](struct.OrderCancelCall.html), [*cancellineitem*](struct.OrderCancellineitemCall.html), [*createtestorder*](struct.OrderCreatetestorderCall.html), [*custombatch*](struct.OrderCustombatchCall.html), [*get*](struct.OrderGetCall.html), [*getbymerchantorderid*](struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](struct.OrderGettestordertemplateCall.html), [*list*](struct.OrderListCall.html), [*refund*](struct.OrderRefundCall.html), [*returnlineitem*](struct.OrderReturnlineitemCall.html), [*setlineitemmetadata*](struct.OrderSetlineitemmetadataCall.html), [*shiplineitems*](struct.OrderShiplineitemCall.html), [*updatelineitemshippingdetails*](struct.OrderUpdatelineitemshippingdetailCall.html), [*updatemerchantorderid*](struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](struct.OrderUpdateshipmentCall.html) //! //! //! @@ -54,14 +54,16 @@ //! let r = hub.orders().updatemerchantorderid(...).doit() //! let r = hub.orders().returnlineitem(...).doit() //! let r = hub.orders().gettestordertemplate(...).doit() +//! let r = hub.orders().setlineitemmetadata(...).doit() +//! let r = hub.orders().updatelineitemshippingdetails(...).doit() +//! let r = hub.orders().shiplineitems(...).doit() //! let r = hub.orders().createtestorder(...).doit() //! let r = hub.orders().refund(...).doit() //! let r = hub.orders().custombatch(...).doit() -//! let r = hub.orders().cancellineitem(...).doit() //! let r = hub.orders().getbymerchantorderid(...).doit() //! let r = hub.orders().acknowledge(...).doit() //! let r = hub.orders().cancel(...).doit() -//! let r = hub.orders().shiplineitems(...).doit() +//! let r = hub.orders().cancellineitem(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -378,6 +380,712 @@ impl<'a, C, A> ShoppingContent // ############ // SCHEMAS ### // ########## +/// 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 OrdersCustomBatchRequestEntryUpdateShipment { + /// New status for the shipment. Not updated if missing. + pub status: Option, + /// 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")] + pub tracking_id: Option, + /// The ID of the shipment. + #[serde(rename="shipmentId")] + pub shipment_id: Option, +} + +impl Part for OrdersCustomBatchRequestEntryUpdateShipment {} + + +/// A list of errors returned by a failed batch entry. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Errors { + /// The message of the first error in errors. + pub message: Option, + /// The HTTP status of the first error in errors. + pub code: Option, + /// A list of errors. + pub errors: Option>, +} + +impl Part for Errors {} + + +/// An error returned 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 ErrorType { + /// The error code. + pub reason: Option, + /// A description of the error. + pub message: Option, + /// The domain of the error. + pub domain: Option, +} + +impl Part for ErrorType {} + + +/// 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*). +/// +/// * [updatelineitemshippingdetails orders](struct.OrderUpdatelineitemshippingdetailCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersUpdateLineItemShippingDetailsRequest { + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, + /// Updated delivery by date, in ISO 8601 format. If not specified only ship by date is updated. + #[serde(rename="deliverByDate")] + pub deliver_by_date: Option, + /// The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, + /// The ID of the line item to set metadata. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// Updated ship by date, in ISO 8601 format. If not specified only deliver by date is updated. + #[serde(rename="shipByDate")] + pub ship_by_date: Option, +} + +impl RequestValue for OrdersUpdateLineItemShippingDetailsRequest {} + + +/// 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 OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails { + /// Updated delivery by date, in ISO 8601 format. If not specified only ship by date is updated. + #[serde(rename="deliverByDate")] + pub deliver_by_date: Option, + /// The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, + /// The ID of the line item to set metadata. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// Updated ship by date, in ISO 8601 format. If not specified only deliver by date is updated. + #[serde(rename="shipByDate")] + pub ship_by_date: Option, +} + +impl Part for OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails {} + + +/// 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*). +/// +/// * [updateshipment orders](struct.OrderUpdateshipmentCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersUpdateShipmentResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersUpdateShipmentResponse". + pub kind: Option, + /// The status of the execution. + #[serde(rename="executionStatus")] + pub execution_status: Option, +} + +impl ResponseResult for OrdersUpdateShipmentResponse {} + + +/// 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 OrderRefund { + /// The amount that is refunded. + pub amount: Option, + /// Date on which the item has been created, in ISO 8601 format. + #[serde(rename="creationDate")] + pub creation_date: Option, + /// The reason for the refund. + pub reason: Option, + /// The actor that created the refund. + pub actor: Option, + /// The explanation of the reason. + #[serde(rename="reasonText")] + pub reason_text: Option, +} + +impl Part for OrderRefund {} + + +/// 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 OrderPromotionBenefit { + /// The OfferId(s) that were purchased in this order and map to this specific benefit of the promotion. + #[serde(rename="offerIds")] + pub offer_ids: Option>, + /// The discount in the order price when the promotion is applied. + pub discount: Option, + /// Describes whether the promotion applies to products (e.g. 20% off) or to shipping (e.g. Free Shipping). + #[serde(rename="type")] + pub type_: Option, + /// The impact on tax when the promotion is applied. + #[serde(rename="taxImpact")] + pub tax_impact: Option, + /// Further describes the benefit of the promotion. Note that we will expand on this enumeration as we support new promotion sub-types. + #[serde(rename="subType")] + pub sub_type: Option, +} + +impl Part for OrderPromotionBenefit {} + + +/// 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*). +/// +/// * [cancellineitem orders](struct.OrderCancellineitemCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersCancelLineItemResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersCancelLineItemResponse". + pub kind: Option, + /// The status of the execution. + #[serde(rename="executionStatus")] + pub execution_status: Option, +} + +impl ResponseResult for OrdersCancelLineItemResponse {} + + +/// 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 OrderAddress { + /// City, town or commune. May also include dependent localities or sublocalities (e.g. neighborhoods or suburbs). + pub locality: Option, + /// CLDR country code (e.g. "US"). + pub country: Option, + /// Strings representing the lines of the printed label for mailing the order, for example: + /// John Smith + /// 1600 Amphitheatre Parkway + /// Mountain View, CA, 94043 + /// United States + #[serde(rename="fullAddress")] + pub full_address: Option>, + /// Street-level part of the address. + #[serde(rename="streetAddress")] + pub street_address: Option>, + /// Postal Code or ZIP (e.g. "94043"). + #[serde(rename="postalCode")] + pub postal_code: Option, + /// Name of the recipient. + #[serde(rename="recipientName")] + pub recipient_name: Option, + /// Whether the address is a post office box. + #[serde(rename="isPostOfficeBox")] + pub is_post_office_box: Option, + /// Top-level administrative subdivision of the country (e.g. "CA"). + pub region: Option, +} + +impl Part for OrderAddress {} + + +/// 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 OrderLineItemProduct { + /// The CLDR territory code of the target country of the product. + #[serde(rename="targetCountry")] + pub target_country: Option, + /// URL to the cached image shown to the user when order was placed. + #[serde(rename="shownImage")] + pub shown_image: Option, + /// The two-letter ISO 639-1 language code for the item. + #[serde(rename="contentLanguage")] + pub content_language: Option, + /// The title of the product. + pub title: Option, + /// Manufacturer Part Number (MPN) of the item. + pub mpn: Option, + /// Variant attributes for the item. These are dimensions of the product, such as color, gender, material, pattern, and size. You can find a comprehensive list of variant attributes here. + #[serde(rename="variantAttributes")] + pub variant_attributes: Option>, + /// Brand of the item. + pub brand: Option, + /// URL of an image of the item. + #[serde(rename="imageLink")] + pub image_link: Option, + /// An identifier of the item. + #[serde(rename="offerId")] + pub offer_id: Option, + /// The REST id of the product. + pub id: Option, + /// Shared identifier for all variants of the same product. + #[serde(rename="itemGroupId")] + pub item_group_id: Option, + /// Global Trade Item Number (GTIN) of the item. + pub gtin: Option, + /// Condition or state of the item. + pub condition: Option, + /// Price of the item. + pub price: Option, + /// The item's channel (online or local). + pub channel: Option, +} + +impl Part for OrderLineItemProduct {} + + +/// 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 OrderLineItemProductVariantAttribute { + /// The dimension of the variant. + pub dimension: Option, + /// The value for the dimension. + pub value: Option, +} + +impl Part for OrderLineItemProductVariantAttribute {} + + +/// 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*). +/// +/// * [getbymerchantorderid orders](struct.OrderGetbymerchantorderidCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersGetByMerchantOrderIdResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersGetByMerchantOrderIdResponse". + pub kind: Option, + /// The requested order. + pub order: Option, +} + +impl ResponseResult for OrdersGetByMerchantOrderIdResponse {} + + +/// 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 OrderMerchantProvidedAnnotation { + /// Key for additional merchant provided (as key-value pairs) annotation about the line item. + pub key: Option, + /// Value for additional merchant provided (as key-value pairs) annotation about the line item. + pub value: Option, +} + +impl Part for OrderMerchantProvidedAnnotation {} + + +/// 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 OrderCustomer { + /// If set, this indicates the user explicitly chose to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the checkout flow. + #[serde(rename="explicitMarketingPreference")] + pub explicit_marketing_preference: Option, + /// Full name of the customer. + #[serde(rename="fullName")] + pub full_name: Option, + /// Email address of the customer. + pub email: Option, +} + +impl Part for OrderCustomer {} + + +/// 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 orders](struct.OrderListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersListResponse { + /// The token for the retrieval of the next page of orders. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersListResponse". + pub kind: Option, + /// no description provided + pub resources: Option>, +} + +impl ResponseResult for OrdersListResponse {} + + +/// 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 OrderShipmentLineItemShipment { + /// The ID of the product to ship. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, + /// The id of the line item that is shipped. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// The quantity that is shipped. + pub quantity: Option, +} + +impl Part for OrderShipmentLineItemShipment {} + + +/// 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*). +/// +/// * [refund orders](struct.OrderRefundCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersRefundRequest { + /// The amount that is refunded. Either amount or amountPretax and amountTax should be filled. + #[serde(rename="amountPretax")] + pub amount_pretax: Option, + /// The explanation of the reason. + #[serde(rename="reasonText")] + pub reason_text: Option, + /// The reason for the refund. + pub reason: Option, + /// Tax amount that correspond to refund amount in amountPretax. + #[serde(rename="amountTax")] + pub amount_tax: Option, + /// The amount that is refunded. + pub amount: Option, + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, +} + +impl RequestValue for OrdersRefundRequest {} + + +/// 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*). +/// +/// * [setlineitemmetadata orders](struct.OrderSetlineitemmetadataCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersSetLineItemMetadataRequest { + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, + /// no description provided + pub annotations: Option>, + /// The ID of the line item to set metadata. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, +} + +impl RequestValue for OrdersSetLineItemMetadataRequest {} + + +/// 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 OrdersCustomBatchRequestEntry { + /// The ID of the order. Required for all methods beside getByMerchantOrderId. + #[serde(rename="orderId")] + pub order_id: Option, + /// Required for updateLineItemShippingDate method. + #[serde(rename="updateLineItemShippingDetails")] + pub update_line_item_shipping_details: Option, + /// Required for shipLineItems method. + #[serde(rename="shipLineItems")] + pub ship_line_items: Option, + /// Required for updateShipment method. + #[serde(rename="updateShipment")] + pub update_shipment: Option, + /// The ID of the managing account. + #[serde(rename="merchantId")] + pub merchant_id: Option, + /// Required for setLineItemMetadata method. + #[serde(rename="setLineItemMetadata")] + pub set_line_item_metadata: Option, + /// The merchant order id. Required for updateMerchantOrderId and getByMerchantOrderId methods. + #[serde(rename="merchantOrderId")] + pub merchant_order_id: Option, + /// Required for cancelLineItem method. + #[serde(rename="cancelLineItem")] + pub cancel_line_item: Option, + /// An entry ID, unique within the batch request. + #[serde(rename="batchId")] + pub batch_id: Option, + /// Required for refund method. + pub refund: Option, + /// Required for cancel method. + pub cancel: Option, + /// The ID of the operation. Unique across all operations for a given order. Required for all methods beside get and getByMerchantOrderId. + #[serde(rename="operationId")] + pub operation_id: Option, + /// The method to apply. + pub method: Option, + /// Required for returnLineItem method. + #[serde(rename="returnLineItem")] + pub return_line_item: Option, +} + +impl Part for OrdersCustomBatchRequestEntry {} + + +/// 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 OrdersCustomBatchRequestEntryCancelLineItem { + /// Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order. + pub amount: Option, + /// Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order. + #[serde(rename="amountPretax")] + pub amount_pretax: Option, + /// The explanation of the reason. + #[serde(rename="reasonText")] + pub reason_text: Option, + /// The ID of the line item to cancel. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// The reason for the cancellation. + pub reason: Option, + /// Tax amount that correspond to cancellation amount in amountPretax. + #[serde(rename="amountTax")] + pub amount_tax: Option, + /// The quantity to cancel. + pub quantity: Option, + /// The ID of the product to cancel. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, +} + +impl Part for OrdersCustomBatchRequestEntryCancelLineItem {} + + +/// 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*). +/// +/// * [acknowledge orders](struct.OrderAcknowledgeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersAcknowledgeRequest { + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, +} + +impl RequestValue for OrdersAcknowledgeRequest {} + + +/// 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*). +/// +/// * [setlineitemmetadata orders](struct.OrderSetlineitemmetadataCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersSetLineItemMetadataResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersSetLineItemMetadataResponse". + pub kind: Option, + /// The status of the execution. + #[serde(rename="executionStatus")] + pub execution_status: Option, +} + +impl ResponseResult for OrdersSetLineItemMetadataResponse {} + + +/// 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*). +/// +/// * [refund orders](struct.OrderRefundCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersRefundResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersRefundResponse". + pub kind: Option, + /// The status of the execution. + #[serde(rename="executionStatus")] + pub execution_status: Option, +} + +impl ResponseResult for OrdersRefundResponse {} + + +/// 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 OrdersCustomBatchRequestEntryRefund { + /// The reason for the refund. + pub reason: Option, + /// The amount that is refunded. + pub amount: Option, + /// The explanation of the reason. + #[serde(rename="reasonText")] + pub reason_text: Option, + /// Tax amount that correspond to refund amount in amountPretax. + #[serde(rename="amountTax")] + pub amount_tax: Option, + /// The amount that is refunded. Either amount or amountPretax and amountTax should be filled. + #[serde(rename="amountPretax")] + pub amount_pretax: Option, +} + +impl Part for OrdersCustomBatchRequestEntryRefund {} + + +/// 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*). +/// +/// * [updatemerchantorderid orders](struct.OrderUpdatemerchantorderidCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersUpdateMerchantOrderIdRequest { + /// The merchant order id to be assigned to the order. Must be unique per merchant. + #[serde(rename="merchantOrderId")] + pub merchant_order_id: Option, + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, +} + +impl RequestValue for OrdersUpdateMerchantOrderIdRequest {} + + +/// 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 TestOrderPaymentMethod { + /// The card expiration month (January = 1, February = 2 etc.). + #[serde(rename="expirationMonth")] + pub expiration_month: Option, + /// The last four digits of the card number. + #[serde(rename="lastFourDigits")] + pub last_four_digits: Option, + /// The card expiration year (4-digit, e.g. 2015). + #[serde(rename="expirationYear")] + pub expiration_year: Option, + /// The type of instrument. Note that real orders might have different values than the four values accepted by createTestOrder. + #[serde(rename="type")] + pub type_: Option, + /// The billing address. + #[serde(rename="predefinedBillingAddress")] + pub predefined_billing_address: Option, +} + +impl Part for TestOrderPaymentMethod {} + + +/// 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 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. + pub promotions: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "content#testOrder". + pub kind: Option, + /// Line items that are ordered. At least one line item must be provided. + #[serde(rename="lineItems")] + pub line_items: Option>, + /// Determines if test order must be pulled by merchant or pushed to merchant via push integration. + #[serde(rename="notificationMode")] + pub notification_mode: Option, + /// Identifier of one of the predefined delivery addresses for the delivery. + #[serde(rename="predefinedDeliveryAddress")] + pub predefined_delivery_address: Option, + /// The total cost of shipping for all items. + #[serde(rename="shippingCost")] + pub shipping_cost: Option, + /// The requested shipping option. + #[serde(rename="shippingOption")] + pub shipping_option: Option, + /// The tax for the total shipping cost. + #[serde(rename="shippingCostTax")] + pub shipping_cost_tax: Option, + /// The details of the payment method. + #[serde(rename="paymentMethod")] + pub payment_method: Option, +} + +impl Part for TestOrder {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -423,23 +1131,6 @@ pub struct OrderReturn { impl Part for OrderReturn {} -/// A list of errors returned by a failed batch entry. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Errors { - /// The message of the first error in errors. - pub message: Option, - /// The HTTP status of the first error in errors. - pub code: Option, - /// A list of errors. - pub errors: Option>, -} - -impl Part for Errors {} - - /// There is no detailed description. /// /// # Activities @@ -458,44 +1149,6 @@ pub struct OrdersAdvanceTestOrderResponse { impl ResponseResult for OrdersAdvanceTestOrderResponse {} -/// 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 OrdersCustomBatchRequestEntryUpdateShipment { - /// New status for the shipment. Not updated if missing. - pub status: Option, - /// 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")] - pub tracking_id: Option, - /// The ID of the shipment. - #[serde(rename="shipmentId")] - pub shipment_id: Option, -} - -impl Part for OrdersCustomBatchRequestEntryUpdateShipment {} - - -/// An error returned 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 ErrorType { - /// The error code. - pub reason: Option, - /// A description of the error. - pub message: Option, - /// The domain of the error. - pub domain: Option, -} - -impl Part for ErrorType {} - - /// There is no detailed description. /// /// # Activities @@ -547,6 +1200,27 @@ pub struct OrdersShipLineItemsRequest { impl RequestValue for OrdersShipLineItemsRequest {} +/// 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*). +/// +/// * [updatelineitemshippingdetails orders](struct.OrderUpdatelineitemshippingdetailCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersUpdateLineItemShippingDetailsResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersUpdateLineItemShippingDetailsResponse". + pub kind: Option, + /// The status of the execution. + #[serde(rename="executionStatus")] + pub execution_status: Option, +} + +impl ResponseResult for OrdersUpdateLineItemShippingDetailsResponse {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -563,26 +1237,20 @@ pub struct OrderShipment { /// 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" + /// - "emsy" + /// - "ont" + /// - "deliv" /// - "dynamex" /// - "lasership" - /// - "smartpost" - /// - "fedex smartpost" /// - "mpx" - /// - "uds" - /// - "united delivery service" + /// - "uds" pub carrier: Option, /// The tracking id for the shipment. #[serde(rename="trackingId")] @@ -646,50 +1314,6 @@ pub struct OrdersUpdateMerchantOrderIdResponse { impl ResponseResult for OrdersUpdateMerchantOrderIdResponse {} -/// 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*). -/// -/// * [updateshipment orders](struct.OrderUpdateshipmentCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersUpdateShipmentResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#ordersUpdateShipmentResponse". - pub kind: Option, - /// The status of the execution. - #[serde(rename="executionStatus")] - pub execution_status: Option, -} - -impl ResponseResult for OrdersUpdateShipmentResponse {} - - -/// 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 OrderRefund { - /// The amount that is refunded. - pub amount: Option, - /// Date on which the item has been created, in ISO 8601 format. - #[serde(rename="creationDate")] - pub creation_date: Option, - /// The reason for the refund. - pub reason: Option, - /// The actor that created the refund. - pub actor: Option, - /// The explanation of the reason. - #[serde(rename="reasonText")] - pub reason_text: Option, -} - -impl Part for OrderRefund {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -724,6 +1348,354 @@ pub struct Price { impl Part for Price {} +/// 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 +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [shiplineitems orders](struct.OrderShiplineitemCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersShipLineItemsResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersShipLineItemsResponse". + pub kind: Option, + /// The status of the execution. + #[serde(rename="executionStatus")] + pub execution_status: Option, +} + +impl ResponseResult for OrdersShipLineItemsResponse {} + + +/// 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 TestOrderLineItemProduct { + /// The CLDR territory code of the target country of the product. + #[serde(rename="targetCountry")] + pub target_country: Option, + /// The two-letter ISO 639-1 language code for the item. + #[serde(rename="contentLanguage")] + pub content_language: Option, + /// The title of the product. + pub title: Option, + /// Manufacturer Part Number (MPN) of the item. Optional. + pub mpn: Option, + /// Variant attributes for the item. Optional. + #[serde(rename="variantAttributes")] + pub variant_attributes: Option>, + /// Brand of the item. + pub brand: Option, + /// URL of an image of the item. + #[serde(rename="imageLink")] + pub image_link: Option, + /// An identifier of the item. + #[serde(rename="offerId")] + pub offer_id: Option, + /// Shared identifier for all variants of the same product. Optional. + #[serde(rename="itemGroupId")] + pub item_group_id: Option, + /// Global Trade Item Number (GTIN) of the item. Optional. + pub gtin: Option, + /// Condition or state of the item. + pub condition: Option, + /// The price for the product. + pub price: Option, + /// The item's channel. + pub channel: Option, +} + +impl Part for TestOrderLineItemProduct {} + + +/// 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 OrderPromotion { + /// The full title of the promotion. + #[serde(rename="longTitle")] + pub long_title: Option, + /// Optional. The text code that corresponds to the promotion when applied on the retailer?s website. + #[serde(rename="genericRedemptionCode")] + pub generic_redemption_code: Option, + /// no description provided + pub benefits: Option>, + /// Indicates that the promotion is valid online. + #[serde(rename="redemptionChannel")] + pub redemption_channel: Option, + /// Whether the promotion is applicable to all products or only specific products. + #[serde(rename="productApplicability")] + pub product_applicability: Option, + /// The date and time frame when the promotion is active and ready for validation review. Note that the promotion live time may be delayed for a few hours due to the validation review. + /// Start date and end date are separated by a forward slash (/). The start date is specified by the format (YYYY-MM-DD), followed by the letter ?T?, the time of the day when the sale starts (in Greenwich Mean Time, GMT), followed by an expression of the time zone for the sale. The end date is in the same format. + #[serde(rename="effectiveDates")] + pub effective_dates: Option, + /// The unique ID of the promotion. + pub id: Option, +} + +impl Part for OrderPromotion {} + + +/// 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*). +/// +/// * [returnlineitem orders](struct.OrderReturnlineitemCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersReturnLineItemRequest { + /// The reason for the return. + pub reason: Option, + /// The explanation of the reason. + #[serde(rename="reasonText")] + pub reason_text: Option, + /// The ID of the line item to return. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, + /// The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, + /// The quantity to return. + pub quantity: Option, +} + +impl RequestValue for OrdersReturnLineItemRequest {} + + +/// 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 OrderCancellation { + /// The quantity that was canceled. + pub quantity: Option, + /// The reason for the cancellation. Orders that are cancelled with a noInventory reason will lead to the removal of the product from POG until you make an update to that product. This will not affect your Shopping ads. + pub reason: Option, + /// Date on which the cancellation has been created, in ISO 8601 format. + #[serde(rename="creationDate")] + pub creation_date: Option, + /// The actor that created the cancellation. + pub actor: Option, + /// The explanation of the reason. + #[serde(rename="reasonText")] + pub reason_text: Option, +} + +impl Part for OrderCancellation {} + + +/// 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 OrdersCustomBatchRequestEntryCancel { + /// The reason for the cancellation. + pub reason: Option, + /// The explanation of the reason. + #[serde(rename="reasonText")] + pub reason_text: Option, +} + +impl Part for OrdersCustomBatchRequestEntryCancel {} + + +/// 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*). +/// +/// * [cancellineitem orders](struct.OrderCancellineitemCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersCancelLineItemRequest { + /// The ID of the product to cancel. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, + /// Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order. + pub amount: Option, + /// Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order. + #[serde(rename="amountPretax")] + pub amount_pretax: Option, + /// The explanation of the reason. + #[serde(rename="reasonText")] + pub reason_text: Option, + /// The ID of the line item to cancel. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// The reason for the cancellation. + pub reason: Option, + /// Tax amount that correspond to cancellation amount in amountPretax. + #[serde(rename="amountTax")] + pub amount_tax: Option, + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, + /// The quantity to cancel. + pub quantity: Option, +} + +impl RequestValue for OrdersCancelLineItemRequest {} + + +/// 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*). +/// +/// * [custombatch orders](struct.OrderCustombatchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersCustomBatchResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersCustomBatchResponse". + pub kind: Option, + /// The result of the execution of the batch requests. + pub entries: Option>, +} + +impl ResponseResult for OrdersCustomBatchResponse {} + + +/// 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 OrdersCustomBatchRequestEntrySetLineItemMetadata { + /// no description provided + pub annotations: Option>, + /// The ID of the line item to set metadata. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, +} + +impl Part for OrdersCustomBatchRequestEntrySetLineItemMetadata {} + + +/// 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 OrdersCustomBatchRequestEntryReturnLineItem { + /// The reason for the return. + pub reason: Option, + /// The explanation of the reason. + #[serde(rename="reasonText")] + pub reason_text: Option, + /// The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required. + #[serde(rename="productId")] + pub product_id: Option, + /// The ID of the line item to return. Either lineItemId or productId is required. + #[serde(rename="lineItemId")] + pub line_item_id: Option, + /// The quantity to return. + pub quantity: Option, +} + +impl Part for OrdersCustomBatchRequestEntryReturnLineItem {} + + +/// 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*). +/// +/// * [createtestorder orders](struct.OrderCreatetestorderCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersCreateTestOrderResponse { + /// The ID of the newly created test order. + #[serde(rename="orderId")] + pub order_id: Option, + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersCreateTestOrderResponse". + pub kind: Option, +} + +impl ResponseResult for OrdersCreateTestOrderResponse {} + + +/// 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*). +/// +/// * [gettestordertemplate orders](struct.OrderGettestordertemplateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrdersGetTestOrderTemplateResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersGetTestOrderTemplateResponse". + pub kind: Option, + /// The requested test order template. + pub template: Option, +} + +impl ResponseResult for OrdersGetTestOrderTemplateResponse {} + + +/// 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 TestOrderCustomer { + /// If set, this indicates the user explicitly chose to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the checkout flow. Optional. + #[serde(rename="explicitMarketingPreference")] + pub explicit_marketing_preference: Option, + /// Full name of the customer. + #[serde(rename="fullName")] + pub full_name: Option, + /// Email address of the customer. + pub email: Option, +} + +impl Part for TestOrderCustomer {} + + /// There is no detailed description. /// /// # Activities @@ -738,14 +1710,16 @@ impl Part for Price {} /// * [updatemerchantorderid orders](struct.OrderUpdatemerchantorderidCall.html) (none) /// * [returnlineitem orders](struct.OrderReturnlineitemCall.html) (none) /// * [gettestordertemplate orders](struct.OrderGettestordertemplateCall.html) (none) +/// * [setlineitemmetadata orders](struct.OrderSetlineitemmetadataCall.html) (none) +/// * [updatelineitemshippingdetails orders](struct.OrderUpdatelineitemshippingdetailCall.html) (none) +/// * [shiplineitems orders](struct.OrderShiplineitemCall.html) (none) /// * [createtestorder orders](struct.OrderCreatetestorderCall.html) (none) /// * [refund orders](struct.OrderRefundCall.html) (none) /// * [custombatch orders](struct.OrderCustombatchCall.html) (none) -/// * [cancellineitem orders](struct.OrderCancellineitemCall.html) (none) /// * [getbymerchantorderid orders](struct.OrderGetbymerchantorderidCall.html) (none) /// * [acknowledge orders](struct.OrderAcknowledgeCall.html) (none) /// * [cancel orders](struct.OrderCancelCall.html) (none) -/// * [shiplineitems orders](struct.OrderShiplineitemCall.html) (none) +/// * [cancellineitem orders](struct.OrderCancellineitemCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Order { @@ -807,621 +1781,6 @@ 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. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TestOrderPaymentMethod { - /// The card expiration month (January = 1, February = 2 etc.). - #[serde(rename="expirationMonth")] - pub expiration_month: Option, - /// The last four digits of the card number. - #[serde(rename="lastFourDigits")] - pub last_four_digits: Option, - /// The card expiration year (4-digit, e.g. 2015). - #[serde(rename="expirationYear")] - pub expiration_year: Option, - /// The type of instrument. Note that real orders might have different values than the four values accepted by createTestOrder. - #[serde(rename="type")] - pub type_: Option, - /// The billing address. - #[serde(rename="predefinedBillingAddress")] - pub predefined_billing_address: Option, -} - -impl Part for TestOrderPaymentMethod {} - - -/// 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 TestOrderLineItemProduct { - /// The CLDR territory code of the target country of the product. - #[serde(rename="targetCountry")] - pub target_country: Option, - /// The two-letter ISO 639-1 language code for the item. - #[serde(rename="contentLanguage")] - pub content_language: Option, - /// The title of the product. - pub title: Option, - /// Manufacturer Part Number (MPN) of the item. Optional. - pub mpn: Option, - /// Variant attributes for the item. Optional. - #[serde(rename="variantAttributes")] - pub variant_attributes: Option>, - /// Brand of the item. - pub brand: Option, - /// URL of an image of the item. - #[serde(rename="imageLink")] - pub image_link: Option, - /// An identifier of the item. - #[serde(rename="offerId")] - pub offer_id: Option, - /// Shared identifier for all variants of the same product. Optional. - #[serde(rename="itemGroupId")] - pub item_group_id: Option, - /// Global Trade Item Number (GTIN) of the item. Optional. - pub gtin: Option, - /// Condition or state of the item. - pub condition: Option, - /// The price for the product. - pub price: Option, - /// The item's channel. - pub channel: Option, -} - -impl Part for TestOrderLineItemProduct {} - - -/// 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 OrderPromotionBenefit { - /// The OfferId(s) that were purchased in this order and map to this specific benefit of the promotion. - #[serde(rename="offerIds")] - pub offer_ids: Option>, - /// The discount in the order price when the promotion is applied. - pub discount: Option, - /// Describes whether the promotion applies to products (e.g. 20% off) or to shipping (e.g. Free Shipping). - #[serde(rename="type")] - pub type_: Option, - /// The impact on tax when the promotion is applied. - #[serde(rename="taxImpact")] - pub tax_impact: Option, - /// Further describes the benefit of the promotion. Note that we will expand on this enumeration as we support new promotion sub-types. - #[serde(rename="subType")] - pub sub_type: Option, -} - -impl Part for OrderPromotionBenefit {} - - -/// 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*). -/// -/// * [getbymerchantorderid orders](struct.OrderGetbymerchantorderidCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersGetByMerchantOrderIdResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#ordersGetByMerchantOrderIdResponse". - pub kind: Option, - /// The requested order. - pub order: Option, -} - -impl ResponseResult for OrdersGetByMerchantOrderIdResponse {} - - -/// 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*). -/// -/// * [cancellineitem orders](struct.OrderCancellineitemCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersCancelLineItemResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#ordersCancelLineItemResponse". - pub kind: Option, - /// The status of the execution. - #[serde(rename="executionStatus")] - pub execution_status: Option, -} - -impl ResponseResult for OrdersCancelLineItemResponse {} - - -/// 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 OrderCancellation { - /// The quantity that was canceled. - pub quantity: Option, - /// The reason for the cancellation. Orders that are cancelled with a noInventory reason will lead to the removal of the product from POG until you make an update to that product. This will not affect your Shopping ads. - pub reason: Option, - /// Date on which the cancellation has been created, in ISO 8601 format. - #[serde(rename="creationDate")] - pub creation_date: Option, - /// The actor that created the cancellation. - pub actor: Option, - /// The explanation of the reason. - #[serde(rename="reasonText")] - pub reason_text: Option, -} - -impl Part for OrderCancellation {} - - -/// 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 OrderAddress { - /// City, town or commune. May also include dependent localities or sublocalities (e.g. neighborhoods or suburbs). - pub locality: Option, - /// CLDR country code (e.g. "US"). - pub country: Option, - /// Strings representing the lines of the printed label for mailing the order, for example: - /// John Smith - /// 1600 Amphitheatre Parkway - /// Mountain View, CA, 94043 - /// United States - #[serde(rename="fullAddress")] - pub full_address: Option>, - /// Street-level part of the address. - #[serde(rename="streetAddress")] - pub street_address: Option>, - /// Postal Code or ZIP (e.g. "94043"). - #[serde(rename="postalCode")] - pub postal_code: Option, - /// Name of the recipient. - #[serde(rename="recipientName")] - pub recipient_name: Option, - /// Whether the address is a post office box. - #[serde(rename="isPostOfficeBox")] - pub is_post_office_box: Option, - /// Top-level administrative subdivision of the country (e.g. "CA"). - pub region: Option, -} - -impl Part for OrderAddress {} - - -/// 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 OrdersCustomBatchRequestEntry { - /// The ID of the order. Required for all methods beside getByMerchantOrderId. - #[serde(rename="orderId")] - pub order_id: Option, - /// An entry ID, unique within the batch request. - #[serde(rename="batchId")] - pub batch_id: Option, - /// Required for shipLineItems method. - #[serde(rename="shipLineItems")] - pub ship_line_items: Option, - /// Required for updateShipment method. - #[serde(rename="updateShipment")] - pub update_shipment: Option, - /// The ID of the managing account. - #[serde(rename="merchantId")] - pub merchant_id: Option, - /// The merchant order id. Required for updateMerchantOrderId and getByMerchantOrderId methods. - #[serde(rename="merchantOrderId")] - pub merchant_order_id: Option, - /// Required for cancelLineItem method. - #[serde(rename="cancelLineItem")] - pub cancel_line_item: Option, - /// Required for refund method. - pub refund: Option, - /// Required for cancel method. - pub cancel: Option, - /// The ID of the operation. Unique across all operations for a given order. Required for all methods beside get and getByMerchantOrderId. - #[serde(rename="operationId")] - pub operation_id: Option, - /// The method to apply. - pub method: Option, - /// Required for returnLineItem method. - #[serde(rename="returnLineItem")] - pub return_line_item: Option, -} - -impl Part for OrdersCustomBatchRequestEntry {} - - -/// 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 OrderLineItemProduct { - /// The CLDR territory code of the target country of the product. - #[serde(rename="targetCountry")] - pub target_country: Option, - /// URL to the cached image shown to the user when order was placed. - #[serde(rename="shownImage")] - pub shown_image: Option, - /// The two-letter ISO 639-1 language code for the item. - #[serde(rename="contentLanguage")] - pub content_language: Option, - /// The title of the product. - pub title: Option, - /// Manufacturer Part Number (MPN) of the item. - pub mpn: Option, - /// Variant attributes for the item. These are dimensions of the product, such as color, gender, material, pattern, and size. You can find a comprehensive list of variant attributes here. - #[serde(rename="variantAttributes")] - pub variant_attributes: Option>, - /// Brand of the item. - pub brand: Option, - /// URL of an image of the item. - #[serde(rename="imageLink")] - pub image_link: Option, - /// An identifier of the item. - #[serde(rename="offerId")] - pub offer_id: Option, - /// The REST id of the product. - pub id: Option, - /// Shared identifier for all variants of the same product. - #[serde(rename="itemGroupId")] - pub item_group_id: Option, - /// Global Trade Item Number (GTIN) of the item. - pub gtin: Option, - /// Condition or state of the item. - pub condition: Option, - /// Price of the item. - pub price: Option, - /// The item's channel (online or local). - pub channel: Option, -} - -impl Part for OrderLineItemProduct {} - - -/// 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*). -/// -/// * [cancellineitem orders](struct.OrderCancellineitemCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersCancelLineItemRequest { - /// Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order. - pub amount: Option, - /// The explanation of the reason. - #[serde(rename="reasonText")] - pub reason_text: Option, - /// The ID of the line item to cancel. - #[serde(rename="lineItemId")] - pub line_item_id: Option, - /// The ID of the operation. Unique across all operations for a given order. - #[serde(rename="operationId")] - pub operation_id: Option, - /// The reason for the cancellation. - pub reason: Option, - /// The quantity to cancel. - pub quantity: Option, -} - -impl RequestValue for OrdersCancelLineItemRequest {} - - -/// 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 OrderPromotion { - /// The full title of the promotion. - #[serde(rename="longTitle")] - pub long_title: Option, - /// Optional. The text code that corresponds to the promotion when applied on the retailer?s website. - #[serde(rename="genericRedemptionCode")] - pub generic_redemption_code: Option, - /// no description provided - pub benefits: Option>, - /// Indicates that the promotion is valid online. - #[serde(rename="redemptionChannel")] - pub redemption_channel: Option, - /// Whether the promotion is applicable to all products or only specific products. - #[serde(rename="productApplicability")] - pub product_applicability: Option, - /// The date and time frame when the promotion is active and ready for validation review. Note that the promotion live time may be delayed for a few hours due to the validation review. - /// Start date and end date are separated by a forward slash (/). The start date is specified by the format (YYYY-MM-DD), followed by the letter ?T?, the time of the day when the sale starts (in Greenwich Mean Time, GMT), followed by an expression of the time zone for the sale. The end date is in the same format. - #[serde(rename="effectiveDates")] - pub effective_dates: Option, - /// The unique ID of the promotion. - pub id: Option, -} - -impl Part for OrderPromotion {} - - -/// 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 OrderLineItemProductVariantAttribute { - /// The dimension of the variant. - pub dimension: Option, - /// The value for the dimension. - pub value: Option, -} - -impl Part for OrderLineItemProductVariantAttribute {} - - -/// 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*). -/// -/// * [returnlineitem orders](struct.OrderReturnlineitemCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersReturnLineItemRequest { - /// The ID of the operation. Unique across all operations for a given order. - #[serde(rename="operationId")] - pub operation_id: Option, - /// The reason for the return. - pub reason: Option, - /// The explanation of the reason. - #[serde(rename="reasonText")] - pub reason_text: Option, - /// The ID of the line item to return. - #[serde(rename="lineItemId")] - pub line_item_id: Option, - /// The quantity to return. - pub quantity: Option, -} - -impl RequestValue for OrdersReturnLineItemRequest {} - - -/// 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*). -/// -/// * [custombatch orders](struct.OrderCustombatchCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersCustomBatchResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#ordersCustomBatchResponse". - pub kind: Option, - /// The result of the execution of the batch requests. - pub entries: Option>, -} - -impl ResponseResult for OrdersCustomBatchResponse {} - - -/// 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 OrderCustomer { - /// If set, this indicates the user explicitly chose to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the checkout flow. - #[serde(rename="explicitMarketingPreference")] - pub explicit_marketing_preference: Option, - /// Full name of the customer. - #[serde(rename="fullName")] - pub full_name: Option, - /// Email address of the customer. - pub email: Option, -} - -impl Part for OrderCustomer {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [cancel orders](struct.OrderCancelCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersCancelRequest { - /// The reason for the cancellation. - pub reason: Option, - /// The explanation of the reason. - #[serde(rename="reasonText")] - pub reason_text: Option, - /// The ID of the operation. Unique across all operations for a given order. - #[serde(rename="operationId")] - pub operation_id: Option, -} - -impl RequestValue for OrdersCancelRequest {} - - -/// 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 orders](struct.OrderListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersListResponse { - /// The token for the retrieval of the next page of orders. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Identifies what kind of resource this is. Value: the fixed string "content#ordersListResponse". - pub kind: Option, - /// no description provided - pub resources: Option>, -} - -impl ResponseResult for OrdersListResponse {} - - -/// 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 OrderShipmentLineItemShipment { - /// The id of the line item that is shipped. - #[serde(rename="lineItemId")] - pub line_item_id: Option, - /// The quantity that is shipped. - pub quantity: Option, -} - -impl Part for OrderShipmentLineItemShipment {} - - -/// 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*). -/// -/// * [createtestorder orders](struct.OrderCreatetestorderCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersCreateTestOrderResponse { - /// The ID of the newly created test order. - #[serde(rename="orderId")] - pub order_id: Option, - /// Identifies what kind of resource this is. Value: the fixed string "content#ordersCreateTestOrderResponse". - pub kind: Option, -} - -impl ResponseResult for OrdersCreateTestOrderResponse {} - - -/// 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*). -/// -/// * [gettestordertemplate orders](struct.OrderGettestordertemplateCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersGetTestOrderTemplateResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#ordersGetTestOrderTemplateResponse". - pub kind: Option, - /// The requested test order template. - pub template: Option, -} - -impl ResponseResult for OrdersGetTestOrderTemplateResponse {} - - -/// 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*). -/// -/// * [refund orders](struct.OrderRefundCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersRefundRequest { - /// The amount that is refunded. - pub amount: Option, - /// The explanation of the reason. - #[serde(rename="reasonText")] - pub reason_text: Option, - /// The reason for the refund. - pub reason: Option, - /// The ID of the operation. Unique across all operations for a given order. - #[serde(rename="operationId")] - pub operation_id: Option, -} - -impl RequestValue for OrdersRefundRequest {} - - -/// 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 TestOrderCustomer { - /// If set, this indicates the user explicitly chose to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the checkout flow. Optional. - #[serde(rename="explicitMarketingPreference")] - pub explicit_marketing_preference: Option, - /// Full name of the customer. - #[serde(rename="fullName")] - pub full_name: Option, - /// Email address of the customer. - pub email: Option, -} - -impl Part for TestOrderCustomer {} - - -/// 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 OrdersCustomBatchRequestEntryCancel { - /// The reason for the cancellation. - pub reason: Option, - /// The explanation of the reason. - #[serde(rename="reasonText")] - pub reason_text: Option, -} - -impl Part for OrdersCustomBatchRequestEntryCancel {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1455,6 +1814,8 @@ pub struct OrderLineItem { /// Number of items shipped. #[serde(rename="quantityShipped")] pub quantity_shipped: Option, + /// Annotations that are attached to the line item. + pub annotations: Option>, /// Number of items returned. #[serde(rename="quantityReturned")] pub quantity_returned: Option, @@ -1469,29 +1830,6 @@ pub struct OrderLineItem { impl Part for OrderLineItem {} -/// 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 OrdersCustomBatchRequestEntryCancelLineItem { - /// Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order. - pub amount: Option, - /// The explanation of the reason. - #[serde(rename="reasonText")] - pub reason_text: Option, - /// The reason for the cancellation. - pub reason: Option, - /// The ID of the line item to cancel. - #[serde(rename="lineItemId")] - pub line_item_id: Option, - /// The quantity to cancel. - pub quantity: Option, -} - -impl Part for OrdersCustomBatchRequestEntryCancelLineItem {} - - /// There is no detailed description. /// /// # Activities @@ -1499,37 +1837,18 @@ impl Part for OrdersCustomBatchRequestEntryCancelLineItem {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [acknowledge orders](struct.OrderAcknowledgeCall.html) (request) +/// * [cancel orders](struct.OrderCancelCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersAcknowledgeRequest { - /// The ID of the operation. Unique across all operations for a given order. - #[serde(rename="operationId")] - pub operation_id: Option, +pub struct OrdersCancelResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#ordersCancelResponse". + pub kind: Option, + /// The status of the execution. + #[serde(rename="executionStatus")] + pub execution_status: Option, } -impl RequestValue for OrdersAcknowledgeRequest {} - - -/// 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 OrdersCustomBatchRequestEntryReturnLineItem { - /// The reason for the return. - pub reason: Option, - /// The explanation of the reason. - #[serde(rename="reasonText")] - pub reason_text: Option, - /// The ID of the line item to return. - #[serde(rename="lineItemId")] - pub line_item_id: Option, - /// The quantity to return. - pub quantity: Option, -} - -impl Part for OrdersCustomBatchRequestEntryReturnLineItem {} +impl ResponseResult for OrdersCancelResponse {} /// There is no detailed description. @@ -1553,27 +1872,6 @@ pub struct OrdersReturnLineItemResponse { impl ResponseResult for OrdersReturnLineItemResponse {} -/// 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*). -/// -/// * [refund orders](struct.OrderRefundCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersRefundResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#ordersRefundResponse". - pub kind: Option, - /// The status of the execution. - #[serde(rename="executionStatus")] - pub execution_status: Option, -} - -impl ResponseResult for OrdersRefundResponse {} - - /// There is no detailed description. /// /// # Activities @@ -1636,28 +1934,6 @@ pub struct OrdersCustomBatchRequestEntryShipLineItems { impl Part for OrdersCustomBatchRequestEntryShipLineItems {} -/// 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*). -/// -/// * [updatemerchantorderid orders](struct.OrderUpdatemerchantorderidCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersUpdateMerchantOrderIdRequest { - /// The merchant order id to be assigned to the order. Must be unique per merchant. - #[serde(rename="merchantOrderId")] - pub merchant_order_id: Option, - /// The ID of the operation. Unique across all operations for a given order. - #[serde(rename="operationId")] - pub operation_id: Option, -} - -impl RequestValue for OrdersUpdateMerchantOrderIdRequest {} - - /// There is no detailed description. /// /// # Activities @@ -1725,39 +2001,21 @@ impl Part for OrderPaymentMethod {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [shiplineitems orders](struct.OrderShiplineitemCall.html) (response) +/// * [cancel orders](struct.OrderCancelCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersShipLineItemsResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#ordersShipLineItemsResponse". - pub kind: Option, - /// The status of the execution. - #[serde(rename="executionStatus")] - pub execution_status: Option, +pub struct OrdersCancelRequest { + /// The reason for the cancellation. + pub reason: Option, + /// The explanation of the reason. + #[serde(rename="reasonText")] + pub reason_text: Option, + /// The ID of the operation. Unique across all operations for a given order. + #[serde(rename="operationId")] + pub operation_id: Option, } -impl ResponseResult for OrdersShipLineItemsResponse {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [cancel orders](struct.OrderCancelCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrdersCancelResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#ordersCancelResponse". - pub kind: Option, - /// The status of the execution. - #[serde(rename="executionStatus")] - pub execution_status: Option, -} - -impl ResponseResult for OrdersCancelResponse {} +impl RequestValue for OrdersCancelRequest {} /// There is no detailed description. @@ -1809,59 +2067,6 @@ pub struct OrderLineItemReturnInfo { impl Part for OrderLineItemReturnInfo {} -/// 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 OrdersCustomBatchRequestEntryRefund { - /// The amount that is refunded. - pub amount: Option, - /// The explanation of the reason. - #[serde(rename="reasonText")] - pub reason_text: Option, - /// The reason for the refund. - pub reason: Option, -} - -impl Part for OrdersCustomBatchRequestEntryRefund {} - - -/// 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 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. - pub promotions: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "content#testOrder". - pub kind: Option, - /// Line items that are ordered. At least one line item must be provided. - #[serde(rename="lineItems")] - pub line_items: Option>, - /// Identifier of one of the predefined delivery addresses for the delivery. - #[serde(rename="predefinedDeliveryAddress")] - pub predefined_delivery_address: Option, - /// The total cost of shipping for all items. - #[serde(rename="shippingCost")] - pub shipping_cost: Option, - /// The requested shipping option. - #[serde(rename="shippingOption")] - pub shipping_option: Option, - /// The tax for the total shipping cost. - #[serde(rename="shippingCostTax")] - pub shipping_cost_tax: Option, - /// The details of the payment method. - #[serde(rename="paymentMethod")] - pub payment_method: Option, -} - -impl Part for TestOrder {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1914,7 +2119,7 @@ impl Part for OrdersCustomBatchResponseEntry {} /// ::default(), None); /// let mut hub = ShoppingContent::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(...)`, `advancetestorder(...)`, `cancel(...)`, `cancellineitem(...)`, `createtestorder(...)`, `custombatch(...)`, `get(...)`, `getbymerchantorderid(...)`, `gettestordertemplate(...)`, `list(...)`, `refund(...)`, `returnlineitem(...)`, `shiplineitems(...)`, `updatemerchantorderid(...)` and `updateshipment(...)` +/// // like `acknowledge(...)`, `advancetestorder(...)`, `cancel(...)`, `cancellineitem(...)`, `createtestorder(...)`, `custombatch(...)`, `get(...)`, `getbymerchantorderid(...)`, `gettestordertemplate(...)`, `list(...)`, `refund(...)`, `returnlineitem(...)`, `setlineitemmetadata(...)`, `shiplineitems(...)`, `updatelineitemshippingdetails(...)`, `updatemerchantorderid(...)` and `updateshipment(...)` /// // to build up your call. /// let rb = hub.orders(); /// # } @@ -1931,11 +2136,11 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Retrieves an order from your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. pub fn get(&self, merchant_id: &str, order_id: &str) -> OrderGetCall<'a, C, A> { OrderGetCall { @@ -1950,11 +2155,11 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts. + /// Lists the orders in your Merchant Center account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. pub fn list(&self, merchant_id: &str) -> OrderListCall<'a, C, A> { OrderListCall { hub: self.hub, @@ -1974,12 +2179,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts. + /// Updates a shipment's status, carrier, and/or tracking ID. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. pub fn updateshipment(&self, request: OrdersUpdateShipmentRequest, merchant_id: &str, order_id: &str) -> OrderUpdateshipmentCall<'a, C, A> { OrderUpdateshipmentCall { @@ -1995,11 +2200,11 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts. + /// Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the test order to modify. pub fn advancetestorder(&self, merchant_id: &str, order_id: &str) -> OrderAdvancetestorderCall<'a, C, A> { OrderAdvancetestorderCall { @@ -2014,12 +2219,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts. + /// Updates the merchant order ID for a given order. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. pub fn updatemerchantorderid(&self, request: OrdersUpdateMerchantOrderIdRequest, merchant_id: &str, order_id: &str) -> OrderUpdatemerchantorderidCall<'a, C, A> { OrderUpdatemerchantorderidCall { @@ -2035,12 +2240,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a line item. This method can only be called for non-multi-client accounts. + /// Returns a line item. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. pub fn returnlineitem(&self, request: OrdersReturnLineItemRequest, merchant_id: &str, order_id: &str) -> OrderReturnlineitemCall<'a, C, A> { OrderReturnlineitemCall { @@ -2056,11 +2261,11 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for non-multi-client accounts. + /// Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that should manage the order. This cannot be a multi-client account. /// * `templateName` - The name of the template to retrieve. pub fn gettestordertemplate(&self, merchant_id: &str, template_name: &str) -> OrderGettestordertemplateCall<'a, C, A> { OrderGettestordertemplateCall { @@ -2075,12 +2280,75 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts. + /// Sets (overrides) merchant provided annotations on the line item. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. + /// * `orderId` - The ID of the order. + pub fn setlineitemmetadata(&self, request: OrdersSetLineItemMetadataRequest, merchant_id: &str, order_id: &str) -> OrderSetlineitemmetadataCall<'a, C, A> { + OrderSetlineitemmetadataCall { + hub: self.hub, + _request: request, + _merchant_id: merchant_id.to_string(), + _order_id: order_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates ship by and delivery by dates for a line item. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. + /// * `orderId` - The ID of the order. + pub fn updatelineitemshippingdetails(&self, request: OrdersUpdateLineItemShippingDetailsRequest, merchant_id: &str, order_id: &str) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> { + OrderUpdatelineitemshippingdetailCall { + hub: self.hub, + _request: request, + _merchant_id: merchant_id.to_string(), + _order_id: order_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Marks line item(s) as shipped. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. + /// * `orderId` - The ID of the order. + pub fn shiplineitems(&self, request: OrdersShipLineItemsRequest, merchant_id: &str, order_id: &str) -> OrderShiplineitemCall<'a, C, A> { + OrderShiplineitemCall { + hub: self.hub, + _request: request, + _merchant_id: merchant_id.to_string(), + _order_id: order_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sandbox only. Creates a test order. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `merchantId` - The ID of the account that should manage the order. This cannot be a multi-client account. pub fn createtestorder(&self, request: OrdersCreateTestOrderRequest, merchant_id: &str) -> OrderCreatetestorderCall<'a, C, A> { OrderCreatetestorderCall { hub: self.hub, @@ -2094,12 +2362,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts. + /// Refund a portion of the order, up to the full amount paid. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order to refund. pub fn refund(&self, request: OrdersRefundRequest, merchant_id: &str, order_id: &str) -> OrderRefundCall<'a, C, A> { OrderRefundCall { @@ -2115,7 +2383,7 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts. + /// Retrieves or modifies multiple orders in a single request. /// /// # Arguments /// @@ -2132,32 +2400,11 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts. + /// Retrieves an order using merchant order id. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. - /// * `orderId` - The ID of the order. - pub fn cancellineitem(&self, request: OrdersCancelLineItemRequest, merchant_id: &str, order_id: &str) -> OrderCancellineitemCall<'a, C, A> { - OrderCancellineitemCall { - hub: self.hub, - _request: request, - _merchant_id: merchant_id.to_string(), - _order_id: order_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts. - /// - /// # Arguments - /// - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `merchantOrderId` - The merchant order id to be looked for. pub fn getbymerchantorderid(&self, merchant_id: &str, merchant_order_id: &str) -> OrderGetbymerchantorderidCall<'a, C, A> { OrderGetbymerchantorderidCall { @@ -2172,12 +2419,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Marks an order as acknowledged. This method can only be called for non-multi-client accounts. + /// Marks an order as acknowledged. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. pub fn acknowledge(&self, request: OrdersAcknowledgeRequest, merchant_id: &str, order_id: &str) -> OrderAcknowledgeCall<'a, C, A> { OrderAcknowledgeCall { @@ -2193,12 +2440,12 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. + /// Cancels all line items in an order, making a full refund. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order to cancel. pub fn cancel(&self, request: OrdersCancelRequest, merchant_id: &str, order_id: &str) -> OrderCancelCall<'a, C, A> { OrderCancelCall { @@ -2214,15 +2461,15 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Marks line item(s) as shipped. This method can only be called for non-multi-client accounts. + /// Cancels a line item, making a full refund. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. /// * `orderId` - The ID of the order. - pub fn shiplineitems(&self, request: OrdersShipLineItemsRequest, merchant_id: &str, order_id: &str) -> OrderShiplineitemCall<'a, C, A> { - OrderShiplineitemCall { + pub fn cancellineitem(&self, request: OrdersCancelLineItemRequest, merchant_id: &str, order_id: &str) -> OrderCancellineitemCall<'a, C, A> { + OrderCancellineitemCall { hub: self.hub, _request: request, _merchant_id: merchant_id.to_string(), @@ -2242,7 +2489,7 @@ impl<'a, C, A> OrderMethods<'a, C, A> { // CallBuilders ### // ################# -/// Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts. +/// Retrieves an order from your Merchant Center account. /// /// A builder for the *get* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -2418,7 +2665,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut } - /// The ID of the managing account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -2497,7 +2744,7 @@ impl<'a, C, A> OrderGetCall<'a, C, A> where C: BorrowMut, A: oaut } -/// Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts. +/// Lists the orders in your Merchant Center account. /// /// A builder for the *list* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -2708,7 +2955,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau } - /// The ID of the managing account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -2829,7 +3076,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau } -/// Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts. +/// Updates a shipment's status, carrier, and/or tracking ID. /// /// A builder for the *updateshipment* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -3036,7 +3283,7 @@ impl<'a, C, A> OrderUpdateshipmentCall<'a, C, A> where C: BorrowMut OrderUpdateshipmentCall<'a, C, A> where C: BorrowMut OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut OrderUpdatemerchantorderidCall<'a, C, A> where C: BorrowMut OrderUpdatemerchantorderidCall<'a, C, A> where C: BorrowMut OrderReturnlineitemCall<'a, C, A> where C: BorrowMut OrderReturnlineitemCall<'a, C, A> where C: BorrowMut OrderGettestordertemplateCall<'a, C, A> where C: BorrowMut OrderGettestordertemplateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = OrdersSetLineItemMetadataRequest::default(); +/// +/// // You can configure optional parameters by calling 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().setlineitemmetadata(req, "merchantId", "orderId") +/// .doit(); +/// # } +/// ``` +pub struct OrderSetlineitemmetadataCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _request: OrdersSetLineItemMetadataRequest, + _merchant_id: String, + _order_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderSetlineitemmetadataCall<'a, C, A> {} + +impl<'a, C, A> OrderSetlineitemmetadataCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersSetLineItemMetadataResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.orders.setlineitemmetadata", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("orderId", self._order_id.to_string())); + for &field in ["alt", "merchantId", "orderId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/setLineItemMetadata"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["orderId", "merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: OrdersSetLineItemMetadataRequest) -> OrderSetlineitemmetadataCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the account that manages the order. This cannot be a multi-client account. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> OrderSetlineitemmetadataCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The ID of the order. + /// + /// Sets the *order id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn order_id(mut self, new_value: &str) -> OrderSetlineitemmetadataCall<'a, C, A> { + self._order_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrderSetlineitemmetadataCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> OrderSetlineitemmetadataCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> OrderSetlineitemmetadataCall<'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 ship by and delivery by dates for a line item. +/// +/// A builder for the *updatelineitemshippingdetails* 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_content2_sandbox as content2_sandbox; +/// use content2_sandbox::OrdersUpdateLineItemShippingDetailsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use content2_sandbox::ShoppingContent; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = OrdersUpdateLineItemShippingDetailsRequest::default(); +/// +/// // You can configure optional parameters by calling 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().updatelineitemshippingdetails(req, "merchantId", "orderId") +/// .doit(); +/// # } +/// ``` +pub struct OrderUpdatelineitemshippingdetailCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _request: OrdersUpdateLineItemShippingDetailsRequest, + _merchant_id: String, + _order_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderUpdatelineitemshippingdetailCall<'a, C, A> {} + +impl<'a, C, A> OrderUpdatelineitemshippingdetailCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersUpdateLineItemShippingDetailsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.orders.updatelineitemshippingdetails", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("orderId", self._order_id.to_string())); + for &field in ["alt", "merchantId", "orderId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/updateLineItemShippingDetails"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["orderId", "merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: OrdersUpdateLineItemShippingDetailsRequest) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the account that manages the order. This cannot be a multi-client account. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The ID of the order. + /// + /// Sets the *order id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn order_id(mut self, new_value: &str) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> { + self._order_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> OrderUpdatelineitemshippingdetailCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Marks line item(s) as shipped. +/// +/// A builder for the *shiplineitems* 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_content2_sandbox as content2_sandbox; +/// use content2_sandbox::OrdersShipLineItemsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use content2_sandbox::ShoppingContent; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = OrdersShipLineItemsRequest::default(); +/// +/// // You can configure optional parameters by calling 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().shiplineitems(req, "merchantId", "orderId") +/// .doit(); +/// # } +/// ``` +pub struct OrderShiplineitemCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _request: OrdersShipLineItemsRequest, + _merchant_id: String, + _order_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderShiplineitemCall<'a, C, A> {} + +impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersShipLineItemsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.orders.shiplineitems", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("orderId", self._order_id.to_string())); + for &field in ["alt", "merchantId", "orderId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/shipLineItems"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["orderId", "merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: OrdersShipLineItemsRequest) -> OrderShiplineitemCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the account that manages the order. This cannot be a multi-client account. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> OrderShiplineitemCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The ID of the order. + /// + /// Sets the *order id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn order_id(mut self, new_value: &str) -> OrderShiplineitemCall<'a, C, A> { + self._order_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrderShiplineitemCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> OrderShiplineitemCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> OrderShiplineitemCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sandbox only. Creates a test order. /// /// A builder for the *createtestorder* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -4402,7 +5507,7 @@ impl<'a, C, A> OrderCreatetestorderCall<'a, C, A> where C: BorrowMut OrderCreatetestorderCall<'a, C, A> where C: BorrowMut OrderRefundCall<'a, C, A> where C: BorrowMut, A: o self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -4757,7 +5862,7 @@ impl<'a, C, A> OrderRefundCall<'a, C, A> where C: BorrowMut, A: o } -/// Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts. +/// Retrieves or modifies multiple orders in a single request. /// /// A builder for the *custombatch* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -4998,293 +6103,7 @@ impl<'a, C, A> OrderCustombatchCall<'a, C, A> where C: BorrowMut, } -/// Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts. -/// -/// A builder for the *cancellineitem* 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_content2_sandbox as content2_sandbox; -/// use content2_sandbox::OrdersCancelLineItemRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2_sandbox::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = OrdersCancelLineItemRequest::default(); -/// -/// // You can configure optional parameters by calling 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().cancellineitem(req, "merchantId", "orderId") -/// .doit(); -/// # } -/// ``` -pub struct OrderCancellineitemCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: OrdersCancelLineItemRequest, - _merchant_id: String, - _order_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrderCancellineitemCall<'a, C, A> {} - -impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersCancelLineItemResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.orders.cancellineitem", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("orderId", self._order_id.to_string())); - for &field in ["alt", "merchantId", "orderId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/cancelLineItem"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["orderId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).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: OrdersCancelLineItemRequest) -> OrderCancellineitemCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the managing account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderCancellineitemCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the order. - /// - /// Sets the *order id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn order_id(mut self, new_value: &str) -> OrderCancellineitemCall<'a, C, A> { - self._order_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrderCancellineitemCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderCancellineitemCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization 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) -> OrderCancellineitemCall<'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 order using merchant order id. This method can only be called for non-multi-client accounts. +/// Retrieves an order using merchant order id. /// /// A builder for the *getbymerchantorderid* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -5460,7 +6279,7 @@ impl<'a, C, A> OrderGetbymerchantorderidCall<'a, C, A> where C: BorrowMut OrderGetbymerchantorderidCall<'a, C, A> where C: BorrowMut OrderAcknowledgeCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -5825,7 +6644,7 @@ impl<'a, C, A> OrderAcknowledgeCall<'a, C, A> where C: BorrowMut, } -/// Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. +/// Cancels all line items in an order, making a full refund. /// /// A builder for the *cancel* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -6032,7 +6851,7 @@ impl<'a, C, A> OrderCancelCall<'a, C, A> where C: BorrowMut, A: o self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// @@ -6111,9 +6930,9 @@ impl<'a, C, A> OrderCancelCall<'a, C, A> where C: BorrowMut, A: o } -/// Marks line item(s) as shipped. This method can only be called for non-multi-client accounts. +/// Cancels a line item, making a full refund. /// -/// A builder for the *shiplineitems* method supported by a *order* resource. +/// A builder for the *cancellineitem* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. /// /// # Example @@ -6125,7 +6944,7 @@ impl<'a, C, A> OrderCancelCall<'a, C, A> where C: BorrowMut, A: o /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_content2_sandbox as content2_sandbox; -/// use content2_sandbox::OrdersShipLineItemsRequest; +/// use content2_sandbox::OrdersCancelLineItemRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -6139,20 +6958,20 @@ impl<'a, C, A> OrderCancelCall<'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 = OrdersShipLineItemsRequest::default(); +/// let mut req = OrdersCancelLineItemRequest::default(); /// /// // You can configure optional parameters by calling 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().shiplineitems(req, "merchantId", "orderId") +/// let result = hub.orders().cancellineitem(req, "merchantId", "orderId") /// .doit(); /// # } /// ``` -pub struct OrderShiplineitemCall<'a, C, A> +pub struct OrderCancellineitemCall<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, - _request: OrdersShipLineItemsRequest, + _request: OrdersCancelLineItemRequest, _merchant_id: String, _order_id: String, _delegate: Option<&'a mut Delegate>, @@ -6160,13 +6979,13 @@ pub struct OrderShiplineitemCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrderShiplineitemCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrderCancellineitemCall<'a, C, A> {} -impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersShipLineItemsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersCancelLineItemResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -6174,7 +6993,7 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "content.orders.shiplineitems", + dlg.begin(MethodInfo { id: "content.orders.cancellineitem", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); @@ -6191,7 +7010,7 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/shipLineItems"; + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/cancelLineItem"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6314,17 +7133,17 @@ impl<'a, C, A> OrderShiplineitemCall<'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: OrdersShipLineItemsRequest) -> OrderShiplineitemCall<'a, C, A> { + pub fn request(mut self, new_value: OrdersCancelLineItemRequest) -> OrderCancellineitemCall<'a, C, A> { self._request = new_value; self } - /// The ID of the managing account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderShiplineitemCall<'a, C, A> { + pub fn merchant_id(mut self, new_value: &str) -> OrderCancellineitemCall<'a, C, A> { self._merchant_id = new_value.to_string(); self } @@ -6334,7 +7153,7 @@ impl<'a, C, A> OrderShiplineitemCall<'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 order_id(mut self, new_value: &str) -> OrderShiplineitemCall<'a, C, A> { + pub fn order_id(mut self, new_value: &str) -> OrderCancellineitemCall<'a, C, A> { self._order_id = new_value.to_string(); self } @@ -6344,7 +7163,7 @@ impl<'a, C, A> OrderShiplineitemCall<'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) -> OrderShiplineitemCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrderCancellineitemCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -6365,7 +7184,7 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderShiplineitemCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> OrderCancellineitemCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -6385,7 +7204,7 @@ impl<'a, C, A> OrderShiplineitemCall<'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) -> OrderShiplineitemCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrderCancellineitemCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { diff --git a/gen/dataproc1-cli/Cargo.toml b/gen/dataproc1-cli/Cargo.toml index 8b3c9c8c69..d1e9bc8c66 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+20170919" +version = "1.0.6+20171207" 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+20170919" +version = "1.0.6+20171207" diff --git a/gen/dataproc1-cli/README.md b/gen/dataproc1-cli/README.md index 1a997944b0..750d28d7ce 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 *20170919*. The CLI is at version *1.0.6*. +This documentation was generated from the *dataproc* API at revision *20171207*. 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 d30fa59542..d306b68f66 100644 --- a/gen/dataproc1-cli/mkdocs.yml +++ b/gen/dataproc1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dataproc v1.0.6+20170919 +site_name: dataproc v1.0.6+20171207 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 c9c53149a7..a31e56923e 100644 --- a/gen/dataproc1-cli/src/main.rs +++ b/gen/dataproc1-cli/src/main.rs @@ -71,8 +71,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.detail" => Some(("status.detail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.substate" => Some(("status.substate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.detail" => Some(("status.detail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster-uuid" => Some(("clusterUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster-name" => Some(("clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -453,8 +453,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.detail" => Some(("status.detail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.substate" => Some(("status.substate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.detail" => Some(("status.detail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster-uuid" => Some(("clusterUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster-name" => Some(("clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -517,6 +517,9 @@ impl<'n> Engine<'n> { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, + "graceful-decommission-timeout" => { + call = call.graceful_decommission_timeout(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -530,7 +533,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(["update-mask"].iter().map(|v|*v)); + v.extend(["update-mask", "graceful-decommission-timeout"].iter().map(|v|*v)); v } )); } } @@ -1982,7 +1985,7 @@ fn main() { let mut app = App::new("dataproc1") .author("Sebastian Thiel ") - .version("1.0.6+20170919") + .version("1.0.6+20171207") .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 cd63dbebfd..3365412df4 100644 --- a/gen/dataproc1/Cargo.toml +++ b/gen/dataproc1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dataproc1" -version = "1.0.6+20170919" +version = "1.0.6+20171207" 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+20170919" +documentation = "https://docs.rs/google-dataproc1/1.0.6+20171207" license = "MIT" keywords = ["dataproc", "google", "protocol", "web", "api"] diff --git a/gen/dataproc1/README.md b/gen/dataproc1/README.md index d44daccb9c..f512e7ba49 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+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*. +This documentation was generated from *dataproc* crate version *1.0.6+20171207*, where *20171207* 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+20170919/google_dataproc1/struct.Dataproc.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.Dataproc.html) ... * projects - * [*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) + * [*regions clusters create*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionClusterCreateCall.html), [*regions clusters delete*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionClusterDeleteCall.html), [*regions clusters diagnose*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionClusterDiagnoseCall.html), [*regions clusters get*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionClusterGetCall.html), [*regions clusters list*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionClusterListCall.html), [*regions clusters patch*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionClusterPatchCall.html), [*regions jobs cancel*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionJobCancelCall.html), [*regions jobs delete*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionJobDeleteCall.html), [*regions jobs get*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionJobGetCall.html), [*regions jobs list*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionJobListCall.html), [*regions jobs patch*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionJobPatchCall.html), [*regions jobs submit*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionJobSubmitCall.html), [*regions operations cancel*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionOperationCancelCall.html), [*regions operations delete*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionOperationDeleteCall.html), [*regions operations get*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/struct.ProjectRegionOperationGetCall.html) and [*regions operations list*](https://docs.rs/google-dataproc1/1.0.6+20171207/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+20170919/google_dataproc1/struct.Dataproc.html)** +* **[Hub](https://docs.rs/google-dataproc1/1.0.6+20171207/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+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)** + * creates [*Method Builders*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dataproc1/1.0.6+20171207/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+20170919/google_dataproc1/trait.Part.html)** + * **[Parts](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dataproc1/1.0.6+20170919/google_dataproc1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -105,6 +105,7 @@ let mut req = Cluster::default(); // Values shown here are possibly random and not representative ! let result = hub.projects().regions_clusters_patch(req, "projectId", "region", "clusterName") .update_mask("sed") + .graceful_decommission_timeout("et") .doit(); match result { @@ -127,17 +128,17 @@ match result { ``` ## Handling Errors -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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-dataproc1/1.0.6+20171207/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+20170919/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+20171207/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+20170919/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+20171207/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+20170919/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+20171207/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 +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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dataproc1/1.0.6+20171207/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+20170919/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+20171207/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dataproc1/1.0.6+20171207/google_dataproc1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dataproc1/1.0.6+20171207/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+20170919/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+20171207/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+20170919/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+20171207/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+20170919/google_dataproc1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dataproc1/1.0.6+20171207/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 9f41e58421..c5260e0ff9 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+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*. +//! This documentation was generated from *dataproc* crate version *1.0.6+20171207*, where *20171207* 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/). @@ -105,7 +105,8 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.projects().regions_clusters_patch(req, "projectId", "region", "clusterName") -//! .update_mask("accusam") +//! .update_mask("takimata") +//! .graceful_decommission_timeout("justo") //! .doit(); //! //! match result { @@ -291,7 +292,8 @@ impl Default for Scope { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().regions_clusters_patch(req, "projectId", "region", "clusterName") -/// .update_mask("erat") +/// .update_mask("sea") +/// .graceful_decommission_timeout("nonumy") /// .doit(); /// /// match result { @@ -396,7 +398,7 @@ pub struct SparkSqlJob { impl Part for SparkSqlJob {} -/// Job scheduling options.Beta Feature: These options are available for testing purposes only. They may be changed before final release. +/// Job scheduling options. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -512,21 +514,18 @@ pub struct Status { impl Part for Status {} -/// 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 {} /// Common config settings for resources of Google Compute Engine cluster instances, applicable to all instances in the cluster. @@ -728,9 +727,6 @@ 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, @@ -745,6 +741,9 @@ 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, @@ -915,18 +914,21 @@ pub struct JobPlacement { impl Part for JobPlacement {} -/// 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 {} /// 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. @@ -1043,11 +1045,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 {} @@ -1167,10 +1169,10 @@ pub struct ClusterStatus { /// Output-only. Time when this state was entered. #[serde(rename="stateStartTime")] pub state_start_time: Option, - /// Output-only. Optional details of cluster's state. - pub detail: Option, /// Output-only. Additional state information that includes status reported by the agent. pub substate: Option, + /// Output-only. Optional details of cluster's state. + pub detail: Option, } impl Part for ClusterStatus {} @@ -1265,6 +1267,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: + /// + /// 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 regions_operations_get(&self, name: &str) -> ProjectRegionOperationGetCall<'a, C, A> { + ProjectRegionOperationGetCall { + 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 resource representation for a cluster in a project. @@ -1350,6 +1369,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _region: region.to_string(), _cluster_name: cluster_name.to_string(), _update_mask: Default::default(), + _graceful_decommission_timeout: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1396,13 +1416,13 @@ impl<'a, C, A> ProjectMethods<'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. + /// 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. - pub fn regions_operations_get(&self, name: &str) -> ProjectRegionOperationGetCall<'a, C, A> { - ProjectRegionOperationGetCall { + /// * `name` - The name of the operation resource to be deleted. + pub fn regions_operations_delete(&self, name: &str) -> ProjectRegionOperationDeleteCall<'a, C, A> { + ProjectRegionOperationDeleteCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -1518,23 +1538,6 @@ 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 regions_operations_delete(&self, name: &str) -> ProjectRegionOperationDeleteCall<'a, C, A> { - ProjectRegionOperationDeleteCall { - 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. @@ -1611,6 +1614,259 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // 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 *regions.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_dataproc1 as dataproc1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dataproc1::Dataproc; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().regions_operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRegionOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRegionOperationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectRegionOperationGetCall<'a, C, 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: "dataproc.projects.regions.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) -> ProjectRegionOperationGetCall<'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) -> ProjectRegionOperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectRegionOperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectRegionOperationGetCall<'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 resource representation for a cluster in a project. /// /// A builder for the *regions.clusters.get* method supported by a *project* resource. @@ -1912,9 +2168,9 @@ impl<'a, C, A> ProjectRegionClusterGetCall<'a, C, A> where C: BorrowMut ProjectRegionClusterListCall<'a, C, A> where C: BorrowMut ProjectRegionJobListCall<'a, C, A> where C: BorrowMut ProjectRegionJobListCall<'a, C, A> { self._job_state_matcher = Some(new_value.to_string()); self } - /// 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 = * + /// 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 NON_ACTIVE. 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 = * /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ProjectRegionJobListCall<'a, C, A> { @@ -2536,7 +2792,8 @@ impl<'a, C, A> ProjectRegionJobListCall<'a, C, A> where C: BorrowMut _region: String, _cluster_name: String, _update_mask: Option, + _graceful_decommission_timeout: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -2570,14 +2828,17 @@ impl<'a, C, A> ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((7 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); params.push(("projectId", self._project_id.to_string())); params.push(("region", self._region.to_string())); params.push(("clusterName", self._cluster_name.to_string())); if let Some(value) = self._update_mask { params.push(("updateMask", value.to_string())); } - for &field in ["alt", "projectId", "region", "clusterName", "updateMask"].iter() { + if let Some(value) = self._graceful_decommission_timeout { + params.push(("gracefulDecommissionTimeout", value.to_string())); + } + for &field in ["alt", "projectId", "region", "clusterName", "updateMask", "gracefulDecommissionTimeout"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2769,6 +3030,13 @@ impl<'a, C, A> ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMut ProjectRegionClusterPatchCall<'a, C, A> { + self._graceful_decommission_timeout = 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. /// @@ -3360,9 +3628,9 @@ impl<'a, C, A> ProjectRegionOperationCancelCall<'a, C, A> where C: BorrowMut ProjectRegionOperationCancelCall<'a, C, A> where C: BorrowMut +pub struct ProjectRegionOperationDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dataproc, @@ -3401,13 +3669,13 @@ pub struct ProjectRegionOperationGetCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectRegionOperationGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectRegionOperationDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectRegionOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectRegionOperationDeleteCall<'a, C, 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 url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -3416,8 +3684,8 @@ impl<'a, C, A> ProjectRegionOperationGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dataproc.projects.regions.operations.get", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "dataproc.projects.regions.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() { @@ -3485,7 +3753,7 @@ impl<'a, C, A> ProjectRegionOperationGetCall<'a, C, A> where C: BorrowMut ProjectRegionOperationGetCall<'a, C, A> where C: BorrowMut ProjectRegionOperationGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectRegionOperationDeleteCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -3554,7 +3822,7 @@ impl<'a, C, A> ProjectRegionOperationGetCall<'a, C, A> where C: BorrowMut ProjectRegionOperationGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectRegionOperationDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3581,7 +3849,7 @@ impl<'a, C, A> ProjectRegionOperationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRegionOperationGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectRegionOperationDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -3601,7 +3869,7 @@ impl<'a, C, A> ProjectRegionOperationGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectRegionOperationGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectRegionOperationDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -5047,259 +5315,6 @@ impl<'a, C, A> ProjectRegionJobDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().regions_operations_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectRegionOperationDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dataproc, - _name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectRegionOperationDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectRegionOperationDeleteCall<'a, C, 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: "dataproc.projects.regions.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) -> ProjectRegionOperationDeleteCall<'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) -> ProjectRegionOperationDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectRegionOperationDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectRegionOperationDeleteCall<'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 *regions.operations.list* method supported by a *project* resource. @@ -5328,9 +5343,9 @@ impl<'a, C, A> ProjectRegionOperationDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionOperationListCall<'a, C, A> where C: BorrowMut"] 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+20170925" +version = "1.0.6+20171201" diff --git a/gen/deploymentmanager2-cli/README.md b/gen/deploymentmanager2-cli/README.md index 7f2ce8a0e4..e2086a3048 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 *20170925*. The CLI is at version *1.0.6*. +This documentation was generated from the *Deployment Manager* API at revision *20171201*. 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 b17a0cb02c..480f6c01ae 100644 --- a/gen/deploymentmanager2-cli/mkdocs.yml +++ b/gen/deploymentmanager2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Deployment Manager v1.0.6+20170925 +site_name: Deployment Manager v1.0.6+20171201 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 67432e798d..b102332242 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+20170925") + .version("1.0.6+20171201") .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 f4a2e927f6..3d6f243acd 100644 --- a/gen/deploymentmanager2/Cargo.toml +++ b/gen/deploymentmanager2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-deploymentmanager2" -version = "1.0.6+20170925" +version = "1.0.6+20171201" 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+20170925" +documentation = "https://docs.rs/google-deploymentmanager2/1.0.6+20171201" license = "MIT" keywords = ["deploymentmanager", "google", "protocol", "web", "api"] diff --git a/gen/deploymentmanager2/README.md b/gen/deploymentmanager2/README.md index 7246adc09f..44d4082e6f 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+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*. +This documentation was generated from *Deployment Manager* crate version *1.0.6+20171201*, where *20171201* 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+20170925/google_deploymentmanager2/struct.DeploymentManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentManager.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) +* [deployments](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.Deployment.html) + * [*cancel preview*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentCancelPreviewCall.html), [*delete*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentDeleteCall.html), [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentGetCall.html), [*get iam policy*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentGetIamPolicyCall.html), [*insert*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentInsertCall.html), [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentListCall.html), [*patch*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentPatchCall.html), [*set iam policy*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentSetIamPolicyCall.html), [*stop*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentStopCall.html), [*test iam permissions*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentTestIamPermissionCall.html) and [*update*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.DeploymentUpdateCall.html) +* [manifests](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.Manifest.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.ManifestGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.ManifestListCall.html) +* [operations](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.Operation.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.OperationListCall.html) +* [resources](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.ResourceType.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.ResourceGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.ResourceListCall.html) +* [types](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/struct.Type.html) + * [*list*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/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+20170925/google_deploymentmanager2/struct.DeploymentManager.html)** +* **[Hub](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/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+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)** + * creates [*Method Builders*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/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+20170925/google_deploymentmanager2/trait.Part.html)** + * **[Parts](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-deploymentmanager2/1.0.6+20170925/google_deploymentmanager2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/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+20170925/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+20171201/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+20170925/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+20171201/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+20170925/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+20171201/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+20170925/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+20171201/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/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+20170925/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+20171201/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/google_deploymentmanager2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/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+20170925/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+20171201/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+20170925/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+20171201/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+20170925/google_deploymentmanager2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-deploymentmanager2/1.0.6+20171201/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 5b16e902bb..4b725ab8f3 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+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*. +//! This documentation was generated from *Deployment Manager* crate version *1.0.6+20171201*, where *20171201* 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/). @@ -934,7 +934,7 @@ impl Resource for ResourceType {} impl ResponseResult for ResourceType {} -/// An Operation resource, used to manage asynchronous API requests. +/// An Operation resource, used to manage asynchronous API requests. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) /// /// # Activities /// diff --git a/gen/dfareporting2d8-cli/Cargo.toml b/gen/dfareporting2d8-cli/Cargo.toml index 88959127f7..8f2a49bdcd 100644 --- a/gen/dfareporting2d8-cli/Cargo.toml +++ b/gen/dfareporting2d8-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dfareporting2d8-cli" -version = "1.0.6+20170818" +version = "1.0.6+20171109" 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-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-dfareporting2d8] path = "../dfareporting2d8" -version = "1.0.6+20170818" +version = "1.0.6+20171109" diff --git a/gen/dfareporting2d8-cli/README.md b/gen/dfareporting2d8-cli/README.md index d64eecb398..31e6b0c0b0 100644 --- a/gen/dfareporting2d8-cli/README.md +++ b/gen/dfareporting2d8-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 *20170818*. The CLI is at version *1.0.6*. +This documentation was generated from the *dfareporting* API at revision *20171109*. The CLI is at version *1.0.6*. ```bash dfareporting2d8 [options] diff --git a/gen/dfareporting2d8-cli/mkdocs.yml b/gen/dfareporting2d8-cli/mkdocs.yml index 5682639c39..3126d56b0b 100644 --- a/gen/dfareporting2d8-cli/mkdocs.yml +++ b/gen/dfareporting2d8-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dfareporting v1.0.6+20170818 +site_name: dfareporting v1.0.6+20171109 site_url: http://byron.github.io/google-apis-rs/google-dfareporting2d8-cli site_description: A complete library to interact with dfareporting (protocol v2.8) diff --git a/gen/dfareporting2d8-cli/src/main.rs b/gen/dfareporting2d8-cli/src/main.rs index 0f3c68bd5e..c9a2838f9f 100644 --- a/gen/dfareporting2d8-cli/src/main.rs +++ b/gen/dfareporting2d8-cli/src/main.rs @@ -23769,7 +23769,7 @@ fn main() { let mut app = App::new("dfareporting2d8") .author("Sebastian Thiel ") - .version("1.0.6+20170818") + .version("1.0.6+20171109") .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") diff --git a/gen/dfareporting2d8/Cargo.toml b/gen/dfareporting2d8/Cargo.toml index 91a01d0077..663ec83d95 100644 --- a/gen/dfareporting2d8/Cargo.toml +++ b/gen/dfareporting2d8/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dfareporting2d8" -version = "1.0.6+20170818" +version = "1.0.6+20171109" 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" +documentation = "https://docs.rs/google-dfareporting2d8/1.0.6+20171109" license = "MIT" keywords = ["dfareporting", "google", "protocol", "web", "api"] diff --git a/gen/dfareporting2d8/README.md b/gen/dfareporting2d8/README.md index 52a7a7f445..ad64b9a5db 100644 --- a/gen/dfareporting2d8/README.md +++ b/gen/dfareporting2d8/README.md @@ -5,144 +5,144 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *dfareporting* crate version *1.0.6+20171109*, where *20171109* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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) +* [account active ad summaries](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountActiveAdSummary.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountActiveAdSummaryGetCall.html) +* [account permission groups](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountPermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountPermissionGroupListCall.html) +* [account permissions](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountPermission.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountPermissionListCall.html) +* [account user profiles](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountUserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountUserProfileUpdateCall.html) +* [accounts](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Account.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AccountUpdateCall.html) +* [ads](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Ad.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdUpdateCall.html) +* [advertiser groups](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserGroup.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserGroupUpdateCall.html) +* [advertisers](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Advertiser.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.AdvertiserUpdateCall.html) +* [browsers](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Browser.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.BrowserListCall.html) +* [campaign creative associations](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CampaignCreativeAssociation.html) + * [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CampaignCreativeAssociationListCall.html) +* [campaigns](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Campaign.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CampaignUpdateCall.html) +* [change logs](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ChangeLog.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ChangeLogListCall.html) +* [cities](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.City.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CityListCall.html) +* [connection types](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ConnectionType.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ConnectionTypeListCall.html) +* [content categories](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ContentCategory.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ContentCategoryUpdateCall.html) +* [conversions](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Conversion.html) + * [*batchinsert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ConversionBatchinsertCall.html) and [*batchupdate*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ConversionBatchupdateCall.html) +* [countries](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Country.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CountryListCall.html) +* [creative assets](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeAsset.html) + * [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeAssetInsertCall.html) +* [creative field values](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldValue.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldValueUpdateCall.html) +* [creative fields](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeField.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeFieldUpdateCall.html) +* [creative groups](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeGroupUpdateCall.html) +* [creatives](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Creative.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.CreativeUpdateCall.html) +* [dimension values](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DimensionValue.html) + * [*query*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DimensionValueQueryCall.html) +* [directory site contacts](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DirectorySiteContact.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DirectorySiteContactListCall.html) +* [directory sites](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DirectorySite.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DirectorySiteListCall.html) +* [dynamic targeting keys](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DynamicTargetingKey.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.DynamicTargetingKeyListCall.html) +* [event tags](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.EventTag.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.EventTagUpdateCall.html) +* [files](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.File.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FileListCall.html) +* [floodlight activities](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivity.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityUpdateCall.html) +* [floodlight activity groups](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightActivityGroupUpdateCall.html) +* [floodlight configurations](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightConfiguration.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FloodlightConfigurationUpdateCall.html) +* [inventory items](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.InventoryItem.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.InventoryItemListCall.html) +* [landing pages](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.LandingPage.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.LandingPageUpdateCall.html) +* [languages](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Language.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.LanguageListCall.html) +* [metros](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Metro.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.MetroListCall.html) +* [mobile carriers](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.MobileCarrier.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.MobileCarrierListCall.html) +* [operating system versions](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.OperatingSystemVersion.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.OperatingSystemVersionListCall.html) +* [operating systems](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.OperatingSystem.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.OperatingSystemListCall.html) +* [order documents](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.OrderDocument.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.OrderDocumentListCall.html) +* [orders](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Order.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.OrderListCall.html) +* [placement groups](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementGroupUpdateCall.html) +* [placement strategies](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementStrategy.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementStrategyUpdateCall.html) +* [placements](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Placement.html) + * [*generatetags*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlacementUpdateCall.html) +* [platform types](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlatformType.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PlatformTypeListCall.html) +* [postal codes](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PostalCode.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.PostalCodeListCall.html) +* [projects](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Project.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ProjectListCall.html) +* [regions](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Region.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.RegionListCall.html) +* [remarketing list shares](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.RemarketingListShare.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.RemarketingListShareUpdateCall.html) +* [remarketing lists](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.RemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.RemarketingListUpdateCall.html) +* [reports](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Report.html) + * [*compatible fields query*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ReportUpdateCall.html) +* [sites](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Site.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SiteUpdateCall.html) +* [sizes](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Size.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SizeListCall.html) +* [subaccounts](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.Subaccount.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.SubaccountUpdateCall.html) +* [targetable remarketing lists](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.TargetableRemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.TargetableRemarketingListListCall.html) +* [targeting templates](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.TargetingTemplate.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.TargetingTemplateUpdateCall.html) +* [user profiles](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserProfileListCall.html) +* [user role permission groups](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRolePermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRolePermissionGroupListCall.html) +* [user role permissions](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRolePermission.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRolePermissionListCall.html) +* [user roles](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRole.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.UserRoleUpdateCall.html) +* [video formats](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.VideoFormat.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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) +* [*insert creative assets*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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) +* [*get files*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.FileGetCall.html) +* [*files get reports*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/struct.ReportFileGetCall.html) @@ -150,17 +150,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/struct.Dfareporting.html)** +* **[Hub](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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)** + * creates [*Method Builders*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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)** + * **[Parts](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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)** +* **[Activities](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/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-dfareporting2d8/1.0.6+20170818/google_dfareporting2d8/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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). +[Hub Delegate](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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. +If such a method also supports a [Response Result](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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. +The [delegate trait](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/google_dfareporting2d8/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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 +Most optionals are are considered [Parts](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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. +Using [method builders](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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 +* [request values](https://docs.rs/google-dfareporting2d8/1.0.6+20171109/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. diff --git a/gen/dfareporting2d8/src/lib.rs b/gen/dfareporting2d8/src/lib.rs index eb4077c13e..e0319f00dc 100644 --- a/gen/dfareporting2d8/src/lib.rs +++ b/gen/dfareporting2d8/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+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*. +//! This documentation was generated from *dfareporting* crate version *1.0.6+20171109*, where *20171109* 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/). @@ -1127,7 +1127,7 @@ impl Part for LookbackConfiguration {} 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. + /// Generated tag for this Floodlight activity. For global site tags, this is the event snippet. #[serde(rename="floodlightActivityTag")] pub floodlight_activity_tag: Option, } @@ -1587,7 +1587,8 @@ pub struct Account { /// - "46" for AED /// - "47" for BGN /// - "48" for HRK - /// - "49" for MXN + /// - "49" for MXN + /// - "50" for NGN #[serde(rename="currencyId")] pub currency_id: Option, /// Reporting configuration of this account. @@ -3609,7 +3610,8 @@ pub struct DirectorySite { /// - "46" for AED /// - "47" for BGN /// - "48" for HRK - /// - "49" for MXN + /// - "49" for MXN + /// - "50" for NGN #[serde(rename="currencyId")] pub currency_id: Option, /// Tag types for regular placements. @@ -4190,7 +4192,7 @@ pub struct Creative { /// 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. + /// 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. @@ -5247,7 +5249,7 @@ pub struct FloodlightActivity { /// 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. + /// Value of the cat= parameter 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. @@ -5540,7 +5542,7 @@ pub struct ReportReachCriteria { /// 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. + /// 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 42 days. #[serde(rename="enableAllDimensionCombinations")] pub enable_all_dimension_combinations: Option, } diff --git a/gen/dfareporting3-cli/Cargo.toml b/gen/dfareporting3-cli/Cargo.toml new file mode 100644 index 0000000000..77e225d1ac --- /dev/null +++ b/gen/dfareporting3-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-dfareporting3-cli" +version = "1.0.6+20171109" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with dfareporting (protocol v3.0)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting3-cli" +homepage = "https://developers.google.com/doubleclick-advertisers/" +documentation = "http://byron.github.io/google-apis-rs/google_dfareporting3_cli" +license = "MIT" +keywords = ["dfareporting", "google", "cli"] + +[[bin]] +name = "dfareporting3" + +[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-dfareporting3] +path = "../dfareporting3" +version = "1.0.6+20171109" diff --git a/gen/dfareporting3-cli/LICENSE.md b/gen/dfareporting3-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/dfareporting3-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/dfareporting3-cli/README.md b/gen/dfareporting3-cli/README.md new file mode 100644 index 0000000000..1b8600b916 --- /dev/null +++ b/gen/dfareporting3-cli/README.md @@ -0,0 +1,376 @@ + +The `dfareporting3` 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-dfareporting3-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting3-cli). + +# Usage + +This documentation was generated from the *dfareporting* API at revision *20171109*. The CLI is at version *1.0.6*. + +```bash +dfareporting3 [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 ] + advertiser-landing-pages + 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 ] + 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 ] + dfareporting3 --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 `dfareporting3-`. 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/dfareporting3-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/dfareporting3-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. `dfareporting3 --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/dfareporting3-cli/mkdocs.yml b/gen/dfareporting3-cli/mkdocs.yml new file mode 100644 index 0000000000..5faaa79d03 --- /dev/null +++ b/gen/dfareporting3-cli/mkdocs.yml @@ -0,0 +1,220 @@ +site_name: dfareporting v1.0.6+20171109 +site_url: http://byron.github.io/google-apis-rs/google-dfareporting3-cli +site_description: A complete library to interact with dfareporting (protocol v3.0) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting3-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'] +- ['advertiser-landing-pages_get.md', 'Advertiser Landing Pages', 'Get'] +- ['advertiser-landing-pages_insert.md', 'Advertiser Landing Pages', 'Insert'] +- ['advertiser-landing-pages_list.md', 'Advertiser Landing Pages', 'List'] +- ['advertiser-landing-pages_patch.md', 'Advertiser Landing Pages', 'Patch'] +- ['advertiser-landing-pages_update.md', 'Advertiser Landing Pages', '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'] +- ['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/dfareporting3-cli/src/cmn.rs b/gen/dfareporting3-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/dfareporting3-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/dfareporting3-cli/src/main.rs b/gen/dfareporting3-cli/src/main.rs new file mode 100644 index 0000000000..13c447a494 --- /dev/null +++ b/gen/dfareporting3-cli/src/main.rs @@ -0,0 +1,23805 @@ +// 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_dfareporting3 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 _advertiser_landing_pages_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.advertiser_landing_pages().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_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()[..] { + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", 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!["advertiser-id", "archived", "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.advertiser_landing_pages().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_landing_pages_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.advertiser_landing_pages().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("")); + }, + "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(["archived", "search-string", "subaccount-id", "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 _advertiser_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()[..] { + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", 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!["advertiser-id", "archived", "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.advertiser_landing_pages().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_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()[..] { + "archived" => Some(("archived", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "advertiser-id" => Some(("advertiserId", 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!["advertiser-id", "archived", "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.advertiser_landing_pages().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 })), + "default-landing-page-id" => Some(("defaultLandingPageId", 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", "default-landing-page-id", "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("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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 })), + "default-landing-page-id" => Some(("defaultLandingPageId", 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", "default-landing-page-id", "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 })), + "default-landing-page-id" => Some(("defaultLandingPageId", 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", "default-landing-page-id", "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 })), + "total-file-size" => Some(("totalFileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "polite-load-asset-id" => Some(("politeLoadAssetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-tag-keys" => Some(("adTagKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "third-party-backup-image-impressions-url" => Some(("thirdPartyBackupImageImpressionsUrl", JsonTypeInfo { jtype: JsonType::String, 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 })), + "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 })), + "dynamic-asset-selection" => Some(("dynamicAssetSelection", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, 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 })), + "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 })), + "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 })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, 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 })), + "backup-image-reporting-label" => Some(("backupImageReportingLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, 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 })), + "background-color" => Some(("backgroundColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom-key-values" => Some(("customKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "redirect-url" => Some(("redirectUrl", 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 })), + "latest-trafficked-creative-id" => Some(("latestTraffickedCreativeId", 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 })), + "backup-image-features" => Some(("backupImageFeatures", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "auto-advance-images" => Some(("autoAdvanceImages", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-duration" => Some(("videoDuration", JsonTypeInfo { jtype: JsonType::Float, 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 })), + "commercial-id" => Some(("commercialId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "required-flash-plugin-version" => Some(("requiredFlashPluginVersion", 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 })), + "advertiser-id" => Some(("advertiserId", 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 })), + "html-code-locked" => Some(("htmlCodeLocked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "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.computed-click-through-url" => Some(("backupImageClickThroughUrl.computedClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-click-through-url.custom-click-through-url" => Some(("backupImageClickThroughUrl.customClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-click-through-url.landing-page-id" => Some(("backupImageClickThroughUrl.landingPageId", JsonTypeInfo { jtype: JsonType::String, 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 })), + "required-flash-version" => Some(("requiredFlashVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "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", "computed-click-through-url", "convert-flash-to-html5", "creative-asset-selection", "custom-click-through-url", "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", "landing-page-id", "last-modified-info", "latest-trafficked-creative-id", "left", "match-type", "name", "offset-percentage", "offset-seconds", "override-css", "polite-load-asset-id", "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 })), + "total-file-size" => Some(("totalFileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "polite-load-asset-id" => Some(("politeLoadAssetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-tag-keys" => Some(("adTagKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "third-party-backup-image-impressions-url" => Some(("thirdPartyBackupImageImpressionsUrl", JsonTypeInfo { jtype: JsonType::String, 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 })), + "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 })), + "dynamic-asset-selection" => Some(("dynamicAssetSelection", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, 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 })), + "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 })), + "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 })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, 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 })), + "backup-image-reporting-label" => Some(("backupImageReportingLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, 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 })), + "background-color" => Some(("backgroundColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom-key-values" => Some(("customKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "redirect-url" => Some(("redirectUrl", 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 })), + "latest-trafficked-creative-id" => Some(("latestTraffickedCreativeId", 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 })), + "backup-image-features" => Some(("backupImageFeatures", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "auto-advance-images" => Some(("autoAdvanceImages", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-duration" => Some(("videoDuration", JsonTypeInfo { jtype: JsonType::Float, 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 })), + "commercial-id" => Some(("commercialId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "required-flash-plugin-version" => Some(("requiredFlashPluginVersion", 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 })), + "advertiser-id" => Some(("advertiserId", 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 })), + "html-code-locked" => Some(("htmlCodeLocked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "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.computed-click-through-url" => Some(("backupImageClickThroughUrl.computedClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-click-through-url.custom-click-through-url" => Some(("backupImageClickThroughUrl.customClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-click-through-url.landing-page-id" => Some(("backupImageClickThroughUrl.landingPageId", JsonTypeInfo { jtype: JsonType::String, 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 })), + "required-flash-version" => Some(("requiredFlashVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "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", "computed-click-through-url", "convert-flash-to-html5", "creative-asset-selection", "custom-click-through-url", "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", "landing-page-id", "last-modified-info", "latest-trafficked-creative-id", "left", "match-type", "name", "offset-percentage", "offset-seconds", "override-css", "polite-load-asset-id", "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 })), + "total-file-size" => Some(("totalFileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "polite-load-asset-id" => Some(("politeLoadAssetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ad-tag-keys" => Some(("adTagKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "active" => Some(("active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "third-party-backup-image-impressions-url" => Some(("thirdPartyBackupImageImpressionsUrl", JsonTypeInfo { jtype: JsonType::String, 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 })), + "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 })), + "dynamic-asset-selection" => Some(("dynamicAssetSelection", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, 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 })), + "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 })), + "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 })), + "ssl-compliant" => Some(("sslCompliant", JsonTypeInfo { jtype: JsonType::Boolean, 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 })), + "backup-image-reporting-label" => Some(("backupImageReportingLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, 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 })), + "background-color" => Some(("backgroundColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom-key-values" => Some(("customKeyValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "redirect-url" => Some(("redirectUrl", 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 })), + "latest-trafficked-creative-id" => Some(("latestTraffickedCreativeId", 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 })), + "backup-image-features" => Some(("backupImageFeatures", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "auto-advance-images" => Some(("autoAdvanceImages", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "video-duration" => Some(("videoDuration", JsonTypeInfo { jtype: JsonType::Float, 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 })), + "commercial-id" => Some(("commercialId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "required-flash-plugin-version" => Some(("requiredFlashPluginVersion", 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 })), + "advertiser-id" => Some(("advertiserId", 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 })), + "html-code-locked" => Some(("htmlCodeLocked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "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.computed-click-through-url" => Some(("backupImageClickThroughUrl.computedClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-click-through-url.custom-click-through-url" => Some(("backupImageClickThroughUrl.customClickThroughUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup-image-click-through-url.landing-page-id" => Some(("backupImageClickThroughUrl.landingPageId", JsonTypeInfo { jtype: JsonType::String, 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 })), + "required-flash-version" => Some(("requiredFlashVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "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", "computed-click-through-url", "convert-flash-to-html5", "creative-asset-selection", "custom-click-through-url", "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", "landing-page-id", "last-modified-info", "latest-trafficked-creative-id", "left", "match-type", "name", "offset-percentage", "offset-seconds", "override-css", "polite-load-asset-id", "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 })), + "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 })), + "tag-format" => Some(("tagFormat", 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 })), + "floodlight-tag-type" => Some(("floodlightTagType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cache-busting-type" => Some(("cacheBustingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expected-url" => Some(("expectedUrl", 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 })), + "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 })), + "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", "floodlight-tag-type", "hidden", "id", "id-dimension-value", "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 })), + "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 })), + "tag-format" => Some(("tagFormat", 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 })), + "floodlight-tag-type" => Some(("floodlightTagType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cache-busting-type" => Some(("cacheBustingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expected-url" => Some(("expectedUrl", 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 })), + "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 })), + "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", "floodlight-tag-type", "hidden", "id", "id-dimension-value", "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 })), + "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 })), + "tag-format" => Some(("tagFormat", 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 })), + "floodlight-tag-type" => Some(("floodlightTagType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cache-busting-type" => Some(("cacheBustingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expected-url" => Some(("expectedUrl", 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 })), + "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 })), + "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", "floodlight-tag-type", "hidden", "id", "id-dimension-value", "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 _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.orientation" => Some(("videoSettings.orientation", JsonTypeInfo { jtype: JsonType::String, 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", "orientation", "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.orientation" => Some(("videoSettings.orientation", JsonTypeInfo { jtype: JsonType::String, 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", "orientation", "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.orientation" => Some(("videoSettings.orientation", JsonTypeInfo { jtype: JsonType::String, 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", "orientation", "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(); + } + } + }, + ("advertiser-landing-pages", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._advertiser_landing_pages_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._advertiser_landing_pages_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._advertiser_landing_pages_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._advertiser_landing_pages_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._advertiser_landing_pages_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("advertiser-landing-pages".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(); + } + } + }, + ("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, "dfareporting3-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: "dfareporting3", + 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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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)), + ]), + ]), + + ("advertiser-landing-pages", "methods: 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("get", + Some(r##"Gets one landing page by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting3_cli/advertiser-landing-pages_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##"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."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting3_cli/advertiser-landing-pages_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 landing pages."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting3_cli/advertiser-landing-pages_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 landing page. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting3_cli/advertiser-landing-pages_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##"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 landing page."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting3_cli/advertiser-landing-pages_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_cli/campaigns_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 campaigns, possibly filtered. This method supports paging."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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)), + ]), + ]), + + ("languages", "methods: 'list'", vec![ + ("list", + Some(r##"Retrieves a list of languages."##), + "Details at http://byron.github.io/google-apis-rs/google_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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_dfareporting3_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("dfareporting3") + .author("Sebastian Thiel ") + .version("1.0.6+20171109") + .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_dfareporting3_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/dfareporting3/Cargo.toml b/gen/dfareporting3/Cargo.toml new file mode 100644 index 0000000000..7cc71e985f --- /dev/null +++ b/gen/dfareporting3/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-dfareporting3" +version = "1.0.6+20171109" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with dfareporting (protocol v3.0)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting3" +homepage = "https://developers.google.com/doubleclick-advertisers/" +documentation = "https://docs.rs/google-dfareporting3/1.0.6+20171109" +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/dfareporting3/LICENSE.md b/gen/dfareporting3/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/dfareporting3/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/dfareporting3/README.md b/gen/dfareporting3/README.md new file mode 100644 index 0000000000..9411edcf05 --- /dev/null +++ b/gen/dfareporting3/README.md @@ -0,0 +1,315 @@ + +The `google-dfareporting3` library allows access to all features of the *Google dfareporting* service. + +This documentation was generated from *dfareporting* crate version *1.0.6+20171109*, where *20171109* is the exact revision of the *dfareporting:v3.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *dfareporting* *v3* 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-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Dfareporting.html) ... + +* [account active ad summaries](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountActiveAdSummary.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountActiveAdSummaryGetCall.html) +* [account permission groups](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountPermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountPermissionGroupListCall.html) +* [account permissions](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountPermission.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountPermissionListCall.html) +* [account user profiles](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountUserProfile.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountUserProfileUpdateCall.html) +* [accounts](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Account.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AccountUpdateCall.html) +* [ads](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Ad.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdUpdateCall.html) +* [advertiser groups](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserGroup.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserGroupUpdateCall.html) +* advertiser landing pages + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserLandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserLandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserLandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserLandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserLandingPageUpdateCall.html) +* [advertisers](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Advertiser.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.AdvertiserUpdateCall.html) +* [browsers](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Browser.html) + * [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.BrowserListCall.html) +* [campaign creative associations](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CampaignCreativeAssociation.html) + * [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CampaignCreativeAssociationListCall.html) +* [campaigns](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Campaign.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CampaignUpdateCall.html) +* [change logs](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ChangeLog.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ChangeLogListCall.html) +* [cities](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.City.html) + * [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CityListCall.html) +* [connection types](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ConnectionType.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ConnectionTypeListCall.html) +* [content categories](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ContentCategory.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ContentCategoryUpdateCall.html) +* [conversions](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Conversion.html) + * [*batchinsert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ConversionBatchinsertCall.html) and [*batchupdate*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ConversionBatchupdateCall.html) +* [countries](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Country.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CountryListCall.html) +* [creative assets](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeAsset.html) + * [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeAssetInsertCall.html) +* [creative field values](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldValue.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldValueUpdateCall.html) +* [creative fields](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeField.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeFieldUpdateCall.html) +* [creative groups](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeGroup.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeGroupUpdateCall.html) +* [creatives](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Creative.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeUpdateCall.html) +* [dimension values](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DimensionValue.html) + * [*query*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DimensionValueQueryCall.html) +* [directory site contacts](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DirectorySiteContact.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DirectorySiteContactListCall.html) +* [directory sites](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DirectorySite.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DirectorySiteListCall.html) +* [dynamic targeting keys](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DynamicTargetingKey.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.DynamicTargetingKeyListCall.html) +* [event tags](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.EventTag.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.EventTagUpdateCall.html) +* [files](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.File.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FileListCall.html) +* [floodlight activities](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivity.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityUpdateCall.html) +* [floodlight activity groups](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityGroup.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightActivityGroupUpdateCall.html) +* [floodlight configurations](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightConfiguration.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FloodlightConfigurationUpdateCall.html) +* [inventory items](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.InventoryItem.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.InventoryItemListCall.html) +* [languages](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Language.html) + * [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.LanguageListCall.html) +* [metros](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Metro.html) + * [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.MetroListCall.html) +* [mobile carriers](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.MobileCarrier.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.MobileCarrierListCall.html) +* [operating system versions](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.OperatingSystemVersion.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.OperatingSystemVersionListCall.html) +* [operating systems](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.OperatingSystem.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.OperatingSystemListCall.html) +* [order documents](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.OrderDocument.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.OrderDocumentListCall.html) +* [orders](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Order.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.OrderListCall.html) +* [placement groups](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementGroup.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementGroupUpdateCall.html) +* [placement strategies](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementStrategy.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementStrategyUpdateCall.html) +* [placements](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Placement.html) + * [*generatetags*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlacementUpdateCall.html) +* [platform types](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlatformType.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PlatformTypeListCall.html) +* [postal codes](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PostalCode.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.PostalCodeListCall.html) +* [projects](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Project.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ProjectListCall.html) +* [regions](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Region.html) + * [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.RegionListCall.html) +* [remarketing list shares](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.RemarketingListShare.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.RemarketingListShareUpdateCall.html) +* [remarketing lists](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.RemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.RemarketingListUpdateCall.html) +* [reports](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Report.html) + * [*compatible fields query*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ReportUpdateCall.html) +* [sites](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Site.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SiteUpdateCall.html) +* [sizes](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Size.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SizeListCall.html) +* [subaccounts](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Subaccount.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.SubaccountUpdateCall.html) +* [targetable remarketing lists](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.TargetableRemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.TargetableRemarketingListListCall.html) +* [targeting templates](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.TargetingTemplate.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.TargetingTemplateUpdateCall.html) +* [user profiles](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserProfile.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserProfileListCall.html) +* [user role permission groups](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRolePermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRolePermissionGroupListCall.html) +* [user role permissions](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRolePermission.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRolePermissionListCall.html) +* [user roles](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRole.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.UserRoleUpdateCall.html) +* [video formats](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.VideoFormat.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.VideoFormatListCall.html) + + +Upload supported by ... + +* [*insert creative assets*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.CreativeAssetInsertCall.html) + +Download supported by ... + +* [*get files*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.FileGetCall.html) +* [*files get reports*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.ReportFileGetCall.html) + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/struct.Dfareporting.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/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-dfareporting3 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_dfareporting3 as dfareporting3; +use dfareporting3::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use dfareporting3::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-dfareporting3/1.0.6+20171109/google_dfareporting3/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-dfareporting3/1.0.6+20171109/google_dfareporting3/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-dfareporting3/1.0.6+20171109/google_dfareporting3/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-dfareporting3/1.0.6+20171109/google_dfareporting3/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-dfareporting3/1.0.6+20171109/google_dfareporting3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/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-dfareporting3/1.0.6+20171109/google_dfareporting3/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-dfareporting3/1.0.6+20171109/google_dfareporting3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dfareporting3/1.0.6+20171109/google_dfareporting3/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-dfareporting3/1.0.6+20171109/google_dfareporting3/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-dfareporting3/1.0.6+20171109/google_dfareporting3/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-dfareporting3/1.0.6+20171109/google_dfareporting3/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 **dfareporting3** 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/dfareporting3/src/cmn.rs b/gen/dfareporting3/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/dfareporting3/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/dfareporting3/src/lib.rs b/gen/dfareporting3/src/lib.rs new file mode 100644 index 0000000000..77b69f2b44 --- /dev/null +++ b/gen/dfareporting3/src/lib.rs @@ -0,0 +1,72393 @@ +// 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+20171109*, where *20171109* is the exact revision of the *dfareporting:v3.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *dfareporting* *v3* 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/dfareporting3). +//! # 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) +//! * advertiser landing pages +//! * [*get*](struct.AdvertiserLandingPageGetCall.html), [*insert*](struct.AdvertiserLandingPageInsertCall.html), [*list*](struct.AdvertiserLandingPageListCall.html), [*patch*](struct.AdvertiserLandingPagePatchCall.html) and [*update*](struct.AdvertiserLandingPageUpdateCall.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) +//! * [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-dfareporting3 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_dfareporting3 as dfareporting3; +//! use dfareporting3::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use dfareporting3::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_dfareporting3 as dfareporting3; +/// use dfareporting3::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::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/v3.0/".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 advertiser_landing_pages(&'a self) -> AdvertiserLandingPageMethods<'a, C, A> { + AdvertiserLandingPageMethods { 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 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/v3.0/`. + /// + /// 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 { + /// The global snippet section of a global site tag. The global site tag sets new cookies on your domain, which will store a unique identifier for a user or the ad click that brought the user to your site. Learn more. + #[serde(rename="globalSiteTagGlobalSnippet")] + pub global_site_tag_global_snippet: Option, + /// Generated tag for this Floodlight activity. For global site tags, this is the event snippet. + #[serde(rename="floodlightActivityTag")] + pub floodlight_activity_tag: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivitiesGenerateTagResponse". + pub kind: 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 + /// - "50" for NGN + #[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>, + /// The default landing page ID for this campaign. + #[serde(rename="defaultLandingPageId")] + pub default_landing_page_id: 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, + /// Information about the creation of this campaign. This is a read-only field. + #[serde(rename="createInfo")] + pub create_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 {} + + +/// 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 advertiser landing pages](struct.AdvertiserLandingPageListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AdvertiserLandingPagesListResponse { + /// 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#advertiserLandingPagesListResponse". + pub kind: Option, + /// Landing page collection + #[serde(rename="landingPages")] + pub landing_pages: Option>, +} + +impl ResponseResult for AdvertiserLandingPagesListResponse {} + + +/// 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 {} + + +/// 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 CreativeClickThroughUrl { + /// Read-only convenience field representing the actual URL that will be used for this click-through. The URL is computed as follows: + /// - If landingPageId is specified then that landing page's URL is assigned to this field. + /// - Otherwise, the customClickThroughUrl is assigned to this field. + #[serde(rename="computedClickThroughUrl")] + pub computed_click_through_url: Option, + /// Custom click-through URL. Applicable if 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. + #[serde(rename="landingPageId")] + pub landing_page_id: Option, +} + +impl Part for CreativeClickThroughUrl {} + + +/// 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, + /// Orientation of video asset. This is a read-only, auto-generated field. + pub orientation: 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 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, + /// 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, + /// 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, + /// 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, + /// Orientation of a video placement. If this value is set, placement will return assets matching the specified orientation. + pub orientation: 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 value for the specified click tag. This field contains a click-through url. + #[serde(rename="clickThroughUrl")] + pub click_through_url: 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, +} + +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 + /// - "50" for NGN + #[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, + /// Exit click-through URL for the event. This field is used only for exit events. + #[serde(rename="exitClickThroughUrl")] + pub exit_click_through_url: 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, + /// 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, + /// 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, + /// The asset ID of the polite load image asset. Applicable to the creative type: DISPLAY. + #[serde(rename="politeLoadAssetId")] + pub polite_load_asset_id: 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>, + /// 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, + /// 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, + /// 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, + /// 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, + /// Whether the creative is SSL-compliant. This is a read-only field. Applicable to all creative types. + #[serde(rename="sslCompliant")] + pub ssl_compliant: 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, + /// 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>, + /// 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, + /// 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, + /// Creative field assignments for this creative. Applicable to all creative types. + #[serde(rename="creativeFieldAssignments")] + pub creative_field_assignments: 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, + /// 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, + /// 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, + /// 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, + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#creative". + pub kind: 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, + /// Click-through URL for backup image. Applicable to ENHANCED_BANNER 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, + /// 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, + /// Required if dynamicAssetSelection is true. + #[serde(rename="creativeAssetSelection")] + pub creative_asset_selection: 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, + /// Advertiser ID of this creative. This is a required field. Applicable to all creative types. + #[serde(rename="advertiserId")] + pub advertiser_id: 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>, + /// 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, + /// 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, + /// ID of this creative. This is a read-only, auto-generated field. Applicable to all creative types. + pub id: 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, + /// 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, + /// 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>, + /// 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>, + /// 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, + /// 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, + /// 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, + /// 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, + /// 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, + /// 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>, + /// 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, + /// 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, + /// 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, + /// Whether the creative is active. Applicable to all creative types. + pub active: 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>, + /// 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, + /// 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, + /// 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, + /// 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>, + /// 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, + /// 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>, + /// 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, +} + +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 {} + + +/// 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, + /// The type of Floodlight tag this activity will generate. This is a required field. + #[serde(rename="floodlightTagType")] + pub floodlight_tag_type: Option, + /// Name of the associated floodlight activity group. This is a read-only field. + #[serde(rename="floodlightActivityGroupName")] + pub floodlight_activity_group_name: 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, + /// 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, + /// 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, + /// 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= parameter 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 42 days. + #[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*). +/// +/// * [insert advertiser landing pages](struct.AdvertiserLandingPageInsertCall.html) (request|response) +/// * [patch advertiser landing pages](struct.AdvertiserLandingPagePatchCall.html) (request|response) +/// * [get advertiser landing pages](struct.AdvertiserLandingPageGetCall.html) (response) +/// * [update advertiser landing pages](struct.AdvertiserLandingPageUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LandingPage { + /// Advertiser ID of this landing page. This is a required field. + #[serde(rename="advertiserId")] + pub advertiser_id: Option, + /// Whether this landing page has been archived. + pub archived: Option, + /// Name of this landing page. This is a required field. It must be less than 256 characters long. + pub name: 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, +} + +impl RequestValue 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 {} + + +/// 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 {} + + +/// 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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 *advertiserLandingPage* 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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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.advertiser_landing_pages(); +/// # } +/// ``` +pub struct AdvertiserLandingPageMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, +} + +impl<'a, C, A> MethodsBuilder for AdvertiserLandingPageMethods<'a, C, A> {} + +impl<'a, C, A> AdvertiserLandingPageMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of landing pages. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + pub fn list(&self, profile_id: &str) -> AdvertiserLandingPageListCall<'a, C, A> { + AdvertiserLandingPageListCall { + 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(), + _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 landing page. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Landing page ID. + pub fn patch(&self, request: LandingPage, profile_id: &str, id: &str) -> AdvertiserLandingPagePatchCall<'a, C, A> { + AdvertiserLandingPagePatchCall { + 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 landing page. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn update(&self, request: LandingPage, profile_id: &str) -> AdvertiserLandingPageUpdateCall<'a, C, A> { + AdvertiserLandingPageUpdateCall { + 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 landing page. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `profileId` - User profile ID associated with this request. + pub fn insert(&self, request: LandingPage, profile_id: &str) -> AdvertiserLandingPageInsertCall<'a, C, A> { + AdvertiserLandingPageInsertCall { + 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 landing page by ID. + /// + /// # Arguments + /// + /// * `profileId` - User profile ID associated with this request. + /// * `id` - Landing page ID. + pub fn get(&self, profile_id: &str, id: &str) -> AdvertiserLandingPageGetCall<'a, C, A> { + AdvertiserLandingPageGetCall { + 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 *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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 *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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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: + /// + /// 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: + /// + /// 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: + /// + /// 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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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: + /// + /// 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: + /// + /// 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: + /// + /// 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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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: + /// + /// 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: + /// + /// 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: + /// + /// 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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 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(), + } + } + + /// 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(), + } + } +} + + + +/// 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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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. + pub fn insert(&self, request: Campaign, profile_id: &str) -> CampaignInsertCall<'a, C, A> { + CampaignInsertCall { + 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 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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dfareporting3::Dfareporting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::ConversionsBatchUpdateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::ConversionsBatchInsertRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 + } +} + + +/// Retrieves a list of landing pages. +/// +/// A builder for the *list* method supported by a *advertiserLandingPage* resource. +/// It is not used directly, but through a `AdvertiserLandingPageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_landing_pages().list("profileId") +/// .subaccount_id("et") +/// .sort_order("diam") +/// .sort_field("ipsum") +/// .search_string("Lorem") +/// .page_token("et") +/// .max_results(-70) +/// .add_ids("aliquyam") +/// .archived(true) +/// .add_advertiser_ids("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserLandingPageListCall<'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, + _archived: Option, + _advertiser_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserLandingPageListCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserLandingPageListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AdvertiserLandingPagesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.advertiserLandingPages.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._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._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", "subaccountId", "sortOrder", "sortField", "searchString", "pageToken", "maxResults", "ids", "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}/advertiserLandingPages"; + 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) -> AdvertiserLandingPageListCall<'a, C, A> { + self._profile_id = new_value.to_string(); + self + } + /// Select only landing pages that belong to this subaccount. + /// + /// Sets the *subaccount id* query property to the given value. + pub fn subaccount_id(mut self, new_value: &str) -> AdvertiserLandingPageListCall<'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) -> AdvertiserLandingPageListCall<'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) -> AdvertiserLandingPageListCall<'a, C, A> { + self._sort_field = Some(new_value.to_string()); + self + } + /// Allows searching for landing pages by name or ID. Wildcards (*) are allowed. For example, "landingpage*2017" will return landing pages with names like "landingpage July 2017", "landingpage March 2017", or simply "landingpage 2017". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "landingpage" will match campaigns with name "my landingpage", "landingpage 2015", or simply "landingpage". + /// + /// Sets the *search string* query property to the given value. + pub fn search_string(mut self, new_value: &str) -> AdvertiserLandingPageListCall<'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) -> AdvertiserLandingPageListCall<'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) -> AdvertiserLandingPageListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Select only landing pages 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) -> AdvertiserLandingPageListCall<'a, C, A> { + self._ids.push(new_value.to_string()); + self + } + /// Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages. + /// + /// Sets the *archived* query property to the given value. + pub fn archived(mut self, new_value: bool) -> AdvertiserLandingPageListCall<'a, C, A> { + self._archived = Some(new_value); + self + } + /// Select only landing pages 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) -> AdvertiserLandingPageListCall<'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) -> AdvertiserLandingPageListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AdvertiserLandingPageListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> AdvertiserLandingPageListCall<'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 landing page. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *advertiserLandingPage* resource. +/// It is not used directly, but through a `AdvertiserLandingPageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting3 as dfareporting3; +/// use dfareporting3::LandingPage; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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.advertiser_landing_pages().patch(req, "profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserLandingPagePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: LandingPage, + _profile_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserLandingPagePatchCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserLandingPagePatchCall<'a, C, 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.advertiserLandingPages.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}/advertiserLandingPages"; + 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: LandingPage) -> AdvertiserLandingPagePatchCall<'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) -> AdvertiserLandingPagePatchCall<'a, C, A> { + self._profile_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) -> AdvertiserLandingPagePatchCall<'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) -> AdvertiserLandingPagePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AdvertiserLandingPagePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> AdvertiserLandingPagePatchCall<'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 landing page. +/// +/// A builder for the *update* method supported by a *advertiserLandingPage* resource. +/// It is not used directly, but through a `AdvertiserLandingPageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting3 as dfareporting3; +/// use dfareporting3::LandingPage; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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.advertiser_landing_pages().update(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserLandingPageUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: LandingPage, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserLandingPageUpdateCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserLandingPageUpdateCall<'a, C, 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.advertiserLandingPages.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}/advertiserLandingPages"; + 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: LandingPage) -> AdvertiserLandingPageUpdateCall<'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) -> AdvertiserLandingPageUpdateCall<'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) -> AdvertiserLandingPageUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AdvertiserLandingPageUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> AdvertiserLandingPageUpdateCall<'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. +/// +/// A builder for the *insert* method supported by a *advertiserLandingPage* resource. +/// It is not used directly, but through a `AdvertiserLandingPageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting3 as dfareporting3; +/// use dfareporting3::LandingPage; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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.advertiser_landing_pages().insert(req, "profileId") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserLandingPageInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dfareporting, + _request: LandingPage, + _profile_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AdvertiserLandingPageInsertCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserLandingPageInsertCall<'a, C, 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.advertiserLandingPages.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}/advertiserLandingPages"; + 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: LandingPage) -> AdvertiserLandingPageInsertCall<'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) -> AdvertiserLandingPageInsertCall<'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) -> AdvertiserLandingPageInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AdvertiserLandingPageInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> AdvertiserLandingPageInsertCall<'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 landing page by ID. +/// +/// A builder for the *get* method supported by a *advertiserLandingPage* resource. +/// It is not used directly, but through a `AdvertiserLandingPageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_landing_pages().get("profileId", "id") +/// .doit(); +/// # } +/// ``` +pub struct AdvertiserLandingPageGetCall<'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 AdvertiserLandingPageGetCall<'a, C, A> {} + +impl<'a, C, A> AdvertiserLandingPageGetCall<'a, C, 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.advertiserLandingPages.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}/advertiserLandingPages/{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) -> AdvertiserLandingPageGetCall<'a, C, A> { + self._profile_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) -> AdvertiserLandingPageGetCall<'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) -> AdvertiserLandingPageGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AdvertiserLandingPageGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> AdvertiserLandingPageGetCall<'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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("Lorem") +/// .sort_field("sea") +/// .add_site_id("et") +/// .search_string("duo") +/// .page_token("et") +/// .add_order_id("eirmod") +/// .max_results(-58) +/// .add_ids("et") +/// .approved(true) +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::CreativeField; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("ut") +/// .sort_field("ea") +/// .search_string("sed") +/// .page_token("dolor") +/// .max_results(-48) +/// .add_ids("dolor") +/// .add_advertiser_ids("et") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::CreativeField; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::CreativeField; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::UserRole; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::UserRole; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::UserRole; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("dolore") +/// .sort_order("duo") +/// .sort_field("aliquyam") +/// .search_string("Lorem") +/// .page_token("et") +/// .max_results(-13) +/// .add_ids("consetetur") +/// .account_user_role_only(false) +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// use dfareporting3::CreativeAssetMetadata; +/// use std::fs; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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/v3.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets", "multipart") + } else if protocol == "resumable" { + (self.hub._root_url.clone() + "resumable/upload/dfareporting/v3.0/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_dfareporting3 as dfareporting3; +/// use dfareporting3::CampaignCreativeAssociation; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("rebum.") +/// .page_token("dolore") +/// .max_results(-41) +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("aliquyam") +/// .search_string("sit") +/// .page_token("eirmod") +/// .object_type("consetetur") +/// .add_object_ids("labore") +/// .min_change_time("sed") +/// .max_results(-16) +/// .max_change_time("gubergren") +/// .add_ids("aliquyam") +/// .action("eos") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::RemarketingListShare; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::RemarketingListShare; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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(false) +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::Report; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("diam") +/// .sort_field("justo") +/// .page_token("est") +/// .max_results(-63) +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::Report; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// use dfareporting3::Report; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// use dfareporting3::Report; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("diam") +/// .sort_field("kasd") +/// .scope("invidunt") +/// .page_token("rebum.") +/// .max_results(-51) +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::Advertiser; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Advertiser; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("consetetur") +/// .status("et") +/// .sort_order("sed") +/// .sort_field("sit") +/// .search_string("takimata") +/// .page_token("elitr") +/// .only_parent(false) +/// .max_results(-15) +/// .include_advertisers_without_groups_only(true) +/// .add_ids("Lorem") +/// .add_floodlight_configuration_ids("diam") +/// .add_advertiser_group_ids("ut") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::Advertiser; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::DimensionValueRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("dolor") +/// .max_results(-9) +/// .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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// use dfareporting3::FloodlightActivityGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_("voluptua.") +/// .sort_order("dolor") +/// .sort_field("et") +/// .search_string("et") +/// .page_token("vero") +/// .max_results(-36) +/// .add_ids("sed") +/// .floodlight_configuration_id("et") +/// .advertiser_id("ipsum") +/// .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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// use dfareporting3::FloodlightActivityGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::FloodlightActivityGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("et") +/// .sort_field("sed") +/// .add_site_id("no") +/// .search_string("invidunt") +/// .page_token("rebum.") +/// .max_results(-86) +/// .add_ids("aliquyam") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("diam") +/// .sort_field("accusam") +/// .search_string("dolores") +/// .page_token("consetetur") +/// .max_results(-54) +/// .add_ids("aliquyam") +/// .add_directory_site_ids("elitr") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Ad; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Ad; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("sanctus") +/// .ssl_required(true) +/// .ssl_compliant(true) +/// .sort_order("consetetur") +/// .sort_field("consetetur") +/// .add_size_ids("eirmod") +/// .search_string("labore") +/// .add_remarketing_list_ids("gubergren") +/// .add_placement_ids("et") +/// .page_token("sadipscing") +/// .overridden_event_tag_id("accusam") +/// .max_results(-32) +/// .add_landing_page_ids("Lorem") +/// .add_ids("rebum.") +/// .dynamic_click_tracker(false) +/// .add_creative_optimization_configuration_ids("clita") +/// .add_creative_ids("eos") +/// .compatibility("dolores") +/// .add_campaign_ids("vero") +/// .add_audience_segment_ids("consetetur") +/// .archived(true) +/// .advertiser_id("consetetur") +/// .active(true) +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Ad; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("accusam") +/// .sort_field("labore") +/// .page_token("diam") +/// .name("nonumy") +/// .max_results(-93) +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// use dfareporting3::AdvertiserGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("dolores") +/// .sort_field("consetetur") +/// .search_string("erat") +/// .page_token("amet.") +/// .max_results(-18) +/// .add_ids("dolores") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::AdvertiserGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::AdvertiserGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Site; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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(true) +/// .subaccount_id("gubergren") +/// .sort_order("sit") +/// .sort_field("gubergren") +/// .search_string("sit") +/// .page_token("amet") +/// .max_results(-39) +/// .add_ids("sanctus") +/// .add_directory_site_ids("Lorem") +/// .add_campaign_ids("amet.") +/// .approved(true) +/// .ad_words_site(true) +/// .accepts_publisher_paid_placements(true) +/// .accepts_interstitial_placements(true) +/// .accepts_in_stream_video_placements(false) +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::Site; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Site; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("diam") +/// .sort_order("tempor") +/// .sort_field("et") +/// .search_string("erat") +/// .page_token("dolores") +/// .max_results(-62) +/// .add_ids("et") +/// .floodlight_configuration_id("clita") +/// .floodlight_activity_group_type("sed") +/// .floodlight_activity_group_tag_string("dolores") +/// .floodlight_activity_group_name("clita") +/// .add_floodlight_activity_group_ids("eos") +/// .advertiser_id("amet") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::FloodlightActivity; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::FloodlightActivity; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("gubergren") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::FloodlightActivity; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::CreativeGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::CreativeGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("labore") +/// .sort_field("voluptua.") +/// .search_string("takimata") +/// .page_token("dolor") +/// .max_results(-8) +/// .add_ids("voluptua.") +/// .group_number(-61) +/// .add_advertiser_ids("aliquyam") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::CreativeGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::TargetingTemplate; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("et") +/// .sort_field("consetetur") +/// .search_string("sea") +/// .page_token("nonumy") +/// .max_results(-45) +/// .add_ids("accusam") +/// .advertiser_id("clita") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::TargetingTemplate; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::TargetingTemplate; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Subaccount; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Subaccount; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Subaccount; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("dolores") +/// .sort_field("et") +/// .search_string("sanctus") +/// .page_token("takimata") +/// .max_results(-12) +/// .add_ids("ut") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::FloodlightConfiguration; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::FloodlightConfiguration; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("sit") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("tempor") +/// .sort_field("clita") +/// .scope("kasd") +/// .page_token("elitr") +/// .max_results(-68) +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("vero") +/// .sort_field("nonumy") +/// .add_site_ids("magna") +/// .search_string("ea") +/// .add_pricing_types("sea") +/// .add_placement_strategy_ids("ipsum") +/// .placement_group_type("labore") +/// .page_token("Lorem") +/// .min_start_date("aliquyam") +/// .min_end_date("sanctus") +/// .max_start_date("et") +/// .max_results(-46) +/// .max_end_date("et") +/// .add_ids("justo") +/// .add_directory_site_ids("kasd") +/// .add_content_category_ids("kasd") +/// .add_campaign_ids("ipsum") +/// .archived(true) +/// .add_advertiser_ids("nonumy") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::PlacementGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::PlacementGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::PlacementGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_("tempor") +/// .sort_order("amet") +/// .sort_field("Lorem") +/// .add_site_id("eirmod") +/// .page_token("elitr") +/// .add_order_id("clita") +/// .max_results(-23) +/// .in_plan(true) +/// .add_ids("ea") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("ipsum") +/// .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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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 + } +} + + +/// 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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("sea") +/// .sort_field("sanctus") +/// .search_string("gubergren") +/// .page_token("est") +/// .max_results(-38) +/// .add_ids("voluptua.") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::ContentCategory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::ContentCategory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::ContentCategory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Creative; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Creative; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("dolor") +/// .studio_creative_id("eirmod") +/// .sort_order("amet") +/// .sort_field("ipsum") +/// .add_size_ids("voluptua.") +/// .search_string("eirmod") +/// .add_rendering_ids("sed") +/// .page_token("accusam") +/// .max_results(-57) +/// .add_ids("dolor") +/// .add_creative_field_ids("dolor") +/// .add_companion_creative_ids("dolore") +/// .campaign_id("duo") +/// .archived(false) +/// .advertiser_id("diam") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::Creative; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Campaign; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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") +/// .doit(); +/// # } +/// ``` +pub struct CampaignInsertCall<'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 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((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::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 + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to 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_dfareporting3 as dfareporting3; +/// use dfareporting3::Campaign; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Campaign; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("elitr") +/// .sort_order("kasd") +/// .sort_field("sit") +/// .search_string("justo") +/// .page_token("gubergren") +/// .overridden_event_tag_id("ipsum") +/// .max_results(-1) +/// .add_ids("dolor") +/// .add_excluded_ids("sanctus") +/// .at_least_one_optimization_activity(false) +/// .archived(true) +/// .add_advertiser_ids("amet.") +/// .add_advertiser_group_ids("eirmod") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("sanctus") +/// .sort_field("diam") +/// .search_string("eos") +/// .add_ids("tempor") +/// .add_event_tag_types("sea") +/// .enabled(true) +/// .definitions_only(false) +/// .campaign_id("duo") +/// .advertiser_id("tempor") +/// .ad_id("consetetur") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::EventTag; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::EventTag; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::EventTag; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::RemarketingList; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("sit") +/// .sort_field("ipsum") +/// .page_token("dolore") +/// .name("sadipscing") +/// .max_results(-100) +/// .floodlight_activity_id("sadipscing") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::RemarketingList; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::RemarketingList; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("et") +/// .name_prefix("invidunt") +/// .add_dart_ids("amet.") +/// .add_country_dart_ids("sit") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::PlacementStrategy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("vero") +/// .sort_field("nonumy") +/// .search_string("accusam") +/// .page_token("est") +/// .max_results(-98) +/// .add_ids("erat") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::PlacementStrategy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::PlacementStrategy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("kasd") +/// .sort_field("diam") +/// .search_string("ut") +/// .page_token("diam") +/// .max_results(-74) +/// .add_ids("elitr") +/// .add_advertiser_ids("tempor") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::DirectorySite; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("gubergren") +/// .sort_field("clita") +/// .search_string("et") +/// .parent_id("justo") +/// .page_token("clita") +/// .max_results(-75) +/// .add_ids("sea") +/// .dfp_network_code("clita") +/// .country_id("tempor") +/// .active(true) +/// .accepts_publisher_paid_placements(true) +/// .accepts_interstitial_placements(true) +/// .accepts_in_stream_video_placements(false) +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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", -16) +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("invidunt") +/// .object_id("accusam") +/// .add_names("accusam") +/// .advertiser_id("invidunt") +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::DynamicTargetingKey; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Size; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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(-46) +/// .add_ids("ut") +/// .iab_standard(false) +/// .height(-71) +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::AccountUserProfile; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("invidunt") +/// .subaccount_id("At") +/// .sort_order("rebum.") +/// .sort_field("sit") +/// .search_string("ipsum") +/// .page_token("clita") +/// .max_results(-13) +/// .add_ids("Stet") +/// .active(true) +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::AccountUserProfile; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::AccountUserProfile; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::CreativeFieldValue; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::CreativeFieldValue; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::CreativeFieldValue; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("takimata") +/// .sort_field("Lorem") +/// .search_string("dolor") +/// .page_token("amet.") +/// .max_results(-29) +/// .add_ids("sea") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("magna") +/// .sort_field("amet.") +/// .search_string("clita") +/// .page_token("Stet") +/// .max_results(-30) +/// .add_ids("eirmod") +/// .active(true) +/// .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_dfareporting3 as dfareporting3; +/// use dfareporting3::Account; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Account; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Placement; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("At") +/// .sort_field("dolor") +/// .add_size_ids("tempor") +/// .add_site_ids("ipsum") +/// .search_string("est") +/// .add_pricing_types("et") +/// .add_placement_strategy_ids("no") +/// .payment_source("sed") +/// .page_token("kasd") +/// .min_start_date("ipsum") +/// .min_end_date("sadipscing") +/// .max_start_date("sea") +/// .max_results(-75) +/// .max_end_date("dolor") +/// .add_ids("Lorem") +/// .add_group_ids("amet") +/// .add_directory_site_ids("Lorem") +/// .add_content_category_ids("kasd") +/// .add_compatibilities("nonumy") +/// .add_campaign_ids("dolor") +/// .archived(false) +/// .add_advertiser_ids("no") +/// .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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Placement; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// use dfareporting3::Placement; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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_dfareporting3 as dfareporting3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dfareporting3::Dfareporting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(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("aliquyam") +/// .add_placement_ids("Lorem") +/// .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/dialogflow2_beta1-cli/Cargo.toml b/gen/dialogflow2_beta1-cli/Cargo.toml new file mode 100644 index 0000000000..27988827d3 --- /dev/null +++ b/gen/dialogflow2_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-dialogflow2_beta1-cli" +version = "1.0.6+20171211" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Dialogflow (protocol v2beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dialogflow2_beta1-cli" +homepage = "https://cloud.google.com/dialogflow-enterprise/" +documentation = "http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli" +license = "MIT" +keywords = ["dialogflow", "google", "cli"] + +[[bin]] +name = "dialogflow2-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-dialogflow2_beta1] +path = "../dialogflow2_beta1" +version = "1.0.6+20171211" diff --git a/gen/dialogflow2_beta1-cli/LICENSE.md b/gen/dialogflow2_beta1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/dialogflow2_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/dialogflow2_beta1-cli/README.md b/gen/dialogflow2_beta1-cli/README.md new file mode 100644 index 0000000000..684fc74db8 --- /dev/null +++ b/gen/dialogflow2_beta1-cli/README.md @@ -0,0 +1,149 @@ + +The `dialogflow2-beta1` command-line interface *(CLI)* allows to use most features of the *Google Dialogflow* 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 *Dialogflow* API can be found at the +[official documentation site](https://cloud.google.com/dialogflow-enterprise/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-dialogflow2_beta1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/dialogflow2_beta1-cli). + +# Usage + +This documentation was generated from the *Dialogflow* API at revision *20171211*. The CLI is at version *1.0.6*. + +```bash +dialogflow2-beta1 [options] + projects + agent-entity-types-batch-delete (-r )... [-p ]... [-o ] + agent-entity-types-batch-update (-r )... [-p ]... [-o ] + agent-entity-types-create (-r )... [-p ]... [-o ] + agent-entity-types-delete [-p ]... [-o ] + agent-entity-types-entities-batch-create (-r )... [-p ]... [-o ] + agent-entity-types-entities-batch-delete (-r )... [-p ]... [-o ] + agent-entity-types-entities-batch-update (-r )... [-p ]... [-o ] + agent-entity-types-get [-p ]... [-o ] + agent-entity-types-list [-p ]... [-o ] + agent-entity-types-patch (-r )... [-p ]... [-o ] + agent-export (-r )... [-p ]... [-o ] + agent-import (-r )... [-p ]... [-o ] + agent-intents-batch-delete (-r )... [-p ]... [-o ] + agent-intents-batch-update (-r )... [-p ]... [-o ] + agent-intents-create (-r )... [-p ]... [-o ] + agent-intents-delete [-p ]... [-o ] + agent-intents-get [-p ]... [-o ] + agent-intents-list [-p ]... [-o ] + agent-intents-patch (-r )... [-p ]... [-o ] + agent-restore (-r )... [-p ]... [-o ] + agent-search [-p ]... [-o ] + agent-sessions-contexts-create (-r )... [-p ]... [-o ] + agent-sessions-contexts-delete [-p ]... [-o ] + agent-sessions-contexts-get [-p ]... [-o ] + agent-sessions-contexts-list [-p ]... [-o ] + agent-sessions-contexts-patch (-r )... [-p ]... [-o ] + agent-sessions-delete-contexts [-p ]... [-o ] + agent-sessions-detect-intent (-r )... [-p ]... [-o ] + agent-sessions-entity-types-create (-r )... [-p ]... [-o ] + agent-sessions-entity-types-delete [-p ]... [-o ] + agent-sessions-entity-types-get [-p ]... [-o ] + agent-sessions-entity-types-list [-p ]... [-o ] + agent-sessions-entity-types-patch (-r )... [-p ]... [-o ] + agent-train (-r )... [-p ]... [-o ] + get-agent [-p ]... [-o ] + operations-get [-p ]... [-o ] + dialogflow2-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 `dialogflow2-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/dialogflow2-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/dialogflow2-beta1-secret.json`, assuming that the required *dialogflow* 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. `dialogflow2-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/dialogflow2_beta1-cli/mkdocs.yml b/gen/dialogflow2_beta1-cli/mkdocs.yml new file mode 100644 index 0000000000..a69a83fa12 --- /dev/null +++ b/gen/dialogflow2_beta1-cli/mkdocs.yml @@ -0,0 +1,52 @@ +site_name: Dialogflow v1.0.6+20171211 +site_url: http://byron.github.io/google-apis-rs/google-dialogflow2_beta1-cli +site_description: A complete library to interact with Dialogflow (protocol v2beta1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/dialogflow2_beta1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_agent-entity-types-batch-delete.md', 'Projects', 'Agent Entity Types Batch Delete'] +- ['projects_agent-entity-types-batch-update.md', 'Projects', 'Agent Entity Types Batch Update'] +- ['projects_agent-entity-types-create.md', 'Projects', 'Agent Entity Types Create'] +- ['projects_agent-entity-types-delete.md', 'Projects', 'Agent Entity Types Delete'] +- ['projects_agent-entity-types-entities-batch-create.md', 'Projects', 'Agent Entity Types Entities Batch Create'] +- ['projects_agent-entity-types-entities-batch-delete.md', 'Projects', 'Agent Entity Types Entities Batch Delete'] +- ['projects_agent-entity-types-entities-batch-update.md', 'Projects', 'Agent Entity Types Entities Batch Update'] +- ['projects_agent-entity-types-get.md', 'Projects', 'Agent Entity Types Get'] +- ['projects_agent-entity-types-list.md', 'Projects', 'Agent Entity Types List'] +- ['projects_agent-entity-types-patch.md', 'Projects', 'Agent Entity Types Patch'] +- ['projects_agent-export.md', 'Projects', 'Agent Export'] +- ['projects_agent-import.md', 'Projects', 'Agent Import'] +- ['projects_agent-intents-batch-delete.md', 'Projects', 'Agent Intents Batch Delete'] +- ['projects_agent-intents-batch-update.md', 'Projects', 'Agent Intents Batch Update'] +- ['projects_agent-intents-create.md', 'Projects', 'Agent Intents Create'] +- ['projects_agent-intents-delete.md', 'Projects', 'Agent Intents Delete'] +- ['projects_agent-intents-get.md', 'Projects', 'Agent Intents Get'] +- ['projects_agent-intents-list.md', 'Projects', 'Agent Intents List'] +- ['projects_agent-intents-patch.md', 'Projects', 'Agent Intents Patch'] +- ['projects_agent-restore.md', 'Projects', 'Agent Restore'] +- ['projects_agent-search.md', 'Projects', 'Agent Search'] +- ['projects_agent-sessions-contexts-create.md', 'Projects', 'Agent Sessions Contexts Create'] +- ['projects_agent-sessions-contexts-delete.md', 'Projects', 'Agent Sessions Contexts Delete'] +- ['projects_agent-sessions-contexts-get.md', 'Projects', 'Agent Sessions Contexts Get'] +- ['projects_agent-sessions-contexts-list.md', 'Projects', 'Agent Sessions Contexts List'] +- ['projects_agent-sessions-contexts-patch.md', 'Projects', 'Agent Sessions Contexts Patch'] +- ['projects_agent-sessions-delete-contexts.md', 'Projects', 'Agent Sessions Delete Contexts'] +- ['projects_agent-sessions-detect-intent.md', 'Projects', 'Agent Sessions Detect Intent'] +- ['projects_agent-sessions-entity-types-create.md', 'Projects', 'Agent Sessions Entity Types Create'] +- ['projects_agent-sessions-entity-types-delete.md', 'Projects', 'Agent Sessions Entity Types Delete'] +- ['projects_agent-sessions-entity-types-get.md', 'Projects', 'Agent Sessions Entity Types Get'] +- ['projects_agent-sessions-entity-types-list.md', 'Projects', 'Agent Sessions Entity Types List'] +- ['projects_agent-sessions-entity-types-patch.md', 'Projects', 'Agent Sessions Entity Types Patch'] +- ['projects_agent-train.md', 'Projects', 'Agent Train'] +- ['projects_get-agent.md', 'Projects', 'Get Agent'] +- ['projects_operations-get.md', 'Projects', 'Operations Get'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/dialogflow2_beta1-cli/src/cmn.rs b/gen/dialogflow2_beta1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/dialogflow2_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/dialogflow2_beta1-cli/src/main.rs b/gen/dialogflow2_beta1-cli/src/main.rs new file mode 100644 index 0000000000..05a078db72 --- /dev/null +++ b/gen/dialogflow2_beta1-cli/src/main.rs @@ -0,0 +1,4044 @@ +// 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_dialogflow2_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::Dialogflow>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_agent_entity_types_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()[..] { + "entity-type-names" => Some(("entityTypeNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-type-names"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchDeleteEntityTypesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_entity_types_batch_delete(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_agent_entity_types_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()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entity-type-batch-uri" => Some(("entityTypeBatchUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-type-batch-uri", "language-code", "update-mask"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchUpdateEntityTypesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_entity_types_batch_update(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_agent_entity_types_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()[..] { + "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", 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 })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "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::EntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_entity_types_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 { + "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 _projects_agent_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_entity_types_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_agent_entity_types_entities_batch_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 })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["language-code"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchCreateEntitiesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_entity_types_entities_batch_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_agent_entity_types_entities_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()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entity-values" => Some(("entityValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-values", "language-code"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchDeleteEntitiesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_entity_types_entities_batch_delete(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_agent_entity_types_entities_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()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["language-code", "update-mask"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchUpdateEntitiesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_entity_types_entities_batch_update(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_agent_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_entity_types_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 _projects_agent_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_entity_types_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")); + }, + "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(["page-token", "page-size", "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 _projects_agent_entity_types_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()[..] { + "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", 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 })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "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::EntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_entity_types_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("")); + }, + "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", "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_agent_export(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-uri"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ExportAgentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_export(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_agent_import(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "agent-content" => Some(("agentContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-content", "agent-uri"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ImportAgentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_import(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_agent_intents_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()[..] { + _ => { + 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::BatchDeleteIntentsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_intents_batch_delete(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_agent_intents_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()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "intent-batch-uri" => Some(("intentBatchUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "intent-view" => Some(("intentView", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["intent-batch-uri", "intent-view", "language-code", "update-mask"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchUpdateIntentsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_intents_batch_update(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_agent_intents_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()[..] { + "is-fallback" => Some(("isFallback", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-followup-intent-name" => Some(("parentFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "webhook-state" => Some(("webhookState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reset-contexts" => Some(("resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-response-platforms" => Some(("defaultResponsePlatforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "root-followup-intent-name" => Some(("rootFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "input-context-names" => Some(("inputContextNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "ml-enabled" => Some(("mlEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "events" => Some(("events", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "default-response-platforms", "display-name", "events", "input-context-names", "is-fallback", "ml-enabled", "name", "parent-followup-intent-name", "priority", "reset-contexts", "root-followup-intent-name", "webhook-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::Intent = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_intents_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 { + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + "intent-view" => { + call = call.intent_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(["language-code", "intent-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_agent_intents_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_intents_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_agent_intents_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_intents_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("")); + }, + "intent-view" => { + call = call.intent_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(["language-code", "intent-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_agent_intents_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_intents_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")); + }, + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + "intent-view" => { + call = call.intent_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(["page-token", "intent-view", "page-size", "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 _projects_agent_intents_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()[..] { + "is-fallback" => Some(("isFallback", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-followup-intent-name" => Some(("parentFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "webhook-state" => Some(("webhookState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reset-contexts" => Some(("resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-response-platforms" => Some(("defaultResponsePlatforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "root-followup-intent-name" => Some(("rootFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "input-context-names" => Some(("inputContextNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "ml-enabled" => Some(("mlEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "events" => Some(("events", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "default-response-platforms", "display-name", "events", "input-context-names", "is-fallback", "ml-enabled", "name", "parent-followup-intent-name", "priority", "reset-contexts", "root-followup-intent-name", "webhook-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::Intent = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_intents_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("")); + }, + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + "intent-view" => { + call = call.intent_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(["language-code", "update-mask", "intent-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_agent_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()[..] { + "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "agent-content" => Some(("agentContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-content", "agent-uri"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RestoreAgentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_restore(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_agent_search(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_search(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_agent_sessions_contexts_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 })), + "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "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::Context = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_sessions_contexts_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_agent_sessions_contexts_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_sessions_contexts_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_agent_sessions_contexts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_sessions_contexts_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_agent_sessions_contexts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_sessions_contexts_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_agent_sessions_contexts_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 })), + "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "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::Context = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_sessions_contexts_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_agent_sessions_delete_contexts(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_sessions_delete_contexts(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_agent_sessions_detect_intent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "input-audio" => Some(("inputAudio", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.text.language-code" => Some(("queryInput.text.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.event.name" => Some(("queryInput.event.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "query-input.audio-config.language-code" => Some(("queryInput.audioConfig.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.audio-encoding" => Some(("queryInput.audioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["audio-config", "audio-encoding", "event", "geo-location", "input-audio", "language-code", "latitude", "longitude", "name", "phrase-hints", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "text", "time-zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::DetectIntentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_sessions_detect_intent(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_agent_sessions_entity_types_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 })), + "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "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::SessionEntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_sessions_entity_types_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_agent_sessions_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_sessions_entity_types_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_agent_sessions_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_sessions_entity_types_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_agent_sessions_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_sessions_entity_types_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_agent_sessions_entity_types_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 })), + "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "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::SessionEntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_sessions_entity_types_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_agent_train(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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::TrainAgentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_train(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_get_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().get_agent(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_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 _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() { + ("agent-entity-types-batch-delete", Some(opt)) => { + call_result = self._projects_agent_entity_types_batch_delete(opt, dry_run, &mut err); + }, + ("agent-entity-types-batch-update", Some(opt)) => { + call_result = self._projects_agent_entity_types_batch_update(opt, dry_run, &mut err); + }, + ("agent-entity-types-create", Some(opt)) => { + call_result = self._projects_agent_entity_types_create(opt, dry_run, &mut err); + }, + ("agent-entity-types-delete", Some(opt)) => { + call_result = self._projects_agent_entity_types_delete(opt, dry_run, &mut err); + }, + ("agent-entity-types-entities-batch-create", Some(opt)) => { + call_result = self._projects_agent_entity_types_entities_batch_create(opt, dry_run, &mut err); + }, + ("agent-entity-types-entities-batch-delete", Some(opt)) => { + call_result = self._projects_agent_entity_types_entities_batch_delete(opt, dry_run, &mut err); + }, + ("agent-entity-types-entities-batch-update", Some(opt)) => { + call_result = self._projects_agent_entity_types_entities_batch_update(opt, dry_run, &mut err); + }, + ("agent-entity-types-get", Some(opt)) => { + call_result = self._projects_agent_entity_types_get(opt, dry_run, &mut err); + }, + ("agent-entity-types-list", Some(opt)) => { + call_result = self._projects_agent_entity_types_list(opt, dry_run, &mut err); + }, + ("agent-entity-types-patch", Some(opt)) => { + call_result = self._projects_agent_entity_types_patch(opt, dry_run, &mut err); + }, + ("agent-export", Some(opt)) => { + call_result = self._projects_agent_export(opt, dry_run, &mut err); + }, + ("agent-import", Some(opt)) => { + call_result = self._projects_agent_import(opt, dry_run, &mut err); + }, + ("agent-intents-batch-delete", Some(opt)) => { + call_result = self._projects_agent_intents_batch_delete(opt, dry_run, &mut err); + }, + ("agent-intents-batch-update", Some(opt)) => { + call_result = self._projects_agent_intents_batch_update(opt, dry_run, &mut err); + }, + ("agent-intents-create", Some(opt)) => { + call_result = self._projects_agent_intents_create(opt, dry_run, &mut err); + }, + ("agent-intents-delete", Some(opt)) => { + call_result = self._projects_agent_intents_delete(opt, dry_run, &mut err); + }, + ("agent-intents-get", Some(opt)) => { + call_result = self._projects_agent_intents_get(opt, dry_run, &mut err); + }, + ("agent-intents-list", Some(opt)) => { + call_result = self._projects_agent_intents_list(opt, dry_run, &mut err); + }, + ("agent-intents-patch", Some(opt)) => { + call_result = self._projects_agent_intents_patch(opt, dry_run, &mut err); + }, + ("agent-restore", Some(opt)) => { + call_result = self._projects_agent_restore(opt, dry_run, &mut err); + }, + ("agent-search", Some(opt)) => { + call_result = self._projects_agent_search(opt, dry_run, &mut err); + }, + ("agent-sessions-contexts-create", Some(opt)) => { + call_result = self._projects_agent_sessions_contexts_create(opt, dry_run, &mut err); + }, + ("agent-sessions-contexts-delete", Some(opt)) => { + call_result = self._projects_agent_sessions_contexts_delete(opt, dry_run, &mut err); + }, + ("agent-sessions-contexts-get", Some(opt)) => { + call_result = self._projects_agent_sessions_contexts_get(opt, dry_run, &mut err); + }, + ("agent-sessions-contexts-list", Some(opt)) => { + call_result = self._projects_agent_sessions_contexts_list(opt, dry_run, &mut err); + }, + ("agent-sessions-contexts-patch", Some(opt)) => { + call_result = self._projects_agent_sessions_contexts_patch(opt, dry_run, &mut err); + }, + ("agent-sessions-delete-contexts", Some(opt)) => { + call_result = self._projects_agent_sessions_delete_contexts(opt, dry_run, &mut err); + }, + ("agent-sessions-detect-intent", Some(opt)) => { + call_result = self._projects_agent_sessions_detect_intent(opt, dry_run, &mut err); + }, + ("agent-sessions-entity-types-create", Some(opt)) => { + call_result = self._projects_agent_sessions_entity_types_create(opt, dry_run, &mut err); + }, + ("agent-sessions-entity-types-delete", Some(opt)) => { + call_result = self._projects_agent_sessions_entity_types_delete(opt, dry_run, &mut err); + }, + ("agent-sessions-entity-types-get", Some(opt)) => { + call_result = self._projects_agent_sessions_entity_types_get(opt, dry_run, &mut err); + }, + ("agent-sessions-entity-types-list", Some(opt)) => { + call_result = self._projects_agent_sessions_entity_types_list(opt, dry_run, &mut err); + }, + ("agent-sessions-entity-types-patch", Some(opt)) => { + call_result = self._projects_agent_sessions_entity_types_patch(opt, dry_run, &mut err); + }, + ("agent-train", Some(opt)) => { + call_result = self._projects_agent_train(opt, dry_run, &mut err); + }, + ("get-agent", Some(opt)) => { + call_result = self._projects_get_agent(opt, dry_run, &mut err); + }, + ("operations-get", Some(opt)) => { + call_result = self._projects_operations_get(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, "dialogflow2-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: "dialogflow2-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::Dialogflow::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: 'agent-entity-types-batch-delete', 'agent-entity-types-batch-update', 'agent-entity-types-create', 'agent-entity-types-delete', 'agent-entity-types-entities-batch-create', 'agent-entity-types-entities-batch-delete', 'agent-entity-types-entities-batch-update', 'agent-entity-types-get', 'agent-entity-types-list', 'agent-entity-types-patch', 'agent-export', 'agent-import', 'agent-intents-batch-delete', 'agent-intents-batch-update', 'agent-intents-create', 'agent-intents-delete', 'agent-intents-get', 'agent-intents-list', 'agent-intents-patch', 'agent-restore', 'agent-search', 'agent-sessions-contexts-create', 'agent-sessions-contexts-delete', 'agent-sessions-contexts-get', 'agent-sessions-contexts-list', 'agent-sessions-contexts-patch', 'agent-sessions-delete-contexts', 'agent-sessions-detect-intent', 'agent-sessions-entity-types-create', 'agent-sessions-entity-types-delete', 'agent-sessions-entity-types-get', 'agent-sessions-entity-types-list', 'agent-sessions-entity-types-patch', 'agent-train', 'get-agent' and 'operations-get'", vec![ + ("agent-entity-types-batch-delete", + Some(r##"Deletes entity types in the specified agent. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-batch-delete", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the agent to delete all entities types for. Format: + `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-entity-types-batch-update", + Some(r##"Updates/Creates multiple entity types in the specified agent. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-batch-update", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the agent to update or create entity types in. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-entity-types-create", + Some(r##"Creates an entity type in the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The agent to create a entity type for. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-entity-types-delete", + Some(r##"Deletes the specified entity type."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the entity type to delete. + Format: `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-entity-types-entities-batch-create", + Some(r##"Creates multiple new entities in the specified entity type (extends the + existing collection of entries). + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-entities-batch-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the entity type to create entities in. Format: + `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-entity-types-entities-batch-delete", + Some(r##"Deletes entities in the specified entity type. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-entities-batch-delete", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the entity type to delete entries for. Format: + `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-entity-types-entities-batch-update", + Some(r##"Updates entities in the specified entity type (replaces the existing + collection of entries). + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-entities-batch-update", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the entity type to update the entities in. Format: + `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-entity-types-get", + Some(r##"Retrieves the specified entity type."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the entity type. + Format: `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-entity-types-list", + Some(r##"Returns the list of all entity types in the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The agent to list all entity types from. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-entity-types-patch", + Some(r##"Updates the specified entity type."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-entity-types-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required for all methods except `create` (`create` populates the name + automatically. + The unique identifier of the entity type. Format: + `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-export", + Some(r##"Exports the specified agent to a ZIP file. + + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-export", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent to export is associated with. + Format: `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)), + ]), + ("agent-import", + Some(r##"Imports the specified agent from a ZIP file. + + Uploads new intents and entity types without deleting the existing ones. + Intents and entity types with the same name are replaced with the new + versions from ImportAgentRequest. + + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-import", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent to import is associated with. + Format: `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)), + ]), + ("agent-intents-batch-delete", + Some(r##"Deletes intents in the specified agent. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-batch-delete", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the agent to delete all entities types for. Format: + `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-intents-batch-update", + Some(r##"Updates/Creates multiple intents in the specified agent. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-batch-update", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the agent to update or create intents in. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-intents-create", + Some(r##"Creates an intent in the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The agent to create a intent for. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-intents-delete", + Some(r##"Deletes the specified intent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the intent to delete. + Format: `projects//agent/intents/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-intents-get", + Some(r##"Retrieves the specified intent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the intent. + Format: `projects//agent/intents/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-intents-list", + Some(r##"Returns the list of all intents in the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The agent to list all intents from. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-intents-patch", + Some(r##"Updates the specified intent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-intents-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required for all methods except `create` (`create` populates the name + automatically. + The unique identifier of this intent. + Format: `projects//agent/intents/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-restore", + Some(r##"Restores the specified agent from a ZIP file. + + Replaces the current agent version with a new one. All the intents and + entity types in the older version are deleted. + + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-restore", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent to restore is associated with. + Format: `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)), + ]), + ("agent-search", + Some(r##"Returns the list of agents. + + Since there is at most one conversational agent per project, this method is + useful primarily for listing all agents across projects the caller has + access to. One can achieve that with a wildcard project collection id "-". + Refer to [List + Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections)."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-search", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project to list agents from. + Format: `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)), + ]), + ("agent-sessions-contexts-create", + Some(r##"Creates a context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-contexts-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to create a context for. + Format: `projects//agent/sessions/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-sessions-contexts-delete", + Some(r##"Deletes the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-contexts-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the context to delete. Format: + `projects//agent/sessions//contexts/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-sessions-contexts-get", + Some(r##"Retrieves the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-contexts-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the context. Format: + `projects//agent/sessions//contexts/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-sessions-contexts-list", + Some(r##"Returns the list of all contexts in the specified session."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-contexts-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to list all contexts from. + Format: `projects//agent/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)), + ]), + ("agent-sessions-contexts-patch", + Some(r##"Updates the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-contexts-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The unique identifier of the context. Format: + `projects//agent/sessions//contexts/`. + Note: The Context ID is always converted to lowercase."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-sessions-delete-contexts", + Some(r##"Deletes all active contexts in the specified session."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-delete-contexts", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the session to delete all contexts from. Format: + `projects//agent/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)), + ]), + ("agent-sessions-detect-intent", + Some(r##"Processes a natural language query and returns structured, actionable data + as a result. This method is not idempotent, because it may cause contexts + and session entity types to be updated, which in turn might affect + results of future queries."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-detect-intent", + vec![ + (Some(r##"session"##), + None, + Some(r##"Required. The name of the session this query is sent to. Format: + `projects//agent/sessions/`. + It's up to the API caller to choose an appropriate session ID. It can be + a random number or some type of user identifier (preferably hashed). + The length of the session ID must not exceed 36 bytes."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-sessions-entity-types-create", + Some(r##"Creates a session entity type."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to create a session entity type for. + Format: `projects//agent/sessions/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-sessions-entity-types-delete", + Some(r##"Deletes the specified session entity type."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the entity type to delete. Format: + `projects//agent/sessions//entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-sessions-entity-types-get", + Some(r##"Retrieves the specified session entity type."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the session entity type. Format: + `projects//agent/sessions//entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-sessions-entity-types-list", + Some(r##"Returns the list of all session entity types in the specified session."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to list all session entity types from. + Format: `projects//agent/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)), + ]), + ("agent-sessions-entity-types-patch", + Some(r##"Updates the specified session entity type."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The unique identifier of this session entity type. Format: + `projects//agent/sessions//entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-train", + Some(r##"Trains the specified agent. + + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-train", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent to train is associated with. + Format: `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)), + ]), + ("get-agent", + Some(r##"Retrieves the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_get-agent", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent to fetch is associated with. + Format: `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)), + ]), + ("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_dialogflow2_beta1_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)), + ]), + ]), + + ]; + + let mut app = App::new("dialogflow2-beta1") + .author("Sebastian Thiel ") + .version("1.0.6+20171211") + .about("An end-to-end development suite for conversational interfaces (e.g., chatbots, voice-powered apps and devices).") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dialogflow2_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/dialogflow2_beta1/Cargo.toml b/gen/dialogflow2_beta1/Cargo.toml new file mode 100644 index 0000000000..034f16137e --- /dev/null +++ b/gen/dialogflow2_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-dialogflow2_beta1" +version = "1.0.6+20171211" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Dialogflow (protocol v2beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dialogflow2_beta1" +homepage = "https://cloud.google.com/dialogflow-enterprise/" +documentation = "https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211" +license = "MIT" +keywords = ["dialogflow", "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/dialogflow2_beta1/LICENSE.md b/gen/dialogflow2_beta1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/dialogflow2_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/dialogflow2_beta1/README.md b/gen/dialogflow2_beta1/README.md new file mode 100644 index 0000000000..2613f154a5 --- /dev/null +++ b/gen/dialogflow2_beta1/README.md @@ -0,0 +1,191 @@ + +The `google-dialogflow2_beta1` library allows access to all features of the *Google Dialogflow* service. + +This documentation was generated from *Dialogflow* crate version *1.0.6+20171211*, where *20171211* is the exact revision of the *dialogflow:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Dialogflow* *v2_beta1* API can be found at the +[official documentation site](https://cloud.google.com/dialogflow-enterprise/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.Dialogflow.html) ... + +* projects + * [*agent entity types batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeBatchDeleteCall.html), [*agent entity types batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeBatchUpdateCall.html), [*agent entity types create*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeCreateCall.html), [*agent entity types delete*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeDeleteCall.html), [*agent entity types entities batch create*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeEntityBatchCreateCall.html), [*agent entity types entities batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html), [*agent entity types entities batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html), [*agent entity types get*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeGetCall.html), [*agent entity types list*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeListCall.html), [*agent entity types patch*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentEntityTypePatchCall.html), [*agent export*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentExportCall.html), [*agent import*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentImportCall.html), [*agent intents batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentIntentBatchDeleteCall.html), [*agent intents batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentIntentBatchUpdateCall.html), [*agent intents create*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentIntentCreateCall.html), [*agent intents delete*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentIntentDeleteCall.html), [*agent intents get*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentIntentGetCall.html), [*agent intents list*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentIntentListCall.html), [*agent intents patch*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentIntentPatchCall.html), [*agent restore*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentRestoreCall.html), [*agent search*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSearchCall.html), [*agent sessions contexts create*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionContextCreateCall.html), [*agent sessions contexts delete*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionContextDeleteCall.html), [*agent sessions contexts get*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionContextGetCall.html), [*agent sessions contexts list*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionContextListCall.html), [*agent sessions contexts patch*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionContextPatchCall.html), [*agent sessions delete contexts*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionDeleteContextCall.html), [*agent sessions detect intent*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionDetectIntentCall.html), [*agent sessions entity types create*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeCreateCall.html), [*agent sessions entity types delete*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeDeleteCall.html), [*agent sessions entity types get*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeGetCall.html), [*agent sessions entity types list*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeListCall.html), [*agent sessions entity types patch*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypePatchCall.html), [*agent train*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectAgentTrainCall.html), [*get agent*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectGetAgentCall.html) and [*operations get*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.ProjectOperationGetCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/struct.Dialogflow.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/trait.CallBuilder.html)** + * operations to apply to *Resources* + +All *structures* are marked with applicable traits to further categorize them and ease browsing. + +Generally speaking, you can invoke *Activities* like this: + +```Rust,ignore +let r = hub.resource().activity(...).doit() +``` + +Or specifically ... + +```ignore +let r = hub.projects().agent_restore(...).doit() +let r = hub.projects().agent_intents_batch_delete(...).doit() +let r = hub.projects().agent_entity_types_batch_delete(...).doit() +let r = hub.projects().agent_train(...).doit() +let r = hub.projects().agent_export(...).doit() +let r = hub.projects().agent_entity_types_batch_update(...).doit() +let r = hub.projects().agent_import(...).doit() +let r = hub.projects().agent_intents_batch_update(...).doit() +let r = hub.projects().agent_entity_types_entities_batch_update(...).doit() +let r = hub.projects().agent_entity_types_entities_batch_delete(...).doit() +let r = hub.projects().operations_get(...).doit() +let r = hub.projects().agent_entity_types_entities_batch_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-dialogflow2_beta1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +use dialogflow2_beta1::RestoreAgentRequest; +use dialogflow2_beta1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use dialogflow2_beta1::Dialogflow; + +// 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 = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +// As the method needs a request, you would usually fill it with the desired information +// into the respective structure. Some of the parts shown here might not be applicable ! +// Values shown here are possibly random and not representative ! +let mut req = RestoreAgentRequest::default(); + +// You can configure optional parameters by calling the respective setters at will, and +// execute the final call using `doit()`. +// Values shown here are possibly random and not representative ! +let result = hub.projects().agent_restore(req, "parent") + .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-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_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-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_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-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_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-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_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-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_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-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_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-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_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-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_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-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_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-dialogflow2_beta1/1.0.6+20171211/google_dialogflow2_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 **dialogflow2_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/dialogflow2_beta1/src/cmn.rs b/gen/dialogflow2_beta1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/dialogflow2_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/dialogflow2_beta1/src/lib.rs b/gen/dialogflow2_beta1/src/lib.rs new file mode 100644 index 0000000000..b567e65955 --- /dev/null +++ b/gen/dialogflow2_beta1/src/lib.rs @@ -0,0 +1,12988 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Dialogflow* crate version *1.0.6+20171211*, where *20171211* is the exact revision of the *dialogflow:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Dialogflow* *v2_beta1* API can be found at the +//! [official documentation site](https://cloud.google.com/dialogflow-enterprise/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/dialogflow2_beta1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.Dialogflow.html) ... +//! +//! * projects +//! * [*agent entity types batch delete*](struct.ProjectAgentEntityTypeBatchDeleteCall.html), [*agent entity types batch update*](struct.ProjectAgentEntityTypeBatchUpdateCall.html), [*agent entity types create*](struct.ProjectAgentEntityTypeCreateCall.html), [*agent entity types delete*](struct.ProjectAgentEntityTypeDeleteCall.html), [*agent entity types entities batch create*](struct.ProjectAgentEntityTypeEntityBatchCreateCall.html), [*agent entity types entities batch delete*](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html), [*agent entity types entities batch update*](struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html), [*agent entity types get*](struct.ProjectAgentEntityTypeGetCall.html), [*agent entity types list*](struct.ProjectAgentEntityTypeListCall.html), [*agent entity types patch*](struct.ProjectAgentEntityTypePatchCall.html), [*agent export*](struct.ProjectAgentExportCall.html), [*agent import*](struct.ProjectAgentImportCall.html), [*agent intents batch delete*](struct.ProjectAgentIntentBatchDeleteCall.html), [*agent intents batch update*](struct.ProjectAgentIntentBatchUpdateCall.html), [*agent intents create*](struct.ProjectAgentIntentCreateCall.html), [*agent intents delete*](struct.ProjectAgentIntentDeleteCall.html), [*agent intents get*](struct.ProjectAgentIntentGetCall.html), [*agent intents list*](struct.ProjectAgentIntentListCall.html), [*agent intents patch*](struct.ProjectAgentIntentPatchCall.html), [*agent restore*](struct.ProjectAgentRestoreCall.html), [*agent search*](struct.ProjectAgentSearchCall.html), [*agent sessions contexts create*](struct.ProjectAgentSessionContextCreateCall.html), [*agent sessions contexts delete*](struct.ProjectAgentSessionContextDeleteCall.html), [*agent sessions contexts get*](struct.ProjectAgentSessionContextGetCall.html), [*agent sessions contexts list*](struct.ProjectAgentSessionContextListCall.html), [*agent sessions contexts patch*](struct.ProjectAgentSessionContextPatchCall.html), [*agent sessions delete contexts*](struct.ProjectAgentSessionDeleteContextCall.html), [*agent sessions detect intent*](struct.ProjectAgentSessionDetectIntentCall.html), [*agent sessions entity types create*](struct.ProjectAgentSessionEntityTypeCreateCall.html), [*agent sessions entity types delete*](struct.ProjectAgentSessionEntityTypeDeleteCall.html), [*agent sessions entity types get*](struct.ProjectAgentSessionEntityTypeGetCall.html), [*agent sessions entity types list*](struct.ProjectAgentSessionEntityTypeListCall.html), [*agent sessions entity types patch*](struct.ProjectAgentSessionEntityTypePatchCall.html), [*agent train*](struct.ProjectAgentTrainCall.html), [*get agent*](struct.ProjectGetAgentCall.html) and [*operations get*](struct.ProjectOperationGetCall.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.Dialogflow.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().agent_restore(...).doit() +//! let r = hub.projects().agent_intents_batch_delete(...).doit() +//! let r = hub.projects().agent_entity_types_batch_delete(...).doit() +//! let r = hub.projects().agent_train(...).doit() +//! let r = hub.projects().agent_export(...).doit() +//! let r = hub.projects().agent_entity_types_batch_update(...).doit() +//! let r = hub.projects().agent_import(...).doit() +//! let r = hub.projects().agent_intents_batch_update(...).doit() +//! let r = hub.projects().agent_entity_types_entities_batch_update(...).doit() +//! let r = hub.projects().agent_entity_types_entities_batch_delete(...).doit() +//! let r = hub.projects().operations_get(...).doit() +//! let r = hub.projects().agent_entity_types_entities_batch_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-dialogflow2_beta1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +//! use dialogflow2_beta1::RestoreAgentRequest; +//! use dialogflow2_beta1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use dialogflow2_beta1::Dialogflow; +//! +//! // 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 = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +//! // As the method needs a request, you would usually fill it with the desired information +//! // into the respective structure. Some of the parts shown here might not be applicable ! +//! // Values shown here are possibly random and not representative ! +//! let mut req = RestoreAgentRequest::default(); +//! +//! // You can configure optional parameters by calling the respective setters at will, and +//! // execute the final call using `doit()`. +//! // Values shown here are possibly random and not representative ! +//! let result = hub.projects().agent_restore(req, "parent") +//! .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 Dialogflow 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::RestoreAgentRequest; +/// use dialogflow2_beta1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dialogflow2_beta1::Dialogflow; +/// +/// // 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 = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = RestoreAgentRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_restore(req, "parent") +/// .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 Dialogflow { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for Dialogflow {} + +impl<'a, C, A> Dialogflow + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> Dialogflow { + Dialogflow { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://dialogflow.googleapis.com/".to_string(), + _root_url: "https://dialogflow.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://dialogflow.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://dialogflow.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 ### +// ########## +/// Represents a context. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent sessions contexts get projects](struct.ProjectAgentSessionContextGetCall.html) (response) +/// * [agent sessions contexts create projects](struct.ProjectAgentSessionContextCreateCall.html) (request|response) +/// * [agent sessions contexts patch projects](struct.ProjectAgentSessionContextPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Context { + /// Required. The unique identifier of the context. Format: + /// `projects//agent/sessions//contexts/`. + /// Note: The Context ID is always converted to lowercase. + pub name: Option, + /// Optional. The collection of parameters associated with this context. + /// Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) for + /// syntax. + pub parameters: Option>, + /// Optional. The number of conversational query requests after which the + /// context expires. If set to `0` (the default) the context expires + /// immediately. Contexts expire automatically after 10 minutes even if there + /// are no matching queries. + #[serde(rename="lifespanCount")] + pub lifespan_count: Option, +} + +impl RequestValue for Context {} +impl ResponseResult for Context {} + + +/// Corresponds to the `Response` field in API.AI console. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessage { + /// The voice and text-only responses for Actions on Google. + #[serde(rename="simpleResponses")] + pub simple_responses: Option, + /// The quick replies response. + #[serde(rename="quickReplies")] + pub quick_replies: Option, + /// The link out suggestion chip for Actions on Google. + #[serde(rename="linkOutSuggestion")] + pub link_out_suggestion: Option, + /// The text response. + pub text: Option, + /// The image response. + pub image: Option, + /// The suggestion chips for Actions on Google. + pub suggestions: Option, + /// Optional. The platform that this message is intended for. + pub platform: Option, + /// The basic card response for Actions on Google. + #[serde(rename="basicCard")] + pub basic_card: Option, + /// The carousel card response for Actions on Google. + #[serde(rename="carouselSelect")] + pub carousel_select: Option, + /// The list card response for Actions on Google. + #[serde(rename="listSelect")] + pub list_select: Option, + /// The response containing a custom payload. + pub payload: Option>, + /// The card response. + pub card: Option, +} + +impl Part for IntentMessage {} + + +/// The request message for EntityTypes.BatchCreateEntities. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent entity types entities batch create projects](struct.ProjectAgentEntityTypeEntityBatchCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchCreateEntitiesRequest { + /// Optional. The language of entity synonyms defined in `entities`. If not + /// specified, the agent's default language is used. + /// [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Required. The collection of entities to create. + pub entities: Option>, +} + +impl RequestValue for BatchCreateEntitiesRequest {} + + +/// 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*). +/// +/// * [agent intents delete projects](struct.ProjectAgentIntentDeleteCall.html) (response) +/// * [agent sessions delete contexts projects](struct.ProjectAgentSessionDeleteContextCall.html) (response) +/// * [agent sessions entity types delete projects](struct.ProjectAgentSessionEntityTypeDeleteCall.html) (response) +/// * [agent entity types delete projects](struct.ProjectAgentEntityTypeDeleteCall.html) (response) +/// * [agent sessions contexts delete projects](struct.ProjectAgentSessionContextDeleteCall.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 {} + + +/// Represents a session entity type. +/// +/// Extends or replaces a developer entity type at the user session level (we +/// refer to the entity types defined at the agent level as "developer entity +/// types"). +/// +/// Note: session entity types apply to all queries, regardless of the language. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent sessions entity types patch projects](struct.ProjectAgentSessionEntityTypePatchCall.html) (request|response) +/// * [agent sessions entity types create projects](struct.ProjectAgentSessionEntityTypeCreateCall.html) (request|response) +/// * [agent sessions entity types get projects](struct.ProjectAgentSessionEntityTypeGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SessionEntityType { + /// Required. The collection of entities associated with this session entity + /// type. + pub entities: Option>, + /// Required. The unique identifier of this session entity type. Format: + /// `projects//agent/sessions//entityTypes/`. + pub name: Option, + /// Required. Indicates whether the additional data should override or + /// supplement the developer entity type definition. + #[serde(rename="entityOverrideMode")] + pub entity_override_mode: Option, +} + +impl RequestValue for SessionEntityType {} +impl ResponseResult for SessionEntityType {} + + +/// Represents the query input. It can contain either: +/// +/// 1. An audio config which +/// instructs the speech recognizer how to process the speech audio. +/// +/// 2. A conversational query in the form of text,. +/// +/// 3. An event that specifies which intent to trigger. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct QueryInput { + /// The natural language text to be processed. + pub text: Option, + /// The event to be processed. + pub event: Option, + /// Instructs the speech recognizer how to process the speech audio. + #[serde(rename="audioConfig")] + pub audio_config: Option, +} + +impl Part for QueryInput {} + + +/// Represents an intent. +/// Intents convert a number of user expressions or patterns into an action. An +/// action is an extraction of a user command or sentence 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*). +/// +/// * [agent intents get projects](struct.ProjectAgentIntentGetCall.html) (response) +/// * [agent intents create projects](struct.ProjectAgentIntentCreateCall.html) (request|response) +/// * [agent intents patch projects](struct.ProjectAgentIntentPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Intent { + /// Required. Indicates whether webhooks are enabled for the intent. + #[serde(rename="webhookState")] + pub webhook_state: Option, + /// Optional. The list of platforms for which the first response will be + /// taken from among the messages assigned to the DEFAULT_PLATFORM. + #[serde(rename="defaultResponsePlatforms")] + pub default_response_platforms: Option>, + /// Optional. The name of the action associated with the intent. + pub action: Option, + /// Optional. Indicates whether Machine Learning is enabled for the intent. + /// Note: If `ml_enabled` setting is set to false, then this intent is not + /// taken into account during inference in `ML ONLY` match mode. Also, + /// auto-markup in the UI is turned off. + #[serde(rename="mlEnabled")] + pub ml_enabled: Option, + /// Optional. The collection of contexts that are activated when the intent + /// is matched. Context messages in this collection should not set the + /// parameters field. Setting the `lifespan_count` to 0 will reset the context + /// when the intent is matched. + /// Format: `projects//agent/sessions/-/contexts/`. + #[serde(rename="outputContexts")] + pub output_contexts: Option>, + /// Optional. Indicates whether this is a fallback intent. + #[serde(rename="isFallback")] + pub is_fallback: Option, + /// Required. The name of this intent. + #[serde(rename="displayName")] + pub display_name: Option, + /// Required for all methods except `create` (`create` populates the name + /// automatically. + /// The unique identifier of this intent. + /// Format: `projects//agent/intents/`. + pub name: Option, + /// Optional. The collection of parameters associated with the intent. + pub parameters: Option>, + /// The unique identifier of the parent intent in the chain of followup + /// intents. + /// It identifies the parent followup intent. + /// Format: `projects//agent/intents/`. + #[serde(rename="parentFollowupIntentName")] + pub parent_followup_intent_name: Option, + /// Optional. Collection of information about all followup intents that have + /// name of this intent as a root_name. + #[serde(rename="followupIntentInfo")] + pub followup_intent_info: Option>, + /// Optional. The collection of examples/templates that the agent is + /// trained on. + #[serde(rename="trainingPhrases")] + pub training_phrases: Option>, + /// Optional. The collection of rich messages corresponding to the + /// `Response` field in API.AI console. + pub messages: Option>, + /// Optional. The priority of this intent. Higher numbers represent higher + /// priorities. Zero or negative numbers mean that the intent is disabled. + pub priority: Option, + /// The unique identifier of the root intent in the chain of followup intents. + /// It identifies the correct followup intents chain for this intent. + /// Format: `projects//agent/intents/`. + #[serde(rename="rootFollowupIntentName")] + pub root_followup_intent_name: Option, + /// Optional. The list of context names required for this intent to be + /// triggered. + /// Format: `projects//agent/sessions/-/contexts/`. + #[serde(rename="inputContextNames")] + pub input_context_names: Option>, + /// Optional. Indicates whether to delete all contexts in the current + /// session when this intent is matched. + #[serde(rename="resetContexts")] + pub reset_contexts: Option, + /// Optional. The collection of event names that trigger the intent. + /// If the collection of input contexts is not empty, all of the contexts must + /// be present in the active user session for an event to trigger this intent. + pub events: Option>, +} + +impl RequestValue for Intent {} +impl ResponseResult for Intent {} + + +/// The request message for EntityTypes.BatchUpdateEntityTypes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent entity types batch update projects](struct.ProjectAgentEntityTypeBatchUpdateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchUpdateEntityTypesRequest { + /// Optional. The language of entity synonyms defined in `entity_types`. If not + /// specified, the agent's default language is used. + /// [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Optional. The mask to control which fields get updated. + #[serde(rename="updateMask")] + pub update_mask: Option, + /// Warning: Importing entity types from a URI is not implemented yet. + /// This feature is coming soon. + /// The URI to a Google Cloud Storage file containing entity types to update + /// or create. The file format can either be a serialized proto (of + /// EntityBatch type) or a JSON object. Note: The URI must start with + /// "gs://". + #[serde(rename="entityTypeBatchUri")] + pub entity_type_batch_uri: Option, + /// The collection of entity type to update or create. + #[serde(rename="entityTypeBatchInline")] + pub entity_type_batch_inline: Option, +} + +impl RequestValue for BatchUpdateEntityTypesRequest {} + + +/// The suggestion chip message that allows the user to jump out to the app +/// or website associated with this agent. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageLinkOutSuggestion { + /// Required. The URI of the app or site to open when the user taps the + /// suggestion chip. + pub uri: Option, + /// Required. The name of the app or site this chip is linking to. + #[serde(rename="destinationName")] + pub destination_name: Option, +} + +impl Part for IntentMessageLinkOutSuggestion {} + + +/// Represents an example or template that the agent is trained 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 IntentTrainingPhrase { + /// Required. The collection of training phrase parts (can be annotated). + /// Fields: `entity_type`, `alias` and `user_defined` should be populated + /// only for the annotated parts of the training phrase. + pub parts: Option>, + /// Required. The type of the training phrase. + #[serde(rename="type")] + pub type_: Option, + /// Required. The unique identifier of this training phrase. + pub name: Option, + /// Optional. Indicates how many times this example or template was added to + /// the intent. Each time a developer adds an existing sample by editing an + /// intent or training, this counter is increased. + #[serde(rename="timesAddedCount")] + pub times_added_count: Option, +} + +impl Part for IntentTrainingPhrase {} + + +/// Opens the given URI. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageBasicCardButtonOpenUriAction { + /// Required. The HTTP or HTTPS scheme URI. + pub uri: Option, +} + +impl Part for IntentMessageBasicCardButtonOpenUriAction {} + + +/// The response message for EntityTypes.BatchCreateEntities. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent entity types entities batch update projects](struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchUpdateEntitiesRequest { + /// Required. The collection of new entities to replace the existing entities. + pub entities: Option>, + /// Optional. The mask to control which fields get updated. + #[serde(rename="updateMask")] + pub update_mask: Option, + /// Optional. The language of entity synonyms defined in `entities`. If not + /// specified, the agent's default language is used. + /// [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + #[serde(rename="languageCode")] + pub language_code: Option, +} + +impl RequestValue for BatchUpdateEntitiesRequest {} + + +/// The card for presenting a list of options to select from. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageListSelect { + /// Required. List items. + pub items: Option>, + /// Optional. The overall title of the list. + pub title: Option, +} + +impl Part for IntentMessageListSelect {} + + +/// The request to detect user's intent. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent sessions detect intent projects](struct.ProjectAgentSessionDetectIntentCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DetectIntentRequest { + /// Optional. The natural language speech audio to be processed. This field + /// should be populated iff `query_input` is set to an input audio config. + /// A single request can contain up to 1 minute of speech audio data. + #[serde(rename="inputAudio")] + pub input_audio: Option, + /// Required. The input specification. It can be set to: + /// + /// 1. an audio config + /// which instructs the speech recognizer how to process the speech audio, + /// + /// 2. a conversational query in the form of text, or + /// + /// 3. an event that specifies which intent to trigger. + #[serde(rename="queryInput")] + pub query_input: Option, + /// Optional. The parameters of this query. + #[serde(rename="queryParams")] + pub query_params: Option, +} + +impl RequestValue for DetectIntentRequest {} + + +/// The response message for EntityTypes.ListEntityTypes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent entity types list projects](struct.ProjectAgentEntityTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListEntityTypesResponse { + /// 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, + /// The list of agent entity types. There will be a maximum number of items + /// returned based on the page_size field in the request. + #[serde(rename="entityTypes")] + pub entity_types: Option>, +} + +impl ResponseResult for ListEntityTypesResponse {} + + +/// The simple response message containing speech or text. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageSimpleResponse { + /// Optional. The text to display. + #[serde(rename="displayText")] + pub display_text: Option, + /// One of text_to_speech or ssml must be provided. The plain text of the + /// speech output. Mutually exclusive with ssml. + #[serde(rename="textToSpeech")] + pub text_to_speech: Option, + /// One of text_to_speech or ssml must be provided. Structured spoken + /// response to the user in the SSML format. Mutually exclusive with + /// text_to_speech. + pub ssml: Option, +} + +impl Part for IntentMessageSimpleResponse {} + + +/// The button object that appears at the bottom of a card. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageBasicCardButton { + /// Required. Action to take when a user taps on the button. + #[serde(rename="openUriAction")] + pub open_uri_action: Option, + /// Required. The title of the button. + pub title: Option, +} + +impl Part for IntentMessageBasicCardButton {} + + +/// The request message for Agents.TrainAgent. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent train projects](struct.ProjectAgentTrainCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TrainAgentRequest { _never_set: Option } + +impl RequestValue for TrainAgentRequest {} + + +/// The image response message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageImage { + /// Optional. The public URI to an image file. + #[serde(rename="imageUri")] + pub image_uri: Option, +} + +impl Part for IntentMessageImage {} + + +/// The request message for EntityTypes.BatchDeleteEntityTypes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent entity types batch delete projects](struct.ProjectAgentEntityTypeBatchDeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchDeleteEntityTypesRequest { + /// Required. The names entity types to delete. All names must point to the + /// same agent as `parent`. + #[serde(rename="entityTypeNames")] + pub entity_type_names: Option>, +} + +impl RequestValue for BatchDeleteEntityTypesRequest {} + + +/// Represents a conversational agent. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 agent projects](struct.ProjectGetAgentCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Agent { + /// Optional. The URI of the agent's avatar. + /// Avatars are used throughout API.AI console and in the self-hosted + /// [Web Demo](https://dialogflow.com/docs/integrations/web-demo) integration. + #[serde(rename="avatarUri")] + pub avatar_uri: Option, + /// Required. The name of this agent. + #[serde(rename="displayName")] + pub display_name: Option, + /// Optional. The description of this agent. + /// The maximum length is 500 characters. If exceeded, the request is rejected. + pub description: Option, + /// Required. The project of this agent. + /// Format: `projects/`. + pub parent: Option, + /// Required. The default language of the agent as a language tag. See + /// [Language Support](https://dialogflow.com/docs/reference/language) for a + /// list of the currently supported language codes. + /// This field cannot be set by the `Update` method. + #[serde(rename="defaultLanguageCode")] + pub default_language_code: Option, + /// Optional. Determines whether this agent should log conversation queries. + #[serde(rename="enableLogging")] + pub enable_logging: Option, + /// Optional. Determines how intents are detected from user queries. + #[serde(rename="matchMode")] + pub match_mode: Option, + /// Optional. The list of all languages supported by this agent (except for the + /// `default_language_code`). + #[serde(rename="supportedLanguageCodes")] + pub supported_language_codes: Option>, + /// Required. The time zone of this agent from the + /// [time zone database](https://www.iana.org/time-zones), e.g., + /// America/New_York, Europe/Paris. + #[serde(rename="timeZone")] + pub time_zone: Option, + /// Optional. To filter out false positive results and still get variety in + /// matched natural language inputs for your agent, you can tune the machine + /// learning classification threshold. If the returned score value is less than + /// the threshold value, then a fallback intent is be triggered or, if there + /// are no fallback intents defined, no intent will be triggered. The score + /// values range from 0.0 (completely uncertain) to 1.0 (completely certain). + /// If set to 0.0, the default of 0.3 is used. + #[serde(rename="classificationThreshold")] + pub classification_threshold: Option, +} + +impl ResponseResult for Agent {} + + +/// Represents a part of a training phrase. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentTrainingPhrasePart { + /// Optional. The parameter name for the value extracted from the + /// annotated part of the example. + pub alias: Option, + /// Optional. The entity type name prefixed with `@`. This field is + /// required for the annotated part of the text and applies only to + /// examples. + #[serde(rename="entityType")] + pub entity_type: Option, + /// Required. The text corresponding to the example or template, + /// if there are no annotations. For + /// annotated examples, it is the text for one of the example's parts. + pub text: Option, + /// Optional. Indicates whether the text was manually annotated by the + /// developer. + #[serde(rename="userDefined")] + pub user_defined: Option, +} + +impl Part for IntentTrainingPhrasePart {} + + +/// Represents the natural language text to be processed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TextInput { + /// Required. The UTF-8 encoded natural language text to be processed. + /// Text length must not exceed 256 bytes. + pub text: Option, + /// Required. The language of this conversational query. See [Language + /// Support](https://dialogflow.com/docs/languages) for a list of the + /// currently supported language codes. Note that queries in the same session + /// do not necessarily need to specify the same language. + #[serde(rename="languageCode")] + pub language_code: Option, +} + +impl Part for TextInput {} + + +/// Represents the parameters of the conversational 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 QueryParameters { + /// Optional. The geo location of this conversational query. + #[serde(rename="geoLocation")] + pub geo_location: Option, + /// Optional. The collection of contexts to be activated before this query is + /// executed. + pub contexts: Option>, + /// Optional. The time zone of this conversational query from the + /// [time zone database](https://www.iana.org/time-zones), e.g., + /// America/New_York, Europe/Paris. If not provided, the time zone specified in + /// agent settings is used. + #[serde(rename="timeZone")] + pub time_zone: Option, + /// Optional. Specifies whether to delete all contexts in the current session + /// before the new ones are activated. + #[serde(rename="resetContexts")] + pub reset_contexts: Option, + /// Optional. This field can be used to pass custom data into the webhook + /// associated with the agent. Arbitrary JSON objects are supported. + pub payload: Option>, + /// Optional. The collection of session entity types to replace or extend + /// developer entities with for this query only. The entity synonyms apply + /// to all languages. + #[serde(rename="sessionEntityTypes")] + pub session_entity_types: Option>, +} + +impl Part for QueryParameters {} + + +/// 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*). +/// +/// * [agent restore projects](struct.ProjectAgentRestoreCall.html) (response) +/// * [agent intents batch delete projects](struct.ProjectAgentIntentBatchDeleteCall.html) (response) +/// * [agent entity types batch delete projects](struct.ProjectAgentEntityTypeBatchDeleteCall.html) (response) +/// * [agent train projects](struct.ProjectAgentTrainCall.html) (response) +/// * [agent export projects](struct.ProjectAgentExportCall.html) (response) +/// * [agent entity types batch update projects](struct.ProjectAgentEntityTypeBatchUpdateCall.html) (response) +/// * [agent import projects](struct.ProjectAgentImportCall.html) (response) +/// * [agent intents batch update projects](struct.ProjectAgentIntentBatchUpdateCall.html) (response) +/// * [agent entity types entities batch update projects](struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html) (response) +/// * [agent entity types entities batch delete projects](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html) (response) +/// * [operations get projects](struct.ProjectOperationGetCall.html) (response) +/// * [agent entity types entities batch create projects](struct.ProjectAgentEntityTypeEntityBatchCreateCall.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 {} + + +/// This message is a wrapper around a collection of intents. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentBatch { + /// A collection of intents. + pub intents: Option>, +} + +impl Part for IntentBatch {} + + +/// Optional. Contains information about a button. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageCardButton { + /// Optional. The text to show on the button. + pub text: Option, + /// Optional. The text to send back to the Dialogflow API or a URI to + /// open. + pub postback: Option, +} + +impl Part for IntentMessageCardButton {} + + +/// Represents the result of conversational query or event processing. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct QueryResult { + /// The language that was triggered during intent detection. + /// See [Language Support](https://dialogflow.com/docs/reference/language) + /// for a list of the currently supported language codes. + #[serde(rename="languageCode")] + pub language_code: Option, + /// The text to be pronounced to the user or shown on the screen. + #[serde(rename="fulfillmentText")] + pub fulfillment_text: Option, + /// This field is set to: + /// - `false` if the matched intent has required parameters and not all of + /// the required parameter values have been collected. + /// - `true` if all required parameter values have been collected, or if the + /// matched intent doesn't contain any required parameters. + #[serde(rename="allRequiredParamsPresent")] + pub all_required_params_present: Option, + /// The collection of extracted parameters. + pub parameters: Option>, + /// The collection of rich messages to present to the user. + #[serde(rename="fulfillmentMessages")] + pub fulfillment_messages: Option>, + /// The confidence estimate between 0.0 and 1.0. A higher number + /// indicates an estimated greater likelihood that the recognized words are + /// correct. The default of 0.0 is a sentinel value indicating that confidence + /// was not set. This field is populated if natural speech audio was provided + /// as input. + #[serde(rename="speechRecognitionConfidence")] + pub speech_recognition_confidence: Option, + /// The intent detection confidence. Values range from 0.0 + /// (completely uncertain) to 1.0 (completely certain). + #[serde(rename="intentDetectionConfidence")] + pub intent_detection_confidence: Option, + /// The original conversational query text: + /// - If natural language text was provided as input, `query_text` contains + /// a copy of the input. + /// - If natural language speech audio was provided as input, `query_text` + /// contains the speech recognition result. If speech recognizer produced + /// multiple alternatives, a particular one is picked. + /// - If an event was provided as input, `query_text` is not set. + #[serde(rename="queryText")] + pub query_text: Option, + /// The intent that matched the conversational query. Some, not + /// all fields are filled in this message, including but not limited to: + /// `name`, `display_name` and `webhook_state`. + pub intent: Option, + /// The free-form diagnostic info. For example, this field + /// could contain webhook call latency. + #[serde(rename="diagnosticInfo")] + pub diagnostic_info: Option>, + /// The action name from the matched intent. + pub action: Option, + /// The collection of output contexts. If applicable, + /// `output_contexts.parameters` contains entries with name + /// `.original` containing the original parameter values + /// before the query. + #[serde(rename="outputContexts")] + pub output_contexts: Option>, + /// If the query was fulfilled by a webhook call, this field is set to the + /// value of the `source` field returned in the webhook response. + #[serde(rename="webhookSource")] + pub webhook_source: Option, + /// If the query was fulfilled by a webhook call, this field is set to the + /// value of the `payload` field returned in the webhook response. + #[serde(rename="webhookPayload")] + pub webhook_payload: Option>, +} + +impl Part for QueryResult {} + + +/// The suggestion chip message that the user can tap to quickly post a reply +/// to the conversation. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageSuggestion { + /// Required. The text shown the in the suggestion chip. + pub title: Option, +} + +impl Part for IntentMessageSuggestion {} + + +/// The request message for EntityTypes.BatchDeleteEntities. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent entity types entities batch delete projects](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchDeleteEntitiesRequest { + /// Optional. The language of entity synonyms defined in `entities`. If not + /// specified, the agent's default language is used. + /// [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Required. The canonical `values` of the entities to delete. Note that + /// these are not fully-qualified names, i.e. they don't start with + /// `projects/`. + #[serde(rename="entityValues")] + pub entity_values: Option>, +} + +impl RequestValue for BatchDeleteEntitiesRequest {} + + +/// Additional info about the select item for when it is triggered in a +/// dialog. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageSelectItemInfo { + /// Optional. A list of synonyms that can also be used to trigger this + /// item in dialog. + pub synonyms: Option>, + /// Required. A unique key that will be sent back to the agent if this + /// response is given. + pub key: Option, +} + +impl Part for IntentMessageSelectItemInfo {} + + +/// The collection of simple response candidates. +/// This message in `QueryResult.fulfillment_messages` and +/// `WebhookResponse.fulfillment_messages` should contain only one +/// `SimpleResponse`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageSimpleResponses { + /// Required. The list of simple responses. + #[serde(rename="simpleResponses")] + pub simple_responses: Option>, +} + +impl Part for IntentMessageSimpleResponses {} + + +/// The basic card message. Useful for displaying 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 IntentMessageBasicCard { + /// Optional. The collection of card buttons. + pub buttons: Option>, + /// Required, unless image is present. The body text of the card. + #[serde(rename="formattedText")] + pub formatted_text: Option, + /// Optional. The image for the card. + pub image: Option, + /// Optional. The subtitle of the card. + pub subtitle: Option, + /// Optional. The title of the card. + pub title: Option, +} + +impl Part for IntentMessageBasicCard {} + + +/// The request message for Intents.BatchUpdateIntents. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent intents batch update projects](struct.ProjectAgentIntentBatchUpdateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchUpdateIntentsRequest { + /// Optional. The language of training phrases, parameters and rich messages + /// defined in `intents`. If not specified, the agent's default language is + /// used. [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Warning: Importing intents from a URI is not implemented yet. + /// This feature is coming soon. + /// The URI to a Google Cloud Storage file containing intents to update or + /// create. The file format can either be a serialized proto (of IntentBatch + /// type) or JSON object. Note: The URI must start with "gs://". + #[serde(rename="intentBatchUri")] + pub intent_batch_uri: Option, + /// The collection of intents to update or create. + #[serde(rename="intentBatchInline")] + pub intent_batch_inline: Option, + /// Optional. The mask to control which fields get updated. + #[serde(rename="updateMask")] + pub update_mask: Option, + /// Optional. The resource view to apply to the returned intent. + #[serde(rename="intentView")] + pub intent_view: Option, +} + +impl RequestValue for BatchUpdateIntentsRequest {} + + +/// Represents a single followup intent in the chain. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentFollowupIntentInfo { + /// The unique identifier of the followup intent. + /// Format: `projects//agent/intents/`. + #[serde(rename="followupIntentName")] + pub followup_intent_name: Option, + /// The unique identifier of the followup intent parent. + /// Format: `projects//agent/intents/`. + #[serde(rename="parentFollowupIntentName")] + pub parent_followup_intent_name: Option, +} + +impl Part for IntentFollowupIntentInfo {} + + +/// The card response message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageCard { + /// Optional. The collection of card buttons. + pub buttons: Option>, + /// Optional. The title of the card. + pub title: Option, + /// Optional. The subtitle of the card. + pub subtitle: Option, + /// Optional. The public URI to an image file for the card. + #[serde(rename="imageUri")] + pub image_uri: Option, +} + +impl Part for IntentMessageCard {} + + +/// The response message for SessionEntityTypes.ListSessionEntityTypes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent sessions entity types list projects](struct.ProjectAgentSessionEntityTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListSessionEntityTypesResponse { + /// 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, + /// The list of session entity types. There will be a maximum number of items + /// returned based on the page_size field in the request. + #[serde(rename="sessionEntityTypes")] + pub session_entity_types: Option>, +} + +impl ResponseResult for ListSessionEntityTypesResponse {} + + +/// Represents an entity type. +/// Entity types serve as a tool for extracting parameter values from natural +/// language queries. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent entity types get projects](struct.ProjectAgentEntityTypeGetCall.html) (response) +/// * [agent entity types patch projects](struct.ProjectAgentEntityTypePatchCall.html) (request|response) +/// * [agent entity types create projects](struct.ProjectAgentEntityTypeCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EntityType { + /// Optional. Indicates whether the entity type can be automatically + /// expanded. + #[serde(rename="autoExpansionMode")] + pub auto_expansion_mode: Option, + /// Optional. The collection of entities associated with the entity type. + pub entities: Option>, + /// Required. Indicates the kind of entity type. + pub kind: Option, + /// Required. The name of the entity. + #[serde(rename="displayName")] + pub display_name: Option, + /// Required for all methods except `create` (`create` populates the name + /// automatically. + /// The unique identifier of the entity type. Format: + /// `projects//agent/entityTypes/`. + pub name: Option, +} + +impl RequestValue for EntityType {} +impl ResponseResult for EntityType {} + + +/// An item in the list. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageListSelectItem { + /// Required. Additional information about this option. + pub info: Option, + /// Optional. The image to display. + pub image: Option, + /// Optional. The main text describing the item. + pub description: Option, + /// Required. The title of the list item. + pub title: Option, +} + +impl Part for IntentMessageListSelectItem {} + + +/// The request message for Agents.ImportAgent. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent import projects](struct.ProjectAgentImportCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImportAgentRequest { + /// Warning: Importing agents from a URI is not implemented yet. + /// This feature is coming soon. + /// The URI to a Google Cloud Storage file containing the agent to import. + /// Note: The URI must start with "gs://". + #[serde(rename="agentUri")] + pub agent_uri: Option, + /// The agent to import. + #[serde(rename="agentContent")] + pub agent_content: Option, +} + +impl RequestValue for ImportAgentRequest {} + + +/// This message is a wrapper around a collection of entity types. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EntityTypeBatch { + /// A collection of entity types. + #[serde(rename="entityTypes")] + pub entity_types: Option>, +} + +impl Part for EntityTypeBatch {} + + +/// The message returned from the DetectIntent 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*). +/// +/// * [agent sessions detect intent projects](struct.ProjectAgentSessionDetectIntentCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DetectIntentResponse { + /// Specifies the status of the webhook request. `webhook_status` + /// is never populated in webhook requests. + #[serde(rename="webhookStatus")] + pub webhook_status: Option, + /// The results of the conversational query or event processing. + #[serde(rename="queryResult")] + pub query_result: Option, + /// The unique identifier of the response. It can be used to + /// locate a response in the training example set or for reporting issues. + #[serde(rename="responseId")] + pub response_id: Option, +} + +impl ResponseResult for DetectIntentResponse {} + + +/// The request message for Intents.BatchDeleteIntents. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent intents batch delete projects](struct.ProjectAgentIntentBatchDeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchDeleteIntentsRequest { + /// Required. The collection of intents to delete. Only intent `name` must be + /// filled in. + pub intents: Option>, +} + +impl RequestValue for BatchDeleteIntentsRequest {} + + +/// An item in the carousel. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageCarouselSelectItem { + /// Required. Additional info about the option item. + pub info: Option, + /// Optional. The image to display. + pub image: Option, + /// Optional. The body text of the card. + pub description: Option, + /// Required. Title of the carousel item. + pub title: Option, +} + +impl Part for IntentMessageCarouselSelectItem {} + + +/// The response message for Agents.SearchAgents. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent search projects](struct.ProjectAgentSearchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SearchAgentsResponse { + /// 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, + /// The list of agents. There will be a maximum number of items returned based + /// on the page_size field in the request. + pub agents: Option>, +} + +impl ResponseResult for SearchAgentsResponse {} + + +/// The request message for Agents.ExportAgent. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent export projects](struct.ProjectAgentExportCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExportAgentRequest { + /// Warning: Exporting agents to a URI is not implemented yet. + /// This feature is coming soon. + /// Optional. The Google Cloud Storage URI to export the agent to. + /// Note: The URI must start with + /// "gs://". If left unspecified, the serialized agent is returned inline. + #[serde(rename="agentUri")] + pub agent_uri: Option, +} + +impl RequestValue for ExportAgentRequest {} + + +/// The response message for Contexts.ListContexts. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent sessions contexts list projects](struct.ProjectAgentSessionContextListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListContextsResponse { + /// 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, + /// The list of contexts. There will be a maximum number of items + /// returned based on the page_size field in the request. + pub contexts: Option>, +} + +impl ResponseResult for ListContextsResponse {} + + +/// The response message for Intents.ListIntents. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent intents list projects](struct.ProjectAgentIntentListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListIntentsResponse { + /// 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, + /// The list of agent intents. There will be a maximum number of items + /// returned based on the page_size field in the request. + pub intents: Option>, +} + +impl ResponseResult for ListIntentsResponse {} + + +/// The quick replies response message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageQuickReplies { + /// Optional. The collection of quick replies. + #[serde(rename="quickReplies")] + pub quick_replies: Option>, + /// Optional. The title of the collection of quick replies. + pub title: Option, +} + +impl Part for IntentMessageQuickReplies {} + + +/// Optional. Represents 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 EntityTypeEntity { + /// Required. A collection of synonyms. For `KIND_LIST` entity types this + /// must contain exactly one synonym equal to `value`. + pub synonyms: Option>, + /// Required. + /// For `KIND_MAP` entity types: + /// A canonical name to be used in place of synonyms. + /// For `KIND_LIST` entity types: + /// A string that can contain references to other entity types (with or + /// without aliases). + pub value: Option, +} + +impl Part for EntityTypeEntity {} + + +/// 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. +/// +/// 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 {} + + +/// The request message for Agents.RestoreAgent. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent restore projects](struct.ProjectAgentRestoreCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RestoreAgentRequest { + /// Warning: Restoring agents from a URI is not implemented yet. + /// This feature is coming soon. + /// The URI to a Google Cloud Storage file containing the agent to restore. + /// Note: The URI must start with "gs://". + #[serde(rename="agentUri")] + pub agent_uri: Option, + /// The agent to restore. + #[serde(rename="agentContent")] + pub agent_content: Option, +} + +impl RequestValue for RestoreAgentRequest {} + + +/// Events allow for matching intents by event name instead of the natural +/// language input. For instance, input `` can trigger a personalized welcome response. +/// The parameter `name` may be used by the agent in the response: +/// `“Hello #welcome_event.name! What can I do for you 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 EventInput { + /// Required. The language of this query. See [Language + /// Support](https://dialogflow.com/docs/languages) for a list of the + /// currently supported language codes. Note that queries in the same session + /// do not necessarily need to specify the same language. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Required. The unique identifier of the event. + pub name: Option, + /// Optional. The collection of parameters associated with the event. + pub parameters: Option>, +} + +impl Part for EventInput {} + + +/// The collection of suggestions. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageSuggestions { + /// Required. The list of suggested replies. + pub suggestions: Option>, +} + +impl Part for IntentMessageSuggestions {} + + +/// Instructs the speech recognizer how to process the audio content. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InputAudioConfig { + /// Optional. The collection of phrase hints which are used to boost accuracy + /// of speech recognition. + /// Refer to [Cloud Speech API documentation](/speech/docs/basics#phrase-hints) + /// for more details. + #[serde(rename="phraseHints")] + pub phrase_hints: Option>, + /// Required. The language of the supplied audio. Dialogflow does not do + /// translations. See [Language + /// Support](https://dialogflow.com/docs/languages) for a list of the + /// currently supported language codes. Note that queries in the same session + /// do not necessarily need to specify the same language. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Required. Sample rate (in Hertz) of the audio content sent in the query. + /// Refer to [Cloud Speech API documentation](/speech/docs/basics) for more + /// details. + #[serde(rename="sampleRateHertz")] + pub sample_rate_hertz: Option, + /// Required. Audio encoding of the audio content to process. + #[serde(rename="audioEncoding")] + pub audio_encoding: Option, +} + +impl Part for InputAudioConfig {} + + +/// The card for presenting a carousel of options to select from. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageCarouselSelect { + /// Required. Carousel items. + pub items: Option>, +} + +impl Part for IntentMessageCarouselSelect {} + + +/// The text response message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntentMessageText { + /// Optional. The collection of the agent's responses. + pub text: Option>, +} + +impl Part for IntentMessageText {} + + +/// Represents intent 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 IntentParameter { + /// Optional. Indicates whether the parameter is required. That is, + /// whether the intent cannot be completed without collecting the parameter + /// value. + pub mandatory: Option, + /// The unique identifier of this parameter. + pub name: Option, + /// Optional. The default value to use when the `value` yields an empty + /// result. + /// Default values can be extracted from contexts by using the following + /// syntax: `#context_name.parameter_name`. + #[serde(rename="defaultValue")] + pub default_value: Option, + /// Optional. The name of the entity type, prefixed with `@`, that + /// describes values of the parameter. If the parameter is + /// required, this must be provided. + #[serde(rename="entityTypeDisplayName")] + pub entity_type_display_name: Option, + /// Optional. The definition of the parameter value. It can be: + /// - a constant string, + /// - a parameter value defined as `$parameter_name`, + /// - an original parameter value defined as `$parameter_name.original`, + /// - a parameter value from some context defined as + /// `#context_name.parameter_name`. + pub value: Option, + /// Optional. The collection of prompts that the agent can present to the + /// user in order to collect value for the parameter. + pub prompts: Option>, + /// Optional. Indicates whether the parameter represents a list of values. + #[serde(rename="isList")] + pub is_list: Option, + /// Required. The name of the parameter. + #[serde(rename="displayName")] + pub display_name: Option, +} + +impl Part for IntentParameter {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `Dialogflow` 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_dialogflow2_beta1 as dialogflow2_beta1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dialogflow2_beta1::Dialogflow; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dialogflow::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 `agent_entity_types_batch_delete(...)`, `agent_entity_types_batch_update(...)`, `agent_entity_types_create(...)`, `agent_entity_types_delete(...)`, `agent_entity_types_entities_batch_create(...)`, `agent_entity_types_entities_batch_delete(...)`, `agent_entity_types_entities_batch_update(...)`, `agent_entity_types_get(...)`, `agent_entity_types_list(...)`, `agent_entity_types_patch(...)`, `agent_export(...)`, `agent_import(...)`, `agent_intents_batch_delete(...)`, `agent_intents_batch_update(...)`, `agent_intents_create(...)`, `agent_intents_delete(...)`, `agent_intents_get(...)`, `agent_intents_list(...)`, `agent_intents_patch(...)`, `agent_restore(...)`, `agent_search(...)`, `agent_sessions_contexts_create(...)`, `agent_sessions_contexts_delete(...)`, `agent_sessions_contexts_get(...)`, `agent_sessions_contexts_list(...)`, `agent_sessions_contexts_patch(...)`, `agent_sessions_delete_contexts(...)`, `agent_sessions_detect_intent(...)`, `agent_sessions_entity_types_create(...)`, `agent_sessions_entity_types_delete(...)`, `agent_sessions_entity_types_get(...)`, `agent_sessions_entity_types_list(...)`, `agent_sessions_entity_types_patch(...)`, `agent_train(...)`, `get_agent(...)` and `operations_get(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, +} + +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 all active contexts in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/`. + pub fn agent_sessions_delete_contexts(&self, parent: &str) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { + ProjectAgentSessionDeleteContextCall { + 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: + /// + /// Updates the specified session entity type. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The unique identifier of this session entity type. Format: + /// `projects//agent/sessions//entityTypes/`. + pub fn agent_sessions_entity_types_patch(&self, request: SessionEntityType, name: &str) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { + ProjectAgentSessionEntityTypePatchCall { + 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: + /// + /// Updates/Creates multiple entity types in the specified agent. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the agent to update or create entity types in. + /// Format: `projects//agent`. + pub fn agent_entity_types_batch_update(&self, request: BatchUpdateEntityTypesRequest, parent: &str) -> ProjectAgentEntityTypeBatchUpdateCall<'a, C, A> { + ProjectAgentEntityTypeBatchUpdateCall { + 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: + /// + /// Trains the specified agent. + /// + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project that the agent to train is associated with. + /// Format: `projects/`. + pub fn agent_train(&self, request: TrainAgentRequest, parent: &str) -> ProjectAgentTrainCall<'a, C, A> { + ProjectAgentTrainCall { + 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/Creates multiple intents in the specified agent. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the agent to update or create intents in. + /// Format: `projects//agent`. + pub fn agent_intents_batch_update(&self, request: BatchUpdateIntentsRequest, parent: &str) -> ProjectAgentIntentBatchUpdateCall<'a, C, A> { + ProjectAgentIntentBatchUpdateCall { + 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 multiple new entities in the specified entity type (extends the + /// existing collection of entries). + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the entity type to create entities in. Format: + /// `projects//agent/entityTypes/`. + pub fn agent_entity_types_entities_batch_create(&self, request: BatchCreateEntitiesRequest, parent: &str) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + ProjectAgentEntityTypeEntityBatchCreateCall { + 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: + /// + /// Restores the specified agent from a ZIP file. + /// + /// Replaces the current agent version with a new one. All the intents and + /// entity types in the older version are deleted. + /// + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project that the agent to restore is associated with. + /// Format: `projects/`. + pub fn agent_restore(&self, request: RestoreAgentRequest, parent: &str) -> ProjectAgentRestoreCall<'a, C, A> { + ProjectAgentRestoreCall { + 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: + /// + /// Processes a natural language query and returns structured, actionable data + /// as a result. This method is not idempotent, because it may cause contexts + /// and session entity types to be updated, which in turn might affect + /// results of future queries. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`. + /// It's up to the API caller to choose an appropriate session ID. It can be + /// a random number or some type of user identifier (preferably hashed). + /// The length of the session ID must not exceed 36 bytes. + pub fn agent_sessions_detect_intent(&self, request: DetectIntentRequest, session: &str) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { + ProjectAgentSessionDetectIntentCall { + 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: + /// + /// Deletes entity types in the specified agent. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. + pub fn agent_entity_types_batch_delete(&self, request: BatchDeleteEntityTypesRequest, parent: &str) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> { + ProjectAgentEntityTypeBatchDeleteCall { + 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: + /// + /// Imports the specified agent from a ZIP file. + /// + /// Uploads new intents and entity types without deleting the existing ones. + /// Intents and entity types with the same name are replaced with the new + /// versions from ImportAgentRequest. + /// + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project that the agent to import is associated with. + /// Format: `projects/`. + pub fn agent_import(&self, request: ImportAgentRequest, parent: &str) -> ProjectAgentImportCall<'a, C, A> { + ProjectAgentImportCall { + 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 the list of all intents in the specified agent. + /// + /// # Arguments + /// + /// * `parent` - Required. The agent to list all intents from. + /// Format: `projects//agent`. + pub fn agent_intents_list(&self, parent: &str) -> ProjectAgentIntentListCall<'a, C, A> { + ProjectAgentIntentListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _language_code: Default::default(), + _intent_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates entities in the specified entity type (replaces the existing + /// collection of entries). + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the entity type to update the entities in. Format: + /// `projects//agent/entityTypes/`. + pub fn agent_entity_types_entities_batch_update(&self, request: BatchUpdateEntitiesRequest, parent: &str) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { + ProjectAgentEntityTypeEntityBatchUpdateCall { + 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 session entity type. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/`. + pub fn agent_sessions_entity_types_create(&self, request: SessionEntityType, parent: &str) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { + ProjectAgentSessionEntityTypeCreateCall { + 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 context. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The session to create a context for. + /// Format: `projects//agent/sessions/`. + pub fn agent_sessions_contexts_create(&self, request: Context, parent: &str) -> ProjectAgentSessionContextCreateCall<'a, C, A> { + ProjectAgentSessionContextCreateCall { + 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 the list of all session entity types in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The session to list all session entity types from. + /// Format: `projects//agent/sessions/`. + pub fn agent_sessions_entity_types_list(&self, parent: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + ProjectAgentSessionEntityTypeListCall { + 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 the list of all contexts in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The session to list all contexts from. + /// Format: `projects//agent/sessions/`. + pub fn agent_sessions_contexts_list(&self, parent: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { + ProjectAgentSessionContextListCall { + 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 the list of all entity types in the specified agent. + /// + /// # Arguments + /// + /// * `parent` - Required. The agent to list all entity types from. + /// Format: `projects//agent`. + pub fn agent_entity_types_list(&self, parent: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { + ProjectAgentEntityTypeListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes intents in the specified agent. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. + pub fn agent_intents_batch_delete(&self, request: BatchDeleteIntentsRequest, parent: &str) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> { + ProjectAgentIntentBatchDeleteCall { + 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 specified entity type. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required for all methods except `create` (`create` populates the name + /// automatically. + /// The unique identifier of the entity type. Format: + /// `projects//agent/entityTypes/`. + pub fn agent_entity_types_patch(&self, request: EntityType, name: &str) -> ProjectAgentEntityTypePatchCall<'a, C, A> { + ProjectAgentEntityTypePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified entity type. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the entity type to delete. + /// Format: `projects//agent/entityTypes/`. + pub fn agent_entity_types_delete(&self, name: &str) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> { + ProjectAgentEntityTypeDeleteCall { + 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 specified session entity type. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the session entity type. Format: + /// `projects//agent/sessions//entityTypes/`. + pub fn agent_sessions_entity_types_get(&self, name: &str) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> { + ProjectAgentSessionEntityTypeGetCall { + 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 entity type in the specified agent. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The agent to create a entity type for. + /// Format: `projects//agent`. + pub fn agent_entity_types_create(&self, request: EntityType, parent: &str) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { + ProjectAgentEntityTypeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.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 the specified entity type. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the entity type. + /// Format: `projects//agent/entityTypes/`. + pub fn agent_entity_types_get(&self, name: &str) -> ProjectAgentEntityTypeGetCall<'a, C, A> { + ProjectAgentEntityTypeGetCall { + hub: self.hub, + _name: name.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: + /// + /// Deletes entities in the specified entity type. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the entity type to delete entries for. Format: + /// `projects//agent/entityTypes/`. + pub fn agent_entity_types_entities_batch_delete(&self, request: BatchDeleteEntitiesRequest, parent: &str) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { + ProjectAgentEntityTypeEntityBatchDeleteCall { + 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 specified context. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The unique identifier of the context. Format: + /// `projects//agent/sessions//contexts/`. + /// Note: The Context ID is always converted to lowercase. + pub fn agent_sessions_contexts_patch(&self, request: Context, name: &str) -> ProjectAgentSessionContextPatchCall<'a, C, A> { + ProjectAgentSessionContextPatchCall { + 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: + /// + /// Retrieves the specified context. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/`. + pub fn agent_sessions_contexts_get(&self, name: &str) -> ProjectAgentSessionContextGetCall<'a, C, A> { + ProjectAgentSessionContextGetCall { + 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 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: + /// + /// Retrieves the specified intent. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the intent. + /// Format: `projects//agent/intents/`. + pub fn agent_intents_get(&self, name: &str) -> ProjectAgentIntentGetCall<'a, C, A> { + ProjectAgentIntentGetCall { + hub: self.hub, + _name: name.to_string(), + _language_code: Default::default(), + _intent_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified agent. + /// + /// # Arguments + /// + /// * `parent` - Required. The project that the agent to fetch is associated with. + /// Format: `projects/`. + pub fn get_agent(&self, parent: &str) -> ProjectGetAgentCall<'a, C, A> { + ProjectGetAgentCall { + 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: + /// + /// Deletes the specified context. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/`. + pub fn agent_sessions_contexts_delete(&self, name: &str) -> ProjectAgentSessionContextDeleteCall<'a, C, A> { + ProjectAgentSessionContextDeleteCall { + 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: + /// + /// Exports the specified agent to a ZIP file. + /// + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project that the agent to export is associated with. + /// Format: `projects/`. + pub fn agent_export(&self, request: ExportAgentRequest, parent: &str) -> ProjectAgentExportCall<'a, C, A> { + ProjectAgentExportCall { + 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 specified intent. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required for all methods except `create` (`create` populates the name + /// automatically. + /// The unique identifier of this intent. + /// Format: `projects//agent/intents/`. + pub fn agent_intents_patch(&self, request: Intent, name: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + ProjectAgentIntentPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _language_code: Default::default(), + _intent_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified session entity type. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/`. + pub fn agent_sessions_entity_types_delete(&self, name: &str) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> { + ProjectAgentSessionEntityTypeDeleteCall { + 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 list of agents. + /// + /// Since there is at most one conversational agent per project, this method is + /// useful primarily for listing all agents across projects the caller has + /// access to. One can achieve that with a wildcard project collection id "-". + /// Refer to [List + /// Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + /// + /// # Arguments + /// + /// * `parent` - Required. The project to list agents from. + /// Format: `projects/`. + pub fn agent_search(&self, parent: &str) -> ProjectAgentSearchCall<'a, C, A> { + ProjectAgentSearchCall { + 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 the specified intent. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the intent to delete. + /// Format: `projects//agent/intents/`. + pub fn agent_intents_delete(&self, name: &str) -> ProjectAgentIntentDeleteCall<'a, C, A> { + ProjectAgentIntentDeleteCall { + 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 intent in the specified agent. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The agent to create a intent for. + /// Format: `projects//agent`. + pub fn agent_intents_create(&self, request: Intent, parent: &str) -> ProjectAgentIntentCreateCall<'a, C, A> { + ProjectAgentIntentCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _language_code: Default::default(), + _intent_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Deletes all active contexts in the specified session. +/// +/// A builder for the *agent.sessions.deleteContexts* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_delete_contexts("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionDeleteContextCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionDeleteContextCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, 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: "dialogflow.projects.agent.sessions.deleteContexts", + http_method: hyper::method::Method::Delete }); + 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() + "v2beta1/{+parent}/contexts"; + 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::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 all contexts from. Format: + /// `projects//agent/sessions/`. + /// + /// 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) -> ProjectAgentSessionDeleteContextCall<'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) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionDeleteContextCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionDeleteContextCall<'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 session entity type. +/// +/// A builder for the *agent.sessions.entityTypes.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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::SessionEntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SessionEntityType::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_entity_types_patch(req, "name") +/// .update_mask("dolores") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionEntityTypePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: SessionEntityType, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionEntityTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.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() + "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)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: SessionEntityType) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The unique identifier of this session entity type. Format: + /// `projects//agent/sessions//entityTypes/`. + /// + /// 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) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentSessionEntityTypePatchCall<'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) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypePatchCall<'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/Creates multiple entity types in the specified agent. +/// +/// Operation +/// +/// A builder for the *agent.entityTypes.batchUpdate* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::BatchUpdateEntityTypesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = BatchUpdateEntityTypesRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_entity_types_batch_update(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeBatchUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: BatchUpdateEntityTypesRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeBatchUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeBatchUpdateCall<'a, C, 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: "dialogflow.projects.agent.entityTypes.batchUpdate", + 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() + "v2beta1/{+parent}/entityTypes:batchUpdate"; + 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: BatchUpdateEntityTypesRequest) -> ProjectAgentEntityTypeBatchUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the agent to update or create entity types in. + /// Format: `projects//agent`. + /// + /// 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) -> ProjectAgentEntityTypeBatchUpdateCall<'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) -> ProjectAgentEntityTypeBatchUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentEntityTypeBatchUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeBatchUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Trains the specified agent. +/// +/// +/// Operation +/// +/// A builder for the *agent.train* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::TrainAgentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = TrainAgentRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_train(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentTrainCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: TrainAgentRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentTrainCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentTrainCall<'a, C, 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: "dialogflow.projects.agent.train", + 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() + "v2beta1/{+parent}/agent:train"; + 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: TrainAgentRequest) -> ProjectAgentTrainCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project that the agent to train is associated with. + /// Format: `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) -> ProjectAgentTrainCall<'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) -> ProjectAgentTrainCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentTrainCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentTrainCall<'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/Creates multiple intents in the specified agent. +/// +/// Operation +/// +/// A builder for the *agent.intents.batchUpdate* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::BatchUpdateIntentsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = BatchUpdateIntentsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_intents_batch_update(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentIntentBatchUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: BatchUpdateIntentsRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentIntentBatchUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentIntentBatchUpdateCall<'a, C, 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: "dialogflow.projects.agent.intents.batchUpdate", + 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() + "v2beta1/{+parent}/intents:batchUpdate"; + 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: BatchUpdateIntentsRequest) -> ProjectAgentIntentBatchUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the agent to update or create intents in. + /// Format: `projects//agent`. + /// + /// 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) -> ProjectAgentIntentBatchUpdateCall<'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) -> ProjectAgentIntentBatchUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentIntentBatchUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentBatchUpdateCall<'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 multiple new entities in the specified entity type (extends the +/// existing collection of entries). +/// +/// Operation +/// +/// A builder for the *agent.entityTypes.entities.batchCreate* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::BatchCreateEntitiesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = BatchCreateEntitiesRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_entity_types_entities_batch_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: BatchCreateEntitiesRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, 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: "dialogflow.projects.agent.entityTypes.entities.batchCreate", + 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() + "v2beta1/{+parent}/entities:batchCreate"; + 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: BatchCreateEntitiesRequest) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the entity type to create entities in. Format: + /// `projects//agent/entityTypes/`. + /// + /// 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) -> ProjectAgentEntityTypeEntityBatchCreateCall<'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) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Restores the specified agent from a ZIP file. +/// +/// Replaces the current agent version with a new one. All the intents and +/// entity types in the older version are deleted. +/// +/// +/// Operation +/// +/// A builder for the *agent.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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::RestoreAgentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = RestoreAgentRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_restore(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentRestoreCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: RestoreAgentRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentRestoreCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentRestoreCall<'a, C, 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: "dialogflow.projects.agent.restore", + 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() + "v2beta1/{+parent}/agent:restore"; + 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: RestoreAgentRequest) -> ProjectAgentRestoreCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project that the agent to restore is associated with. + /// Format: `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) -> ProjectAgentRestoreCall<'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) -> ProjectAgentRestoreCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentRestoreCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentRestoreCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Processes a natural language query and returns structured, actionable data +/// as a result. This method is not idempotent, because it may cause contexts +/// and session entity types to be updated, which in turn might affect +/// results of future queries. +/// +/// A builder for the *agent.sessions.detectIntent* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::DetectIntentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = DetectIntentRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_detect_intent(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionDetectIntentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: DetectIntentRequest, + _session: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionDetectIntentCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionDetectIntentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DetectIntentResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.detectIntent", + 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() + "v2beta1/{+session}:detectIntent"; + 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: DetectIntentRequest) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`. + /// It's up to the API caller to choose an appropriate session ID. It can be + /// a random number or some type of user identifier (preferably hashed). + /// The length of the session ID must not exceed 36 bytes. + /// + /// 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) -> ProjectAgentSessionDetectIntentCall<'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) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionDetectIntentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionDetectIntentCall<'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 entity types in the specified agent. +/// +/// Operation +/// +/// A builder for the *agent.entityTypes.batchDelete* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::BatchDeleteEntityTypesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = BatchDeleteEntityTypesRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_entity_types_batch_delete(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: BatchDeleteEntityTypesRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeBatchDeleteCall<'a, C, 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: "dialogflow.projects.agent.entityTypes.batchDelete", + 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() + "v2beta1/{+parent}/entityTypes:batchDelete"; + 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: BatchDeleteEntityTypesRequest) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. + /// + /// 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) -> ProjectAgentEntityTypeBatchDeleteCall<'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) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Imports the specified agent from a ZIP file. +/// +/// Uploads new intents and entity types without deleting the existing ones. +/// Intents and entity types with the same name are replaced with the new +/// versions from ImportAgentRequest. +/// +/// +/// Operation +/// +/// A builder for the *agent.import* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::ImportAgentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ImportAgentRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_import(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentImportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: ImportAgentRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentImportCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentImportCall<'a, C, 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: "dialogflow.projects.agent.import", + 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() + "v2beta1/{+parent}/agent:import"; + 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: ImportAgentRequest) -> ProjectAgentImportCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project that the agent to import is associated with. + /// Format: `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) -> ProjectAgentImportCall<'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) -> ProjectAgentImportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentImportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentImportCall<'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 all intents in the specified agent. +/// +/// A builder for the *agent.intents.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_intents_list("parent") +/// .page_token("dolores") +/// .page_size(-61) +/// .language_code("sadipscing") +/// .intent_view("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentIntentListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _language_code: Option, + _intent_view: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentIntentListCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentIntentListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListIntentsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.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._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._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "languageCode", "intentView"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) 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/{+parent}/intents"; + 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 agent to list all intents from. + /// Format: `projects//agent`. + /// + /// 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) -> ProjectAgentIntentListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentIntentListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentIntentListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Optional. The language to list training phrases, parameters and rich + /// messages for. If not specified, the agent's default language is used. + /// [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent before they can be used. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentListCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentListCall<'a, C, A> { + self._intent_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) -> ProjectAgentIntentListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentIntentListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentListCall<'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 entities in the specified entity type (replaces the existing +/// collection of entries). +/// +/// Operation +/// +/// A builder for the *agent.entityTypes.entities.batchUpdate* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::BatchUpdateEntitiesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = BatchUpdateEntitiesRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_entity_types_entities_batch_update(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: BatchUpdateEntitiesRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, 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: "dialogflow.projects.agent.entityTypes.entities.batchUpdate", + 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() + "v2beta1/{+parent}/entities:batchUpdate"; + 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: BatchUpdateEntitiesRequest) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the entity type to update the entities in. Format: + /// `projects//agent/entityTypes/`. + /// + /// 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) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'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) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'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 session entity type. +/// +/// A builder for the *agent.sessions.entityTypes.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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::SessionEntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SessionEntityType::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_entity_types_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionEntityTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: SessionEntityType, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.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() + "v2beta1/{+parent}/entityTypes"; + 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: SessionEntityType) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/`. + /// + /// 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) -> ProjectAgentSessionEntityTypeCreateCall<'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) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeCreateCall<'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 context. +/// +/// A builder for the *agent.sessions.contexts.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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::Context; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Context::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_contexts_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionContextCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: Context, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.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() + "v2beta1/{+parent}/contexts"; + 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: Context) -> ProjectAgentSessionContextCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session to create a context for. + /// Format: `projects//agent/sessions/`. + /// + /// 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) -> ProjectAgentSessionContextCreateCall<'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) -> ProjectAgentSessionContextCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionContextCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextCreateCall<'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 all session entity types in the specified session. +/// +/// A builder for the *agent.sessions.entityTypes.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_entity_types_list("parent") +/// .page_token("et") +/// .page_size(-17) +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionEntityTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeListCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListSessionEntityTypesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.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() + "v2beta1/{+parent}/entityTypes"; + 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 session to list all session entity types from. + /// Format: `projects//agent/sessions/`. + /// + /// 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) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentSessionEntityTypeListCall<'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) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeListCall<'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 all contexts in the specified session. +/// +/// A builder for the *agent.sessions.contexts.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_contexts_list("parent") +/// .page_token("ipsum") +/// .page_size(-5) +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionContextListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextListCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListContextsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.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() + "v2beta1/{+parent}/contexts"; + 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 session to list all contexts from. + /// Format: `projects//agent/sessions/`. + /// + /// 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) -> ProjectAgentSessionContextListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentSessionContextListCall<'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) -> ProjectAgentSessionContextListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionContextListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextListCall<'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 all entity types in the specified agent. +/// +/// A builder for the *agent.entityTypes.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_entity_types_list("parent") +/// .page_token("duo") +/// .page_size(-32) +/// .language_code("sea") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _language_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeListCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListEntityTypesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.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._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "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/{+parent}/entityTypes"; + 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 agent to list all entity types from. + /// Format: `projects//agent`. + /// + /// 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) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Optional. The language to list entity synonyms for. If not specified, + /// the agent's default language is used. + /// [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'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) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentEntityTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeListCall<'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 intents in the specified agent. +/// +/// Operation +/// +/// A builder for the *agent.intents.batchDelete* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::BatchDeleteIntentsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = BatchDeleteIntentsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_intents_batch_delete(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentIntentBatchDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: BatchDeleteIntentsRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentIntentBatchDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentIntentBatchDeleteCall<'a, C, 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: "dialogflow.projects.agent.intents.batchDelete", + 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() + "v2beta1/{+parent}/intents:batchDelete"; + 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: BatchDeleteIntentsRequest) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. + /// + /// 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) -> ProjectAgentIntentBatchDeleteCall<'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) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentBatchDeleteCall<'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 entity type. +/// +/// A builder for the *agent.entityTypes.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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::EntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = EntityType::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_entity_types_patch(req, "name") +/// .update_mask("erat") +/// .language_code("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: EntityType, + _name: String, + _update_mask: Option, + _language_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, EntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.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._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "name", "updateMask", "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/{+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: EntityType) -> ProjectAgentEntityTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required for all methods except `create` (`create` populates the name + /// automatically. + /// The unique identifier of the entity type. Format: + /// `projects//agent/entityTypes/`. + /// + /// 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) -> ProjectAgentEntityTypePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentEntityTypePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. The language of entity synonyms defined in `entity_type`. If not + /// specified, the agent's default language is used. + /// [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypePatchCall<'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) -> ProjectAgentEntityTypePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentEntityTypePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypePatchCall<'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 entity type. +/// +/// A builder for the *agent.entityTypes.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_entity_types_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeDeleteCall<'a, C, 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: "dialogflow.projects.agent.entityTypes.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) + } + } + } + } + + + /// Required. The name of the entity type to delete. + /// Format: `projects//agent/entityTypes/`. + /// + /// 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) -> ProjectAgentEntityTypeDeleteCall<'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) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeDeleteCall<'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 specified session entity type. +/// +/// A builder for the *agent.sessions.entityTypes.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_entity_types_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionEntityTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionEntityTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.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) + } + } + } + } + + + /// Required. The name of the session entity type. Format: + /// `projects//agent/sessions//entityTypes/`. + /// + /// 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) -> ProjectAgentSessionEntityTypeGetCall<'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) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeGetCall<'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 entity type in the specified agent. +/// +/// A builder for the *agent.entityTypes.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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::EntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = EntityType::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_entity_types_create(req, "parent") +/// .language_code("amet") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: EntityType, + _parent: String, + _language_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, EntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.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._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "parent", "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/{+parent}/entityTypes"; + 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: EntityType) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The agent to create a entity type for. + /// Format: `projects//agent`. + /// + /// 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) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The language of entity synonyms defined in `entity_type`. If not + /// specified, the agent's default language is used. + /// [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypeCreateCall<'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) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentEntityTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeCreateCall<'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 specified entity type. +/// +/// A builder for the *agent.entityTypes.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_entity_types_get("name") +/// .language_code("labore") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _language_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, EntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.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() + "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) + } + } + } + } + + + /// Required. The name of the entity type. + /// Format: `projects//agent/entityTypes/`. + /// + /// 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) -> ProjectAgentEntityTypeGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The language to retrieve entity synonyms for. If not specified, + /// the agent's default language is used. + /// [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypeGetCall<'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) -> ProjectAgentEntityTypeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentEntityTypeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeGetCall<'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 entities in the specified entity type. +/// +/// Operation +/// +/// A builder for the *agent.entityTypes.entities.batchDelete* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::BatchDeleteEntitiesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = BatchDeleteEntitiesRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_entity_types_entities_batch_delete(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: BatchDeleteEntitiesRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, 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: "dialogflow.projects.agent.entityTypes.entities.batchDelete", + 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() + "v2beta1/{+parent}/entities:batchDelete"; + 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: BatchDeleteEntitiesRequest) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the entity type to delete entries for. Format: + /// `projects//agent/entityTypes/`. + /// + /// 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) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'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) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'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 context. +/// +/// A builder for the *agent.sessions.contexts.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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::Context; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Context::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_contexts_patch(req, "name") +/// .update_mask("invidunt") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionContextPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: Context, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionContextPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.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() + "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)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: Context) -> ProjectAgentSessionContextPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The unique identifier of the context. Format: + /// `projects//agent/sessions//contexts/`. + /// Note: The Context ID is always converted to lowercase. + /// + /// 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) -> ProjectAgentSessionContextPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentSessionContextPatchCall<'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) -> ProjectAgentSessionContextPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionContextPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextPatchCall<'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 specified context. +/// +/// A builder for the *agent.sessions.contexts.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_contexts_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionContextGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.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) + } + } + } + } + + + /// Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/`. + /// + /// 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) -> ProjectAgentSessionContextGetCall<'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) -> ProjectAgentSessionContextGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionContextGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextGetCall<'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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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 Dialogflow, + _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, 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: "dialogflow.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() + "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) -> 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 + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> 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 + } +} + + +/// Retrieves the specified intent. +/// +/// A builder for the *agent.intents.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_intents_get("name") +/// .language_code("sea") +/// .intent_view("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentIntentGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _language_code: Option, + _intent_view: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentIntentGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Intent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.get", + 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._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "name", "languageCode", "intentView"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) 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) + } + } + } + } + + + /// Required. The name of the intent. + /// Format: `projects//agent/intents/`. + /// + /// 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) -> ProjectAgentIntentGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The language to retrieve training phrases, parameters and rich + /// messages for. If not specified, the agent's default language is used. + /// [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentGetCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentGetCall<'a, C, A> { + self._intent_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) -> ProjectAgentIntentGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentIntentGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentGetCall<'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 specified agent. +/// +/// A builder for the *getAgent* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_agent("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetAgentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetAgentCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Agent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.getAgent", + 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() + "v2beta1/{+parent}/agent"; + 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 project that the agent to fetch is associated with. + /// Format: `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) -> ProjectGetAgentCall<'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) -> ProjectGetAgentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectGetAgentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectGetAgentCall<'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 context. +/// +/// A builder for the *agent.sessions.contexts.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_contexts_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionContextDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionContextDeleteCall<'a, C, 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: "dialogflow.projects.agent.sessions.contexts.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) + } + } + } + } + + + /// Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/`. + /// + /// 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) -> ProjectAgentSessionContextDeleteCall<'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) -> ProjectAgentSessionContextDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionContextDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Exports the specified agent to a ZIP file. +/// +/// +/// Operation +/// +/// A builder for the *agent.export* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::ExportAgentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ExportAgentRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_export(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentExportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: ExportAgentRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentExportCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentExportCall<'a, C, 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: "dialogflow.projects.agent.export", + 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() + "v2beta1/{+parent}/agent:export"; + 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: ExportAgentRequest) -> ProjectAgentExportCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project that the agent to export is associated with. + /// Format: `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) -> ProjectAgentExportCall<'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) -> ProjectAgentExportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentExportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentExportCall<'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 intent. +/// +/// A builder for the *agent.intents.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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::Intent; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Intent::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_intents_patch(req, "name") +/// .update_mask("et") +/// .language_code("amet") +/// .intent_view("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentIntentPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: Intent, + _name: String, + _update_mask: Option, + _language_code: Option, + _intent_view: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentIntentPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Intent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + 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._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "name", "updateMask", "languageCode", "intentView"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) 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)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: Intent) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required for all methods except `create` (`create` populates the name + /// automatically. + /// The unique identifier of this intent. + /// Format: `projects//agent/intents/`. + /// + /// 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) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. The language of training phrases, parameters and rich messages + /// defined in `intent`. If not specified, the agent's default language is + /// used. [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._intent_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) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentIntentPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentPatchCall<'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 session entity type. +/// +/// A builder for the *agent.sessions.entityTypes.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_sessions_entity_types_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionEntityTypeDeleteCall<'a, C, 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: "dialogflow.projects.agent.sessions.entityTypes.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) + } + } + } + } + + + /// Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/`. + /// + /// 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) -> ProjectAgentSessionEntityTypeDeleteCall<'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) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeDeleteCall<'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 agents. +/// +/// Since there is at most one conversational agent per project, this method is +/// useful primarily for listing all agents across projects the caller has +/// access to. One can achieve that with a wildcard project collection id "-". +/// Refer to [List +/// Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). +/// +/// A builder for the *agent.search* 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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_search("parent") +/// .page_token("ea") +/// .page_size(-80) +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSearchCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SearchAgentsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.search", + 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() + "v2beta1/{+parent}/agent:search"; + 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 project to list agents from. + /// Format: `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) -> ProjectAgentSearchCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentSearchCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentSearchCall<'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) -> ProjectAgentSearchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentSearchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSearchCall<'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 intent. +/// +/// A builder for the *agent.intents.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_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_intents_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentIntentDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentIntentDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentIntentDeleteCall<'a, C, 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: "dialogflow.projects.agent.intents.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) + } + } + } + } + + + /// Required. The name of the intent to delete. + /// Format: `projects//agent/intents/`. + /// + /// 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) -> ProjectAgentIntentDeleteCall<'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) -> ProjectAgentIntentDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentIntentDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentDeleteCall<'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 intent in the specified agent. +/// +/// A builder for the *agent.intents.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_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::Intent; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Intent::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().agent_intents_create(req, "parent") +/// .language_code("dolor") +/// .intent_view("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentIntentCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: Intent, + _parent: String, + _language_code: Option, + _intent_view: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentIntentCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentIntentCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Intent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.create", + http_method: hyper::method::Method::Post }); + 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._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "parent", "languageCode", "intentView"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) 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/{+parent}/intents"; + 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: Intent) -> ProjectAgentIntentCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The agent to create a intent for. + /// Format: `projects//agent`. + /// + /// 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) -> ProjectAgentIntentCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The language of training phrases, parameters and rich messages + /// defined in `intent`. If not specified, the agent's default language is + /// used. [More than a dozen + /// languages](https://dialogflow.com/docs/reference/language) are supported. + /// Note: languages must be enabled in the agent, before they can be used. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentCreateCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentCreateCall<'a, C, A> { + self._intent_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) -> ProjectAgentIntentCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectAgentIntentCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentCreateCall<'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 index c786d1be7b..9bed4e664a 100644 --- a/gen/dlp2_beta1-cli/Cargo.toml +++ b/gen/dlp2_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dlp2_beta1-cli" -version = "1.0.6+20170918" +version = "1.0.6+20171205" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-dlp2_beta1] path = "../dlp2_beta1" -version = "1.0.6+20170918" +version = "1.0.6+20171205" diff --git a/gen/dlp2_beta1-cli/README.md b/gen/dlp2_beta1-cli/README.md index 49dabc3400..1bc9ca9ddf 100644 --- a/gen/dlp2_beta1-cli/README.md +++ b/gen/dlp2_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 *DLP* API at revision *20170918*. The CLI is at version *1.0.6*. +This documentation was generated from the *DLP* API at revision *20171205*. The CLI is at version *1.0.6*. ```bash dlp2-beta1 [options] diff --git a/gen/dlp2_beta1-cli/mkdocs.yml b/gen/dlp2_beta1-cli/mkdocs.yml index ccf59ad1c4..3d1ea0180e 100644 --- a/gen/dlp2_beta1-cli/mkdocs.yml +++ b/gen/dlp2_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: DLP v1.0.6+20170918 +site_name: DLP v1.0.6+20171205 site_url: http://byron.github.io/google-apis-rs/google-dlp2_beta1-cli site_description: A complete library to interact with DLP (protocol v2beta1) diff --git a/gen/dlp2_beta1-cli/src/main.rs b/gen/dlp2_beta1-cli/src/main.rs index a525f38a7b..f89af89a11 100644 --- a/gen/dlp2_beta1-cli/src/main.rs +++ b/gen/dlp2_beta1-cli/src/main.rs @@ -335,13 +335,14 @@ impl<'n> Engine<'n> { 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.k-map-estimation-config.region-code" => Some(("privacyMetric.kMapEstimationConfig.regionCode", 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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["categorical-stats-config", "column-name", "dataset-id", "entity-id", "field", "k-anonymity-config", "k-map-estimation-config", "l-diversity-config", "numerical-stats-config", "privacy-metric", "project-id", "region-code", "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 } @@ -516,12 +517,12 @@ impl<'n> Engine<'n> { "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.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.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 })), _ => { @@ -1742,7 +1743,7 @@ fn main() { let mut app = App::new("dlp2-beta1") .author("Sebastian Thiel ") - .version("1.0.6+20170918") + .version("1.0.6+20171205") .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") diff --git a/gen/dlp2_beta1/Cargo.toml b/gen/dlp2_beta1/Cargo.toml index aa10dbb159..2b5a1bd63e 100644 --- a/gen/dlp2_beta1/Cargo.toml +++ b/gen/dlp2_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dlp2_beta1" -version = "1.0.6+20170918" +version = "1.0.6+20171205" 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" +documentation = "https://docs.rs/google-dlp2_beta1/1.0.6+20171205" license = "MIT" keywords = ["dlp", "google", "protocol", "web", "api"] diff --git a/gen/dlp2_beta1/README.md b/gen/dlp2_beta1/README.md index 2eb7733d90..e6fbc6eba0 100644 --- a/gen/dlp2_beta1/README.md +++ b/gen/dlp2_beta1/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *DLP* crate version *1.0.6+20171205*, where *20171205* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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) + * [*deidentify*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.ContentDeidentifyCall.html), [*inspect*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.ContentInspectCall.html) and [*redact*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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) + * [*analyze*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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) + * [*operations cancel*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.InspectOperationCancelCall.html), [*operations create*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.InspectOperationCreateCall.html), [*operations delete*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.InspectOperationDeleteCall.html), [*operations get*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.InspectOperationGetCall.html), [*operations list*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.InspectOperationListCall.html) and [*results findings list*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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) + * [*operations cancel*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.RiskAnalysiOperationCancelCall.html), [*operations delete*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.RiskAnalysiOperationDeleteCall.html), [*operations get*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.RiskAnalysiOperationGetCall.html) and [*operations list*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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) + * [*info types list*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.RootCategoryInfoTypeListCall.html) and [*list*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/struct.RootCategoryListCall.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-dlp2_beta1/1.0.6+20170918/google_dlp2_beta1/struct.DLP.html)** +* **[Hub](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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)** + * creates [*Method Builders*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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)** + * **[Parts](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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)** +* **[Activities](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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. @@ -133,17 +133,17 @@ match result { ``` ## 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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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). +[Hub Delegate](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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. +If such a method also supports a [Response Result](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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. +The [delegate trait](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/google_dlp2_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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 +Most optionals are are considered [Parts](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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. +Using [method builders](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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 +* [request values](https://docs.rs/google-dlp2_beta1/1.0.6+20171205/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. diff --git a/gen/dlp2_beta1/src/lib.rs b/gen/dlp2_beta1/src/lib.rs index a265c52335..7dc3298e85 100644 --- a/gen/dlp2_beta1/src/lib.rs +++ b/gen/dlp2_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 *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*. +//! This documentation was generated from *DLP* crate version *1.0.6+20171205*, where *20171205* 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/). @@ -438,6 +438,25 @@ pub struct GooglePrivacyDlpV2beta1CategoryDescription { impl Part for GooglePrivacyDlpV2beta1CategoryDescription {} +/// 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 {} + + /// 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 @@ -460,6 +479,32 @@ pub struct GooglePrivacyDlpV2beta1CryptoKey { impl Part for GooglePrivacyDlpV2beta1CryptoKey {} +/// A column with a semantic tag attached. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1TaggedField { + /// Identifies the column. [required] + pub field: Option, + /// A column can be tagged with a custom tag. In this case, the user must + /// indicate an auxiliary table that contains statistical information on + /// the possible values of this column (below). + #[serde(rename="customTag")] + pub custom_tag: Option, + /// A column can be tagged with a InfoType to use the relevant public + /// dataset as a statistical model of population, if available. We + /// currently support US ZIP codes, region codes, ages and genders. + #[serde(rename="infoType")] + pub info_type: Option, + /// If no semantic tag is indicated, we infer the statistical model from + /// the distribution of values in the input data + pub inferred: Option, +} + +impl Part for GooglePrivacyDlpV2beta1TaggedField {} + + /// Set of files to scan. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -525,12 +570,12 @@ 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, + /// Configuration for the de-identification of the list of content items. + #[serde(rename="deidentifyConfig")] + pub deidentify_config: Option, } impl RequestValue for GooglePrivacyDlpV2beta1DeidentifyContentRequest {} @@ -554,14 +599,46 @@ pub struct GooglePrivacyDlpV2beta1RedactContentResponse { impl ResponseResult for GooglePrivacyDlpV2beta1RedactContentResponse {} +/// Reidentifiability metric. This corresponds to a risk model similar to what +/// is called "journalist risk" in the literature, except the attack dataset is +/// statistically modeled instead of being perfectly known. This can be done +/// using publicly available data (like the US Census), or using a custom +/// statistical model (indicated as one or several BigQuery tables), or by +/// extrapolating from the distribution of values in the input dataset. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1KMapEstimationConfig { + /// ISO 3166-1 alpha-2 region code to use in the statistical modeling. + /// Required if no column is tagged with a region-specific InfoType (like + /// US_ZIP_5) or a region code. + #[serde(rename="regionCode")] + pub region_code: Option, + /// Fields considered to be quasi-identifiers. No two columns can have the + /// same tag. [required] + #[serde(rename="quasiIds")] + pub quasi_ids: Option>, + /// Several auxiliary tables can be used in the analysis. Each custom_tag + /// used to tag a quasi-identifiers column must appear in exactly one column + /// of one auxiliary table. + #[serde(rename="auxiliaryTables")] + pub auxiliary_tables: Option>, +} + +impl Part for GooglePrivacyDlpV2beta1KMapEstimationConfig {} + + /// 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>, + /// 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, /// Apply the transformation to the entire field. #[serde(rename="primitiveTransformation")] pub primitive_transformation: Option, @@ -575,10 +652,8 @@ pub struct GooglePrivacyDlpV2beta1FieldTransformation { /// 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, + /// Input field(s) to apply the transformation to. [required] + pub fields: Option>, } impl Part for GooglePrivacyDlpV2beta1FieldTransformation {} @@ -611,24 +686,6 @@ pub struct GooglePrivacyDlpV2beta1TransformationSummary { 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. @@ -666,7 +723,7 @@ pub struct GooglePrivacyDlpV2beta1ReplaceConfig { impl Part for GooglePrivacyDlpV2beta1ReplaceConfig {} -/// Configuration for determing how redaction of images should occur. +/// Configuration for determining how redaction of images should occur. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -814,8 +871,17 @@ impl Part for GooglePrivacyDlpV2beta1Bucket {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2beta1KAnonymityConfig { - /// Optional message indicating that each distinct `EntityId` should not + /// Optional message indicating that each distinct entity_id should not /// contribute to the k-anonymity count more than once per equivalence class. + /// If an entity_id appears on several rows with different quasi-identifier + /// tuples, it will contribute to each count exactly once. + /// + /// This can lead to unexpected results. Consider a table where ID 1 is + /// associated to quasi-identifier "foo", ID 2 to "bar", and ID 3 to *both* + /// quasi-identifiers "foo" and "bar" (on separate rows), and where this ID + /// is used as entity_id. Then, the anonymity value associated to ID 3 will + /// be 2, even if it is the only ID to be associated to both values "foo" and + /// "bar". #[serde(rename="entityId")] pub entity_id: Option, /// Set of fields to compute k-anonymity over. When multiple fields are @@ -830,6 +896,43 @@ pub struct GooglePrivacyDlpV2beta1KAnonymityConfig { impl Part for GooglePrivacyDlpV2beta1KAnonymityConfig {} +/// 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>, + /// Custom info types provided by the user. + #[serde(rename="customInfoTypes")] + pub custom_info_types: 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 {} + + /// 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. @@ -881,40 +984,6 @@ pub struct GooglePrivacyDlpV2beta1RedactContentRequest { 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 @@ -950,17 +1019,40 @@ pub struct GooglePrivacyDlpV2beta1ImageLocation { impl Part for GooglePrivacyDlpV2beta1ImageLocation {} -/// A representation of a Datastore property in a projection. +/// Custom information type provided by the user. Used to find domain-specific +/// sensitive information configurable to the data in question. /// /// 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, +pub struct GooglePrivacyDlpV2beta1CustomInfoType { + /// Surrogate info type. + #[serde(rename="surrogateType")] + pub surrogate_type: Option, + /// Info type configuration. All custom info types must have configurations + /// that do not conflict with built-in info types or other custom info types. + #[serde(rename="infoType")] + pub info_type: Option, + /// Dictionary-based custom info type. + pub dictionary: Option, } -impl Part for GooglePrivacyDlpV2beta1Projection {} +impl Part for GooglePrivacyDlpV2beta1CustomInfoType {} + + +/// 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 {} /// Using raw keys is prone to security risks due to accidentally @@ -1004,20 +1096,20 @@ pub struct GooglePrivacyDlpV2beta1PrimitiveTransformation { #[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="fixedSizeBucketingConfig")] + pub fixed_size_bucketing_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, + #[serde(rename="bucketingConfig")] + pub bucketing_config: Option, /// no description provided #[serde(rename="cryptoReplaceFfxFpeConfig")] pub crypto_replace_ffx_fpe_config: Option, @@ -1029,6 +1121,38 @@ pub struct GooglePrivacyDlpV2beta1PrimitiveTransformation { impl Part for GooglePrivacyDlpV2beta1PrimitiveTransformation {} +/// Custom information type based on a dictionary of words or phrases. This can +/// be used to match sensitive information specific to the data, such as a list +/// of employee IDs or job titles. +/// +/// Dictionary words are case-insensitive and all characters other than letters +/// and digits in the unicode [Basic Multilingual +/// Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) +/// will be replaced with whitespace when scanning for matches, so the +/// dictionary phrase "Sam Johnson" will match all three phrases "sam johnson", +/// "Sam, Johnson", and "Sam (Johnson)". Additionally, the characters +/// surrounding any match must be of a different type than the adjacent +/// characters within the word, so letters must be next to non-letters and +/// digits next to non-digits. For example, the dictionary word "jen" will +/// match the first three letters of the text "jen123" but will return no +/// matches for "jennifer". +/// +/// Dictionary words containing a large number of characters that are not +/// letters or digits may result in unexpected findings because such characters +/// are treated as whitespace. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1Dictionary { + /// List of words or phrases to search for. + #[serde(rename="wordList")] + pub word_list: Option, +} + +impl Part for GooglePrivacyDlpV2beta1Dictionary {} + + /// Results of de-identifying a list of items. /// /// # Activities @@ -1068,12 +1192,12 @@ impl Part for GooglePrivacyDlpV2beta1InfoType {} /// #[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 Datastore options specification. + #[serde(rename="datastoreOptions")] + pub datastore_options: Option, /// Google Cloud Storage options specification. #[serde(rename="cloudStorageOptions")] pub cloud_storage_options: Option, @@ -1082,19 +1206,17 @@ pub struct GooglePrivacyDlpV2beta1StorageConfig { impl Part for GooglePrivacyDlpV2beta1StorageConfig {} -/// Compute numerical stats over an individual column, including -/// min, max, and quantiles. +/// 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 GooglePrivacyDlpV2beta1NumericalStatsConfig { - /// Field to compute numerical stats on. Supported types are - /// integer, float, date, datetime, timestamp, time. - pub field: Option, +pub struct GooglePrivacyDlpV2beta1Projection { + /// The property to project. + pub property: Option, } -impl Part for GooglePrivacyDlpV2beta1NumericalStatsConfig {} +impl Part for GooglePrivacyDlpV2beta1Projection {} /// A unique identifier for a Datastore entity. @@ -1173,6 +1295,22 @@ pub struct GooglePrivacyDlpV2beta1DeidentificationSummary { impl Part for GooglePrivacyDlpV2beta1DeidentificationSummary {} +/// Message for detecting output from deidentification transformations +/// such as +/// [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2beta1/content/deidentify#CryptoReplaceFfxFpeConfig). +/// These types of transformations are +/// those that perform pseudonymization, thereby producing a "surrogate" as +/// output. This should be used in conjunction with a field on the +/// transformation such as `surrogate_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 GooglePrivacyDlpV2beta1SurrogateType { _never_set: Option } + +impl Part for GooglePrivacyDlpV2beta1SurrogateType {} + + /// A location in Cloud Storage. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1227,16 +1365,16 @@ impl ResponseResult for GooglePrivacyDlpV2beta1ListRootCategoriesResponse {} pub struct GooglePrivacyDlpV2beta1Finding { /// The specific string that may be potentially sensitive info. pub quote: Option, + /// Estimate of how likely it is that the info_type is correct. + pub likelihood: 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, + /// Location of the info found. + pub location: 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 {} @@ -1337,23 +1475,19 @@ 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. +/// Message defining a list of words or phrases to search for in the 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 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, +pub struct GooglePrivacyDlpV2beta1WordList { + /// Words or phrases defining the dictionary. The dictionary must contain + /// at least one phrase and every phrase must contain at least 2 characters + /// that are letters or digits. [required] + pub words: Option>, } -impl Part for GooglePrivacyDlpV2beta1SummaryResult {} +impl Part for GooglePrivacyDlpV2beta1WordList {} /// Replace each input value with a given `Value`. @@ -1410,14 +1544,14 @@ impl Part for GooglePrivacyDlpV2beta1PathElement {} /// #[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, + /// 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 GoogleTypeDate {} @@ -1459,13 +1593,13 @@ pub struct GooglePrivacyDlpV2beta1InspectResult { impl Part for GooglePrivacyDlpV2beta1InspectResult {} -/// Replaces an identifier with an surrogate using FPE with the FFX +/// Replaces an identifier with a surrogate using FPE with the FFX /// mode of operation. -/// The identifier must be encoded as ASCII. +/// The identifier must be representable by the US-ASCII character set. /// 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. +/// Identifiers must be at least two characters long. +/// In the case that the identifier is the empty string, it will be skipped. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1485,9 +1619,6 @@ pub struct GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig { 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 @@ -1515,6 +1646,36 @@ pub struct GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig { /// /// This is also known as the 'tweak', as in tweakable encryption. pub context: Option, + /// The custom info type to annotate the surrogate with. + /// This annotation will be applied to the surrogate by prefixing it with + /// the name of the custom info type followed by the number of + /// characters comprising the surrogate. The following scheme defines the + /// format: info_type_name(surrogate_character_count):surrogate + /// + /// For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and + /// the surrogate is 'abc', the full replacement value + /// will be: 'MY_TOKEN_INFO_TYPE(3):abc' + /// + /// This annotation identifies the surrogate when inspecting content using the + /// custom info type + /// [`SurrogateType`](/dlp/docs/reference/rest/v2beta1/InspectConfig#surrogatetype). + /// This facilitates reversal of the surrogate when it occurs in free text. + /// + /// In order for inspection to work properly, the name of this info type must + /// not occur naturally anywhere in your data; otherwise, inspection may + /// find a surrogate that does not correspond to an actual identifier. + /// Therefore, choose your custom info type name carefully after considering + /// what your data looks like. One way to select a name that has a high chance + /// of yielding reliable detection is to include one or more unicode characters + /// that are highly improbable to exist in your data. + /// For example, assuming your data is entered from a regular ASCII keyboard, + /// the symbol with the hex code point 29DD might be used like so: + /// ⧝MY_TOKEN_TYPE + #[serde(rename="surrogateInfoType")] + pub surrogate_info_type: Option, + /// no description provided + #[serde(rename="commonAlphabet")] + pub common_alphabet: Option, } impl Part for GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig {} @@ -1654,6 +1815,43 @@ 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. + /// 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="storagePath")] pub storage_path: Option, } @@ -1661,6 +1859,23 @@ pub struct GooglePrivacyDlpV2beta1OutputStorageConfig { impl Part for GooglePrivacyDlpV2beta1OutputStorageConfig {} +/// A quasi-identifier column has a custom_tag, used to know which column +/// in the data corresponds to which column in the statistical 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 GooglePrivacyDlpV2beta1QuasiIdField { + /// no description provided + pub field: Option, + /// no description provided + #[serde(rename="customTag")] + pub custom_tag: Option, +} + +impl Part for GooglePrivacyDlpV2beta1QuasiIdField {} + + /// 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: @@ -1736,43 +1951,7 @@ impl Part for GooglePrivacyDlpV2beta1LDiversityConfig {} /// #[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 + /// Optional location to store findings. #[serde(rename="outputConfig")] pub output_config: Option, /// Configuration for the inspector. @@ -1810,6 +1989,33 @@ pub struct GooglePrivacyDlpV2beta1InfoTypeLimit { impl Part for GooglePrivacyDlpV2beta1InfoTypeLimit {} +/// An auxiliary table contains statistical information on the relative +/// frequency of different quasi-identifiers values. It has one or several +/// quasi-identifiers columns, and one column that indicates the relative +/// frequency of each quasi-identifier tuple. +/// If a tuple is present in the data but not in the auxiliary table, the +/// corresponding relative frequency is assumed to be zero (and thus, the +/// tuple is highly reidentifiable). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2beta1AuxiliaryTable { + /// Auxiliary table location. [required] + pub table: Option, + /// Quasi-identifier columns. [required] + #[serde(rename="quasiIds")] + pub quasi_ids: Option>, + /// The relative frequency column must contain a floating-point number + /// between 0 and 1 (inclusive). Null values are assumed to be zero. + /// [required] + #[serde(rename="relativeFrequency")] + pub relative_frequency: Option, +} + +impl Part for GooglePrivacyDlpV2beta1AuxiliaryTable {} + + /// The field type of `value` and `field` do not need to match to be /// considered equal, but not all comparisons are possible. /// @@ -1930,7 +2136,7 @@ pub struct GooglePrivacyDlpV2beta1ListInspectFindingsResponse { impl ResponseResult for GooglePrivacyDlpV2beta1ListInspectFindingsResponse {} -/// A condition for determing whether a transformation should be applied to +/// A condition for determining 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. @@ -1989,6 +2195,9 @@ pub struct GooglePrivacyDlpV2beta1PrivacyMetric { #[serde(rename="lDiversityConfig")] pub l_diversity_config: Option, /// no description provided + #[serde(rename="kMapEstimationConfig")] + pub k_map_estimation_config: Option, + /// no description provided #[serde(rename="kAnonymityConfig")] pub k_anonymity_config: Option, /// no description provided @@ -2082,17 +2291,17 @@ impl Part for GooglePrivacyDlpV2beta1CharsToIgnore {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2beta1ContentItem { + /// Structured content for inspection. + pub table: Option, /// Content data to inspect or redact. pub data: Option, + /// String data to inspect or redact. + pub value: 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 {} @@ -2195,6 +2404,24 @@ pub struct GooglePrivacyDlpV2beta1Table { impl Part for GooglePrivacyDlpV2beta1Table {} +/// 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 {} + + /// 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: @@ -2262,21 +2489,23 @@ pub struct GooglePrivacyDlpV2beta1Range { impl Part for GooglePrivacyDlpV2beta1Range {} -/// Compute numerical stats over an individual column, including -/// number of distinct values and value count distribution. +/// 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 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, +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 GooglePrivacyDlpV2beta1CategoricalStatsConfig {} +impl Part for GooglePrivacyDlpV2beta1InfoTypeTransformation {} /// The response message for Operations.ListOperations. @@ -2291,11 +2520,11 @@ impl Part for GooglePrivacyDlpV2beta1CategoricalStatsConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleLongrunningListOperationsResponse { + /// 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 GoogleLongrunningListOperationsResponse {} @@ -2315,23 +2544,21 @@ pub struct GooglePrivacyDlpV2beta1RecordSuppression { impl Part for GooglePrivacyDlpV2beta1RecordSuppression {} -/// A transformation to apply to text that is identified as a specific -/// info_type. +/// 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 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>, +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 GooglePrivacyDlpV2beta1InfoTypeTransformation {} +impl Part for GooglePrivacyDlpV2beta1CategoricalStatsConfig {} @@ -3051,10 +3278,10 @@ impl<'a, C, A> ContentRedactCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3299,10 +3526,10 @@ impl<'a, C, A> ContentDeidentifyCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3547,10 +3774,10 @@ impl<'a, C, A> ContentInspectCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3814,10 +4041,10 @@ impl<'a, C, A> RootCategoryInfoTypeListCall<'a, C, A> where C: BorrowMut RootCategoryListCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4292,10 +4519,10 @@ impl<'a, C, A> InspectOperationCreateCall<'a, C, A> where C: BorrowMut InspectOperationListCall<'a, C, A> where C: BorrowMut InspectOperationGetCall<'a, C, A> where C: BorrowMut InspectOperationCancelCall<'a, C, A> where C: BorrowMut InspectOperationDeleteCall<'a, C, A> where C: BorrowMut InspectResultFindingListCall<'a, C, A> where C: BorrowMut RiskAnalysiOperationDeleteCall<'a, C, A> where C: BorrowMut RiskAnalysiOperationListCall<'a, C, A> where C: BorrowMut RiskAnalysiOperationGetCall<'a, C, A> where C: BorrowMut RiskAnalysiOperationCancelCall<'a, C, A> where C: BorrowMut DataSourceAnalyzeCall<'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"). /// * *quotaUser* (query-string) - Available 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/gen/dns1-cli/Cargo.toml b/gen/dns1-cli/Cargo.toml index 5b5fe30215..87154d7682 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+20170921" +version = "1.0.6+20171204" 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+20170921" +version = "1.0.6+20171204" diff --git a/gen/dns1-cli/README.md b/gen/dns1-cli/README.md index 48264f9786..5ab54dd4c3 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 *20170921*. The CLI is at version *1.0.6*. +This documentation was generated from the *dns* API at revision *20171204*. 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 905b145981..bdd3737bd6 100644 --- a/gen/dns1-cli/mkdocs.yml +++ b/gen/dns1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dns v1.0.6+20170921 +site_name: dns v1.0.6+20171204 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 636e2c59e2..da6fbf8799 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+20170921") + .version("1.0.6+20171204") .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 8aca241856..93f984da40 100644 --- a/gen/dns1/Cargo.toml +++ b/gen/dns1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dns1" -version = "1.0.6+20170921" +version = "1.0.6+20171204" 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+20170921" +documentation = "https://docs.rs/google-dns1/1.0.6+20171204" license = "MIT" keywords = ["dns", "google", "protocol", "web", "api"] diff --git a/gen/dns1/README.md b/gen/dns1/README.md index 979032cc06..f802802b2f 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+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*. +This documentation was generated from *dns* crate version *1.0.6+20171204*, where *20171204* 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+20170921/google_dns1/struct.Dns.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.Dns.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) +* [changes](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.Change.html) + * [*create*](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.ChangeCreateCall.html), [*get*](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.ChangeGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.ChangeListCall.html) +* [managed zones](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.ManagedZone.html) + * [*create*](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.ManagedZoneCreateCall.html), [*delete*](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.ManagedZoneDeleteCall.html), [*get*](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.ManagedZoneGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.ManagedZoneListCall.html) +* [projects](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.Project.html) + * [*get*](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.ProjectGetCall.html) +* [resource record sets](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/struct.ResourceRecordSet.html) + * [*list*](https://docs.rs/google-dns1/1.0.6+20171204/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+20170921/google_dns1/struct.Dns.html)** +* **[Hub](https://docs.rs/google-dns1/1.0.6+20171204/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+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)** + * creates [*Method Builders*](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dns1/1.0.6+20171204/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+20170921/google_dns1/trait.Part.html)** + * **[Parts](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dns1/1.0.6+20170921/google_dns1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dns1/1.0.6+20171204/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+20170921/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+20171204/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+20170921/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+20171204/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+20170921/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+20171204/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+20170921/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+20171204/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dns1/1.0.6+20171204/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+20170921/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+20171204/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dns1/1.0.6+20171204/google_dns1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dns1/1.0.6+20171204/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+20170921/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+20171204/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+20170921/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+20171204/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+20170921/google_dns1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dns1/1.0.6+20171204/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 e34a6e4ae0..20376eac24 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+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*. +//! This documentation was generated from *dns* crate version *1.0.6+20171204*, where *20171204* 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/doubleclicksearch2-cli/Cargo.toml b/gen/doubleclicksearch2-cli/Cargo.toml index 4504d8cd13..7aebcd0730 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+20170919" +version = "1.0.6+20171116" 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+20170919" +version = "1.0.6+20171116" diff --git a/gen/doubleclicksearch2-cli/README.md b/gen/doubleclicksearch2-cli/README.md index c001841d43..65e8a62ac7 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 *20170919*. The CLI is at version *1.0.6*. +This documentation was generated from the *doubleclicksearch* API at revision *20171116*. 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 39977d9cfb..e4e97f01d4 100644 --- a/gen/doubleclicksearch2-cli/mkdocs.yml +++ b/gen/doubleclicksearch2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: doubleclicksearch v1.0.6+20170919 +site_name: doubleclicksearch v1.0.6+20171116 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 31343195af..e5fe51fdad 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+20170919") + .version("1.0.6+20171116") .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 dabc554bc4..21db5ec974 100644 --- a/gen/doubleclicksearch2/Cargo.toml +++ b/gen/doubleclicksearch2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-doubleclicksearch2" -version = "1.0.6+20170919" +version = "1.0.6+20171116" 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+20170919" +documentation = "https://docs.rs/google-doubleclicksearch2/1.0.6+20171116" license = "MIT" keywords = ["doubleclicksearch", "google", "protocol", "web", "api"] diff --git a/gen/doubleclicksearch2/README.md b/gen/doubleclicksearch2/README.md index acba256e32..3ae9e3c4a6 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+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*. +This documentation was generated from *doubleclicksearch* crate version *1.0.6+20171116*, where *20171116* 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+20170919/google_doubleclicksearch2/struct.Doubleclicksearch.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.Doubleclicksearch.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) +* [conversion](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.Conversion.html) + * [*get*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.ConversionGetCall.html), [*insert*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.ConversionInsertCall.html), [*patch*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.ConversionPatchCall.html), [*update*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.ConversionUpdateCall.html) and [*update availability*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.ConversionUpdateAvailabilityCall.html) +* [reports](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.Report.html) + * [*generate*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.ReportGenerateCall.html), [*get*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.ReportGetCall.html), [*get file*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.ReportGetFileCall.html) and [*request*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.ReportRequestCall.html) +* [saved columns](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.SavedColumn.html) + * [*list*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/struct.SavedColumnListCall.html) Download supported by ... -* [*get file reports*](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/struct.ReportGetFileCall.html) +* [*get file reports*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/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+20170919/google_doubleclicksearch2/struct.Doubleclicksearch.html)** +* **[Hub](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/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+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)** + * creates [*Method Builders*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/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+20170919/google_doubleclicksearch2/trait.Part.html)** + * **[Parts](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-doubleclicksearch2/1.0.6+20170919/google_doubleclicksearch2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/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+20170919/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+20171116/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+20170919/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+20171116/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+20170919/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+20171116/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+20170919/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+20171116/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/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+20170919/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+20171116/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/google_doubleclicksearch2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/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+20170919/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+20171116/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+20170919/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+20171116/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+20170919/google_doubleclicksearch2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-doubleclicksearch2/1.0.6+20171116/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 d5efe46e52..d77c1eac3d 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+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*. +//! This documentation was generated from *doubleclicksearch* crate version *1.0.6+20171116*, where *20171116* 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 4f27aa790f..284496d295 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+20170915" +version = "1.0.6+20171201" 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+20170915" +version = "1.0.6+20171201" diff --git a/gen/drive2-cli/README.md b/gen/drive2-cli/README.md index 08f610652d..b8caf0266d 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 *20170915*. The CLI is at version *1.0.6*. +This documentation was generated from the *drive* API at revision *20171201*. 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 49d3019fe8..25f6e28ce1 100644 --- a/gen/drive2-cli/mkdocs.yml +++ b/gen/drive2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: drive v1.0.6+20170915 +site_name: drive v1.0.6+20171201 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 15d2e72820..eb0a41d269 100644 --- a/gen/drive2-cli/src/main.rs +++ b/gen/drive2-cli/src/main.rs @@ -3304,6 +3304,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, "supports-team-drives" => { call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); }, @@ -3320,7 +3323,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(["supports-team-drives"].iter().map(|v|*v)); + v.extend(["use-domain-admin-access", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -3352,6 +3355,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, "supports-team-drives" => { call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); }, @@ -3368,7 +3374,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(["supports-team-drives"].iter().map(|v|*v)); + v.extend(["use-domain-admin-access", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -3508,6 +3514,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, "supports-team-drives" => { call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); }, @@ -3530,7 +3539,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(["email-message", "send-notification-emails", "supports-team-drives"].iter().map(|v|*v)); + v.extend(["email-message", "send-notification-emails", "use-domain-admin-access", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -3570,6 +3579,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, "supports-team-drives" => { call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); }, @@ -3592,7 +3604,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", "max-results", "supports-team-drives"].iter().map(|v|*v)); + v.extend(["page-token", "use-domain-admin-access", "max-results", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -3680,6 +3692,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, "transfer-ownership" => { call = call.transfer_ownership(arg_from_str(value.unwrap_or("false"), err, "transfer-ownership", "boolean")); }, @@ -3702,7 +3717,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(["transfer-ownership", "supports-team-drives", "remove-expiration"].iter().map(|v|*v)); + v.extend(["use-domain-admin-access", "transfer-ownership", "supports-team-drives", "remove-expiration"].iter().map(|v|*v)); v } )); } } @@ -3790,6 +3805,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, "transfer-ownership" => { call = call.transfer_ownership(arg_from_str(value.unwrap_or("false"), err, "transfer-ownership", "boolean")); }, @@ -3812,7 +3830,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(["transfer-ownership", "supports-team-drives", "remove-expiration"].iter().map(|v|*v)); + v.extend(["use-domain-admin-access", "transfer-ownership", "supports-team-drives", "remove-expiration"].iter().map(|v|*v)); v } )); } } @@ -5268,6 +5286,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -5281,6 +5302,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(["use-domain-admin-access"].iter().map(|v|*v)); v } )); } } @@ -5337,11 +5359,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "color-rgb" => Some(("colorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "background-image-link" => Some(("backgroundImageLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "theme-id" => Some(("themeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "color-rgb" => Some(("colorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-copy" => Some(("capabilities.canCopy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -5360,9 +5382,10 @@ impl<'n> Engine<'n> { "background-image-file.y-coordinate" => Some(("backgroundImageFile.yCoordinate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "background-image-file.id" => Some(("backgroundImageFile.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "background-image-file.x-coordinate" => Some(("backgroundImageFile.xCoordinate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "created-date" => Some(("createdDate", 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!["background-image-file", "background-image-link", "can-add-children", "can-change-team-drive-background", "can-comment", "can-copy", "can-delete-team-drive", "can-download", "can-edit", "can-list-children", "can-manage-members", "can-read-revisions", "can-remove-children", "can-rename", "can-rename-team-drive", "can-share", "capabilities", "color-rgb", "id", "kind", "name", "theme-id", "width", "x-coordinate", "y-coordinate"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["background-image-file", "background-image-link", "can-add-children", "can-change-team-drive-background", "can-comment", "can-copy", "can-delete-team-drive", "can-download", "can-edit", "can-list-children", "can-manage-members", "can-read-revisions", "can-remove-children", "can-rename", "can-rename-team-drive", "can-share", "capabilities", "color-rgb", "created-date", "id", "kind", "name", "theme-id", "width", "x-coordinate", "y-coordinate"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5428,6 +5451,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, + "q" => { + call = call.q(value.unwrap_or("")); + }, "page-token" => { call = call.page_token(value.unwrap_or("")); }, @@ -5447,7 +5476,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", "max-results"].iter().map(|v|*v)); + v.extend(["q", "page-token", "use-domain-admin-access", "max-results"].iter().map(|v|*v)); v } )); } } @@ -5504,11 +5533,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "color-rgb" => Some(("colorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "background-image-link" => Some(("backgroundImageLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "theme-id" => Some(("themeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "color-rgb" => Some(("colorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-copy" => Some(("capabilities.canCopy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -5527,9 +5556,10 @@ impl<'n> Engine<'n> { "background-image-file.y-coordinate" => Some(("backgroundImageFile.yCoordinate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "background-image-file.id" => Some(("backgroundImageFile.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "background-image-file.x-coordinate" => Some(("backgroundImageFile.xCoordinate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "created-date" => Some(("createdDate", 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!["background-image-file", "background-image-link", "can-add-children", "can-change-team-drive-background", "can-comment", "can-copy", "can-delete-team-drive", "can-download", "can-edit", "can-list-children", "can-manage-members", "can-read-revisions", "can-remove-children", "can-rename", "can-rename-team-drive", "can-share", "capabilities", "color-rgb", "id", "kind", "name", "theme-id", "width", "x-coordinate", "y-coordinate"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["background-image-file", "background-image-link", "can-add-children", "can-change-team-drive-background", "can-comment", "can-copy", "can-delete-team-drive", "can-download", "can-edit", "can-list-children", "can-manage-members", "can-read-revisions", "can-remove-children", "can-rename", "can-rename-team-drive", "can-share", "capabilities", "color-rgb", "created-date", "id", "kind", "name", "theme-id", "width", "x-coordinate", "y-coordinate"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -7726,7 +7756,7 @@ fn main() { let mut app = App::new("drive2") .author("Sebastian Thiel ") - .version("1.0.6+20170915") + .version("1.0.6+20171201") .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 fd89623bef..e287edf76a 100644 --- a/gen/drive2/Cargo.toml +++ b/gen/drive2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-drive2" -version = "1.0.6+20170915" +version = "1.0.6+20171201" 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+20170915" +documentation = "https://docs.rs/google-drive2/1.0.6+20171201" license = "MIT" keywords = ["drive", "google", "protocol", "web", "api"] diff --git a/gen/drive2/README.md b/gen/drive2/README.md index eef7a391a8..6db9f7482b 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+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*. +This documentation was generated from *drive* crate version *1.0.6+20171201*, where *20171201* 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+20170915/google_drive2/struct.Drive.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.Drive.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) +* [about](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.About.html) + * [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.AboutGetCall.html) +* [apps](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.App.html) + * [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.AppGetCall.html) and [*list*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.AppListCall.html) +* [changes](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.Change.html) + * [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ChangeGetCall.html), [*get start page token*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ChangeWatchCall.html) +* [channels](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.Channel.html) + * [*stop*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ChannelStopCall.html) * children - * [*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) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ChildrenDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ChildrenGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ChildrenInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ChildrenListCall.html) +* [comments](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.Comment.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.CommentListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.CommentPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.CommentUpdateCall.html) +* [files](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.File.html) + * [*copy*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileCopyCall.html), [*delete*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FilePatchCall.html), [*touch*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileTouchCall.html), [*trash*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileTrashCall.html), [*untrash*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileUntrashCall.html), [*update*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileWatchCall.html) * parents - * [*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) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ParentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ParentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ParentInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ParentListCall.html) +* [permissions](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.Permission.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PermissionGetCall.html), [*get id for email*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PermissionGetIdForEmailCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PermissionInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PermissionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PermissionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PermissionUpdateCall.html) +* [properties](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.Property.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PropertyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PropertyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PropertyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PropertyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PropertyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.PropertyUpdateCall.html) * realtime - * [*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) + * [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.RealtimeGetCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.RealtimeUpdateCall.html) * replies - * [*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) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ReplyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ReplyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ReplyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ReplyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ReplyUpdateCall.html) +* [revisions](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.Revision.html) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.RevisionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.RevisionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.RevisionUpdateCall.html) * teamdrives - * [*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) + * [*delete*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.TeamdriveGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.TeamdriveInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.TeamdriveUpdateCall.html) Upload supported by ... -* [*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) +* [*update files*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileUpdateCall.html) +* [*insert files*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileInsertCall.html) +* [*update realtime*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.RealtimeUpdateCall.html) Download supported by ... -* [*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) +* [*watch files*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileWatchCall.html) +* [*get realtime*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.RealtimeGetCall.html) +* [*get files*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileGetCall.html) +* [*export files*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileExportCall.html) Subscription supported by ... -* [*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) +* [*watch files*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileWatchCall.html) +* [*insert files*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileInsertCall.html) +* [*get files*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.FileGetCall.html) +* [*watch changes*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/struct.ChangeWatchCall.html) +* [*list changes*](https://docs.rs/google-drive2/1.0.6+20171201/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+20170915/google_drive2/struct.Drive.html)** +* **[Hub](https://docs.rs/google-drive2/1.0.6+20171201/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+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)** + * creates [*Method Builders*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-drive2/1.0.6+20171201/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+20170915/google_drive2/trait.Part.html)** + * **[Parts](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-drive2/1.0.6+20170915/google_drive2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-drive2/1.0.6+20171201/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+20170915/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+20171201/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+20170915/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+20171201/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+20170915/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+20171201/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+20170915/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+20171201/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-drive2/1.0.6+20171201/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+20170915/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+20171201/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-drive2/1.0.6+20171201/google_drive2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-drive2/1.0.6+20171201/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+20170915/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+20171201/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+20170915/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+20171201/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+20170915/google_drive2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-drive2/1.0.6+20171201/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 0d79e8af45..a7ce000ff8 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+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*. +//! This documentation was generated from *drive* crate version *1.0.6+20171201*, where *20171201* 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/). @@ -1359,8 +1359,9 @@ impl Part for FileLabels {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TeamDrive { - /// This is always drive#teamDrive - pub kind: Option, + /// The color of this Team Drive as an RGB hex string. It can only be set on a drive.teamdrives.update request that does not set themeId. + #[serde(rename="colorRgb")] + pub color_rgb: Option, /// A short-lived link to this Team Drive's background image. #[serde(rename="backgroundImageLink")] pub background_image_link: Option, @@ -1369,14 +1370,16 @@ pub struct TeamDrive { /// The ID of the theme from which the background image and color will be set. The set of possible teamDriveThemes can be retrieved from a drive.about.get response. When not specified on a drive.teamdrives.insert request, a random theme is chosen from which the background image and color are set. This is a write-only field; it can only be set on requests that don't set colorRgb or backgroundImageFile. #[serde(rename="themeId")] pub theme_id: Option, - /// The color of this Team Drive as an RGB hex string. It can only be set on a drive.teamdrives.update request that does not set themeId. - #[serde(rename="colorRgb")] - pub color_rgb: Option, + /// This is always drive#teamDrive + pub kind: Option, /// Capabilities the current user has on this Team Drive. pub capabilities: Option, /// An image file and cropping parameters from which a background image for this Team Drive is set. This is a write only field; it can only be set on drive.teamdrives.update requests that don't set themeId. When specified, all fields of the backgroundImageFile must be set. #[serde(rename="backgroundImageFile")] pub background_image_file: Option, + /// The time at which the Team Drive was created (RFC 3339 date-time). + #[serde(rename="createdDate")] + pub created_date: Option, /// The ID of this Team Drive which is also the ID of the top level folder for this Team Drive. pub id: Option, } @@ -2741,6 +2744,7 @@ impl<'a, C, A> TeamdriveMethods<'a, C, A> { TeamdriveGetCall { hub: self.hub, _team_drive_id: team_drive_id.to_string(), + _use_domain_admin_access: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2753,6 +2757,8 @@ impl<'a, C, A> TeamdriveMethods<'a, C, A> { pub fn list(&self) -> TeamdriveListCall<'a, C, A> { TeamdriveListCall { hub: self.hub, + _use_domain_admin_access: Default::default(), + _q: Default::default(), _page_token: Default::default(), _max_results: Default::default(), _delegate: Default::default(), @@ -3695,6 +3701,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { hub: self.hub, _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), + _use_domain_admin_access: Default::default(), _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -3715,6 +3722,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { hub: self.hub, _request: request, _file_id: file_id.to_string(), + _use_domain_admin_access: Default::default(), _supports_team_drives: Default::default(), _send_notification_emails: Default::default(), _email_message: Default::default(), @@ -3739,6 +3747,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { _request: request, _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), + _use_domain_admin_access: Default::default(), _transfer_ownership: Default::default(), _supports_team_drives: Default::default(), _remove_expiration: Default::default(), @@ -3759,6 +3768,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { PermissionListCall { hub: self.hub, _file_id: file_id.to_string(), + _use_domain_admin_access: Default::default(), _supports_team_drives: Default::default(), _page_token: Default::default(), _max_results: Default::default(), @@ -3783,6 +3793,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { _request: request, _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), + _use_domain_admin_access: Default::default(), _transfer_ownership: Default::default(), _supports_team_drives: Default::default(), _remove_expiration: Default::default(), @@ -3805,6 +3816,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { hub: self.hub, _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), + _use_domain_admin_access: Default::default(), _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -9087,6 +9099,7 @@ impl<'a, C, A> TeamdriveInsertCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.teamdrives().get("teamDriveId") +/// .use_domain_admin_access(true) /// .doit(); /// # } /// ``` @@ -9095,6 +9108,7 @@ pub struct TeamdriveGetCall<'a, C, A> hub: &'a Drive, _team_drive_id: String, + _use_domain_admin_access: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -9116,9 +9130,12 @@ impl<'a, C, A> TeamdriveGetCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "drive.teamdrives.get", 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())); params.push(("teamDriveId", self._team_drive_id.to_string())); - for &field in ["alt", "teamDriveId"].iter() { + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } + for &field in ["alt", "teamDriveId", "useDomainAdminAccess"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9243,6 +9260,13 @@ impl<'a, C, A> TeamdriveGetCall<'a, C, A> where C: BorrowMut, A: self._team_drive_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> TeamdriveGetCall<'a, C, A> { + self._use_domain_admin_access = 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. /// @@ -9330,8 +9354,10 @@ impl<'a, C, A> TeamdriveGetCall<'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.teamdrives().list() -/// .page_token("invidunt") -/// .max_results(-87) +/// .use_domain_admin_access(false) +/// .q("dolores") +/// .page_token("eos") +/// .max_results(-78) /// .doit(); /// # } /// ``` @@ -9339,6 +9365,8 @@ pub struct TeamdriveListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Drive, + _use_domain_admin_access: Option, + _q: Option, _page_token: Option, _max_results: Option, _delegate: Option<&'a mut Delegate>, @@ -9362,14 +9390,20 @@ impl<'a, C, A> TeamdriveListCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "drive.teamdrives.list", 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((6 + self._additional_params.len())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } + if let Some(value) = self._q { + params.push(("q", 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", "pageToken", "maxResults"].iter() { + for &field in ["alt", "useDomainAdminAccess", "q", "pageToken", "maxResults"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9463,6 +9497,20 @@ impl<'a, C, A> TeamdriveListCall<'a, C, A> where C: BorrowMut, A: } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> TeamdriveListCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } + /// Query string for searching Team Drives. + /// + /// Sets the *q* query property to the given value. + pub fn q(mut self, new_value: &str) -> TeamdriveListCall<'a, C, A> { + self._q = Some(new_value.to_string()); + self + } /// Page token for Team Drives. /// /// Sets the *page token* query property to the given value. @@ -10071,7 +10119,7 @@ impl<'a, C, A> TeamdriveUpdateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.realtime().update("fileId") -/// .base_revision("duo") +/// .base_revision("ea") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -10426,7 +10474,7 @@ impl<'a, C, A> RealtimeUpdateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.realtime().get("fileId") -/// .revision(-31) +/// .revision(-74) /// .doit(); /// # } /// ``` @@ -10913,9 +10961,9 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.apps().list() -/// .language_code("ea") -/// .app_filter_mime_types("et") -/// .app_filter_extensions("dolor") +/// .language_code("diam") +/// .app_filter_mime_types("kasd") +/// .app_filter_extensions("invidunt") /// .doit(); /// # } /// ``` @@ -11159,8 +11207,8 @@ impl<'a, C, A> AppListCall<'a, C, A> where C: BorrowMut, A: oauth /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.about().get() -/// .start_change_id("diam") -/// .max_change_id_count(-62) +/// .start_change_id("rebum.") +/// .max_change_id_count(-51) /// .include_subscribed(false) /// .doit(); /// # } @@ -11649,7 +11697,7 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().get("fileId", "commentId") -/// .include_deleted(false) +/// .include_deleted(true) /// .doit(); /// # } /// ``` @@ -12762,9 +12810,9 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().list("fileId") -/// .updated_min("elitr") -/// .page_token("nonumy") -/// .max_results(-15) +/// .updated_min("Lorem") +/// .page_token("Lorem") +/// .max_results(-42) /// .include_deleted(true) /// .doit(); /// # } @@ -13053,10 +13101,10 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.children().list("folderId") -/// .q("diam") -/// .page_token("ut") +/// .q("amet.") +/// .page_token("ipsum") /// .order_by("ut") -/// .max_results(-51) +/// .max_results(-3) /// .doit(); /// # } /// ``` @@ -13849,7 +13897,7 @@ impl<'a, C, A> ChildrenDeleteCall<'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.children().insert(req, "folderId") -/// .supports_team_drives(true) +/// .supports_team_drives(false) /// .doit(); /// # } /// ``` @@ -14852,7 +14900,7 @@ impl<'a, C, A> ParentDeleteCall<'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.parents().insert(req, "fileId") -/// .supports_team_drives(false) +/// .supports_team_drives(true) /// .doit(); /// # } /// ``` @@ -15685,8 +15733,8 @@ impl<'a, C, A> ReplyPatchCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.replies().list("fileId", "commentId") -/// .page_token("vero") -/// .max_results(-99) +/// .page_token("et") +/// .max_results(-91) /// .include_deleted(false) /// .doit(); /// # } @@ -17095,7 +17143,8 @@ impl<'a, C, A> ReplyUpdateCall<'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.permissions().delete("fileId", "permissionId") -/// .supports_team_drives(true) +/// .use_domain_admin_access(true) +/// .supports_team_drives(false) /// .doit(); /// # } /// ``` @@ -17105,6 +17154,7 @@ pub struct PermissionDeleteCall<'a, C, A> hub: &'a Drive, _file_id: String, _permission_id: String, + _use_domain_admin_access: Option, _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -17127,13 +17177,16 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "drive.permissions.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(("fileId", self._file_id.to_string())); params.push(("permissionId", self._permission_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } if let Some(value) = self._supports_team_drives { params.push(("supportsTeamDrives", value.to_string())); } - for &field in ["fileId", "permissionId", "supportsTeamDrives"].iter() { + for &field in ["fileId", "permissionId", "useDomainAdminAccess", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -17257,6 +17310,13 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, self._permission_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionDeleteCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } /// Whether the requesting application supports Team Drives. /// /// Sets the *supports team drives* query property to the given value. @@ -17357,9 +17417,10 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().insert(req, "fileId") +/// .use_domain_admin_access(false) /// .supports_team_drives(false) -/// .send_notification_emails(true) -/// .email_message("dolores") +/// .send_notification_emails(false) +/// .email_message("ea") /// .doit(); /// # } /// ``` @@ -17369,6 +17430,7 @@ pub struct PermissionInsertCall<'a, C, A> hub: &'a Drive, _request: Permission, _file_id: String, + _use_domain_admin_access: Option, _supports_team_drives: Option, _send_notification_emails: Option, _email_message: Option, @@ -17393,8 +17455,11 @@ impl<'a, C, A> PermissionInsertCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "drive.permissions.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(("fileId", self._file_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } if let Some(value) = self._supports_team_drives { params.push(("supportsTeamDrives", value.to_string())); } @@ -17404,7 +17469,7 @@ impl<'a, C, A> PermissionInsertCall<'a, C, A> where C: BorrowMut, if let Some(value) = self._email_message { params.push(("emailMessage", value.to_string())); } - for &field in ["alt", "fileId", "supportsTeamDrives", "sendNotificationEmails", "emailMessage"].iter() { + for &field in ["alt", "fileId", "useDomainAdminAccess", "supportsTeamDrives", "sendNotificationEmails", "emailMessage"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -17553,6 +17618,13 @@ impl<'a, C, A> PermissionInsertCall<'a, C, A> where C: BorrowMut, self._file_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } /// Whether the requesting application supports Team Drives. /// /// Sets the *supports team drives* query property to the given value. @@ -17667,8 +17739,9 @@ impl<'a, C, A> PermissionInsertCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().patch(req, "fileId", "permissionId") +/// .use_domain_admin_access(true) /// .transfer_ownership(false) -/// .supports_team_drives(false) +/// .supports_team_drives(true) /// .remove_expiration(true) /// .doit(); /// # } @@ -17680,6 +17753,7 @@ pub struct PermissionPatchCall<'a, C, A> _request: Permission, _file_id: String, _permission_id: String, + _use_domain_admin_access: Option, _transfer_ownership: Option, _supports_team_drives: Option, _remove_expiration: Option, @@ -17704,9 +17778,12 @@ impl<'a, C, A> PermissionPatchCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "drive.permissions.patch", http_method: hyper::method::Method::Patch }); - 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(("fileId", self._file_id.to_string())); params.push(("permissionId", self._permission_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } if let Some(value) = self._transfer_ownership { params.push(("transferOwnership", value.to_string())); } @@ -17716,7 +17793,7 @@ impl<'a, C, A> PermissionPatchCall<'a, C, A> where C: BorrowMut, if let Some(value) = self._remove_expiration { params.push(("removeExpiration", value.to_string())); } - for &field in ["alt", "fileId", "permissionId", "transferOwnership", "supportsTeamDrives", "removeExpiration"].iter() { + for &field in ["alt", "fileId", "permissionId", "useDomainAdminAccess", "transferOwnership", "supportsTeamDrives", "removeExpiration"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -17875,6 +17952,13 @@ impl<'a, C, A> PermissionPatchCall<'a, C, A> where C: BorrowMut, self._permission_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionPatchCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } /// Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'. /// /// Sets the *transfer ownership* query property to the given value. @@ -17983,9 +18067,10 @@ impl<'a, C, A> PermissionPatchCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().list("fileId") -/// .supports_team_drives(false) -/// .page_token("sed") -/// .max_results(-99) +/// .use_domain_admin_access(false) +/// .supports_team_drives(true) +/// .page_token("eirmod") +/// .max_results(-36) /// .doit(); /// # } /// ``` @@ -17994,6 +18079,7 @@ pub struct PermissionListCall<'a, C, A> hub: &'a Drive, _file_id: String, + _use_domain_admin_access: Option, _supports_team_drives: Option, _page_token: Option, _max_results: Option, @@ -18018,8 +18104,11 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A }; dlg.begin(MethodInfo { id: "drive.permissions.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } if let Some(value) = self._supports_team_drives { params.push(("supportsTeamDrives", value.to_string())); } @@ -18029,7 +18118,7 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } - for &field in ["alt", "fileId", "supportsTeamDrives", "pageToken", "maxResults"].iter() { + for &field in ["alt", "fileId", "useDomainAdminAccess", "supportsTeamDrives", "pageToken", "maxResults"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -18154,6 +18243,13 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A self._file_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionListCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } /// Whether the requesting application supports Team Drives. /// /// Sets the *supports team drives* query property to the given value. @@ -18268,9 +18364,10 @@ impl<'a, C, A> PermissionListCall<'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.permissions().update(req, "fileId", "permissionId") -/// .transfer_ownership(true) -/// .supports_team_drives(false) -/// .remove_expiration(true) +/// .use_domain_admin_access(true) +/// .transfer_ownership(false) +/// .supports_team_drives(true) +/// .remove_expiration(false) /// .doit(); /// # } /// ``` @@ -18281,6 +18378,7 @@ pub struct PermissionUpdateCall<'a, C, A> _request: Permission, _file_id: String, _permission_id: String, + _use_domain_admin_access: Option, _transfer_ownership: Option, _supports_team_drives: Option, _remove_expiration: Option, @@ -18305,9 +18403,12 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "drive.permissions.update", http_method: hyper::method::Method::Put }); - 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(("fileId", self._file_id.to_string())); params.push(("permissionId", self._permission_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } if let Some(value) = self._transfer_ownership { params.push(("transferOwnership", value.to_string())); } @@ -18317,7 +18418,7 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, if let Some(value) = self._remove_expiration { params.push(("removeExpiration", value.to_string())); } - for &field in ["alt", "fileId", "permissionId", "transferOwnership", "supportsTeamDrives", "removeExpiration"].iter() { + for &field in ["alt", "fileId", "permissionId", "useDomainAdminAccess", "transferOwnership", "supportsTeamDrives", "removeExpiration"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -18476,6 +18577,13 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, self._permission_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionUpdateCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } /// Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'. /// /// Sets the *transfer ownership* query property to the given value. @@ -18584,7 +18692,8 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().get("fileId", "permissionId") -/// .supports_team_drives(false) +/// .use_domain_admin_access(false) +/// .supports_team_drives(true) /// .doit(); /// # } /// ``` @@ -18594,6 +18703,7 @@ pub struct PermissionGetCall<'a, C, A> hub: &'a Drive, _file_id: String, _permission_id: String, + _use_domain_admin_access: Option, _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -18616,13 +18726,16 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "drive.permissions.get", http_method: hyper::method::Method::Get }); - 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(("fileId", self._file_id.to_string())); params.push(("permissionId", self._permission_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } if let Some(value) = self._supports_team_drives { params.push(("supportsTeamDrives", value.to_string())); } - for &field in ["alt", "fileId", "permissionId", "supportsTeamDrives"].iter() { + for &field in ["alt", "fileId", "permissionId", "useDomainAdminAccess", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -18757,6 +18870,13 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: self._permission_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionGetCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } /// Whether the requesting application supports Team Drives. /// /// Sets the *supports team drives* query property to the given value. @@ -19094,7 +19214,7 @@ impl<'a, C, A> PermissionGetIdForEmailCall<'a, C, A> where C: BorrowMut ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.changes().list() -/// .team_drive_id("consetetur") -/// .supports_team_drives(true) -/// .start_change_id("justo") -/// .spaces("tempor") -/// .page_token("gubergren") -/// .max_results(-84) +/// .team_drive_id("elitr") +/// .supports_team_drives(false) +/// .start_change_id("ipsum") +/// .spaces("invidunt") +/// .page_token("accusam") +/// .max_results(-86) /// .include_team_drive_items(false) /// .include_subscribed(true) /// .include_deleted(false) @@ -20019,7 +20139,7 @@ impl<'a, C, A> ChangeListCall<'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.changes().get("changeId") -/// .team_drive_id("ipsum") +/// .team_drive_id("dolor") /// .supports_team_drives(true) /// .doit(); /// # } @@ -20292,7 +20412,7 @@ impl<'a, C, A> ChangeGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().patch(req, "fileId", "propertyKey") -/// .visibility("diam") +/// .visibility("nonumy") /// .doit(); /// # } /// ``` @@ -20584,7 +20704,7 @@ impl<'a, C, A> PropertyPatchCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().delete("fileId", "propertyKey") -/// .visibility("diam") +/// .visibility("consetetur") /// .doit(); /// # } /// ``` @@ -21363,7 +21483,7 @@ impl<'a, C, A> PropertyListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().update(req, "fileId", "propertyKey") -/// .visibility("vero") +/// .visibility("et") /// .doit(); /// # } /// ``` @@ -21655,7 +21775,7 @@ impl<'a, C, A> PropertyUpdateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().get("fileId", "propertyKey") -/// .visibility("dolores") +/// .visibility("aliquyam") /// .doit(); /// # } /// ``` @@ -22993,8 +23113,8 @@ impl<'a, C, A> RevisionUpdateCall<'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.revisions().list("fileId") -/// .page_token("nonumy") -/// .max_results(-47) +/// .page_token("amet") +/// .max_results(-39) /// .doit(); /// # } /// ``` diff --git a/gen/drive3-cli/Cargo.toml b/gen/drive3-cli/Cargo.toml index 14f7300706..c414f924a1 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+20170915" +version = "1.0.6+20171201" 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+20170915" +version = "1.0.6+20171201" diff --git a/gen/drive3-cli/README.md b/gen/drive3-cli/README.md index 6e16dfa590..00d19cba53 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 *20170915*. The CLI is at version *1.0.6*. +This documentation was generated from the *drive* API at revision *20171201*. 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 8bdb39908d..4319b31f4f 100644 --- a/gen/drive3-cli/mkdocs.yml +++ b/gen/drive3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: drive v1.0.6+20170915 +site_name: drive v1.0.6+20171201 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 87242587eb..ce136b706d 100644 --- a/gen/drive3-cli/src/main.rs +++ b/gen/drive3-cli/src/main.rs @@ -1953,6 +1953,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, "transfer-ownership" => { call = call.transfer_ownership(arg_from_str(value.unwrap_or("false"), err, "transfer-ownership", "boolean")); }, @@ -1978,7 +1981,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(["send-notification-email", "email-message", "transfer-ownership", "supports-team-drives"].iter().map(|v|*v)); + v.extend(["send-notification-email", "email-message", "use-domain-admin-access", "transfer-ownership", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -2018,6 +2021,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, "supports-team-drives" => { call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); }, @@ -2034,7 +2040,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(["supports-team-drives"].iter().map(|v|*v)); + v.extend(["use-domain-admin-access", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -2066,6 +2072,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, "supports-team-drives" => { call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); }, @@ -2082,7 +2091,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(["supports-team-drives"].iter().map(|v|*v)); + v.extend(["use-domain-admin-access", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -2122,6 +2131,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, "supports-team-drives" => { call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); }, @@ -2144,7 +2156,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", "page-size", "supports-team-drives"].iter().map(|v|*v)); + v.extend(["page-token", "use-domain-admin-access", "page-size", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -2227,6 +2239,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, "transfer-ownership" => { call = call.transfer_ownership(arg_from_str(value.unwrap_or("false"), err, "transfer-ownership", "boolean")); }, @@ -2249,7 +2264,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(["transfer-ownership", "supports-team-drives", "remove-expiration"].iter().map(|v|*v)); + v.extend(["use-domain-admin-access", "transfer-ownership", "supports-team-drives", "remove-expiration"].iter().map(|v|*v)); v } )); } } @@ -2933,11 +2948,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "color-rgb" => Some(("colorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "background-image-link" => Some(("backgroundImageLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "theme-id" => Some(("themeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "color-rgb" => Some(("colorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-copy" => Some(("capabilities.canCopy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2956,9 +2971,10 @@ impl<'n> Engine<'n> { "background-image-file.y-coordinate" => Some(("backgroundImageFile.yCoordinate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "background-image-file.id" => Some(("backgroundImageFile.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "background-image-file.x-coordinate" => Some(("backgroundImageFile.xCoordinate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "created-time" => Some(("createdTime", 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!["background-image-file", "background-image-link", "can-add-children", "can-change-team-drive-background", "can-comment", "can-copy", "can-delete-team-drive", "can-download", "can-edit", "can-list-children", "can-manage-members", "can-read-revisions", "can-remove-children", "can-rename", "can-rename-team-drive", "can-share", "capabilities", "color-rgb", "id", "kind", "name", "theme-id", "width", "x-coordinate", "y-coordinate"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["background-image-file", "background-image-link", "can-add-children", "can-change-team-drive-background", "can-comment", "can-copy", "can-delete-team-drive", "can-download", "can-edit", "can-list-children", "can-manage-members", "can-read-revisions", "can-remove-children", "can-rename", "can-rename-team-drive", "can-share", "capabilities", "color-rgb", "created-time", "id", "kind", "name", "theme-id", "width", "x-coordinate", "y-coordinate"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3068,6 +3084,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -3081,6 +3100,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(["use-domain-admin-access"].iter().map(|v|*v)); v } )); } } @@ -3120,6 +3140,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 { + "use-domain-admin-access" => { + call = call.use_domain_admin_access(arg_from_str(value.unwrap_or("false"), err, "use-domain-admin-access", "boolean")); + }, + "q" => { + call = call.q(value.unwrap_or("")); + }, "page-token" => { call = call.page_token(value.unwrap_or("")); }, @@ -3139,7 +3165,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", "page-size"].iter().map(|v|*v)); + v.extend(["q", "page-token", "use-domain-admin-access", "page-size"].iter().map(|v|*v)); v } )); } } @@ -3196,11 +3222,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "color-rgb" => Some(("colorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "background-image-link" => Some(("backgroundImageLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "theme-id" => Some(("themeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "color-rgb" => Some(("colorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-copy" => Some(("capabilities.canCopy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -3219,9 +3245,10 @@ impl<'n> Engine<'n> { "background-image-file.y-coordinate" => Some(("backgroundImageFile.yCoordinate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "background-image-file.id" => Some(("backgroundImageFile.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "background-image-file.x-coordinate" => Some(("backgroundImageFile.xCoordinate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "created-time" => Some(("createdTime", 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!["background-image-file", "background-image-link", "can-add-children", "can-change-team-drive-background", "can-comment", "can-copy", "can-delete-team-drive", "can-download", "can-edit", "can-list-children", "can-manage-members", "can-read-revisions", "can-remove-children", "can-rename", "can-rename-team-drive", "can-share", "capabilities", "color-rgb", "id", "kind", "name", "theme-id", "width", "x-coordinate", "y-coordinate"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["background-image-file", "background-image-link", "can-add-children", "can-change-team-drive-background", "can-comment", "can-copy", "can-delete-team-drive", "can-download", "can-edit", "can-list-children", "can-manage-members", "can-read-revisions", "can-remove-children", "can-rename", "can-rename-team-drive", "can-share", "capabilities", "color-rgb", "created-time", "id", "kind", "name", "theme-id", "width", "x-coordinate", "y-coordinate"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4561,7 +4588,7 @@ fn main() { let mut app = App::new("drive3") .author("Sebastian Thiel ") - .version("1.0.6+20170915") + .version("1.0.6+20171201") .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 7f7ff1a162..c5876fc896 100644 --- a/gen/drive3/Cargo.toml +++ b/gen/drive3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-drive3" -version = "1.0.6+20170915" +version = "1.0.6+20171201" 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+20170915" +documentation = "https://docs.rs/google-drive3/1.0.6+20171201" license = "MIT" keywords = ["drive", "google", "protocol", "web", "api"] diff --git a/gen/drive3/README.md b/gen/drive3/README.md index 4d6492fdad..ee4b577813 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+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*. +This documentation was generated from *drive* crate version *1.0.6+20171201*, where *20171201* 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+20170915/google_drive3/struct.Drive.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.Drive.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) +* [about](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.About.html) + * [*get*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.AboutGetCall.html) +* [changes](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.Change.html) + * [*get start page token*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.ChangeWatchCall.html) +* [channels](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.Channel.html) + * [*stop*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.ChannelStopCall.html) +* [comments](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.Comment.html) + * [*create*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.CommentCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.CommentGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.CommentListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.CommentUpdateCall.html) +* [files](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.File.html) + * [*copy*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileCopyCall.html), [*create*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileListCall.html), [*update*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileWatchCall.html) +* [permissions](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.Permission.html) + * [*create*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.PermissionCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.PermissionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.PermissionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.PermissionUpdateCall.html) +* [replies](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.Reply.html) + * [*create*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.ReplyCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.ReplyGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.ReplyListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.ReplyUpdateCall.html) +* [revisions](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.Revision.html) + * [*delete*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.RevisionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.RevisionUpdateCall.html) * teamdrives - * [*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) + * [*create*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.TeamdriveCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.TeamdriveGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.TeamdriveUpdateCall.html) Upload supported by ... -* [*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) +* [*update files*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileUpdateCall.html) +* [*create files*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileCreateCall.html) Download supported by ... -* [*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) +* [*watch files*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileWatchCall.html) +* [*export files*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileExportCall.html) +* [*get revisions*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.RevisionGetCall.html) +* [*get files*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileGetCall.html) Subscription supported by ... -* [*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) +* [*watch files*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileWatchCall.html) +* [*watch changes*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.ChangeWatchCall.html) +* [*list changes*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.ChangeListCall.html) +* [*create files*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/struct.FileCreateCall.html) +* [*get files*](https://docs.rs/google-drive3/1.0.6+20171201/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+20170915/google_drive3/struct.Drive.html)** +* **[Hub](https://docs.rs/google-drive3/1.0.6+20171201/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+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)** + * creates [*Method Builders*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-drive3/1.0.6+20171201/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+20170915/google_drive3/trait.Part.html)** + * **[Parts](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-drive3/1.0.6+20170915/google_drive3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-drive3/1.0.6+20171201/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+20170915/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+20171201/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+20170915/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+20171201/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+20170915/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+20171201/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+20170915/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+20171201/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-drive3/1.0.6+20171201/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+20170915/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+20171201/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-drive3/1.0.6+20171201/google_drive3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-drive3/1.0.6+20171201/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+20170915/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+20171201/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+20170915/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+20171201/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+20170915/google_drive3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-drive3/1.0.6+20171201/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 b963de6f1f..d744a1565b 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+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*. +//! This documentation was generated from *drive* crate version *1.0.6+20171201*, where *20171201* 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/). @@ -1285,8 +1285,9 @@ impl ResponseResult for FileList {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TeamDrive { - /// Identifies what kind of resource this is. Value: the fixed string "drive#teamDrive". - pub kind: Option, + /// The color of this Team Drive as an RGB hex string. It can only be set on a drive.teamdrives.update request that does not set themeId. + #[serde(rename="colorRgb")] + pub color_rgb: Option, /// A short-lived link to this Team Drive's background image. #[serde(rename="backgroundImageLink")] pub background_image_link: Option, @@ -1295,14 +1296,16 @@ pub struct TeamDrive { /// The ID of the theme from which the background image and color will be set. The set of possible teamDriveThemes can be retrieved from a drive.about.get response. When not specified on a drive.teamdrives.create request, a random theme is chosen from which the background image and color are set. This is a write-only field; it can only be set on requests that don't set colorRgb or backgroundImageFile. #[serde(rename="themeId")] pub theme_id: Option, - /// The color of this Team Drive as an RGB hex string. It can only be set on a drive.teamdrives.update request that does not set themeId. - #[serde(rename="colorRgb")] - pub color_rgb: Option, + /// Identifies what kind of resource this is. Value: the fixed string "drive#teamDrive". + pub kind: Option, /// Capabilities the current user has on this Team Drive. pub capabilities: Option, /// An image file and cropping parameters from which a background image for this Team Drive is set. This is a write only field; it can only be set on drive.teamdrives.update requests that don't set themeId. When specified, all fields of the backgroundImageFile must be set. #[serde(rename="backgroundImageFile")] pub background_image_file: Option, + /// The time at which the Team Drive was created (RFC 3339 date-time). + #[serde(rename="createdTime")] + pub created_time: Option, /// The ID of this Team Drive which is also the ID of the top level folder for this Team Drive. pub id: Option, } @@ -1913,6 +1916,7 @@ impl<'a, C, A> TeamdriveMethods<'a, C, A> { TeamdriveGetCall { hub: self.hub, _team_drive_id: team_drive_id.to_string(), + _use_domain_admin_access: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1944,6 +1948,8 @@ impl<'a, C, A> TeamdriveMethods<'a, C, A> { pub fn list(&self) -> TeamdriveListCall<'a, C, A> { TeamdriveListCall { hub: self.hub, + _use_domain_admin_access: Default::default(), + _q: Default::default(), _page_token: Default::default(), _page_size: Default::default(), _delegate: Default::default(), @@ -2678,6 +2684,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { hub: self.hub, _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), + _use_domain_admin_access: Default::default(), _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2700,6 +2707,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { _request: request, _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), + _use_domain_admin_access: Default::default(), _transfer_ownership: Default::default(), _supports_team_drives: Default::default(), _remove_expiration: Default::default(), @@ -2720,6 +2728,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { PermissionListCall { hub: self.hub, _file_id: file_id.to_string(), + _use_domain_admin_access: Default::default(), _supports_team_drives: Default::default(), _page_token: Default::default(), _page_size: Default::default(), @@ -2742,6 +2751,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { hub: self.hub, _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), + _use_domain_admin_access: Default::default(), _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2762,6 +2772,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { hub: self.hub, _request: request, _file_id: file_id.to_string(), + _use_domain_admin_access: Default::default(), _transfer_ownership: Default::default(), _supports_team_drives: Default::default(), _send_notification_email: Default::default(), @@ -5867,6 +5878,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.teamdrives().get("teamDriveId") +/// .use_domain_admin_access(true) /// .doit(); /// # } /// ``` @@ -5875,6 +5887,7 @@ pub struct TeamdriveGetCall<'a, C, A> hub: &'a Drive, _team_drive_id: String, + _use_domain_admin_access: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -5896,9 +5909,12 @@ impl<'a, C, A> TeamdriveGetCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "drive.teamdrives.get", 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())); params.push(("teamDriveId", self._team_drive_id.to_string())); - for &field in ["alt", "teamDriveId"].iter() { + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } + for &field in ["alt", "teamDriveId", "useDomainAdminAccess"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6023,6 +6039,13 @@ impl<'a, C, A> TeamdriveGetCall<'a, C, A> where C: BorrowMut, A: self._team_drive_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> TeamdriveGetCall<'a, C, A> { + self._use_domain_admin_access = 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. /// @@ -6363,8 +6386,10 @@ impl<'a, C, A> TeamdriveCreateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.teamdrives().list() -/// .page_token("sit") -/// .page_size(-26) +/// .use_domain_admin_access(true) +/// .q("diam") +/// .page_token("rebum.") +/// .page_size(-45) /// .doit(); /// # } /// ``` @@ -6372,6 +6397,8 @@ pub struct TeamdriveListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Drive, + _use_domain_admin_access: Option, + _q: Option, _page_token: Option, _page_size: Option, _delegate: Option<&'a mut Delegate>, @@ -6395,14 +6422,20 @@ impl<'a, C, A> TeamdriveListCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "drive.teamdrives.list", 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((6 + self._additional_params.len())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } + if let Some(value) = self._q { + params.push(("q", 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", "pageToken", "pageSize"].iter() { + for &field in ["alt", "useDomainAdminAccess", "q", "pageToken", "pageSize"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6496,6 +6529,20 @@ impl<'a, C, A> TeamdriveListCall<'a, C, A> where C: BorrowMut, A: } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> TeamdriveListCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } + /// Query string for searching Team Drives. + /// + /// Sets the *q* query property to the given value. + pub fn q(mut self, new_value: &str) -> TeamdriveListCall<'a, C, A> { + self._q = Some(new_value.to_string()); + self + } /// Page token for Team Drives. /// /// Sets the *page token* query property to the given value. @@ -7557,7 +7604,7 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().get("fileId", "commentId") -/// .include_deleted(false) +/// .include_deleted(true) /// .doit(); /// # } /// ``` @@ -8384,9 +8431,9 @@ impl<'a, C, A> CommentCreateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().list("fileId") -/// .start_modified_time("Lorem") -/// .page_token("et") -/// .page_size(-13) +/// .start_modified_time("consetetur") +/// .page_token("takimata") +/// .page_size(-40) /// .include_deleted(true) /// .doit(); /// # } @@ -9191,8 +9238,8 @@ impl<'a, C, A> ReplyCreateCall<'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.replies().list("fileId", "commentId") -/// .page_token("takimata") -/// .page_size(-27) +/// .page_token("invidunt") +/// .page_size(-66) /// .include_deleted(false) /// .doit(); /// # } @@ -9482,7 +9529,7 @@ impl<'a, C, A> ReplyListCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.replies().get("fileId", "commentId", "replyId") -/// .include_deleted(false) +/// .include_deleted(true) /// .doit(); /// # } /// ``` @@ -10606,7 +10653,7 @@ impl<'a, C, A> RevisionUpdateCall<'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.revisions().get("fileId", "revisionId") -/// .acknowledge_abuse(false) +/// .acknowledge_abuse(true) /// .doit(); /// # } /// ``` @@ -11133,8 +11180,8 @@ impl<'a, C, A> RevisionDeleteCall<'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.revisions().list("fileId") -/// .page_token("sea") -/// .page_size(-85) +/// .page_token("aliquyam") +/// .page_size(-69) /// .doit(); /// # } /// ``` @@ -11400,14 +11447,14 @@ impl<'a, C, A> RevisionListCall<'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.changes().list("pageToken") -/// .team_drive_id("aliquyam") -/// .supports_team_drives(false) -/// .spaces("sit") +/// .team_drive_id("diam") +/// .supports_team_drives(true) +/// .spaces("justo") /// .restrict_to_my_drive(true) -/// .page_size(-37) -/// .include_team_drive_items(false) +/// .page_size(-46) +/// .include_team_drive_items(true) /// .include_removed(true) -/// .include_corpus_removals(true) +/// .include_corpus_removals(false) /// .doit(); /// # } /// ``` @@ -11718,8 +11765,8 @@ impl<'a, C, A> ChangeListCall<'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.changes().get_start_page_token() -/// .team_drive_id("accusam") -/// .supports_team_drives(true) +/// .team_drive_id("justo") +/// .supports_team_drives(false) /// .doit(); /// # } /// ``` @@ -11958,14 +12005,14 @@ impl<'a, C, A> ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().delete("fileId", "permissionId") +/// .use_domain_admin_access(false) /// .supports_team_drives(true) /// .doit(); /// # } @@ -12311,6 +12359,7 @@ pub struct PermissionDeleteCall<'a, C, A> hub: &'a Drive, _file_id: String, _permission_id: String, + _use_domain_admin_access: Option, _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -12333,13 +12382,16 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "drive.permissions.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(("fileId", self._file_id.to_string())); params.push(("permissionId", self._permission_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } if let Some(value) = self._supports_team_drives { params.push(("supportsTeamDrives", value.to_string())); } - for &field in ["fileId", "permissionId", "supportsTeamDrives"].iter() { + for &field in ["fileId", "permissionId", "useDomainAdminAccess", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12463,6 +12515,13 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, self._permission_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionDeleteCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } /// Whether the requesting application supports Team Drives. /// /// Sets the *supports team drives* query property to the given value. @@ -12563,9 +12622,10 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().update(req, "fileId", "permissionId") -/// .transfer_ownership(false) +/// .use_domain_admin_access(false) +/// .transfer_ownership(true) /// .supports_team_drives(true) -/// .remove_expiration(true) +/// .remove_expiration(false) /// .doit(); /// # } /// ``` @@ -12576,6 +12636,7 @@ pub struct PermissionUpdateCall<'a, C, A> _request: Permission, _file_id: String, _permission_id: String, + _use_domain_admin_access: Option, _transfer_ownership: Option, _supports_team_drives: Option, _remove_expiration: Option, @@ -12600,9 +12661,12 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "drive.permissions.update", http_method: hyper::method::Method::Patch }); - 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(("fileId", self._file_id.to_string())); params.push(("permissionId", self._permission_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } if let Some(value) = self._transfer_ownership { params.push(("transferOwnership", value.to_string())); } @@ -12612,7 +12676,7 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, if let Some(value) = self._remove_expiration { params.push(("removeExpiration", value.to_string())); } - for &field in ["alt", "fileId", "permissionId", "transferOwnership", "supportsTeamDrives", "removeExpiration"].iter() { + for &field in ["alt", "fileId", "permissionId", "useDomainAdminAccess", "transferOwnership", "supportsTeamDrives", "removeExpiration"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12771,6 +12835,13 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, self._permission_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionUpdateCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } /// Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. /// /// Sets the *transfer ownership* query property to the given value. @@ -12879,9 +12950,10 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().list("fileId") +/// .use_domain_admin_access(false) /// .supports_team_drives(false) -/// .page_token("rebum.") -/// .page_size(-51) +/// .page_token("consetetur") +/// .page_size(-22) /// .doit(); /// # } /// ``` @@ -12890,6 +12962,7 @@ pub struct PermissionListCall<'a, C, A> hub: &'a Drive, _file_id: String, + _use_domain_admin_access: Option, _supports_team_drives: Option, _page_token: Option, _page_size: Option, @@ -12914,8 +12987,11 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A }; dlg.begin(MethodInfo { id: "drive.permissions.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } if let Some(value) = self._supports_team_drives { params.push(("supportsTeamDrives", value.to_string())); } @@ -12925,7 +13001,7 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A if let Some(value) = self._page_size { params.push(("pageSize", value.to_string())); } - for &field in ["alt", "fileId", "supportsTeamDrives", "pageToken", "pageSize"].iter() { + for &field in ["alt", "fileId", "useDomainAdminAccess", "supportsTeamDrives", "pageToken", "pageSize"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -13050,6 +13126,13 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A self._file_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionListCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } /// Whether the requesting application supports Team Drives. /// /// Sets the *supports team drives* query property to the given value. @@ -13158,7 +13241,8 @@ impl<'a, C, A> PermissionListCall<'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.permissions().get("fileId", "permissionId") -/// .supports_team_drives(false) +/// .use_domain_admin_access(true) +/// .supports_team_drives(true) /// .doit(); /// # } /// ``` @@ -13168,6 +13252,7 @@ pub struct PermissionGetCall<'a, C, A> hub: &'a Drive, _file_id: String, _permission_id: String, + _use_domain_admin_access: Option, _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -13190,13 +13275,16 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "drive.permissions.get", http_method: hyper::method::Method::Get }); - 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(("fileId", self._file_id.to_string())); params.push(("permissionId", self._permission_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } if let Some(value) = self._supports_team_drives { params.push(("supportsTeamDrives", value.to_string())); } - for &field in ["alt", "fileId", "permissionId", "supportsTeamDrives"].iter() { + for &field in ["alt", "fileId", "permissionId", "useDomainAdminAccess", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -13331,6 +13419,13 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: self._permission_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionGetCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } /// Whether the requesting application supports Team Drives. /// /// Sets the *supports team drives* query property to the given value. @@ -13431,10 +13526,11 @@ impl<'a, C, A> PermissionGetCall<'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.permissions().create(req, "fileId") -/// .transfer_ownership(false) +/// .use_domain_admin_access(true) +/// .transfer_ownership(true) /// .supports_team_drives(true) -/// .send_notification_email(false) -/// .email_message("sit") +/// .send_notification_email(true) +/// .email_message("ut") /// .doit(); /// # } /// ``` @@ -13444,6 +13540,7 @@ pub struct PermissionCreateCall<'a, C, A> hub: &'a Drive, _request: Permission, _file_id: String, + _use_domain_admin_access: Option, _transfer_ownership: Option, _supports_team_drives: Option, _send_notification_email: Option, @@ -13469,8 +13566,11 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "drive.permissions.create", 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(("fileId", self._file_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } if let Some(value) = self._transfer_ownership { params.push(("transferOwnership", value.to_string())); } @@ -13483,7 +13583,7 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, if let Some(value) = self._email_message { params.push(("emailMessage", value.to_string())); } - for &field in ["alt", "fileId", "transferOwnership", "supportsTeamDrives", "sendNotificationEmail", "emailMessage"].iter() { + for &field in ["alt", "fileId", "useDomainAdminAccess", "transferOwnership", "supportsTeamDrives", "sendNotificationEmail", "emailMessage"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -13632,6 +13732,13 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, self._file_id = new_value.to_string(); self } + /// Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionCreateCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } /// Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. /// /// Sets the *transfer ownership* query property to the given value. diff --git a/gen/firebasedynamiclinks1-cli/Cargo.toml b/gen/firebasedynamiclinks1-cli/Cargo.toml index f5b2835821..54c6d869b5 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+20170926" +version = "1.0.6+20171205" 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+20170926" +version = "1.0.6+20171205" diff --git a/gen/firebasedynamiclinks1-cli/README.md b/gen/firebasedynamiclinks1-cli/README.md index 96f3509b92..48bf627eae 100644 --- a/gen/firebasedynamiclinks1-cli/README.md +++ b/gen/firebasedynamiclinks1-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 *Firebase Dynamic Links* API at revision *20170926*. The CLI is at version *1.0.6*. +This documentation was generated from the *Firebase Dynamic Links* API at revision *20171205*. The CLI is at version *1.0.6*. ```bash firebasedynamiclinks1 [options] diff --git a/gen/firebasedynamiclinks1-cli/mkdocs.yml b/gen/firebasedynamiclinks1-cli/mkdocs.yml index 69c977f76b..8b1abcde58 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+20170926 +site_name: Firebase Dynamic Links v1.0.6+20171205 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) diff --git a/gen/firebasedynamiclinks1-cli/src/main.rs b/gen/firebasedynamiclinks1-cli/src/main.rs index b29118b883..473ebf8798 100644 --- a/gen/firebasedynamiclinks1-cli/src/main.rs +++ b/gen/firebasedynamiclinks1-cli/src/main.rs @@ -129,16 +129,17 @@ impl<'n> Engine<'n> { "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 })), + "device.language-code-raw" => Some(("device.languageCodeRaw", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device.device-model-name" => Some(("device.deviceModelName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device.screen-resolution-height" => Some(("device.screenResolutionHeight", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device.timezone" => Some(("device.timezone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "device.screen-resolution-width" => Some(("device.screenResolutionWidth", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retrieval-method" => Some(("retrievalMethod", 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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-installation-time", "bundle-id", "device", "device-model-name", "ios-version", "language-code", "language-code-raw", "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 } @@ -246,11 +247,12 @@ impl<'n> Engine<'n> { "dynamic-link-info.social-meta-tag-info.social-description" => Some(("dynamicLinkInfo.socialMetaTagInfo.socialDescription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dynamic-link-info.social-meta-tag-info.social-image-link" => Some(("dynamicLinkInfo.socialMetaTagInfo.socialImageLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dynamic-link-info.link" => Some(("dynamicLinkInfo.link", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dynamic-link-info.desktop-info.desktop-fallback-link" => Some(("dynamicLinkInfo.desktopInfo.desktopFallbackLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dynamic-link-info.dynamic-link-domain" => Some(("dynamicLinkInfo.dynamicLinkDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "long-dynamic-link" => Some(("longDynamicLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "suffix.option" => Some(("suffix.option", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["analytics-info", "android-fallback-link", "android-info", "android-link", "android-min-package-version-code", "android-package-name", "at", "ct", "dynamic-link-domain", "dynamic-link-info", "enable-forced-redirect", "gclid", "google-play-analytics", "ios-app-store-id", "ios-bundle-id", "ios-custom-scheme", "ios-fallback-link", "ios-info", "ios-ipad-bundle-id", "ios-ipad-fallback-link", "itunes-connect-analytics", "link", "long-dynamic-link", "mt", "navigation-info", "option", "pt", "social-description", "social-image-link", "social-meta-tag-info", "social-title", "suffix", "utm-campaign", "utm-content", "utm-medium", "utm-source", "utm-term"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["analytics-info", "android-fallback-link", "android-info", "android-link", "android-min-package-version-code", "android-package-name", "at", "ct", "desktop-fallback-link", "desktop-info", "dynamic-link-domain", "dynamic-link-info", "enable-forced-redirect", "gclid", "google-play-analytics", "ios-app-store-id", "ios-bundle-id", "ios-custom-scheme", "ios-fallback-link", "ios-info", "ios-ipad-bundle-id", "ios-ipad-fallback-link", "itunes-connect-analytics", "link", "long-dynamic-link", "mt", "navigation-info", "option", "pt", "social-description", "social-image-link", "social-meta-tag-info", "social-title", "suffix", "utm-campaign", "utm-content", "utm-medium", "utm-source", "utm-term"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -512,7 +514,7 @@ fn main() { let mut app = App::new("firebasedynamiclinks1") .author("Sebastian Thiel ") - .version("1.0.6+20170926") + .version("1.0.6+20171205") .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 c10ac5962a..45a48cae7f 100644 --- a/gen/firebasedynamiclinks1/Cargo.toml +++ b/gen/firebasedynamiclinks1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-firebasedynamiclinks1" -version = "1.0.6+20170926" +version = "1.0.6+20171205" 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+20170926" +documentation = "https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205" license = "MIT" keywords = ["firebasedynamiclinks", "google", "protocol", "web", "api"] diff --git a/gen/firebasedynamiclinks1/README.md b/gen/firebasedynamiclinks1/README.md index 6ba5a5414d..a27a3b43cd 100644 --- a/gen/firebasedynamiclinks1/README.md +++ b/gen/firebasedynamiclinks1/README.md @@ -5,21 +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+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*. +This documentation was generated from *Firebase Dynamic Links* crate version *1.0.6+20171205*, where *20171205* 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+20170926/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html) ... * short links - * [*create*](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/struct.ShortLinkCreateCall.html) + * [*create*](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/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) +* [get link stats](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/google_firebasedynamiclinks1/struct.MethodGetLinkStatCall.html) +* [install attribution](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/google_firebasedynamiclinks1/struct.MethodInstallAttributionCall.html) @@ -27,17 +27,17 @@ Other activities are ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html)** +* **[Hub](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/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+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)** + * creates [*Method Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/google_firebasedynamiclinks1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/google_firebasedynamiclinks1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/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+20170926/google_firebasedynamiclinks1/trait.Part.html)** + * **[Parts](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/google_firebasedynamiclinks1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20170926/google_firebasedynamiclinks1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/google_firebasedynamiclinks1/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-firebasedynamiclinks1/1.0.6+20170926/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+20171205/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+20170926/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+20171205/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+20170926/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+20171205/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+20170926/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+20171205/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/google_firebasedynamiclinks1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/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+20170926/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+20171205/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/google_firebasedynamiclinks1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/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+20170926/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+20171205/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+20170926/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+20171205/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+20170926/google_firebasedynamiclinks1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-firebasedynamiclinks1/1.0.6+20171205/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 63c68a3421..333adef0de 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+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*. +//! This documentation was generated from *Firebase Dynamic Links* crate version *1.0.6+20171205*, where *20171205* 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/). @@ -401,13 +401,18 @@ pub struct GetIosPostInstallAttributionResponse { /// 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, + /// Describes why match failed, ie: "discarded due to low confidence". + /// This message will be publicly visible. + #[serde(rename="matchMessage")] + pub match_message: Option, /// The confidence of the returned attribution. #[serde(rename="attributionConfidence")] pub attribution_confidence: 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, /// 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. @@ -416,15 +421,14 @@ pub struct GetIosPostInstallAttributionResponse { /// 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 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 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] @@ -442,10 +446,6 @@ pub struct GetIosPostInstallAttributionResponse { /// 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, @@ -556,13 +556,13 @@ pub struct GetIosPostInstallAttributionRequest { /// 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, + /// Device information. + pub device: Option, /// iOS version, ie: 9.3.5. /// Consider adding "build". #[serde(rename="iosVersion")] @@ -588,13 +588,6 @@ pub struct DynamicLinkInfo { /// [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")] @@ -607,6 +600,17 @@ pub struct DynamicLinkInfo { /// Used to set meta tag data for link previews on social sites. #[serde(rename="socialMetaTagInfo")] pub social_meta_tag_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, + /// Desktop related information. See desktop related parameters in the + /// [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + #[serde(rename="desktopInfo")] + pub desktop_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. @@ -674,12 +678,12 @@ 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, + /// The document describing the warning, and helps resolve. + #[serde(rename="warningDocumentLink")] + pub warning_document_link: Option, /// The warning message to help developers improve their requests. #[serde(rename="warningMessage")] pub warning_message: Option, @@ -746,20 +750,26 @@ impl Part for SocialMetaTagInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DeviceInfo { - /// Device timezone setting. - pub timezone: Option, /// Device language code setting. #[serde(rename="languageCode")] pub language_code: Option, + /// Device language code raw setting. + /// iOS does returns language code in different format than iOS WebView. + /// For example WebView returns en_US, but iOS returns en-US. + /// Field below will return raw value returned by iOS. + #[serde(rename="languageCodeRaw")] + pub language_code_raw: 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, + /// Device timezone setting. + pub timezone: Option, + /// Device display resolution width. + #[serde(rename="screenResolutionWidth")] + pub screen_resolution_width: Option, } impl Part for DeviceInfo {} @@ -820,6 +830,20 @@ pub struct GooglePlayAnalytics { impl Part for GooglePlayAnalytics {} +/// Desktop 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 DesktopInfo { + /// Link to open on desktop. + #[serde(rename="desktopFallbackLink")] + pub desktop_fallback_link: Option, +} + +impl Part for DesktopInfo {} + + /// Response to create a short Dynamic Link. /// /// # Activities diff --git a/gen/firebaseremoteconfig1-cli/Cargo.toml b/gen/firebaseremoteconfig1-cli/Cargo.toml index c9c4542aff..7c1b8c160a 100644 --- a/gen/firebaseremoteconfig1-cli/Cargo.toml +++ b/gen/firebaseremoteconfig1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-firebaseremoteconfig1-cli" -version = "1.0.6+20170912" +version = "1.0.6+20171129" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-firebaseremoteconfig1] path = "../firebaseremoteconfig1" -version = "1.0.6+20170912" +version = "1.0.6+20171129" diff --git a/gen/firebaseremoteconfig1-cli/README.md b/gen/firebaseremoteconfig1-cli/README.md index 90d457c963..25b8b9826f 100644 --- a/gen/firebaseremoteconfig1-cli/README.md +++ b/gen/firebaseremoteconfig1-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 *Firebase Remote Config* API at revision *20170912*. The CLI is at version *1.0.6*. +This documentation was generated from the *Firebase Remote Config* API at revision *20171129*. The CLI is at version *1.0.6*. ```bash firebaseremoteconfig1 [options] diff --git a/gen/firebaseremoteconfig1-cli/mkdocs.yml b/gen/firebaseremoteconfig1-cli/mkdocs.yml index bdfd459309..d7381001b9 100644 --- a/gen/firebaseremoteconfig1-cli/mkdocs.yml +++ b/gen/firebaseremoteconfig1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Firebase Remote Config v1.0.6+20170912 +site_name: Firebase Remote Config v1.0.6+20171129 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) diff --git a/gen/firebaseremoteconfig1-cli/src/main.rs b/gen/firebaseremoteconfig1-cli/src/main.rs index 7420009c2b..feb64578a3 100644 --- a/gen/firebaseremoteconfig1-cli/src/main.rs +++ b/gen/firebaseremoteconfig1-cli/src/main.rs @@ -363,7 +363,7 @@ fn main() { let mut app = App::new("firebaseremoteconfig1") .author("Sebastian Thiel ") - .version("1.0.6+20170912") + .version("1.0.6+20171129") .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") diff --git a/gen/firebaseremoteconfig1/Cargo.toml b/gen/firebaseremoteconfig1/Cargo.toml index dd94cb1aa1..b08b399261 100644 --- a/gen/firebaseremoteconfig1/Cargo.toml +++ b/gen/firebaseremoteconfig1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-firebaseremoteconfig1" -version = "1.0.6+20170912" +version = "1.0.6+20171129" 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" +documentation = "https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129" license = "MIT" keywords = ["firebaseremoteconfig", "google", "protocol", "web", "api"] diff --git a/gen/firebaseremoteconfig1/README.md b/gen/firebaseremoteconfig1/README.md index c54810bc35..8090fa3aa2 100644 --- a/gen/firebaseremoteconfig1/README.md +++ b/gen/firebaseremoteconfig1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Firebase Remote Config* crate version *1.0.6+20171129*, where *20171129* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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) + * [*get remote config*](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/google_firebaseremoteconfig1/struct.ProjectGetRemoteConfigCall.html) and [*update remote config*](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/google_firebaseremoteconfig1/struct.ProjectUpdateRemoteConfigCall.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-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/struct.FirebaseRemoteConfig.html)** +* **[Hub](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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)** + * creates [*Method Builders*](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/google_firebaseremoteconfig1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/google_firebaseremoteconfig1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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)** + * **[Parts](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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)** +* **[Activities](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/google_firebaseremoteconfig1/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-firebaseremoteconfig1/1.0.6+20170912/google_firebaseremoteconfig1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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). +[Hub Delegate](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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. +If such a method also supports a [Response Result](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/google_firebaseremoteconfig1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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. +The [delegate trait](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/google_firebaseremoteconfig1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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 +Most optionals are are considered [Parts](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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. +Using [method builders](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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 +* [request values](https://docs.rs/google-firebaseremoteconfig1/1.0.6+20171129/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. diff --git a/gen/firebaseremoteconfig1/src/lib.rs b/gen/firebaseremoteconfig1/src/lib.rs index 6875264489..bcf2e02ff9 100644 --- a/gen/firebaseremoteconfig1/src/lib.rs +++ b/gen/firebaseremoteconfig1/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 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*. +//! This documentation was generated from *Firebase Remote Config* crate version *1.0.6+20171129*, where *20171129* 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/). @@ -360,6 +360,12 @@ pub struct RemoteConfigParameter { /// the value of this parameter. #[serde(rename="conditionalValues")] pub conditional_values: Option>, + /// Optional. + /// A description for this Parameter. Length must be less than or equal to + /// 100 characters (or more precisely, unicode code points, which is defined in + /// java/com/google/wireless/android/config/ConstsExporter.java). + /// A description may contain any Unicode characters + pub description: Option, } impl Part for RemoteConfigParameter {} @@ -389,6 +395,12 @@ pub struct RemoteConfigCondition { /// Required. /// A non empty and unique name of this condition. pub name: Option, + /// Optional. + /// A description for this Condition. Length must be less than or equal to + /// 100 characters (or more precisely, unicode code points, which is defined in + /// java/com/google/wireless/android/config/ConstsExporter.java). + /// A description may contain any Unicode characters + pub description: Option, } impl Part for RemoteConfigCondition {} @@ -397,7 +409,7 @@ 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 +/// to a structure containing an optional default value, as well as a optional /// submap of (condition name to value when that condition is true). /// /// # Activities @@ -775,10 +787,10 @@ impl<'a, C, A> ProjectGetRemoteConfigCall<'a, C, A> where C: BorrowMut ProjectUpdateRemoteConfigCall<'a, C, A> where C: BorrowMut"] +description = "A complete library to interact with Firestore (protocol v1beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firestore1_beta1-cli" +homepage = "https://cloud.google.com/firestore" +documentation = "http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli" +license = "MIT" +keywords = ["firestore", "google", "cli"] + +[[bin]] +name = "firestore1-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-firestore1_beta1] +path = "../firestore1_beta1" +version = "1.0.6+20171205" diff --git a/gen/firestore1_beta1-cli/LICENSE.md b/gen/firestore1_beta1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/firestore1_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/firestore1_beta1-cli/README.md b/gen/firestore1_beta1-cli/README.md new file mode 100644 index 0000000000..566292c4f6 --- /dev/null +++ b/gen/firestore1_beta1-cli/README.md @@ -0,0 +1,130 @@ + +The `firestore1-beta1` command-line interface *(CLI)* allows to use most features of the *Google Firestore* 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 *Firestore* API can be found at the +[official documentation site](https://cloud.google.com/firestore). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-firestore1_beta1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/firestore1_beta1-cli). + +# Usage + +This documentation was generated from the *Firestore* API at revision *20171205*. The CLI is at version *1.0.6*. + +```bash +firestore1-beta1 [options] + projects + databases-documents-batch-get (-r )... [-p ]... [-o ] + databases-documents-begin-transaction (-r )... [-p ]... [-o ] + databases-documents-commit (-r )... [-p ]... [-o ] + databases-documents-create-document (-r )... [-p ]... [-o ] + databases-documents-delete [-p ]... [-o ] + databases-documents-get [-p ]... [-o ] + databases-documents-list [-p ]... [-o ] + databases-documents-list-collection-ids (-r )... [-p ]... [-o ] + databases-documents-listen (-r )... [-p ]... [-o ] + databases-documents-patch (-r )... [-p ]... [-o ] + databases-documents-rollback (-r )... [-p ]... [-o ] + databases-documents-run-query (-r )... [-p ]... [-o ] + databases-documents-write (-r )... [-p ]... [-o ] + databases-indexes-create (-r )... [-p ]... [-o ] + databases-indexes-delete [-p ]... [-o ] + databases-indexes-get [-p ]... [-o ] + databases-indexes-list [-p ]... [-o ] + firestore1-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 `firestore1-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/firestore1-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/firestore1-beta1-secret.json`, assuming that the required *firestore* 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. `firestore1-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/firestore1_beta1-cli/mkdocs.yml b/gen/firestore1_beta1-cli/mkdocs.yml new file mode 100644 index 0000000000..78b8e29966 --- /dev/null +++ b/gen/firestore1_beta1-cli/mkdocs.yml @@ -0,0 +1,33 @@ +site_name: Firestore v1.0.6+20171205 +site_url: http://byron.github.io/google-apis-rs/google-firestore1_beta1-cli +site_description: A complete library to interact with Firestore (protocol v1beta1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/firestore1_beta1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_databases-documents-batch-get.md', 'Projects', 'Databases Documents Batch Get'] +- ['projects_databases-documents-begin-transaction.md', 'Projects', 'Databases Documents Begin Transaction'] +- ['projects_databases-documents-commit.md', 'Projects', 'Databases Documents Commit'] +- ['projects_databases-documents-create-document.md', 'Projects', 'Databases Documents Create Document'] +- ['projects_databases-documents-delete.md', 'Projects', 'Databases Documents Delete'] +- ['projects_databases-documents-get.md', 'Projects', 'Databases Documents Get'] +- ['projects_databases-documents-list.md', 'Projects', 'Databases Documents List'] +- ['projects_databases-documents-list-collection-ids.md', 'Projects', 'Databases Documents List Collection Ids'] +- ['projects_databases-documents-listen.md', 'Projects', 'Databases Documents Listen'] +- ['projects_databases-documents-patch.md', 'Projects', 'Databases Documents Patch'] +- ['projects_databases-documents-rollback.md', 'Projects', 'Databases Documents Rollback'] +- ['projects_databases-documents-run-query.md', 'Projects', 'Databases Documents Run Query'] +- ['projects_databases-documents-write.md', 'Projects', 'Databases Documents Write'] +- ['projects_databases-indexes-create.md', 'Projects', 'Databases Indexes Create'] +- ['projects_databases-indexes-delete.md', 'Projects', 'Databases Indexes Delete'] +- ['projects_databases-indexes-get.md', 'Projects', 'Databases Indexes Get'] +- ['projects_databases-indexes-list.md', 'Projects', 'Databases Indexes List'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/firestore1_beta1-cli/src/cmn.rs b/gen/firestore1_beta1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/firestore1_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/firestore1_beta1-cli/src/main.rs b/gen/firestore1_beta1-cli/src/main.rs new file mode 100644 index 0000000000..c1ef4b34df --- /dev/null +++ b/gen/firestore1_beta1-cli/src/main.rs @@ -0,0 +1,2175 @@ +// 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_firestore1_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::Firestore>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_databases_documents_batch_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "new-transaction.read-write.retry-transaction" => Some(("newTransaction.readWrite.retryTransaction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "new-transaction.read-only.read-time" => Some(("newTransaction.readOnly.readTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction" => Some(("transaction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mask.field-paths" => Some(("mask.fieldPaths", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "documents" => Some(("documents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "read-time" => Some(("readTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["documents", "field-paths", "mask", "new-transaction", "read-only", "read-time", "read-write", "retry-transaction", "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::BatchGetDocumentsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().databases_documents_batch_get(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_databases_documents_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-write.retry-transaction" => Some(("options.readWrite.retryTransaction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "options.read-only.read-time" => Some(("options.readOnly.readTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "read-only", "read-time", "read-write", "retry-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::BeginTransactionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().databases_documents_begin_transaction(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_databases_documents_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" => Some(("transaction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["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::CommitRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().databases_documents_commit(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_databases_documents_create_document(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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 })), + "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", "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::Document = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().databases_documents_create_document(request, opt.value_of("parent").unwrap_or(""), opt.value_of("collection-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "mask-field-paths" => { + call = call.add_mask_field_paths(value.unwrap_or("")); + }, + "document-id" => { + call = call.document_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(["mask-field-paths", "document-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_databases_documents_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().databases_documents_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 { + "current-document-update-time" => { + call = call.current_document_update_time(value.unwrap_or("")); + }, + "current-document-exists" => { + call = call.current_document_exists(arg_from_str(value.unwrap_or("false"), err, "current-document-exists", "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(["current-document-update-time", "current-document-exists"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_databases_documents_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().databases_documents_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 { + "transaction" => { + call = call.transaction(value.unwrap_or("")); + }, + "read-time" => { + call = call.read_time(value.unwrap_or("")); + }, + "mask-field-paths" => { + call = call.add_mask_field_paths(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(["mask-field-paths", "transaction", "read-time"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_databases_documents_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().databases_documents_list(opt.value_of("parent").unwrap_or(""), opt.value_of("collection-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "transaction" => { + call = call.transaction(value.unwrap_or("")); + }, + "show-missing" => { + call = call.show_missing(arg_from_str(value.unwrap_or("false"), err, "show-missing", "boolean")); + }, + "read-time" => { + call = call.read_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")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "mask-field-paths" => { + call = call.add_mask_field_paths(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", "show-missing", "transaction", "page-size", "mask-field-paths", "page-token", "read-time"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_databases_documents_list_collection_ids(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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 })), + "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["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::ListCollectionIdsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().databases_documents_list_collection_ids(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_databases_documents_listen(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "add-target.documents.documents" => Some(("addTarget.documents.documents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "add-target.resume-token" => Some(("addTarget.resumeToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.target-id" => Some(("addTarget.targetId", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "add-target.query.structured-query.limit" => Some(("addTarget.query.structuredQuery.limit", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.unary-filter.field.field-path" => Some(("addTarget.query.structuredQuery.where.unaryFilter.field.fieldPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.unary-filter.op" => Some(("addTarget.query.structuredQuery.where.unaryFilter.op", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.field.field-path" => Some(("addTarget.query.structuredQuery.where.fieldFilter.field.fieldPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.value.bytes-value" => Some(("addTarget.query.structuredQuery.where.fieldFilter.value.bytesValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.value.timestamp-value" => Some(("addTarget.query.structuredQuery.where.fieldFilter.value.timestampValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.value.geo-point-value.latitude" => Some(("addTarget.query.structuredQuery.where.fieldFilter.value.geoPointValue.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.value.geo-point-value.longitude" => Some(("addTarget.query.structuredQuery.where.fieldFilter.value.geoPointValue.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.value.reference-value" => Some(("addTarget.query.structuredQuery.where.fieldFilter.value.referenceValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.value.double-value" => Some(("addTarget.query.structuredQuery.where.fieldFilter.value.doubleValue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.value.string-value" => Some(("addTarget.query.structuredQuery.where.fieldFilter.value.stringValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.value.boolean-value" => Some(("addTarget.query.structuredQuery.where.fieldFilter.value.booleanValue", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.value.integer-value" => Some(("addTarget.query.structuredQuery.where.fieldFilter.value.integerValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.value.null-value" => Some(("addTarget.query.structuredQuery.where.fieldFilter.value.nullValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.field-filter.op" => Some(("addTarget.query.structuredQuery.where.fieldFilter.op", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.query.structured-query.where.composite-filter.op" => Some(("addTarget.query.structuredQuery.where.compositeFilter.op", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.query.structured-query.start-at.before" => Some(("addTarget.query.structuredQuery.startAt.before", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "add-target.query.structured-query.end-at.before" => Some(("addTarget.query.structuredQuery.endAt.before", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "add-target.query.structured-query.offset" => Some(("addTarget.query.structuredQuery.offset", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "add-target.query.parent" => Some(("addTarget.query.parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.read-time" => Some(("addTarget.readTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "add-target.once" => Some(("addTarget.once", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "remove-target" => Some(("removeTarget", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["add-target", "before", "boolean-value", "bytes-value", "composite-filter", "documents", "double-value", "end-at", "field", "field-filter", "field-path", "geo-point-value", "integer-value", "labels", "latitude", "limit", "longitude", "null-value", "offset", "once", "op", "parent", "query", "read-time", "reference-value", "remove-target", "resume-token", "start-at", "string-value", "structured-query", "target-id", "timestamp-value", "unary-filter", "value", "where"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ListenRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().databases_documents_listen(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_databases_documents_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 })), + "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", "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::Document = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().databases_documents_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-field-paths" => { + call = call.add_update_mask_field_paths(value.unwrap_or("")); + }, + "mask-field-paths" => { + call = call.add_mask_field_paths(value.unwrap_or("")); + }, + "current-document-update-time" => { + call = call.current_document_update_time(value.unwrap_or("")); + }, + "current-document-exists" => { + call = call.current_document_exists(arg_from_str(value.unwrap_or("false"), err, "current-document-exists", "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(["current-document-update-time", "mask-field-paths", "update-mask-field-paths", "current-document-exists"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_databases_documents_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" => Some(("transaction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["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::RollbackRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().databases_documents_rollback(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_databases_documents_run_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()[..] { + "new-transaction.read-write.retry-transaction" => Some(("newTransaction.readWrite.retryTransaction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "new-transaction.read-only.read-time" => Some(("newTransaction.readOnly.readTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transaction" => Some(("transaction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.limit" => Some(("structuredQuery.limit", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "structured-query.where.unary-filter.field.field-path" => Some(("structuredQuery.where.unaryFilter.field.fieldPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.where.unary-filter.op" => Some(("structuredQuery.where.unaryFilter.op", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.field.field-path" => Some(("structuredQuery.where.fieldFilter.field.fieldPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.value.bytes-value" => Some(("structuredQuery.where.fieldFilter.value.bytesValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.value.timestamp-value" => Some(("structuredQuery.where.fieldFilter.value.timestampValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.value.geo-point-value.latitude" => Some(("structuredQuery.where.fieldFilter.value.geoPointValue.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.value.geo-point-value.longitude" => Some(("structuredQuery.where.fieldFilter.value.geoPointValue.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.value.reference-value" => Some(("structuredQuery.where.fieldFilter.value.referenceValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.value.double-value" => Some(("structuredQuery.where.fieldFilter.value.doubleValue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.value.string-value" => Some(("structuredQuery.where.fieldFilter.value.stringValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.value.boolean-value" => Some(("structuredQuery.where.fieldFilter.value.booleanValue", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.value.integer-value" => Some(("structuredQuery.where.fieldFilter.value.integerValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.value.null-value" => Some(("structuredQuery.where.fieldFilter.value.nullValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.where.field-filter.op" => Some(("structuredQuery.where.fieldFilter.op", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.where.composite-filter.op" => Some(("structuredQuery.where.compositeFilter.op", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "structured-query.start-at.before" => Some(("structuredQuery.startAt.before", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "structured-query.end-at.before" => Some(("structuredQuery.endAt.before", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "structured-query.offset" => Some(("structuredQuery.offset", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "read-time" => Some(("readTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["before", "boolean-value", "bytes-value", "composite-filter", "double-value", "end-at", "field", "field-filter", "field-path", "geo-point-value", "integer-value", "latitude", "limit", "longitude", "new-transaction", "null-value", "offset", "op", "read-only", "read-time", "read-write", "reference-value", "retry-transaction", "start-at", "string-value", "structured-query", "timestamp-value", "transaction", "unary-filter", "value", "where"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RunQueryRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().databases_documents_run_query(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_databases_documents_write(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "stream-token" => Some(("streamToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "stream-id" => Some(("streamId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["labels", "stream-id", "stream-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::WriteRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().databases_documents_write(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_databases_indexes_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()[..] { + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "collection-id" => Some(("collectionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["collection-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::Index = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().databases_indexes_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_databases_indexes_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().databases_indexes_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_databases_indexes_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().databases_indexes_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_databases_indexes_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().databases_indexes_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 _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() { + ("databases-documents-batch-get", Some(opt)) => { + call_result = self._projects_databases_documents_batch_get(opt, dry_run, &mut err); + }, + ("databases-documents-begin-transaction", Some(opt)) => { + call_result = self._projects_databases_documents_begin_transaction(opt, dry_run, &mut err); + }, + ("databases-documents-commit", Some(opt)) => { + call_result = self._projects_databases_documents_commit(opt, dry_run, &mut err); + }, + ("databases-documents-create-document", Some(opt)) => { + call_result = self._projects_databases_documents_create_document(opt, dry_run, &mut err); + }, + ("databases-documents-delete", Some(opt)) => { + call_result = self._projects_databases_documents_delete(opt, dry_run, &mut err); + }, + ("databases-documents-get", Some(opt)) => { + call_result = self._projects_databases_documents_get(opt, dry_run, &mut err); + }, + ("databases-documents-list", Some(opt)) => { + call_result = self._projects_databases_documents_list(opt, dry_run, &mut err); + }, + ("databases-documents-list-collection-ids", Some(opt)) => { + call_result = self._projects_databases_documents_list_collection_ids(opt, dry_run, &mut err); + }, + ("databases-documents-listen", Some(opt)) => { + call_result = self._projects_databases_documents_listen(opt, dry_run, &mut err); + }, + ("databases-documents-patch", Some(opt)) => { + call_result = self._projects_databases_documents_patch(opt, dry_run, &mut err); + }, + ("databases-documents-rollback", Some(opt)) => { + call_result = self._projects_databases_documents_rollback(opt, dry_run, &mut err); + }, + ("databases-documents-run-query", Some(opt)) => { + call_result = self._projects_databases_documents_run_query(opt, dry_run, &mut err); + }, + ("databases-documents-write", Some(opt)) => { + call_result = self._projects_databases_documents_write(opt, dry_run, &mut err); + }, + ("databases-indexes-create", Some(opt)) => { + call_result = self._projects_databases_indexes_create(opt, dry_run, &mut err); + }, + ("databases-indexes-delete", Some(opt)) => { + call_result = self._projects_databases_indexes_delete(opt, dry_run, &mut err); + }, + ("databases-indexes-get", Some(opt)) => { + call_result = self._projects_databases_indexes_get(opt, dry_run, &mut err); + }, + ("databases-indexes-list", Some(opt)) => { + call_result = self._projects_databases_indexes_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, "firestore1-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: "firestore1-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::Firestore::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: 'databases-documents-batch-get', 'databases-documents-begin-transaction', 'databases-documents-commit', 'databases-documents-create-document', 'databases-documents-delete', 'databases-documents-get', 'databases-documents-list', 'databases-documents-list-collection-ids', 'databases-documents-listen', 'databases-documents-patch', 'databases-documents-rollback', 'databases-documents-run-query', 'databases-documents-write', 'databases-indexes-create', 'databases-indexes-delete', 'databases-indexes-get' and 'databases-indexes-list'", vec![ + ("databases-documents-batch-get", + Some(r##"Gets multiple documents. + + Documents returned by this method are not guaranteed to be returned in the + same order that they were requested."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-batch-get", + vec![ + (Some(r##"database"##), + None, + Some(r##"The database name. In the format: + `projects/{project_id}/databases/{database_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)), + ]), + ("databases-documents-begin-transaction", + Some(r##"Starts a new transaction."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-begin-transaction", + vec![ + (Some(r##"database"##), + None, + Some(r##"The database name. In the format: + `projects/{project_id}/databases/{database_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)), + ]), + ("databases-documents-commit", + Some(r##"Commits a transaction, while optionally updating documents."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-commit", + vec![ + (Some(r##"database"##), + None, + Some(r##"The database name. In the format: + `projects/{project_id}/databases/{database_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)), + ]), + ("databases-documents-create-document", + Some(r##"Creates a new document."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-create-document", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The parent resource. For example: + `projects/{project_id}/databases/{database_id}/documents` or + `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`"##), + Some(true), + Some(false)), + + (Some(r##"collection-id"##), + None, + Some(r##"The collection ID, relative to `parent`, to list. For example: `chatrooms`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("databases-documents-delete", + Some(r##"Deletes a document."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the Document to delete. In the format: + `projects/{project_id}/databases/{database_id}/documents/{document_path}`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("databases-documents-get", + Some(r##"Gets a single document."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the Document to get. In the format: + `projects/{project_id}/databases/{database_id}/documents/{document_path}`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("databases-documents-list", + Some(r##"Lists documents."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The parent resource name. In the format: + `projects/{project_id}/databases/{database_id}/documents` or + `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + For example: + `projects/my-project/databases/my-database/documents` or + `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`"##), + Some(true), + Some(false)), + + (Some(r##"collection-id"##), + None, + Some(r##"The collection ID, relative to `parent`, to list. For example: `chatrooms` + or `messages`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("databases-documents-list-collection-ids", + Some(r##"Lists all the collection IDs underneath a document."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-list-collection-ids", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The parent document. In the format: + `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + For example: + `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("databases-documents-listen", + Some(r##"Listens to changes."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-listen", + vec![ + (Some(r##"database"##), + None, + Some(r##"The database name. In the format: + `projects/{project_id}/databases/{database_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)), + ]), + ("databases-documents-patch", + Some(r##"Updates or inserts a document."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the document, for example + `projects/{project_id}/databases/{database_id}/documents/{document_path}`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("databases-documents-rollback", + Some(r##"Rolls back a transaction."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-rollback", + vec![ + (Some(r##"database"##), + None, + Some(r##"The database name. In the format: + `projects/{project_id}/databases/{database_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)), + ]), + ("databases-documents-run-query", + Some(r##"Runs a query."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-run-query", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The parent resource name. In the format: + `projects/{project_id}/databases/{database_id}/documents` or + `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + For example: + `projects/my-project/databases/my-database/documents` or + `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("databases-documents-write", + Some(r##"Streams batches of document updates and deletes, in order."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-documents-write", + vec![ + (Some(r##"database"##), + None, + Some(r##"The database name. In the format: + `projects/{project_id}/databases/{database_id}`. + This is only required in the first message."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("databases-indexes-create", + Some(r##"Creates the specified index. + A newly created index's initial state is `CREATING`. On completion of the + returned google.longrunning.Operation, the state will be `READY`. + If the index already exists, the call will return an `ALREADY_EXISTS` + status. + + During creation, the process could result in an error, in which case the + index will move to the `ERROR` state. The process can be recovered by + fixing the data that caused the error, removing the index with + delete, then re-creating the index with + create. + + Indexes with a single field cannot be created."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-indexes-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The name of the database this index will apply to. For example: + `projects/{project_id}/databases/{database_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)), + ]), + ("databases-indexes-delete", + Some(r##"Deletes an index."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-indexes-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The index name. For example: + `projects/{project_id}/databases/{database_id}/indexes/{index_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)), + ]), + ("databases-indexes-get", + Some(r##"Gets an index."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-indexes-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the index. For example: + `projects/{project_id}/databases/{database_id}/indexes/{index_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)), + ]), + ("databases-indexes-list", + Some(r##"Lists the indexes that match the specified filters."##), + "Details at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli/projects_databases-indexes-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The database name. For example: + `projects/{project_id}/databases/{database_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)), + ]), + ]), + + ]; + + let mut app = App::new("firestore1-beta1") + .author("Sebastian Thiel ") + .version("1.0.6+20171205") + .about("") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_firestore1_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/firestore1_beta1/Cargo.toml b/gen/firestore1_beta1/Cargo.toml new file mode 100644 index 0000000000..419cb3d985 --- /dev/null +++ b/gen/firestore1_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-firestore1_beta1" +version = "1.0.6+20171205" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Firestore (protocol v1beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firestore1_beta1" +homepage = "https://cloud.google.com/firestore" +documentation = "https://docs.rs/google-firestore1_beta1/1.0.6+20171205" +license = "MIT" +keywords = ["firestore", "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/firestore1_beta1/LICENSE.md b/gen/firestore1_beta1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/firestore1_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/firestore1_beta1/README.md b/gen/firestore1_beta1/README.md new file mode 100644 index 0000000000..1de578efc5 --- /dev/null +++ b/gen/firestore1_beta1/README.md @@ -0,0 +1,186 @@ + +The `google-firestore1_beta1` library allows access to all features of the *Google Firestore* service. + +This documentation was generated from *Firestore* crate version *1.0.6+20171205*, where *20171205* is the exact revision of the *firestore:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Firestore* *v1_beta1* API can be found at the +[official documentation site](https://cloud.google.com/firestore). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.Firestore.html) ... + +* projects + * [*databases documents batch get*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentBatchGetCall.html), [*databases documents begin transaction*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentBeginTransactionCall.html), [*databases documents commit*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentCommitCall.html), [*databases documents create document*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentCreateDocumentCall.html), [*databases documents delete*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentDeleteCall.html), [*databases documents get*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentGetCall.html), [*databases documents list*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentListCall.html), [*databases documents list collection ids*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentListCollectionIdCall.html), [*databases documents listen*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentListenCall.html), [*databases documents patch*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentPatchCall.html), [*databases documents rollback*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentRollbackCall.html), [*databases documents run query*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentRunQueryCall.html), [*databases documents write*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseDocumentWriteCall.html), [*databases indexes create*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseIndexeCreateCall.html), [*databases indexes delete*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseIndexeDeleteCall.html), [*databases indexes get*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseIndexeGetCall.html) and [*databases indexes list*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.ProjectDatabaseIndexeListCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/struct.Firestore.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/trait.CallBuilder.html)** + * operations to apply to *Resources* + +All *structures* are marked with applicable traits to further categorize them and ease browsing. + +Generally speaking, you can invoke *Activities* like this: + +```Rust,ignore +let r = hub.resource().activity(...).doit() +``` + +Or specifically ... + +```ignore +let r = hub.projects().databases_documents_get(...).doit() +let r = hub.projects().databases_documents_create_document(...).doit() +let r = hub.projects().databases_documents_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-firestore1_beta1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_firestore1_beta1 as firestore1_beta1; +use firestore1_beta1::Document; +use firestore1_beta1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use firestore1_beta1::Firestore; + +// 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 = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +// As the method needs a request, you would usually fill it with the desired information +// into the respective structure. Some of the parts shown here might not be applicable ! +// Values shown here are possibly random and not representative ! +let mut req = Document::default(); + +// You can configure optional parameters by calling the respective setters at will, and +// execute the final call using `doit()`. +// Values shown here are possibly random and not representative ! +let result = hub.projects().databases_documents_patch(req, "name") + .add_update_mask_field_paths("sit") + .add_mask_field_paths("Stet") + .current_document_update_time("sed") + .current_document_exists(false) + .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-firestore1_beta1/1.0.6+20171205/google_firestore1_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-firestore1_beta1/1.0.6+20171205/google_firestore1_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-firestore1_beta1/1.0.6+20171205/google_firestore1_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-firestore1_beta1/1.0.6+20171205/google_firestore1_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-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_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-firestore1_beta1/1.0.6+20171205/google_firestore1_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-firestore1_beta1/1.0.6+20171205/google_firestore1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firestore1_beta1/1.0.6+20171205/google_firestore1_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-firestore1_beta1/1.0.6+20171205/google_firestore1_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-firestore1_beta1/1.0.6+20171205/google_firestore1_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-firestore1_beta1/1.0.6+20171205/google_firestore1_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 **firestore1_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/firestore1_beta1/src/cmn.rs b/gen/firestore1_beta1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/firestore1_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/firestore1_beta1/src/lib.rs b/gen/firestore1_beta1/src/lib.rs new file mode 100644 index 0000000000..d11553849f --- /dev/null +++ b/gen/firestore1_beta1/src/lib.rs @@ -0,0 +1,7242 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Firestore* crate version *1.0.6+20171205*, where *20171205* is the exact revision of the *firestore:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Firestore* *v1_beta1* API can be found at the +//! [official documentation site](https://cloud.google.com/firestore). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/firestore1_beta1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.Firestore.html) ... +//! +//! * projects +//! * [*databases documents batch get*](struct.ProjectDatabaseDocumentBatchGetCall.html), [*databases documents begin transaction*](struct.ProjectDatabaseDocumentBeginTransactionCall.html), [*databases documents commit*](struct.ProjectDatabaseDocumentCommitCall.html), [*databases documents create document*](struct.ProjectDatabaseDocumentCreateDocumentCall.html), [*databases documents delete*](struct.ProjectDatabaseDocumentDeleteCall.html), [*databases documents get*](struct.ProjectDatabaseDocumentGetCall.html), [*databases documents list*](struct.ProjectDatabaseDocumentListCall.html), [*databases documents list collection ids*](struct.ProjectDatabaseDocumentListCollectionIdCall.html), [*databases documents listen*](struct.ProjectDatabaseDocumentListenCall.html), [*databases documents patch*](struct.ProjectDatabaseDocumentPatchCall.html), [*databases documents rollback*](struct.ProjectDatabaseDocumentRollbackCall.html), [*databases documents run query*](struct.ProjectDatabaseDocumentRunQueryCall.html), [*databases documents write*](struct.ProjectDatabaseDocumentWriteCall.html), [*databases indexes create*](struct.ProjectDatabaseIndexeCreateCall.html), [*databases indexes delete*](struct.ProjectDatabaseIndexeDeleteCall.html), [*databases indexes get*](struct.ProjectDatabaseIndexeGetCall.html) and [*databases indexes list*](struct.ProjectDatabaseIndexeListCall.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.Firestore.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().databases_documents_get(...).doit() +//! let r = hub.projects().databases_documents_create_document(...).doit() +//! let r = hub.projects().databases_documents_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-firestore1_beta1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_firestore1_beta1 as firestore1_beta1; +//! use firestore1_beta1::Document; +//! use firestore1_beta1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use firestore1_beta1::Firestore; +//! +//! // 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 = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +//! // As the method needs a request, you would usually fill it with the desired information +//! // into the respective structure. Some of the parts shown here might not be applicable ! +//! // Values shown here are possibly random and not representative ! +//! let mut req = Document::default(); +//! +//! // You can configure optional parameters by calling the respective setters at will, and +//! // execute the final call using `doit()`. +//! // Values shown here are possibly random and not representative ! +//! let result = hub.projects().databases_documents_patch(req, "name") +//! .add_update_mask_field_paths("kasd") +//! .add_mask_field_paths("accusam") +//! .current_document_update_time("takimata") +//! .current_document_exists(false) +//! .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 Cloud Datastore data + Datastore, + + /// View and manage your data across Google Cloud Platform services + CloudPlatform, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::Datastore => "https://www.googleapis.com/auth/datastore", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Datastore + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all Firestore 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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::Document; +/// use firestore1_beta1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use firestore1_beta1::Firestore; +/// +/// // 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 = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Document::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_documents_patch(req, "name") +/// .add_update_mask_field_paths("erat") +/// .add_mask_field_paths("labore") +/// .current_document_update_time("sea") +/// .current_document_exists(false) +/// .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 Firestore { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for Firestore {} + +impl<'a, C, A> Firestore + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> Firestore { + Firestore { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://firestore.googleapis.com/".to_string(), + _root_url: "https://firestore.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://firestore.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://firestore.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 ### +// ########## +/// An index definition. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases indexes create projects](struct.ProjectDatabaseIndexeCreateCall.html) (request) +/// * [databases indexes get projects](struct.ProjectDatabaseIndexeGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Index { + /// The fields to index. + pub fields: Option>, + /// The state of the index. + /// Output only. + pub state: Option, + /// The resource name of the index. + /// Output only. + pub name: Option, + /// The collection ID to which this index applies. Required. + #[serde(rename="collectionId")] + pub collection_id: Option, +} + +impl RequestValue for Index {} +impl ResponseResult for Index {} + + +/// The response for Firestore.Listen. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases documents listen projects](struct.ProjectDatabaseDocumentListenCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListenResponse { + /// A filter to apply to the set of documents previously returned for the + /// given target. + /// + /// Returned when documents may have been removed from the given target, but + /// the exact documents are unknown. + pub filter: Option, + /// Targets have changed. + #[serde(rename="targetChange")] + pub target_change: Option, + /// A Document has been deleted. + #[serde(rename="documentDelete")] + pub document_delete: Option, + /// A Document has changed. + #[serde(rename="documentChange")] + pub document_change: Option, + /// A Document has been removed from a target (because it is no longer + /// relevant to that target). + #[serde(rename="documentRemove")] + pub document_remove: Option, +} + +impl ResponseResult for ListenResponse {} + + +/// The response for Firestore.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*). +/// +/// * [databases documents begin transaction projects](struct.ProjectDatabaseDocumentBeginTransactionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BeginTransactionResponse { + /// The transaction that was started. + pub transaction: Option, +} + +impl ResponseResult for BeginTransactionResponse {} + + +/// The response for Firestore.RunQuery. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases documents run query projects](struct.ProjectDatabaseDocumentRunQueryCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RunQueryResponse { + /// The number of results that have been skipped due to an offset between + /// the last response and the current response. + #[serde(rename="skippedResults")] + pub skipped_results: Option, + /// The transaction that was started as part of this request. + /// Can only be set in the first response, and only if + /// RunQueryRequest.new_transaction was set in the request. + /// If set, no other fields will be set in this response. + pub transaction: Option, + /// A query result. + /// Not set when reporting partial progress. + pub document: Option, + /// The time at which the document was read. This may be monotonically + /// increasing; in this case, the previous documents in the result stream are + /// guaranteed not to have changed between their `read_time` and this one. + /// + /// If the query returns no results, a response with `read_time` and no + /// `document` will be sent, and this represents the time at which the query + /// was run. + #[serde(rename="readTime")] + pub read_time: Option, +} + +impl ResponseResult for RunQueryResponse {} + + +/// A filter on a specific 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 FieldFilter { + /// The field to filter by. + pub field: Option, + /// The value to compare to. + pub value: Option, + /// The operator to filter by. + pub op: Option, +} + +impl Part for FieldFilter {} + + +/// A Firestore document. +/// +/// Must not exceed 1 MiB - 4 bytes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases documents get projects](struct.ProjectDatabaseDocumentGetCall.html) (response) +/// * [databases documents create document projects](struct.ProjectDatabaseDocumentCreateDocumentCall.html) (request|response) +/// * [databases documents patch projects](struct.ProjectDatabaseDocumentPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Document { + /// The document's fields. + /// + /// The map keys represent field names. + /// + /// A simple field name contains only characters `a` to `z`, `A` to `Z`, + /// `0` to `9`, or `_`, and must not start with `0` to `9`. For example, + /// `foo_bar_17`. + /// + /// Field names matching the regular expression `__.*__` are reserved. Reserved + /// field names are forbidden except in certain documented contexts. The map + /// keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be + /// empty. + /// + /// Field paths may be used in other contexts to refer to structured fields + /// defined here. For `map_value`, the field path is represented by the simple + /// or quoted field names of the containing fields, delimited by `.`. For + /// example, the structured field + /// `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be + /// represented by the field path `foo.x&y`. + /// + /// Within a field path, a quoted field name starts and ends with `` ` `` and + /// may contain any character. Some characters, including `` ` ``, must be + /// escaped using a `\`. For example, `` `x&y` `` represents `x&y` and + /// `` `bak\`tik` `` represents `` bak`tik ``. + pub fields: Option>, + /// Output only. The time at which the document was last changed. + /// + /// This value is initally set to the `create_time` then increases + /// monotonically with each change to the document. It can also be + /// compared to values from other documents and the `read_time` of a query. + #[serde(rename="updateTime")] + pub update_time: Option, + /// Output only. The time at which the document was created. + /// + /// This value increases monotonically when a document is deleted then + /// recreated. It can also be compared to values from other documents and + /// the `read_time` of a query. + #[serde(rename="createTime")] + pub create_time: Option, + /// The resource name of the document, for example + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + pub name: Option, +} + +impl RequestValue for Document {} +impl ResponseResult for Document {} + + +/// An array 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 ArrayValue { + /// Values in the array. + pub values: Option>, +} + +impl Part for ArrayValue {} + + +/// 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*). +/// +/// * [databases documents delete projects](struct.ProjectDatabaseDocumentDeleteCall.html) (response) +/// * [databases indexes delete projects](struct.ProjectDatabaseIndexeDeleteCall.html) (response) +/// * [databases documents rollback projects](struct.ProjectDatabaseDocumentRollbackCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// Options for creating a new 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 TransactionOptions { + /// The transaction can be used for both read and write operations. + #[serde(rename="readWrite")] + pub read_write: Option, + /// The transaction can only be used for read operations. + #[serde(rename="readOnly")] + pub read_only: Option, +} + +impl Part for TransactionOptions {} + + +/// A request for Firestore.Listen +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases documents listen projects](struct.ProjectDatabaseDocumentListenCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListenRequest { + /// A target to add to this stream. + #[serde(rename="addTarget")] + pub add_target: Option, + /// Labels associated with this target change. + pub labels: Option>, + /// The ID of a target to remove from this stream. + #[serde(rename="removeTarget")] + pub remove_target: Option, +} + +impl RequestValue for ListenRequest {} + + +/// A reference to a field, such as `max(messages.time) as max_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 FieldReference { + /// no description provided + #[serde(rename="fieldPath")] + pub field_path: Option, +} + +impl Part for FieldReference {} + + +/// A filter with a single operand. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UnaryFilter { + /// The field to which to apply the operator. + pub field: Option, + /// The unary operator to apply. + pub op: Option, +} + +impl Part for UnaryFilter {} + + +/// The response for Firestore.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*). +/// +/// * [databases documents commit projects](struct.ProjectDatabaseDocumentCommitCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommitResponse { + /// The result of applying the writes. + /// + /// This i-th write result corresponds to the i-th write in the + /// request. + #[serde(rename="writeResults")] + pub write_results: Option>, + /// The time at which the commit occurred. + #[serde(rename="commitTime")] + pub commit_time: Option, +} + +impl ResponseResult for CommitResponse {} + + +/// A field of an index. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IndexField { + /// The path of the field. Must match the field path specification described + /// by google.firestore.v1beta1.Document.fields. + /// Special field path `__name__` may be used by itself or at the end of a + /// path. `__type__` may be used only at the end of path. + #[serde(rename="fieldPath")] + pub field_path: Option, + /// The field's mode. + pub mode: Option, +} + +impl Part for IndexField {} + + +/// A set of field paths on a document. +/// Used to restrict a get or update operation on a document to a subset of its +/// fields. +/// This is different from standard field masks, as this is always scoped to a +/// Document, and takes in account the dynamic nature of 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 DocumentMask { + /// The list of field paths in the mask. See Document.fields for a field + /// path syntax reference. + #[serde(rename="fieldPaths")] + pub field_paths: Option>, +} + +impl Part for DocumentMask {} + + +/// A filter that merges multiple other filters using the given operator. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CompositeFilter { + /// The list of filters to combine. + /// Must contain at least one filter. + pub filters: Option>, + /// The operator for combining multiple filters. + pub op: Option, +} + +impl Part for CompositeFilter {} + + +/// The streamed response for Firestore.BatchGetDocuments. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases documents batch get projects](struct.ProjectDatabaseDocumentBatchGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchGetDocumentsResponse { + /// A document that was requested. + pub found: Option, + /// The transaction that was started as part of this request. + /// Will only be set in the first response, and only if + /// BatchGetDocumentsRequest.new_transaction was set in the request. + pub transaction: Option, + /// The time at which the document was read. + /// This may be monotically increasing, in this case the previous documents in + /// the result stream are guaranteed not to have changed between their + /// read_time and this one. + #[serde(rename="readTime")] + pub read_time: Option, + /// A document name that was requested but does not exist. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + pub missing: Option, +} + +impl ResponseResult for BatchGetDocumentsResponse {} + + +/// The response for FirestoreAdmin.ListIndexes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases indexes list projects](struct.ProjectDatabaseIndexeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListIndexesResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The indexes. + pub indexes: Option>, +} + +impl ResponseResult for ListIndexesResponse {} + + +/// The response for Firestore.Write. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases documents write projects](struct.ProjectDatabaseDocumentWriteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WriteResponse { + /// The result of applying the writes. + /// + /// This i-th write result corresponds to the i-th write in the + /// request. + #[serde(rename="writeResults")] + pub write_results: Option>, + /// A token that represents the position of this response in the stream. + /// This can be used by a client to resume the stream at this point. + /// + /// This field is always set. + #[serde(rename="streamToken")] + pub stream_token: Option, + /// The time at which the commit occurred. + #[serde(rename="commitTime")] + pub commit_time: Option, + /// The ID of the stream. + /// Only set on the first message, when a new stream was created. + #[serde(rename="streamId")] + pub stream_id: Option, +} + +impl ResponseResult for WriteResponse {} + + +/// The request for Firestore.ListCollectionIds. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases documents list collection ids projects](struct.ProjectDatabaseDocumentListCollectionIdCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListCollectionIdsRequest { + /// A page token. Must be a value from + /// ListCollectionIdsResponse. + #[serde(rename="pageToken")] + pub page_token: Option, + /// The maximum number of results to return. + #[serde(rename="pageSize")] + pub page_size: Option, +} + +impl RequestValue for ListCollectionIdsRequest {} + + +/// A Document has been removed from the view of the targets. +/// +/// Sent if the document is no longer relevant to a target and is out of view. +/// Can be sent instead of a DocumentDelete or a DocumentChange if the server +/// can not send the new value of the document. +/// +/// Multiple DocumentRemove messages may be returned for the same logical +/// write or delete, if multiple targets are affected. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DocumentRemove { + /// The resource name of the Document that has gone out of view. + pub document: Option, + /// A set of target IDs for targets that previously matched this document. + #[serde(rename="removedTargetIds")] + pub removed_target_ids: Option>, + /// The read timestamp at which the remove was observed. + /// + /// Greater or equal to the `commit_time` of the change/delete/remove. + #[serde(rename="readTime")] + pub read_time: Option, +} + +impl Part for DocumentRemove {} + + +/// A map 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 MapValue { + /// The map's fields. + /// + /// The map keys represent field names. Field names matching the regular + /// expression `__.*__` are reserved. Reserved field names are forbidden except + /// in certain documented contexts. The map keys, represented as UTF-8, must + /// not exceed 1,500 bytes and cannot be empty. + pub fields: Option>, +} + +impl Part for MapValue {} + + +/// 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 specification of a set of documents to listen to. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Target { + /// A target specified by a set of document names. + pub documents: Option, + /// Start listening after a specific `read_time`. + /// + /// The client must know the state of matching documents at this time. + #[serde(rename="readTime")] + pub read_time: Option, + /// A target specified by a query. + pub query: Option, + /// A resume token from a prior TargetChange for an identical target. + /// + /// Using a resume token with a different target is unsupported and may fail. + #[serde(rename="resumeToken")] + pub resume_token: Option, + /// A client provided target ID. + /// + /// If not set, the server will assign an ID for the target. + /// + /// Used for resuming a target without changing IDs. The IDs can either be + /// client-assigned or be server-assigned in a previous stream. All targets + /// with client provided IDs must be added before adding a target that needs + /// a server-assigned id. + #[serde(rename="targetId")] + pub target_id: Option, + /// If the target should be removed once it is current and consistent. + pub once: Option, +} + +impl Part for Target {} + + +/// A digest of all the documents that match a given 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 ExistenceFilter { + /// The total count of documents that match target_id. + /// + /// If different from the count of documents in the client that match, the + /// client must manually determine which documents no longer match the target. + pub count: Option, + /// The target ID to which this filter applies. + #[serde(rename="targetId")] + pub target_id: Option, +} + +impl Part for ExistenceFilter {} + + +/// A target specified by a set of documents names. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DocumentsTarget { + /// The names of the documents to retrieve. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// The request will fail if any of the document is not a child resource of + /// the given `database`. Duplicate names will be elided. + pub documents: Option>, +} + +impl Part for DocumentsTarget {} + + +/// The response from Firestore.ListCollectionIds. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases documents list collection ids projects](struct.ProjectDatabaseDocumentListCollectionIdCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListCollectionIdsResponse { + /// A page token that may be used to continue the list. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The collection ids. + #[serde(rename="collectionIds")] + pub collection_ids: Option>, +} + +impl ResponseResult for ListCollectionIdsResponse {} + + +/// A message that can hold any of the supported value types. +/// +/// 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 { + /// A bytes value. + /// + /// Must not exceed 1 MiB - 89 bytes. + /// Only the first 1,500 bytes are considered by queries. + #[serde(rename="bytesValue")] + pub bytes_value: Option, + /// A timestamp value. + /// + /// Precise only to microseconds. When stored, any additional precision is + /// rounded down. + #[serde(rename="timestampValue")] + pub timestamp_value: Option, + /// A null value. + #[serde(rename="nullValue")] + pub null_value: Option, + /// A reference to a document. For example: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + #[serde(rename="referenceValue")] + pub reference_value: Option, + /// A double value. + #[serde(rename="doubleValue")] + pub double_value: Option, + /// A map value. + #[serde(rename="mapValue")] + pub map_value: Option, + /// A string value. + /// + /// The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. + /// Only the first 1,500 bytes of the UTF-8 representation are considered by + /// queries. + #[serde(rename="stringValue")] + pub string_value: Option, + /// A boolean value. + #[serde(rename="booleanValue")] + pub boolean_value: Option, + /// An array value. + /// + /// Cannot contain another array value. + #[serde(rename="arrayValue")] + pub array_value: Option, + /// An integer value. + #[serde(rename="integerValue")] + pub integer_value: Option, + /// A geo point value representing a point on the surface of Earth. + #[serde(rename="geoPointValue")] + pub geo_point_value: Option, +} + +impl Part for Value {} + + +/// A 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 Filter { + /// A filter that takes exactly one argument. + #[serde(rename="unaryFilter")] + pub unary_filter: Option, + /// A filter on a document field. + #[serde(rename="fieldFilter")] + pub field_filter: Option, + /// A composite filter. + #[serde(rename="compositeFilter")] + pub composite_filter: Option, +} + +impl Part for Filter {} + + +/// A selection of a collection, such as `messages as m1`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CollectionSelector { + /// When false, selects only collections that are immediate children of + /// the `parent` specified in the containing `RunQueryRequest`. + /// When true, selects all descendant collections. + #[serde(rename="allDescendants")] + pub all_descendants: Option, + /// The collection ID. + /// When set, selects only collections with this ID. + #[serde(rename="collectionId")] + pub collection_id: Option, +} + +impl Part for CollectionSelector {} + + +/// A Firestore 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 StructuredQuery { + /// The order to apply to the query results. + /// + /// Firestore guarantees a stable ordering through the following rules: + /// + /// * Any field required to appear in `order_by`, that is not already + /// specified in `order_by`, is appended to the order in field name order + /// by default. + /// * If an order on `__name__` is not specified, it is appended by default. + /// + /// Fields are appended with the same sort direction as the last order + /// specified, or 'ASCENDING' if no order was specified. For example: + /// + /// * `SELECT * FROM Foo ORDER BY A` becomes + /// `SELECT * FROM Foo ORDER BY A, __name__` + /// * `SELECT * FROM Foo ORDER BY A DESC` becomes + /// `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC` + /// * `SELECT * FROM Foo WHERE A > 1` becomes + /// `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__` + #[serde(rename="orderBy")] + pub order_by: Option>, + /// A starting point for the query results. + #[serde(rename="startAt")] + pub start_at: Option, + /// A end point for the query results. + #[serde(rename="endAt")] + pub end_at: Option, + /// The maximum number of results to return. + /// + /// Applies after all other constraints. + /// Must be >= 0 if specified. + pub limit: Option, + /// The number of results to skip. + /// + /// Applies before limit, but after all other constraints. Must be >= 0 if + /// specified. + pub offset: Option, + /// The collections to query. + pub from: Option>, + /// The filter to apply. + #[serde(rename="where")] + pub where_: Option, + /// The projection to return. + pub select: Option, +} + +impl Part for StructuredQuery {} + + +/// A transformation of a field of the document. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FieldTransform { + /// The path of the field. See Document.fields for the field path syntax + /// reference. + #[serde(rename="fieldPath")] + pub field_path: Option, + /// Sets the field to the given server value. + #[serde(rename="setToServerValue")] + pub set_to_server_value: Option, +} + +impl Part for FieldTransform {} + + +/// The request for Firestore.RunQuery. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases documents run query projects](struct.ProjectDatabaseDocumentRunQueryCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RunQueryRequest { + /// Starts a new transaction and reads the documents. + /// Defaults to a read-only transaction. + /// The new transaction ID will be returned as the first response in the + /// stream. + #[serde(rename="newTransaction")] + pub new_transaction: Option, + /// Reads documents in a transaction. + pub transaction: Option, + /// A structured query. + #[serde(rename="structuredQuery")] + pub structured_query: Option, + /// Reads documents as they were at the given time. + /// This may not be older than 60 seconds. + #[serde(rename="readTime")] + pub read_time: Option, +} + +impl RequestValue for RunQueryRequest {} + + +/// An order on 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 Order { + /// The field to order by. + pub field: Option, + /// The direction to order by. Defaults to `ASCENDING`. + pub direction: Option, +} + +impl Part for Order {} + + +/// Targets being watched have changed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetChange { + /// The type of change that occurred. + #[serde(rename="targetChangeType")] + pub target_change_type: Option, + /// A token that can be used to resume the stream for the given `target_ids`, + /// or all targets if `target_ids` is empty. + /// + /// Not set on every target change. + #[serde(rename="resumeToken")] + pub resume_token: Option, + /// The error that resulted in this change, if applicable. + pub cause: Option, + /// The target IDs of targets that have changed. + /// + /// If empty, the change applies to all targets. + /// + /// For `target_change_type=ADD`, the order of the target IDs matches the order + /// of the requests to add the targets. This allows clients to unambiguously + /// associate server-assigned target IDs with added targets. + /// + /// For other states, the order of the target IDs is not defined. + #[serde(rename="targetIds")] + pub target_ids: Option>, + /// The consistent `read_time` for the given `target_ids` (omitted when the + /// target_ids are not at a consistent snapshot). + /// + /// The stream is guaranteed to send a `read_time` with `target_ids` empty + /// whenever the entire stream reaches a new consistent snapshot. ADD, + /// CURRENT, and RESET messages are guaranteed to (eventually) result in a + /// new consistent snapshot (while NO_CHANGE and REMOVE messages are not). + /// + /// For a given stream, `read_time` is guaranteed to be monotonically + /// increasing. + #[serde(rename="readTime")] + pub read_time: Option, +} + +impl Part for TargetChange {} + + +/// A write on a document. +/// +/// 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 { + /// A document name to delete. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + pub delete: Option, + /// An optional precondition on the document. + /// + /// The write will fail if this is set and not met by the target document. + #[serde(rename="currentDocument")] + pub current_document: Option, + /// A document to write. + pub update: Option, + /// Applies a tranformation to a document. + /// At most one `transform` per document is allowed in a given request. + /// An `update` cannot follow a `transform` on the same document in a given + /// request. + pub transform: Option, + /// The fields to update in this write. + /// + /// This field can be set only when the operation is `update`. + /// None of the field paths in the mask may contain a reserved name. + /// If the document exists on the server and has fields not referenced in the + /// mask, they are left unchanged. + /// Fields referenced in the mask, but not present in the input document, are + /// deleted from the document on the server. + /// The field paths in this mask must not contain a reserved field name. + #[serde(rename="updateMask")] + pub update_mask: Option, +} + +impl Part for Write {} + + +/// A precondition on a document, used for conditional 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 Precondition { + /// When set, the target document must exist and have been last updated at + /// that time. + #[serde(rename="updateTime")] + pub update_time: Option, + /// When set to `true`, the target document must exist. + /// When set to `false`, the target document must not exist. + pub exists: Option, +} + +impl Part for Precondition {} + + +/// The request for Firestore.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*). +/// +/// * [databases documents commit projects](struct.ProjectDatabaseDocumentCommitCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommitRequest { + /// The writes to apply. + /// + /// Always executed atomically and in order. + pub writes: Option>, + /// If set, applies all writes in this transaction, and commits it. + pub transaction: Option, +} + +impl RequestValue for CommitRequest {} + + +/// The projection of document's fields to return. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Projection { + /// The fields to return. + /// + /// If empty, all fields are returned. To only return the name + /// of the document, use `['__name__']`. + pub fields: Option>, +} + +impl Part for Projection {} + + +/// The response for Firestore.ListDocuments. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases documents list projects](struct.ProjectDatabaseDocumentListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDocumentsResponse { + /// The next page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The Documents found. + pub documents: Option>, +} + +impl ResponseResult for ListDocumentsResponse {} + + +/// Options for a transaction that can be used to read and write documents. +/// +/// 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 { + /// An optional transaction to retry. + #[serde(rename="retryTransaction")] + pub retry_transaction: Option, +} + +impl Part for ReadWrite {} + + +/// The request for Firestore.Write. +/// +/// The first request creates a stream, or resumes an existing one from a token. +/// +/// When creating a new stream, the server replies with a response containing +/// only an ID and a token, to use in the next request. +/// +/// When resuming a stream, the server first streams any responses later than the +/// given token, then a response containing only an up-to-date token, to use in +/// the next 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*). +/// +/// * [databases documents write projects](struct.ProjectDatabaseDocumentWriteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WriteRequest { + /// The writes to apply. + /// + /// Always executed atomically and in order. + /// This must be empty on the first request. + /// This may be empty on the last request. + /// This must not be empty on all other requests. + pub writes: Option>, + /// Labels associated with this write request. + pub labels: Option>, + /// A stream token that was previously sent by the server. + /// + /// The client should set this field to the token from the most recent + /// WriteResponse it has received. This acknowledges that the client has + /// received responses up to this token. After sending this token, earlier + /// tokens may not be used anymore. + /// + /// The server may close the stream if there are too many unacknowledged + /// responses. + /// + /// Leave this field unset when creating a new stream. To resume a stream at + /// a specific point, set this field and the `stream_id` field. + /// + /// Leave this field unset when creating a new stream. + #[serde(rename="streamToken")] + pub stream_token: Option, + /// The ID of the write stream to resume. + /// This may only be set in the first message. When left empty, a new write + /// stream will be created. + #[serde(rename="streamId")] + pub stream_id: Option, +} + +impl RequestValue for WriteRequest {} + + +/// 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. +/// +/// 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 {} + + +/// A Document has changed. +/// +/// May be the result of multiple writes, including deletes, that +/// ultimately resulted in a new value for the Document. +/// +/// Multiple DocumentChange messages may be returned for the same logical +/// change, if multiple targets are affected. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DocumentChange { + /// A set of target IDs for targets that no longer match this document. + #[serde(rename="removedTargetIds")] + pub removed_target_ids: Option>, + /// The new state of the Document. + /// + /// If `mask` is set, contains only fields that were updated or added. + pub document: Option, + /// A set of target IDs of targets that match this document. + #[serde(rename="targetIds")] + pub target_ids: Option>, +} + +impl Part for DocumentChange {} + + +/// The request for Firestore.BatchGetDocuments. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [databases documents batch get projects](struct.ProjectDatabaseDocumentBatchGetCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchGetDocumentsRequest { + /// Starts a new transaction and reads the documents. + /// Defaults to a read-only transaction. + /// The new transaction ID will be returned as the first response in the + /// stream. + #[serde(rename="newTransaction")] + pub new_transaction: Option, + /// Reads documents in a transaction. + pub transaction: Option, + /// The fields to return. If not set, returns all fields. + /// + /// If a document has a field that is not present in this mask, that field will + /// not be returned in the response. + pub mask: Option, + /// The names of the documents to retrieve. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// The request will fail if any of the document is not a child resource of the + /// given `database`. Duplicate names will be elided. + pub documents: Option>, + /// Reads documents as they were at the given time. + /// This may not be older than 60 seconds. + #[serde(rename="readTime")] + pub read_time: Option, +} + +impl RequestValue for BatchGetDocumentsRequest {} + + +/// The request for Firestore.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*). +/// +/// * [databases documents rollback projects](struct.ProjectDatabaseDocumentRollbackCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RollbackRequest { + /// The transaction to roll back. + pub transaction: Option, +} + +impl RequestValue for RollbackRequest {} + + +/// Options for a transaction that can only be used to read documents. +/// +/// 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 { + /// Reads documents at the given time. + /// This may not be older than 60 seconds. + #[serde(rename="readTime")] + pub read_time: Option, +} + +impl Part for ReadOnly {} + + +/// The request for Firestore.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*). +/// +/// * [databases documents begin transaction projects](struct.ProjectDatabaseDocumentBeginTransactionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BeginTransactionRequest { + /// The options for the transaction. + /// Defaults to a read-write transaction. + pub options: Option, +} + +impl RequestValue for BeginTransactionRequest {} + + +/// A Document has been deleted. +/// +/// May be the result of multiple writes, including updates, the +/// last of which deleted the Document. +/// +/// Multiple DocumentDelete messages may be returned for the same logical +/// delete, if multiple targets are affected. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DocumentDelete { + /// A set of target IDs for targets that previously matched this entity. + #[serde(rename="removedTargetIds")] + pub removed_target_ids: Option>, + /// The resource name of the Document that was deleted. + pub document: Option, + /// The read timestamp at which the delete was observed. + /// + /// Greater or equal to the `commit_time` of the delete. + #[serde(rename="readTime")] + pub read_time: Option, +} + +impl Part for DocumentDelete {} + + +/// A transformation of a document. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DocumentTransform { + /// The name of the document to transform. + pub document: Option, + /// The list of transformations to apply to the fields of the document, in + /// order. + /// This must not be empty. + #[serde(rename="fieldTransforms")] + pub field_transforms: Option>, +} + +impl Part for DocumentTransform {} + + +/// The result of applying a 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 WriteResult { + /// The last update time of the document after applying the write. Not set + /// after a `delete`. + /// + /// If the write did not actually change the document, this will be the + /// previous update_time. + #[serde(rename="updateTime")] + pub update_time: Option, + /// The results of applying each DocumentTransform.FieldTransform, in the + /// same order. + #[serde(rename="transformResults")] + pub transform_results: Option>, +} + +impl Part for WriteResult {} + + +/// A target specified by a 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 QueryTarget { + /// A structured query. + #[serde(rename="structuredQuery")] + pub structured_query: Option, + /// The parent resource name. In the format: + /// `projects/{project_id}/databases/{database_id}/documents` or + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// For example: + /// `projects/my-project/databases/my-database/documents` or + /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + pub parent: Option, +} + +impl Part for QueryTarget {} + + +/// 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*). +/// +/// * [databases indexes create projects](struct.ProjectDatabaseIndexeCreateCall.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 position in a query result 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 Cursor { + /// The values that represent a position, in the order they appear in + /// the order by clause of a query. + /// + /// Can contain fewer values than specified in the order by clause. + pub values: Option>, + /// If the position is just before or just after the given values, relative + /// to the sort order defined by the query. + pub before: Option, +} + +impl Part for Cursor {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `Firestore` 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_firestore1_beta1 as firestore1_beta1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use firestore1_beta1::Firestore; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Firestore::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 `databases_documents_batch_get(...)`, `databases_documents_begin_transaction(...)`, `databases_documents_commit(...)`, `databases_documents_create_document(...)`, `databases_documents_delete(...)`, `databases_documents_get(...)`, `databases_documents_list(...)`, `databases_documents_list_collection_ids(...)`, `databases_documents_listen(...)`, `databases_documents_patch(...)`, `databases_documents_rollback(...)`, `databases_documents_run_query(...)`, `databases_documents_write(...)`, `databases_indexes_create(...)`, `databases_indexes_delete(...)`, `databases_indexes_get(...)` and `databases_indexes_list(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, +} + +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 the indexes that match the specified filters. + /// + /// # Arguments + /// + /// * `parent` - The database name. For example: + /// `projects/{project_id}/databases/{database_id}` + pub fn databases_indexes_list(&self, parent: &str) -> ProjectDatabaseIndexeListCall<'a, C, A> { + ProjectDatabaseIndexeListCall { + 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 document. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The parent resource. For example: + /// `projects/{project_id}/databases/{database_id}/documents` or + /// `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + /// * `collectionId` - The collection ID, relative to `parent`, to list. For example: `chatrooms`. + pub fn databases_documents_create_document(&self, request: Document, parent: &str, collection_id: &str) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> { + ProjectDatabaseDocumentCreateDocumentCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _collection_id: collection_id.to_string(), + _mask_field_paths: Default::default(), + _document_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates the specified index. + /// A newly created index's initial state is `CREATING`. On completion of the + /// returned google.longrunning.Operation, the state will be `READY`. + /// If the index already exists, the call will return an `ALREADY_EXISTS` + /// status. + /// + /// During creation, the process could result in an error, in which case the + /// index will move to the `ERROR` state. The process can be recovered by + /// fixing the data that caused the error, removing the index with + /// delete, then re-creating the index with + /// create. + /// + /// Indexes with a single field cannot be created. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the database this index will apply to. For example: + /// `projects/{project_id}/databases/{database_id}` + pub fn databases_indexes_create(&self, request: Index, parent: &str) -> ProjectDatabaseIndexeCreateCall<'a, C, A> { + ProjectDatabaseIndexeCreateCall { + 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: + /// + /// Rolls back a transaction. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `database` - The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + pub fn databases_documents_rollback(&self, request: RollbackRequest, database: &str) -> ProjectDatabaseDocumentRollbackCall<'a, C, A> { + ProjectDatabaseDocumentRollbackCall { + 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: + /// + /// Lists documents. + /// + /// # Arguments + /// + /// * `parent` - The parent resource name. In the format: + /// `projects/{project_id}/databases/{database_id}/documents` or + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// For example: + /// `projects/my-project/databases/my-database/documents` or + /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + /// * `collectionId` - The collection ID, relative to `parent`, to list. For example: `chatrooms` + /// or `messages`. + pub fn databases_documents_list(&self, parent: &str, collection_id: &str) -> ProjectDatabaseDocumentListCall<'a, C, A> { + ProjectDatabaseDocumentListCall { + hub: self.hub, + _parent: parent.to_string(), + _collection_id: collection_id.to_string(), + _transaction: Default::default(), + _show_missing: Default::default(), + _read_time: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _mask_field_paths: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets an index. + /// + /// # Arguments + /// + /// * `name` - The name of the index. For example: + /// `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + pub fn databases_indexes_get(&self, name: &str) -> ProjectDatabaseIndexeGetCall<'a, C, A> { + ProjectDatabaseIndexeGetCall { + 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 single document. + /// + /// # Arguments + /// + /// * `name` - The resource name of the Document to get. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + pub fn databases_documents_get(&self, name: &str) -> ProjectDatabaseDocumentGetCall<'a, C, A> { + ProjectDatabaseDocumentGetCall { + hub: self.hub, + _name: name.to_string(), + _transaction: Default::default(), + _read_time: Default::default(), + _mask_field_paths: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Streams batches of document updates and deletes, in order. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `database` - The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + /// This is only required in the first message. + pub fn databases_documents_write(&self, request: WriteRequest, database: &str) -> ProjectDatabaseDocumentWriteCall<'a, C, A> { + ProjectDatabaseDocumentWriteCall { + 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: + /// + /// Runs a query. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The parent resource name. In the format: + /// `projects/{project_id}/databases/{database_id}/documents` or + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// For example: + /// `projects/my-project/databases/my-database/documents` or + /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + pub fn databases_documents_run_query(&self, request: RunQueryRequest, parent: &str) -> ProjectDatabaseDocumentRunQueryCall<'a, C, A> { + ProjectDatabaseDocumentRunQueryCall { + 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 or inserts a document. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the document, for example + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + pub fn databases_documents_patch(&self, request: Document, name: &str) -> ProjectDatabaseDocumentPatchCall<'a, C, A> { + ProjectDatabaseDocumentPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask_field_paths: Default::default(), + _mask_field_paths: Default::default(), + _current_document_update_time: Default::default(), + _current_document_exists: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets multiple documents. + /// + /// Documents returned by this method are not guaranteed to be returned in the + /// same order that they were requested. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `database` - The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + pub fn databases_documents_batch_get(&self, request: BatchGetDocumentsRequest, database: &str) -> ProjectDatabaseDocumentBatchGetCall<'a, C, A> { + ProjectDatabaseDocumentBatchGetCall { + 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: + /// + /// Starts a new transaction. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `database` - The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + pub fn databases_documents_begin_transaction(&self, request: BeginTransactionRequest, database: &str) -> ProjectDatabaseDocumentBeginTransactionCall<'a, C, A> { + ProjectDatabaseDocumentBeginTransactionCall { + 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: + /// + /// Lists all the collection IDs underneath a document. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The parent document. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// For example: + /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + pub fn databases_documents_list_collection_ids(&self, request: ListCollectionIdsRequest, parent: &str) -> ProjectDatabaseDocumentListCollectionIdCall<'a, C, A> { + ProjectDatabaseDocumentListCollectionIdCall { + 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 index. + /// + /// # Arguments + /// + /// * `name` - The index name. For example: + /// `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + pub fn databases_indexes_delete(&self, name: &str) -> ProjectDatabaseIndexeDeleteCall<'a, C, A> { + ProjectDatabaseIndexeDeleteCall { + 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 document. + /// + /// # Arguments + /// + /// * `name` - The resource name of the Document to delete. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + pub fn databases_documents_delete(&self, name: &str) -> ProjectDatabaseDocumentDeleteCall<'a, C, A> { + ProjectDatabaseDocumentDeleteCall { + hub: self.hub, + _name: name.to_string(), + _current_document_update_time: Default::default(), + _current_document_exists: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Commits a transaction, while optionally updating documents. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `database` - The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + pub fn databases_documents_commit(&self, request: CommitRequest, database: &str) -> ProjectDatabaseDocumentCommitCall<'a, C, A> { + ProjectDatabaseDocumentCommitCall { + 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: + /// + /// Listens to changes. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `database` - The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + pub fn databases_documents_listen(&self, request: ListenRequest, database: &str) -> ProjectDatabaseDocumentListenCall<'a, C, A> { + ProjectDatabaseDocumentListenCall { + hub: self.hub, + _request: request, + _database: database.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Lists the indexes that match the specified filters. +/// +/// A builder for the *databases.indexes.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_firestore1_beta1 as firestore1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_indexes_list("parent") +/// .page_token("gubergren") +/// .page_size(-95) +/// .filter("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseIndexeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _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 ProjectDatabaseIndexeListCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseIndexeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListIndexesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.indexes.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() + "v1beta1/{+parent}/indexes"; + 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 database name. For example: + /// `projects/{project_id}/databases/{database_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) -> ProjectDatabaseIndexeListCall<'a, C, A> { + self._parent = 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) -> ProjectDatabaseIndexeListCall<'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) -> ProjectDatabaseIndexeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectDatabaseIndexeListCall<'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) -> ProjectDatabaseIndexeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseIndexeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseIndexeListCall<'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 document. +/// +/// A builder for the *databases.documents.createDocument* 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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::Document; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Document::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_documents_create_document(req, "parent", "collectionId") +/// .add_mask_field_paths("justo") +/// .document_id("justo") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _request: Document, + _parent: String, + _collection_id: String, + _mask_field_paths: Vec, + _document_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Document)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.documents.createDocument", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + params.push(("collectionId", self._collection_id.to_string())); + if self._mask_field_paths.len() > 0 { + for f in self._mask_field_paths.iter() { + params.push(("mask.fieldPaths", f.to_string())); + } + } + if let Some(value) = self._document_id { + params.push(("documentId", value.to_string())); + } + for &field in ["alt", "parent", "collectionId", "mask.fieldPaths", "documentId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) 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/{+parent}/{collectionId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{collectionId}", "collectionId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_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 ["collectionId", "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: Document) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> { + self._request = new_value; + self + } + /// The parent resource. For example: + /// `projects/{project_id}/databases/{database_id}/documents` or + /// `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_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) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The collection ID, relative to `parent`, to list. For example: `chatrooms`. + /// + /// Sets the *collection id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn collection_id(mut self, new_value: &str) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> { + self._collection_id = new_value.to_string(); + self + } + /// The list of field paths in the mask. See Document.fields for a field + /// path syntax reference. + /// + /// Append the given value to the *mask.field paths* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_mask_field_paths(mut self, new_value: &str) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> { + self._mask_field_paths.push(new_value.to_string()); + self + } + /// The client-assigned document ID to use for this document. + /// + /// Optional. If not specified, an ID will be assigned by the service. + /// + /// Sets the *document id* query property to the given value. + pub fn document_id(mut self, new_value: &str) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> { + self._document_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) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentCreateDocumentCall<'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 the specified index. +/// A newly created index's initial state is `CREATING`. On completion of the +/// returned google.longrunning.Operation, the state will be `READY`. +/// If the index already exists, the call will return an `ALREADY_EXISTS` +/// status. +/// +/// During creation, the process could result in an error, in which case the +/// index will move to the `ERROR` state. The process can be recovered by +/// fixing the data that caused the error, removing the index with +/// delete, then re-creating the index with +/// create. +/// +/// Indexes with a single field cannot be created. +/// +/// A builder for the *databases.indexes.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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::Index; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Index::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_indexes_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseIndexeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _request: Index, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseIndexeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseIndexeCreateCall<'a, C, 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: "firestore.projects.databases.indexes.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() + "v1beta1/{+parent}/indexes"; + 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: Index) -> ProjectDatabaseIndexeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the database this index will apply to. For example: + /// `projects/{project_id}/databases/{database_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) -> ProjectDatabaseIndexeCreateCall<'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) -> ProjectDatabaseIndexeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseIndexeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseIndexeCreateCall<'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. +/// +/// A builder for the *databases.documents.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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::RollbackRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the 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().databases_documents_rollback(req, "database") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentRollbackCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _request: RollbackRequest, + _database: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentRollbackCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentRollbackCall<'a, C, 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: "firestore.projects.databases.documents.rollback", + 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() + "v1beta1/{+database}/documents:rollback"; + 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: RollbackRequest) -> ProjectDatabaseDocumentRollbackCall<'a, C, A> { + self._request = new_value; + self + } + /// The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + /// + /// 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) -> ProjectDatabaseDocumentRollbackCall<'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) -> ProjectDatabaseDocumentRollbackCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentRollbackCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentRollbackCall<'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 documents. +/// +/// A builder for the *databases.documents.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_firestore1_beta1 as firestore1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_documents_list("parent", "collectionId") +/// .transaction("Lorem") +/// .show_missing(true) +/// .read_time("duo") +/// .page_token("aliquyam") +/// .page_size(-9) +/// .order_by("Lorem") +/// .add_mask_field_paths("eos") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _parent: String, + _collection_id: String, + _transaction: Option, + _show_missing: Option, + _read_time: Option, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _mask_field_paths: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentListCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListDocumentsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.documents.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + params.push(("collectionId", self._collection_id.to_string())); + if let Some(value) = self._transaction { + params.push(("transaction", value.to_string())); + } + if let Some(value) = self._show_missing { + params.push(("showMissing", value.to_string())); + } + if let Some(value) = self._read_time { + params.push(("readTime", 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())); + } + if self._mask_field_paths.len() > 0 { + for f in self._mask_field_paths.iter() { + params.push(("mask.fieldPaths", f.to_string())); + } + } + for &field in ["alt", "parent", "collectionId", "transaction", "showMissing", "readTime", "pageToken", "pageSize", "orderBy", "mask.fieldPaths"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) 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/{+parent}/{collectionId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{collectionId}", "collectionId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_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 ["collectionId", "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 parent resource name. In the format: + /// `projects/{project_id}/databases/{database_id}/documents` or + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// For example: + /// `projects/my-project/databases/my-database/documents` or + /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + /// + /// 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) -> ProjectDatabaseDocumentListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The collection ID, relative to `parent`, to list. For example: `chatrooms` + /// or `messages`. + /// + /// Sets the *collection id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn collection_id(mut self, new_value: &str) -> ProjectDatabaseDocumentListCall<'a, C, A> { + self._collection_id = new_value.to_string(); + self + } + /// Reads documents in a transaction. + /// + /// Sets the *transaction* query property to the given value. + pub fn transaction(mut self, new_value: &str) -> ProjectDatabaseDocumentListCall<'a, C, A> { + self._transaction = Some(new_value.to_string()); + self + } + /// If the list should show missing documents. A missing document is a + /// document that does not exist but has sub-documents. These documents will + /// be returned with a key but will not have fields, Document.create_time, + /// or Document.update_time set. + /// + /// Requests with `show_missing` may not specify `where` or + /// `order_by`. + /// + /// Sets the *show missing* query property to the given value. + pub fn show_missing(mut self, new_value: bool) -> ProjectDatabaseDocumentListCall<'a, C, A> { + self._show_missing = Some(new_value); + self + } + /// Reads documents as they were at the given time. + /// This may not be older than 60 seconds. + /// + /// Sets the *read time* query property to the given value. + pub fn read_time(mut self, new_value: &str) -> ProjectDatabaseDocumentListCall<'a, C, A> { + self._read_time = Some(new_value.to_string()); + self + } + /// The `next_page_token` value returned from a previous List request, if any. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectDatabaseDocumentListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of documents to return. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectDatabaseDocumentListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The order to sort results by. For example: `priority desc, name`. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectDatabaseDocumentListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The list of field paths in the mask. See Document.fields for a field + /// path syntax reference. + /// + /// Append the given value to the *mask.field paths* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_mask_field_paths(mut self, new_value: &str) -> ProjectDatabaseDocumentListCall<'a, C, A> { + self._mask_field_paths.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) -> ProjectDatabaseDocumentListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentListCall<'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 index. +/// +/// A builder for the *databases.indexes.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_firestore1_beta1 as firestore1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_indexes_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseIndexeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseIndexeGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseIndexeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Index)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.indexes.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() + "v1beta1/{+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 index. For example: + /// `projects/{project_id}/databases/{database_id}/indexes/{index_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) -> ProjectDatabaseIndexeGetCall<'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) -> ProjectDatabaseIndexeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseIndexeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseIndexeGetCall<'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 document. +/// +/// A builder for the *databases.documents.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_firestore1_beta1 as firestore1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_documents_get("name") +/// .transaction("dolor") +/// .read_time("eirmod") +/// .add_mask_field_paths("elitr") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _name: String, + _transaction: Option, + _read_time: Option, + _mask_field_paths: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Document)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.documents.get", + 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._transaction { + params.push(("transaction", value.to_string())); + } + if let Some(value) = self._read_time { + params.push(("readTime", value.to_string())); + } + if self._mask_field_paths.len() > 0 { + for f in self._mask_field_paths.iter() { + params.push(("mask.fieldPaths", f.to_string())); + } + } + for &field in ["alt", "name", "transaction", "readTime", "mask.fieldPaths"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) 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/{+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 Document to get. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// + /// 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) -> ProjectDatabaseDocumentGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Reads the document in a transaction. + /// + /// Sets the *transaction* query property to the given value. + pub fn transaction(mut self, new_value: &str) -> ProjectDatabaseDocumentGetCall<'a, C, A> { + self._transaction = Some(new_value.to_string()); + self + } + /// Reads the version of the document at the given time. + /// This may not be older than 60 seconds. + /// + /// Sets the *read time* query property to the given value. + pub fn read_time(mut self, new_value: &str) -> ProjectDatabaseDocumentGetCall<'a, C, A> { + self._read_time = Some(new_value.to_string()); + self + } + /// The list of field paths in the mask. See Document.fields for a field + /// path syntax reference. + /// + /// Append the given value to the *mask.field paths* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_mask_field_paths(mut self, new_value: &str) -> ProjectDatabaseDocumentGetCall<'a, C, A> { + self._mask_field_paths.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) -> ProjectDatabaseDocumentGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentGetCall<'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 batches of document updates and deletes, in order. +/// +/// A builder for the *databases.documents.write* 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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::WriteRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = WriteRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_documents_write(req, "database") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentWriteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _request: WriteRequest, + _database: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentWriteCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentWriteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, WriteResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.documents.write", + 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() + "v1beta1/{+database}/documents:write"; + 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: WriteRequest) -> ProjectDatabaseDocumentWriteCall<'a, C, A> { + self._request = new_value; + self + } + /// The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + /// This is only required in the first message. + /// + /// 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) -> ProjectDatabaseDocumentWriteCall<'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) -> ProjectDatabaseDocumentWriteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentWriteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentWriteCall<'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 query. +/// +/// A builder for the *databases.documents.runQuery* 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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::RunQueryRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = RunQueryRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_documents_run_query(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentRunQueryCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _request: RunQueryRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentRunQueryCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentRunQueryCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, RunQueryResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.documents.runQuery", + 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() + "v1beta1/{+parent}:runQuery"; + 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: RunQueryRequest) -> ProjectDatabaseDocumentRunQueryCall<'a, C, A> { + self._request = new_value; + self + } + /// The parent resource name. In the format: + /// `projects/{project_id}/databases/{database_id}/documents` or + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// For example: + /// `projects/my-project/databases/my-database/documents` or + /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + /// + /// 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) -> ProjectDatabaseDocumentRunQueryCall<'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) -> ProjectDatabaseDocumentRunQueryCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentRunQueryCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentRunQueryCall<'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 inserts a document. +/// +/// A builder for the *databases.documents.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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::Document; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Document::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_documents_patch(req, "name") +/// .add_update_mask_field_paths("eirmod") +/// .add_mask_field_paths("dolore") +/// .current_document_update_time("invidunt") +/// .current_document_exists(false) +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _request: Document, + _name: String, + _update_mask_field_paths: Vec, + _mask_field_paths: Vec, + _current_document_update_time: Option, + _current_document_exists: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Document)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.documents.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if self._update_mask_field_paths.len() > 0 { + for f in self._update_mask_field_paths.iter() { + params.push(("updateMask.fieldPaths", f.to_string())); + } + } + if self._mask_field_paths.len() > 0 { + for f in self._mask_field_paths.iter() { + params.push(("mask.fieldPaths", f.to_string())); + } + } + if let Some(value) = self._current_document_update_time { + params.push(("currentDocument.updateTime", value.to_string())); + } + if let Some(value) = self._current_document_exists { + params.push(("currentDocument.exists", value.to_string())); + } + for &field in ["alt", "name", "updateMask.fieldPaths", "mask.fieldPaths", "currentDocument.updateTime", "currentDocument.exists"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) 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/{+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: Document) -> ProjectDatabaseDocumentPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the document, for example + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// + /// 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) -> ProjectDatabaseDocumentPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The list of field paths in the mask. See Document.fields for a field + /// path syntax reference. + /// + /// Append the given value to the *update mask.field paths* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_update_mask_field_paths(mut self, new_value: &str) -> ProjectDatabaseDocumentPatchCall<'a, C, A> { + self._update_mask_field_paths.push(new_value.to_string()); + self + } + /// The list of field paths in the mask. See Document.fields for a field + /// path syntax reference. + /// + /// Append the given value to the *mask.field paths* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_mask_field_paths(mut self, new_value: &str) -> ProjectDatabaseDocumentPatchCall<'a, C, A> { + self._mask_field_paths.push(new_value.to_string()); + self + } + /// When set, the target document must exist and have been last updated at + /// that time. + /// + /// Sets the *current document.update time* query property to the given value. + pub fn current_document_update_time(mut self, new_value: &str) -> ProjectDatabaseDocumentPatchCall<'a, C, A> { + self._current_document_update_time = Some(new_value.to_string()); + self + } + /// When set to `true`, the target document must exist. + /// When set to `false`, the target document must not exist. + /// + /// Sets the *current document.exists* query property to the given value. + pub fn current_document_exists(mut self, new_value: bool) -> ProjectDatabaseDocumentPatchCall<'a, C, A> { + self._current_document_exists = 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) -> ProjectDatabaseDocumentPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentPatchCall<'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 multiple documents. +/// +/// Documents returned by this method are not guaranteed to be returned in the +/// same order that they were requested. +/// +/// A builder for the *databases.documents.batchGet* 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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::BatchGetDocumentsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = BatchGetDocumentsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_documents_batch_get(req, "database") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentBatchGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _request: BatchGetDocumentsRequest, + _database: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentBatchGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentBatchGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BatchGetDocumentsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.documents.batchGet", + 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() + "v1beta1/{+database}/documents:batchGet"; + 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: BatchGetDocumentsRequest) -> ProjectDatabaseDocumentBatchGetCall<'a, C, A> { + self._request = new_value; + self + } + /// The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + /// + /// 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) -> ProjectDatabaseDocumentBatchGetCall<'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) -> ProjectDatabaseDocumentBatchGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentBatchGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentBatchGetCall<'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 transaction. +/// +/// A builder for the *databases.documents.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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::BeginTransactionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the 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().databases_documents_begin_transaction(req, "database") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentBeginTransactionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _request: BeginTransactionRequest, + _database: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentBeginTransactionCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentBeginTransactionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BeginTransactionResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.documents.beginTransaction", + 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() + "v1beta1/{+database}/documents:beginTransaction"; + 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: BeginTransactionRequest) -> ProjectDatabaseDocumentBeginTransactionCall<'a, C, A> { + self._request = new_value; + self + } + /// The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + /// + /// 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) -> ProjectDatabaseDocumentBeginTransactionCall<'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) -> ProjectDatabaseDocumentBeginTransactionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentBeginTransactionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentBeginTransactionCall<'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 collection IDs underneath a document. +/// +/// A builder for the *databases.documents.listCollectionIds* 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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::ListCollectionIdsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ListCollectionIdsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_documents_list_collection_ids(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentListCollectionIdCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _request: ListCollectionIdsRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentListCollectionIdCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentListCollectionIdCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListCollectionIdsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.documents.listCollectionIds", + 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() + "v1beta1/{+parent}:listCollectionIds"; + 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: ListCollectionIdsRequest) -> ProjectDatabaseDocumentListCollectionIdCall<'a, C, A> { + self._request = new_value; + self + } + /// The parent document. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// For example: + /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + /// + /// 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) -> ProjectDatabaseDocumentListCollectionIdCall<'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) -> ProjectDatabaseDocumentListCollectionIdCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentListCollectionIdCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentListCollectionIdCall<'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 index. +/// +/// A builder for the *databases.indexes.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_firestore1_beta1 as firestore1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_indexes_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseIndexeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseIndexeDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseIndexeDeleteCall<'a, C, 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: "firestore.projects.databases.indexes.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() + "v1beta1/{+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 index name. For example: + /// `projects/{project_id}/databases/{database_id}/indexes/{index_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) -> ProjectDatabaseIndexeDeleteCall<'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) -> ProjectDatabaseIndexeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseIndexeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseIndexeDeleteCall<'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 document. +/// +/// A builder for the *databases.documents.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_firestore1_beta1 as firestore1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_documents_delete("name") +/// .current_document_update_time("et") +/// .current_document_exists(true) +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _name: String, + _current_document_update_time: Option, + _current_document_exists: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentDeleteCall<'a, C, 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: "firestore.projects.databases.documents.delete", + http_method: hyper::method::Method::Delete }); + 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._current_document_update_time { + params.push(("currentDocument.updateTime", value.to_string())); + } + if let Some(value) = self._current_document_exists { + params.push(("currentDocument.exists", value.to_string())); + } + for &field in ["alt", "name", "currentDocument.updateTime", "currentDocument.exists"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) 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/{+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 Document to delete. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + /// + /// 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) -> ProjectDatabaseDocumentDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// When set, the target document must exist and have been last updated at + /// that time. + /// + /// Sets the *current document.update time* query property to the given value. + pub fn current_document_update_time(mut self, new_value: &str) -> ProjectDatabaseDocumentDeleteCall<'a, C, A> { + self._current_document_update_time = Some(new_value.to_string()); + self + } + /// When set to `true`, the target document must exist. + /// When set to `false`, the target document must not exist. + /// + /// Sets the *current document.exists* query property to the given value. + pub fn current_document_exists(mut self, new_value: bool) -> ProjectDatabaseDocumentDeleteCall<'a, C, A> { + self._current_document_exists = 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) -> ProjectDatabaseDocumentDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentDeleteCall<'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, while optionally updating documents. +/// +/// A builder for the *databases.documents.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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::CommitRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the 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().databases_documents_commit(req, "database") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentCommitCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _request: CommitRequest, + _database: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentCommitCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentCommitCall<'a, C, 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: "firestore.projects.databases.documents.commit", + 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() + "v1beta1/{+database}/documents:commit"; + 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: CommitRequest) -> ProjectDatabaseDocumentCommitCall<'a, C, A> { + self._request = new_value; + self + } + /// The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + /// + /// 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) -> ProjectDatabaseDocumentCommitCall<'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) -> ProjectDatabaseDocumentCommitCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentCommitCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentCommitCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Listens to changes. +/// +/// A builder for the *databases.documents.listen* 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_firestore1_beta1 as firestore1_beta1; +/// use firestore1_beta1::ListenRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firestore1_beta1::Firestore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Firestore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ListenRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().databases_documents_listen(req, "database") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDatabaseDocumentListenCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Firestore, + _request: ListenRequest, + _database: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDatabaseDocumentListenCall<'a, C, A> {} + +impl<'a, C, A> ProjectDatabaseDocumentListenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListenResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firestore.projects.databases.documents.listen", + 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() + "v1beta1/{+database}/documents:listen"; + 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: ListenRequest) -> ProjectDatabaseDocumentListenCall<'a, C, A> { + self._request = new_value; + self + } + /// The database name. In the format: + /// `projects/{project_id}/databases/{database_id}`. + /// + /// 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) -> ProjectDatabaseDocumentListenCall<'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) -> ProjectDatabaseDocumentListenCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectDatabaseDocumentListenCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDatabaseDocumentListenCall<'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/fitness1-cli/Cargo.toml b/gen/fitness1-cli/Cargo.toml index bf7ba7c230..7d0e27c191 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+20170830" +version = "1.0.6+20170922" 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+20170830" +version = "1.0.6+20170922" diff --git a/gen/fitness1-cli/README.md b/gen/fitness1-cli/README.md index c424b04154..c5f732597d 100644 --- a/gen/fitness1-cli/README.md +++ b/gen/fitness1-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 *fitness* API at revision *20170830*. The CLI is at version *1.0.6*. +This documentation was generated from the *fitness* API at revision *20170922*. The CLI is at version *1.0.6*. ```bash fitness1 [options] diff --git a/gen/fitness1-cli/mkdocs.yml b/gen/fitness1-cli/mkdocs.yml index 68032e4307..d917a28c4b 100644 --- a/gen/fitness1-cli/mkdocs.yml +++ b/gen/fitness1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: fitness v1.0.6+20170830 +site_name: fitness v1.0.6+20170922 site_url: http://byron.github.io/google-apis-rs/google-fitness1-cli site_description: A complete library to interact with fitness (protocol v1) diff --git a/gen/fitness1-cli/src/main.rs b/gen/fitness1-cli/src/main.rs index ab0a3b5e18..bef53c62f8 100644 --- a/gen/fitness1-cli/src/main.rs +++ b/gen/fitness1-cli/src/main.rs @@ -1240,12 +1240,12 @@ fn main() { Some(false)), ]), ("data-sources-data-point-changes-list", - Some(r##"results ordered by descending end_time"##), + Some(r##"Queries for user's data point changes for a particular data source."##), "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(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)), @@ -1631,7 +1631,7 @@ fn main() { let mut app = App::new("fitness1") .author("Sebastian Thiel ") - .version("1.0.6+20170830") + .version("1.0.6+20170922") .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 a02317dcbb..ec81217c73 100644 --- a/gen/fitness1/Cargo.toml +++ b/gen/fitness1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-fitness1" -version = "1.0.6+20170830" +version = "1.0.6+20170922" 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+20170830" +documentation = "https://docs.rs/google-fitness1/1.0.6+20170922" license = "MIT" keywords = ["fitness", "google", "protocol", "web", "api"] diff --git a/gen/fitness1/README.md b/gen/fitness1/README.md index 3fdc36f87f..3dad120a23 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+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*. +This documentation was generated from *fitness* crate version *1.0.6+20170922*, where *20170922* 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+20170830/google_fitness1/struct.Fitness.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.Fitness.html) ... * users - * [*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) + * [*data sources create*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserDataSourceCreateCall.html), [*data sources data point changes list*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserDataSourceDataPointChangeListCall.html), [*data sources datasets delete*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserDataSourceDatasetDeleteCall.html), [*data sources datasets get*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserDataSourceDatasetGetCall.html), [*data sources datasets patch*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserDataSourceDatasetPatchCall.html), [*data sources delete*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserDataSourceDeleteCall.html), [*data sources get*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserDataSourceGetCall.html), [*data sources list*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserDataSourceListCall.html), [*data sources patch*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserDataSourcePatchCall.html), [*data sources update*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserDataSourceUpdateCall.html), [*dataset aggregate*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserDatasetAggregateCall.html), [*sessions delete*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserSessionDeleteCall.html), [*sessions list*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/struct.UserSessionListCall.html) and [*sessions update*](https://docs.rs/google-fitness1/1.0.6+20170922/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+20170830/google_fitness1/struct.Fitness.html)** +* **[Hub](https://docs.rs/google-fitness1/1.0.6+20170922/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+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)** + * creates [*Method Builders*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-fitness1/1.0.6+20170922/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+20170830/google_fitness1/trait.Part.html)** + * **[Parts](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-fitness1/1.0.6+20170830/google_fitness1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-fitness1/1.0.6+20170922/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+20170830/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+20170922/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+20170830/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+20170922/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+20170830/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+20170922/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+20170830/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+20170922/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-fitness1/1.0.6+20170922/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+20170830/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+20170922/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-fitness1/1.0.6+20170922/google_fitness1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-fitness1/1.0.6+20170922/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+20170830/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+20170922/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+20170830/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+20170922/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+20170830/google_fitness1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-fitness1/1.0.6+20170922/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 24929eca79..4ad19571d5 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+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*. +//! This documentation was generated from *fitness* crate version *1.0.6+20170922*, where *20170922* 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/). @@ -896,13 +896,13 @@ 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. + /// Deleted data points for the user. Note, for modifications this should be parsed before handling insertions. #[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. + /// Inserted data points for the user. #[serde(rename="insertedDataPoint")] pub inserted_data_point: Option>, } @@ -1264,11 +1264,11 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// results ordered by descending end_time + /// Queries for user's data point changes for a particular data source. /// /// # Arguments /// - /// * `userId` - List data points for the person identified. Use "me" to indicate the authenticated user. Only "me" is supported at this time. + /// * `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 { @@ -4405,7 +4405,7 @@ impl<'a, C, A> UserSessionUpdateCall<'a, C, A> where C: BorrowMut } -/// results ordered by descending end_time +/// Queries for user's data point changes for a particular data source. /// /// A builder for the *dataSources.dataPointChanges.list* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. @@ -4591,7 +4591,7 @@ impl<'a, C, A> UserDataSourceDataPointChangeListCall<'a, C, A> where C: BorrowMu } - /// List data points for the person identified. Use "me" to indicate the authenticated user. Only "me" is supported at this time. + /// 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. /// @@ -4618,7 +4618,7 @@ impl<'a, C, A> UserDataSourceDataPointChangeListCall<'a, C, A> where C: BorrowMu 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. + /// If specified, no more than this many data point changes will be included in the response. /// /// Sets the *limit* query property to the given value. pub fn limit(mut self, new_value: i32) -> UserDataSourceDataPointChangeListCall<'a, C, A> { diff --git a/gen/fusiontables2-cli/Cargo.toml b/gen/fusiontables2-cli/Cargo.toml index dd78ddc855..d9c2e946fa 100644 --- a/gen/fusiontables2-cli/Cargo.toml +++ b/gen/fusiontables2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fusiontables2-cli" -version = "1.0.6+20170413" +version = "1.0.6+20171117" authors = ["Sebastian Thiel "] description = "A complete library to interact with fusiontables (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fusiontables2-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-fusiontables2] path = "../fusiontables2" -version = "1.0.6+20170413" +version = "1.0.6+20171117" diff --git a/gen/fusiontables2-cli/README.md b/gen/fusiontables2-cli/README.md index dad1595b70..c3c0fb2791 100644 --- a/gen/fusiontables2-cli/README.md +++ b/gen/fusiontables2-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 *fusiontables* API at revision *20170413*. The CLI is at version *1.0.6*. +This documentation was generated from the *fusiontables* API at revision *20171117*. The CLI is at version *1.0.6*. ```bash fusiontables2 [options] @@ -55,6 +55,7 @@ fusiontables2 [options] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] + refetch-sheet [-p ]... [-o ] replace-rows (-u (simple|resumable) -f [-m ]) [-p ]... [-o ] update (-r )... [-p ]... [-o ] task diff --git a/gen/fusiontables2-cli/mkdocs.yml b/gen/fusiontables2-cli/mkdocs.yml index a42a101af3..187ffe22a8 100644 --- a/gen/fusiontables2-cli/mkdocs.yml +++ b/gen/fusiontables2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: fusiontables v1.0.6+20170413 +site_name: fusiontables v1.0.6+20171117 site_url: http://byron.github.io/google-apis-rs/google-fusiontables2-cli site_description: A complete library to interact with fusiontables (protocol v2) @@ -31,6 +31,7 @@ pages: - ['table_insert.md', 'Table', 'Insert'] - ['table_list.md', 'Table', 'List'] - ['table_patch.md', 'Table', 'Patch'] +- ['table_refetch-sheet.md', 'Table', 'Refetch Sheet'] - ['table_replace-rows.md', 'Table', 'Replace Rows'] - ['table_update.md', 'Table', 'Update'] - ['task_delete.md', 'Task', 'Delete'] diff --git a/gen/fusiontables2-cli/src/main.rs b/gen/fusiontables2-cli/src/main.rs index 9f4d3e0505..cd18359a41 100644 --- a/gen/fusiontables2-cli/src/main.rs +++ b/gen/fusiontables2-cli/src/main.rs @@ -1692,6 +1692,58 @@ impl<'n> Engine<'n> { } } + fn _table_refetch_sheet(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.table().refetch_sheet(opt.value_of("table-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _table_replace_rows(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.table().replace_rows(opt.value_of("table-id").unwrap_or("")); @@ -2548,6 +2600,9 @@ impl<'n> Engine<'n> { ("patch", Some(opt)) => { call_result = self._table_patch(opt, dry_run, &mut err); }, + ("refetch-sheet", Some(opt)) => { + call_result = self._table_refetch_sheet(opt, dry_run, &mut err); + }, ("replace-rows", Some(opt)) => { call_result = self._table_replace_rows(opt, dry_run, &mut err); }, @@ -3095,7 +3150,7 @@ fn main() { ]), ]), - ("table", "methods: 'copy', 'delete', 'get', 'import-rows', 'import-table', 'insert', 'list', 'patch', 'replace-rows' and 'update'", vec![ + ("table", "methods: 'copy', 'delete', 'get', 'import-rows', 'import-table', 'insert', 'list', 'patch', 'refetch-sheet', 'replace-rows' and 'update'", vec![ ("copy", Some(r##"Copies a table."##), "Details at http://byron.github.io/google-apis-rs/google_fusiontables2_cli/table_copy", @@ -3272,6 +3327,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)), + ]), + ("refetch-sheet", + Some(r##"Replaces rows of the table with the rows of the spreadsheet that is first imported from. Current rows remain visible until all replacement rows are ready."##), + "Details at http://byron.github.io/google-apis-rs/google_fusiontables2_cli/table_refetch-sheet", + vec![ + (Some(r##"table-id"##), + None, + Some(r##"Table whose rows will be replaced from the spreadsheet."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3586,7 +3663,7 @@ fn main() { let mut app = App::new("fusiontables2") .author("Sebastian Thiel ") - .version("1.0.6+20170413") + .version("1.0.6+20171117") .about("API for working with Fusion Tables data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_fusiontables2_cli") .arg(Arg::with_name("url") diff --git a/gen/fusiontables2/Cargo.toml b/gen/fusiontables2/Cargo.toml index 3f554a18de..de3ed80393 100644 --- a/gen/fusiontables2/Cargo.toml +++ b/gen/fusiontables2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-fusiontables2" -version = "1.0.6+20170413" +version = "1.0.6+20171117" authors = ["Sebastian Thiel "] description = "A complete library to interact with fusiontables (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fusiontables2" homepage = "https://developers.google.com/fusiontables" -documentation = "https://docs.rs/google-fusiontables2/1.0.6+20170413" +documentation = "https://docs.rs/google-fusiontables2/1.0.6+20171117" license = "MIT" keywords = ["fusiontables", "google", "protocol", "web", "api"] diff --git a/gen/fusiontables2/README.md b/gen/fusiontables2/README.md index 4919658fdd..f3357c85fc 100644 --- a/gen/fusiontables2/README.md +++ b/gen/fusiontables2/README.md @@ -5,38 +5,38 @@ DO NOT EDIT ! --> The `google-fusiontables2` library allows access to all features of the *Google fusiontables* service. -This documentation was generated from *fusiontables* crate version *1.0.6+20170413*, where *20170413* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *fusiontables* crate version *1.0.6+20171117*, where *20171117* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *fusiontables* *v2* API can be found at the [official documentation site](https://developers.google.com/fusiontables). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.Fusiontables.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.Fusiontables.html) ... -* [column](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.Column.html) - * [*delete*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.ColumnDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.ColumnGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.ColumnInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.ColumnListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.ColumnPatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.ColumnUpdateCall.html) +* [column](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.Column.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.ColumnDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.ColumnGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.ColumnInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.ColumnListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.ColumnPatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.ColumnUpdateCall.html) * query - * [*sql*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.QuerySqlCall.html) and [*sql get*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.QuerySqlGetCall.html) + * [*sql*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.QuerySqlCall.html) and [*sql get*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.QuerySqlGetCall.html) * style - * [*delete*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.StyleDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.StyleGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.StyleInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.StyleListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.StylePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.StyleUpdateCall.html) -* [table](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.Table.html) - * [*copy*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableCopyCall.html), [*delete*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableGetCall.html), [*import rows*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableImportRowCall.html), [*import table*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableImportTableCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TablePatchCall.html), [*replace rows*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableReplaceRowCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableUpdateCall.html) -* [task](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.Task.html) - * [*delete*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TaskDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TaskGetCall.html) and [*list*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TaskListCall.html) -* [template](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.Template.html) - * [*delete*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TemplateDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TemplateGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TemplateInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TemplateListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TemplatePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TemplateUpdateCall.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.StyleDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.StyleGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.StyleInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.StyleListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.StylePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.StyleUpdateCall.html) +* [table](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.Table.html) + * [*copy*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableCopyCall.html), [*delete*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableGetCall.html), [*import rows*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableImportRowCall.html), [*import table*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableImportTableCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TablePatchCall.html), [*refetch sheet*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableRefetchSheetCall.html), [*replace rows*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableReplaceRowCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableUpdateCall.html) +* [task](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.Task.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TaskDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TaskGetCall.html) and [*list*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TaskListCall.html) +* [template](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.Template.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TemplateDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TemplateGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TemplateInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TemplateListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TemplatePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TemplateUpdateCall.html) Upload supported by ... -* [*replace rows table*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableReplaceRowCall.html) -* [*import rows table*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableImportRowCall.html) -* [*import table table*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.TableImportTableCall.html) +* [*replace rows table*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableReplaceRowCall.html) +* [*import rows table*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableImportRowCall.html) +* [*import table table*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.TableImportTableCall.html) Download supported by ... -* [*sql get query*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.QuerySqlGetCall.html) -* [*sql query*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.QuerySqlCall.html) +* [*sql get query*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.QuerySqlGetCall.html) +* [*sql query*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.QuerySqlCall.html) @@ -44,17 +44,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/struct.Fusiontables.html)** +* **[Hub](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/struct.Fusiontables.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.Part.html)** + * **[Parts](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -145,17 +145,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/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-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/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-fusiontables2/1.0.6+20170413/google_fusiontables2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/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-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/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")`. @@ -165,29 +165,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-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/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-fusiontables2/1.0.6+20171117/google_fusiontables2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/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-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/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-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-fusiontables2/1.0.6+20170413/google_fusiontables2/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-fusiontables2/1.0.6+20171117/google_fusiontables2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/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-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/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-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/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-fusiontables2/1.0.6+20170413/google_fusiontables2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-fusiontables2/1.0.6+20171117/google_fusiontables2/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/fusiontables2/src/lib.rs b/gen/fusiontables2/src/lib.rs index 75d095d68c..d7945b8980 100644 --- a/gen/fusiontables2/src/lib.rs +++ b/gen/fusiontables2/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 *fusiontables* crate version *1.0.6+20170413*, where *20170413* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *fusiontables* crate version *1.0.6+20171117*, where *20171117* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *fusiontables* *v2* API can be found at the //! [official documentation site](https://developers.google.com/fusiontables). @@ -18,7 +18,7 @@ //! * style //! * [*delete*](struct.StyleDeleteCall.html), [*get*](struct.StyleGetCall.html), [*insert*](struct.StyleInsertCall.html), [*list*](struct.StyleListCall.html), [*patch*](struct.StylePatchCall.html) and [*update*](struct.StyleUpdateCall.html) //! * [table](struct.Table.html) -//! * [*copy*](struct.TableCopyCall.html), [*delete*](struct.TableDeleteCall.html), [*get*](struct.TableGetCall.html), [*import rows*](struct.TableImportRowCall.html), [*import table*](struct.TableImportTableCall.html), [*insert*](struct.TableInsertCall.html), [*list*](struct.TableListCall.html), [*patch*](struct.TablePatchCall.html), [*replace rows*](struct.TableReplaceRowCall.html) and [*update*](struct.TableUpdateCall.html) +//! * [*copy*](struct.TableCopyCall.html), [*delete*](struct.TableDeleteCall.html), [*get*](struct.TableGetCall.html), [*import rows*](struct.TableImportRowCall.html), [*import table*](struct.TableImportTableCall.html), [*insert*](struct.TableInsertCall.html), [*list*](struct.TableListCall.html), [*patch*](struct.TablePatchCall.html), [*refetch sheet*](struct.TableRefetchSheetCall.html), [*replace rows*](struct.TableReplaceRowCall.html) and [*update*](struct.TableUpdateCall.html) //! * [task](struct.Task.html) //! * [*delete*](struct.TaskDeleteCall.html), [*get*](struct.TaskGetCall.html) and [*list*](struct.TaskListCall.html) //! * [template](struct.Template.html) @@ -409,6 +409,7 @@ impl<'a, C, A> Fusiontables /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [get task](struct.TaskGetCall.html) (response) +/// * [refetch sheet table](struct.TableRefetchSheetCall.html) (response) /// * [replace rows table](struct.TableReplaceRowCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1668,7 +1669,7 @@ impl<'a, C, A> QueryMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Fusiontables::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 `copy(...)`, `delete(...)`, `get(...)`, `import_rows(...)`, `import_table(...)`, `insert(...)`, `list(...)`, `patch(...)`, `replace_rows(...)` and `update(...)` +/// // like `copy(...)`, `delete(...)`, `get(...)`, `import_rows(...)`, `import_table(...)`, `insert(...)`, `list(...)`, `patch(...)`, `refetch_sheet(...)`, `replace_rows(...)` and `update(...)` /// // to build up your call. /// let rb = hub.table(); /// # } @@ -1703,6 +1704,23 @@ impl<'a, C, A> TableMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Replaces rows of the table with the rows of the spreadsheet that is first imported from. Current rows remain visible until all replacement rows are ready. + /// + /// # Arguments + /// + /// * `tableId` - Table whose rows will be replaced from the spreadsheet. + pub fn refetch_sheet(&self, table_id: &str) -> TableRefetchSheetCall<'a, C, A> { + TableRefetchSheetCall { + hub: self.hub, + _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: /// /// Replaces rows of an existing table. Current rows remain visible until all replacement rows are ready. @@ -8332,6 +8350,249 @@ impl<'a, C, A> TablePatchCall<'a, C, A> where C: BorrowMut, A: oa } +/// Replaces rows of the table with the rows of the spreadsheet that is first imported from. Current rows remain visible until all replacement rows are ready. +/// +/// A builder for the *refetchSheet* 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_fusiontables2 as fusiontables2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use fusiontables2::Fusiontables; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Fusiontables::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.table().refetch_sheet("tableId") +/// .doit(); +/// # } +/// ``` +pub struct TableRefetchSheetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Fusiontables, + _table_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TableRefetchSheetCall<'a, C, A> {} + +impl<'a, C, A> TableRefetchSheetCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "fusiontables.table.refetchSheet", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("tableId", self._table_id.to_string())); + for &field in ["alt", "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() + "tables/{tableId}/refetch"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{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(1); + for param_name in ["tableId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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) + } + } + } + } + + + /// Table whose rows will be replaced from the spreadsheet. + /// + /// 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) -> TableRefetchSheetCall<'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) -> TableRefetchSheetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TableRefetchSheetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization 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) -> TableRefetchSheetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Replaces rows of an existing table. Current rows remain visible until all replacement rows are ready. /// /// A builder for the *replaceRows* method supported by a *table* resource. @@ -8363,9 +8624,9 @@ impl<'a, C, A> TablePatchCall<'a, C, A> where C: BorrowMut, A: oa /// let result = hub.table().replace_rows("tableId") /// .start_line(-48) /// .is_strict(true) -/// .end_line(-23) -/// .encoding("consetetur") -/// .delimiter("amet.") +/// .end_line(-96) +/// .encoding("amet.") +/// .delimiter("voluptua.") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -8778,7 +9039,7 @@ impl<'a, C, A> TableReplaceRowCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.table().update(req, "tableId") -/// .replace_view_definition(false) +/// .replace_view_definition(true) /// .doit(); /// # } /// ``` @@ -9774,8 +10035,8 @@ impl<'a, C, A> TableGetCall<'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.table().list() -/// .page_token("sit") -/// .max_results(75) +/// .page_token("vero") +/// .max_results(73) /// .doit(); /// # } /// ``` @@ -10009,11 +10270,11 @@ impl<'a, C, A> TableListCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.table().import_rows("tableId") -/// .start_line(-66) +/// .start_line(-45) /// .is_strict(true) -/// .end_line(-44) -/// .encoding("vero") -/// .delimiter("sadipscing") +/// .end_line(-76) +/// .encoding("sadipscing") +/// .delimiter("invidunt") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -10421,8 +10682,8 @@ impl<'a, C, A> TableImportRowCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.table().import_table("name") -/// .encoding("consetetur") -/// .delimiter("dolore") +/// .encoding("dolore") +/// .delimiter("duo") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -10775,7 +11036,7 @@ impl<'a, C, A> TableImportTableCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.table().copy("tableId") -/// .copy_presentation(false) +/// .copy_presentation(true) /// .doit(); /// # } /// ``` diff --git a/gen/games1-cli/Cargo.toml b/gen/games1-cli/Cargo.toml index de41f296b4..9128789e17 100644 --- a/gen/games1-cli/Cargo.toml +++ b/gen/games1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-games1-cli" -version = "1.0.6+20170925" +version = "1.0.6+20171207" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/games1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-games1] path = "../games1" -version = "1.0.6+20170925" +version = "1.0.6+20171207" diff --git a/gen/games1-cli/README.md b/gen/games1-cli/README.md index 3c6fdb71c7..327a069e2a 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 *20170925*. The CLI is at version *1.0.6*. +This documentation was generated from the *Games* API at revision *20171207*. 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 c2a958b12c..35b487fc07 100644 --- a/gen/games1-cli/mkdocs.yml +++ b/gen/games1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games v1.0.6+20170925 +site_name: Games v1.0.6+20171207 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 f5b0dea4e0..e9d47dd616 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+20170925") + .version("1.0.6+20171207") .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 2a05f73b3e..75910021b3 100644 --- a/gen/games1/Cargo.toml +++ b/gen/games1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-games1" -version = "1.0.6+20170925" +version = "1.0.6+20171207" 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+20170925" +documentation = "https://docs.rs/google-games1/1.0.6+20171207" license = "MIT" keywords = ["games", "google", "protocol", "web", "api"] diff --git a/gen/games1/README.md b/gen/games1/README.md index 9380e39211..a942737415 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+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*. +This documentation was generated from *Games* crate version *1.0.6+20171207*, where *20171207* 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+20170925/google_games1/struct.Games.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.Games.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) +* [achievement definitions](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.AchievementDefinition.html) + * [*list*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.AchievementDefinitionListCall.html) * achievements - * [*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) + * [*increment*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.AchievementIncrementCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.AchievementListCall.html), [*reveal*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.AchievementRevealCall.html), [*set steps at least*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.AchievementSetStepsAtLeastCall.html), [*unlock*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.AchievementUnlockCall.html) and [*update multiple*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.AchievementUpdateMultipleCall.html) +* [applications](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.Application.html) + * [*get*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.ApplicationGetCall.html), [*played*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.ApplicationPlayedCall.html) and [*verify*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.ApplicationVerifyCall.html) * events - * [*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) + * [*list by player*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.EventListByPlayerCall.html), [*list definitions*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.EventListDefinitionCall.html) and [*record*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.EventRecordCall.html) +* [leaderboards](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.Leaderboard.html) + * [*get*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.LeaderboardGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.LeaderboardListCall.html) * metagame - * [*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) + * [*get metagame config*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.MetagameGetMetagameConfigCall.html) and [*list categories by player*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.MetagameListCategoriesByPlayerCall.html) +* [players](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.Player.html) + * [*get*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.PlayerGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.PlayerListCall.html) * pushtokens - * [*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) + * [*remove*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.PushtokenRemoveCall.html) and [*update*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.PushtokenUpdateCall.html) +* [quest milestones](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.QuestMilestone.html) + * [*claim*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.QuestMilestoneClaimCall.html) +* [quests](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.Quest.html) + * [*accept*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.QuestAcceptCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.QuestListCall.html) * revisions - * [*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) + * [*check*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.RevisionCheckCall.html) +* [rooms](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.Room.html) + * [*create*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.RoomCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.RoomDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.RoomDismisCall.html), [*get*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.RoomGetCall.html), [*join*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.RoomJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.RoomLeaveCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.RoomListCall.html) and [*report status*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.RoomReportStatuCall.html) * scores - * [*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) + * [*get*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.ScoreGetCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.ScoreListCall.html), [*list window*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.ScoreListWindowCall.html), [*submit*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.ScoreSubmitCall.html) and [*submit multiple*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.ScoreSubmitMultipleCall.html) +* [snapshots](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.Snapshot.html) + * [*get*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.SnapshotGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.SnapshotListCall.html) * turn based matches - * [*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) + * [*cancel*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheCancelCall.html), [*create*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheDismisCall.html), [*finish*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheFinishCall.html), [*get*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheGetCall.html), [*join*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheLeaveCall.html), [*leave turn*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheLeaveTurnCall.html), [*list*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheListCall.html), [*rematch*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheRematchCall.html), [*sync*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/struct.TurnBasedMatcheSyncCall.html) and [*take turn*](https://docs.rs/google-games1/1.0.6+20171207/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+20170925/google_games1/struct.Games.html)** +* **[Hub](https://docs.rs/google-games1/1.0.6+20171207/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+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)** + * creates [*Method Builders*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-games1/1.0.6+20171207/google_games1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-games1/1.0.6+20171207/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+20170925/google_games1/trait.Part.html)** + * **[Parts](https://docs.rs/google-games1/1.0.6+20171207/google_games1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-games1/1.0.6+20170925/google_games1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-games1/1.0.6+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-games1/1.0.6+20171207/google_games1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-games1/1.0.6+20171207/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+20170925/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+20171207/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-games1/1.0.6+20171207/google_games1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-games1/1.0.6+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/google_games1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-games1/1.0.6+20171207/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 01490c13c0..1b7c4f35da 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+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*. +//! This documentation was generated from *Games* crate version *1.0.6+20171207*, where *20171207* 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 ffefc4a94e..fb53063ff7 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+20170925" +version = "1.0.6+20171207" 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+20170925" +version = "1.0.6+20171207" diff --git a/gen/gamesconfiguration1_configuration-cli/README.md b/gen/gamesconfiguration1_configuration-cli/README.md index e2776425f5..71a9510e6c 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 *20170925*. The CLI is at version *1.0.6*. +This documentation was generated from the *Games Configuration* API at revision *20171207*. 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 dcc1008c5f..847067bb27 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+20170925 +site_name: Games Configuration v1.0.6+20171207 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 57567554f0..ae6a85ba07 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+20170925") + .version("1.0.6+20171207") .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 e2a2a99542..51d06c58fe 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+20170925" +version = "1.0.6+20171207" 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+20170925" +documentation = "https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207" license = "MIT" keywords = ["gamesConfiguration", "google", "protocol", "web", "api"] diff --git a/gen/gamesconfiguration1_configuration/README.md b/gen/gamesconfiguration1_configuration/README.md index cfa3668f85..8ec3699850 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+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*. +This documentation was generated from *Games Configuration* crate version *1.0.6+20171207*, where *20171207* 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+20170925/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+20171207/google_gamesconfiguration1_configuration/struct.GamesConfiguration.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) +* [achievement configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.AchievementConfiguration.html) + * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationUpdateCall.html) +* [image configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.ImageConfiguration.html) + * [*upload*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) +* [leaderboard configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.LeaderboardConfiguration.html) + * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationUpdateCall.html) Upload supported by ... -* [*upload image configurations*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20170925/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) +* [*upload image configurations*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/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+20170925/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html)** +* **[Hub](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/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+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)** + * creates [*Method Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/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+20170925/google_gamesconfiguration1_configuration/trait.Part.html)** + * **[Parts](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/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+20170925/google_gamesconfiguration1_configuration/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/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+20170925/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+20171207/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/google_gamesconfiguration1_configuration/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/google_gamesconfiguration1_configuration/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gamesconfiguration1_configuration/1.0.6+20171207/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 bf4acf5b3c..3cf9e52416 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+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*. +//! This documentation was generated from *Games Configuration* crate version *1.0.6+20171207*, where *20171207* 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 9f411f6cc3..0bc4ad3230 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+20170925" +version = "1.0.6+20171207" 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+20170925" +version = "1.0.6+20171207" diff --git a/gen/gamesmanagement1_management-cli/README.md b/gen/gamesmanagement1_management-cli/README.md index 56a07f06dd..80159c2717 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 *20170925*. The CLI is at version *1.0.6*. +This documentation was generated from the *Games Management* API at revision *20171207*. 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 1b7f065869..e06c967684 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+20170925 +site_name: Games Management v1.0.6+20171207 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 825d78005f..4a88bb6e9f 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+20170925") + .version("1.0.6+20171207") .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 cd7cc27459..9f70459e4a 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+20170925" +version = "1.0.6+20171207" 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+20170925" +documentation = "https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207" license = "MIT" keywords = ["gamesManagement", "google", "protocol", "web", "api"] diff --git a/gen/gamesmanagement1_management/README.md b/gen/gamesmanagement1_management/README.md index dcff33537a..1fe6d4681a 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+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*. +This documentation was generated from *Games Management* crate version *1.0.6+20171207*, where *20171207* 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+20170925/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+20171207/google_gamesmanagement1_management/struct.GamesManagement.html) ... * achievements - * [*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) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.AchievementResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.AchievementResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.AchievementResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.AchievementResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.AchievementResetMultipleForAllPlayerCall.html) * applications - * [*list hidden*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20170925/google_gamesmanagement1_management/struct.ApplicationListHiddenCall.html) + * [*list hidden*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.ApplicationListHiddenCall.html) * events - * [*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) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.EventResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.EventResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.EventResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.EventResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.EventResetMultipleForAllPlayerCall.html) +* [players](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.Player.html) + * [*hide*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.PlayerHideCall.html) and [*unhide*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.PlayerUnhideCall.html) * quests - * [*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) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.QuestResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.QuestResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.QuestResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.QuestResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.QuestResetMultipleForAllPlayerCall.html) * rooms - * [*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) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.RoomResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.RoomResetForAllPlayerCall.html) * scores - * [*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) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.ScoreResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.ScoreResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.ScoreResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.ScoreResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.ScoreResetMultipleForAllPlayerCall.html) * turn based matches - * [*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) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/struct.TurnBasedMatcheResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/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+20170925/google_gamesmanagement1_management/struct.GamesManagement.html)** +* **[Hub](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/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+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)** + * creates [*Method Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/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+20170925/google_gamesmanagement1_management/trait.Part.html)** + * **[Parts](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/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+20170925/google_gamesmanagement1_management/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/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+20170925/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+20171207/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/google_gamesmanagement1_management/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/google_gamesmanagement1_management/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gamesmanagement1_management/1.0.6+20171207/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 7b4db29afb..2ead5c76c5 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+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*. +//! This documentation was generated from *Games Management* crate version *1.0.6+20171207*, where *20171207* 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 3724c8e326..6699ab1ed7 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+20170925" +version = "1.0.6+20171207" 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+20170925" +version = "1.0.6+20171207" diff --git a/gen/genomics1-cli/README.md b/gen/genomics1-cli/README.md index b32461cd0c..d93c7669aa 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 *20170925*. The CLI is at version *1.0.6*. +This documentation was generated from the *genomics* API at revision *20171207*. 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 e6073484d2..436a3eaf9e 100644 --- a/gen/genomics1-cli/mkdocs.yml +++ b/gen/genomics1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: genomics v1.0.6+20170925 +site_name: genomics v1.0.6+20171207 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 ca229a183b..cfcbea4a90 100644 --- a/gen/genomics1-cli/src/main.rs +++ b/gen/genomics1-cli/src/main.rs @@ -157,7 +157,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 })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transcript.coding-sequence.start" => Some(("transcript.codingSequence.start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transcript.coding-sequence.end" => Some(("transcript.codingSequence.end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transcript.gene-id" => Some(("transcript.geneId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "variant.effect" => Some(("variant.effect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "variant.transcript-ids" => Some(("variant.transcriptIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "variant.alternate-bases" => Some(("variant.alternateBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -168,9 +170,7 @@ impl<'n> Engine<'n> { "annotation-set-id" => Some(("annotationSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reverse-strand" => Some(("reverseStrand", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "transcript.coding-sequence.start" => Some(("transcript.codingSequence.start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "transcript.coding-sequence.end" => Some(("transcript.codingSequence.end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "transcript.gene-id" => Some(("transcript.geneId", 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 })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-bases", "annotation-set-id", "clinical-significance", "coding-sequence", "effect", "end", "gene-id", "id", "name", "reference-id", "reference-name", "reverse-strand", "start", "transcript", "transcript-ids", "type", "variant"]); @@ -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 })), - "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 })), + "annotation-set-ids" => Some(("annotationSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "start" => Some(("start", 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"]); @@ -454,7 +454,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 })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transcript.coding-sequence.start" => Some(("transcript.codingSequence.start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transcript.coding-sequence.end" => Some(("transcript.codingSequence.end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transcript.gene-id" => Some(("transcript.geneId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "variant.effect" => Some(("variant.effect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "variant.transcript-ids" => Some(("variant.transcriptIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "variant.alternate-bases" => Some(("variant.alternateBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -465,9 +467,7 @@ impl<'n> Engine<'n> { "annotation-set-id" => Some(("annotationSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reverse-strand" => Some(("reverseStrand", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "transcript.coding-sequence.start" => Some(("transcript.codingSequence.start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "transcript.coding-sequence.end" => Some(("transcript.codingSequence.end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "transcript.gene-id" => Some(("transcript.geneId", 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 })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-bases", "annotation-set-id", "clinical-significance", "coding-sequence", "effect", "end", "gene-id", "id", "name", "reference-id", "reference-name", "reverse-strand", "start", "transcript", "transcript-ids", "type", "variant"]); @@ -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 })), - "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 })), + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dataset-ids" => Some(("datasetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "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"]); @@ -2315,9 +2315,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "export-uri" => Some(("exportUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "reference-names" => Some(("referenceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-names" => Some(("referenceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "export-uri" => Some(("exportUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["export-uri", "project-id", "reference-names"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -2454,8 +2454,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-uris" => Some(("sourceUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "partition-strategy" => Some(("partitionStrategy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -3164,14 +3164,14 @@ impl<'n> Engine<'n> { "variant-set-id" => Some(("variantSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "end" => Some(("end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created" => Some(("created", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-bases" => Some(("referenceBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "names" => Some(("names", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "alternate-bases" => Some(("alternateBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "quality" => Some(("quality", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "reference-bases" => Some(("referenceBases", 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!["alternate-bases", "created", "end", "filter", "id", "names", "quality", "reference-bases", "reference-name", "start", "variant-set-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -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 })), - "normalize-reference-names" => Some(("normalizeReferenceNames", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, 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 })), - "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "normalize-reference-names" => Some(("normalizeReferenceNames", JsonTypeInfo { jtype: JsonType::Boolean, 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())))); @@ -3538,14 +3538,14 @@ impl<'n> Engine<'n> { "variant-set-id" => Some(("variantSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "end" => Some(("end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created" => Some(("created", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-bases" => Some(("referenceBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "names" => Some(("names", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "alternate-bases" => Some(("alternateBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "quality" => Some(("quality", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "reference-bases" => Some(("referenceBases", 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!["alternate-bases", "created", "end", "filter", "id", "names", "quality", "reference-bases", "reference-name", "start", "variant-set-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -3727,9 +3727,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -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 })), - "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-table" => Some(("bigqueryTable", 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 })), - "bigquery-table" => Some(("bigqueryTable", 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!["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())))); @@ -4009,9 +4009,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -6241,7 +6241,7 @@ fn main() { let mut app = App::new("genomics1") .author("Sebastian Thiel ") - .version("1.0.6+20170925") + .version("1.0.6+20171207") .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 bec9564620..fe70776c5e 100644 --- a/gen/genomics1/Cargo.toml +++ b/gen/genomics1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-genomics1" -version = "1.0.6+20170925" +version = "1.0.6+20171207" 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+20170925" +documentation = "https://docs.rs/google-genomics1/1.0.6+20171207" license = "MIT" keywords = ["genomics", "google", "protocol", "web", "api"] diff --git a/gen/genomics1/README.md b/gen/genomics1/README.md index 4d800286f1..925db64407 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+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*. +This documentation was generated from *genomics* crate version *1.0.6+20171207*, where *20171207* 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+20170925/google_genomics1/struct.Genomics.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.Genomics.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) +* [annotations](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.Annotation.html) + * [*batch create*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.AnnotationBatchCreateCall.html), [*create*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.AnnotationCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.AnnotationDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.AnnotationGetCall.html), [*search*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.AnnotationSearchCall.html) and [*update*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.AnnotationUpdateCall.html) * annotationsets - * [*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) + * [*create*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.AnnotationsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.AnnotationsetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.AnnotationsetGetCall.html), [*search*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.AnnotationsetSearchCall.html) and [*update*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.AnnotationsetUpdateCall.html) * callsets - * [*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) + * [*create*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.CallsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.CallsetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.CallsetGetCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.CallsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.CallsetSearchCall.html) +* [datasets](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.Dataset.html) + * [*create*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.DatasetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.DatasetGetCall.html), [*get iam policy*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.DatasetGetIamPolicyCall.html), [*list*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.DatasetPatchCall.html), [*set iam policy*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.DatasetSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.DatasetTestIamPermissionCall.html) and [*undelete*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.DatasetUndeleteCall.html) +* [operations](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.Operation.html) + * [*cancel*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.OperationCancelCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.OperationListCall.html) * readgroupsets - * [*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) + * [*coveragebuckets list*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReadgroupsetCoveragebucketListCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReadgroupsetDeleteCall.html), [*export*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReadgroupsetExportCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReadgroupsetGetCall.html), [*import*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReadgroupsetImportCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReadgroupsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReadgroupsetSearchCall.html) +* [reads](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.Read.html) + * [*search*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReadSearchCall.html) +* [references](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.Reference.html) + * [*bases list*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReferenceBaseListCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReferenceGetCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReferenceSearchCall.html) * referencesets - * [*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) + * [*get*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReferencesetGetCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.ReferencesetSearchCall.html) +* [variants](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.Variant.html) + * [*create*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantGetCall.html), [*import*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantImportCall.html), [*merge*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantMergeCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantSearchCall.html) * variantsets - * [*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) + * [*create*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantsetDeleteCall.html), [*export*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantsetExportCall.html), [*get*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantsetGetCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/struct.VariantsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.6+20171207/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+20170925/google_genomics1/struct.Genomics.html)** +* **[Hub](https://docs.rs/google-genomics1/1.0.6+20171207/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+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)** + * creates [*Method Builders*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-genomics1/1.0.6+20171207/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+20170925/google_genomics1/trait.Part.html)** + * **[Parts](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-genomics1/1.0.6+20170925/google_genomics1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-genomics1/1.0.6+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-genomics1/1.0.6+20171207/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+20170925/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+20171207/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-genomics1/1.0.6+20171207/google_genomics1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-genomics1/1.0.6+20171207/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+20170925/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+20171207/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+20170925/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+20171207/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+20170925/google_genomics1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-genomics1/1.0.6+20171207/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 896903a527..95c6eb13c5 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+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*. +//! This documentation was generated from *genomics* crate version *1.0.6+20171207*, where *20171207* 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 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 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 set of external IDs for this condition. - #[serde(rename="externalIds")] - pub external_ids: 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, /// A set of names for the condition. pub names: Option>, } @@ -502,20 +502,20 @@ impl RequestValue for SearchVariantSetsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ExportReadGroupSetRequest { - /// Required. A Google Cloud Storage URI for the exported BAM file. - /// The currently authenticated user must have write access to the new file. - /// An error will be returned if the URI already contains data. - #[serde(rename="exportUri")] - pub export_uri: Option, + /// Required. The Google Cloud project ID that owns this + /// export. The caller must have WRITE access to this project. + #[serde(rename="projectId")] + pub project_id: Option, /// The reference names to export. If this is not specified, all reference /// sequences, including unmapped reads, are exported. /// Use `*` to export only unmapped reads. #[serde(rename="referenceNames")] pub reference_names: Option>, - /// Required. The Google Cloud project ID that owns this - /// export. The caller must have WRITE access to this project. - #[serde(rename="projectId")] - pub project_id: Option, + /// Required. A Google Cloud Storage URI for the exported BAM file. + /// The currently authenticated user must have write access to the new file. + /// An error will be returned if the URI already contains data. + #[serde(rename="exportUri")] + pub export_uri: Option, } impl RequestValue for ExportReadGroupSetRequest {} @@ -527,6 +527,9 @@ 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, @@ -538,9 +541,6 @@ 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,9 +598,16 @@ pub struct ImportVariantsRequest { /// Required. The variant set to which variant data should be imported. #[serde(rename="variantSetId")] pub variant_set_id: Option, - /// The format of the variant data being imported. If unspecified, defaults to - /// to `VCF`. - pub format: Option, + /// 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, /// 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). @@ -612,16 +619,9 @@ pub struct ImportVariantsRequest { /// generated by the resulting import job. #[serde(rename="infoMergeConfig")] pub info_merge_config: 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, } impl RequestValue for ImportVariantsRequest {} @@ -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,9 +826,6 @@ 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. @@ -844,6 +841,9 @@ 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 {} @@ -880,11 +880,10 @@ pub struct Annotation { pub end: Option, /// The display name of this annotation. pub name: Option, - /// A transcript value represents the assertion that a particular region of - /// the reference genome may be transcribed as RNA. An alternative splicing - /// pattern would be represented as a separate transcript object. This field - /// is only set for annotations of type `TRANSCRIPT`. - pub transcript: Option, + /// The data type for this annotation. Must match the containing annotation + /// set's type. + #[serde(rename="type")] + pub type_: Option, /// A variant annotation, which describes the effect of a variant on the /// genome, the coding sequence, and/or higher level consequences at the /// organism level e.g. pathogenicity. This field is only set for annotations @@ -904,10 +903,11 @@ pub struct Annotation { /// range always refer to the forward strand. #[serde(rename="reverseStrand")] pub reverse_strand: Option, - /// The data type for this annotation. Must match the containing annotation - /// set's type. - #[serde(rename="type")] - pub type_: Option, + /// A transcript value represents the assertion that a particular region of + /// the reference genome may be transcribed as RNA. An alternative splicing + /// pattern would be represented as a separate transcript object. This field + /// is only set for annotations of type `TRANSCRIPT`. + pub transcript: Option, /// The server-generated annotation ID, unique across all annotations. pub id: Option, } @@ -1205,6 +1205,12 @@ 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. @@ -1217,12 +1223,6 @@ 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")] @@ -1255,6 +1255,10 @@ 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`. @@ -1263,19 +1267,15 @@ 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, - /// 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, + /// ID from http://www.ncbi.nlm.nih.gov/taxonomy. For example, 9606 for human. + #[serde(rename="ncbiTaxonId")] + pub ncbi_taxon_id: Option, } impl Resource for Reference {} @@ -1297,11 +1297,8 @@ pub struct ExportVariantSetRequest { /// 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, + /// 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")] @@ -1311,8 +1308,11 @@ pub struct ExportVariantSetRequest { /// project will also own the resulting export job. #[serde(rename="projectId")] pub project_id: Option, - /// The format for the exported data. - pub format: Option, + /// Required. The BigQuery table to export data to. + /// If the table doesn't exist, it will be created. If it already exists, it + /// will be overwritten. + #[serde(rename="bigqueryTable")] + pub bigquery_table: Option, } impl RequestValue for ExportVariantSetRequest {} @@ -1436,8 +1436,8 @@ pub struct ReadGroup { /// the sequenced DNA fragment from end-to-end, not including the adapters. #[serde(rename="predictedInsertSize")] pub predicted_insert_size: Option, - /// The read group name. This corresponds to the @RG ID field in the SAM spec. - pub name: Option, + /// A free-form text description of this read group. + pub description: Option, /// The programs used to generate this read group. Programs are always /// identical for all read groups within a read group set. For this reason, /// only the first read group in a returned set will have this field @@ -1458,8 +1458,8 @@ pub struct ReadGroup { /// The dataset to which this read group belongs. #[serde(rename="datasetId")] pub dataset_id: Option, - /// A free-form text description of this read group. - pub description: Option, + /// The read group name. This corresponds to the @RG ID field in the SAM spec. + pub name: Option, } impl Part for ReadGroup {} @@ -1644,12 +1644,12 @@ pub struct ListBasesResponse { /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// A substring of the bases that make up this reference. - pub sequence: Option, /// The offset position (0-based) of the given `sequence` from the /// start of this `Reference`. This value will differ for each page /// in a paginated request. pub offset: Option, + /// A substring of the bases that make up this reference. + pub sequence: Option, } impl ResponseResult for ListBasesResponse {} @@ -2054,10 +2054,8 @@ pub struct Variant { pub calls: Option>, /// The date this variant was created, in milliseconds from the epoch. pub created: Option, - /// The reference bases for this variant. They start at the given - /// position. - #[serde(rename="referenceBases")] - pub reference_bases: Option, + /// The server-generated variant ID, unique across all variants. + pub id: Option, /// A list of filters (normally quality filters) this variant has failed. /// `PASS` indicates this variant has passed all filters. pub filter: Option>, @@ -2076,8 +2074,10 @@ pub struct Variant { /// A measure of how likely this variant is to be real. /// A higher value is better. pub quality: Option, - /// The server-generated variant ID, unique across all variants. - pub id: Option, + /// The reference bases for this variant. They start at the given + /// position. + #[serde(rename="referenceBases")] + pub reference_bases: Option, } impl RequestValue for Variant {} @@ -2195,9 +2195,6 @@ 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 @@ -2207,6 +2204,9 @@ 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 {} @@ -2255,8 +2255,8 @@ impl ResponseResult for SearchReferenceSetsResponse {} pub struct VariantSet { /// The metadata associated with this variant set. pub metadata: Option>, - /// A textual description of this variant set. - pub description: Option, + /// User-specified, mutable name. + pub name: Option, /// A list of all references used by the variants in a variant set /// with associated coordinate upper bounds for each one. #[serde(rename="referenceBounds")] @@ -2278,8 +2278,8 @@ pub struct VariantSet { /// The dataset to which this variant set belongs. #[serde(rename="datasetId")] pub dataset_id: Option, - /// User-specified, mutable name. - pub name: Option, + /// A textual description of this variant set. + pub description: Option, } impl RequestValue for VariantSet {} @@ -2298,11 +2298,12 @@ impl ResponseResult for VariantSet {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] 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 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, @@ -2315,12 +2316,11 @@ pub struct SearchAnnotationsRequest { /// 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 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")] @@ -2424,14 +2424,14 @@ pub struct SearchAnnotationSetsRequest { /// defaults to 128. The maximum value is 1024. #[serde(rename="pageSize")] pub page_size: 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, + /// 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 that have any of these types are /// returned. pub types: Option>, @@ -4946,12 +4946,12 @@ impl<'a, C, A> OperationCancelCall<'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) -> OperationCancelCall<'a, C, A> @@ -5201,12 +5201,12 @@ impl<'a, C, A> OperationGetCall<'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) -> OperationGetCall<'a, C, A> @@ -5508,12 +5508,12 @@ impl<'a, C, A> OperationListCall<'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) -> OperationListCall<'a, C, A> @@ -5759,12 +5759,12 @@ impl<'a, C, A> DatasetCreateCall<'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) -> DatasetCreateCall<'a, C, A> @@ -6017,12 +6017,12 @@ impl<'a, C, A> DatasetDeleteCall<'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) -> DatasetDeleteCall<'a, C, A> @@ -6303,12 +6303,12 @@ impl<'a, C, A> DatasetUndeleteCall<'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) -> DatasetUndeleteCall<'a, C, A> @@ -6596,12 +6596,12 @@ impl<'a, C, A> DatasetSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DatasetSetIamPolicyCall<'a, C, A> @@ -6887,12 +6887,12 @@ impl<'a, C, A> DatasetTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DatasetTestIamPermissionCall<'a, C, A> @@ -7140,12 +7140,12 @@ impl<'a, C, A> DatasetGetCall<'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) -> DatasetGetCall<'a, C, A> @@ -7399,12 +7399,12 @@ impl<'a, C, A> DatasetListCall<'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) -> DatasetListCall<'a, C, A> @@ -7692,12 +7692,12 @@ impl<'a, C, A> DatasetGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DatasetGetIamPolicyCall<'a, C, A> @@ -7993,12 +7993,12 @@ impl<'a, C, A> DatasetPatchCall<'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) -> DatasetPatchCall<'a, C, A> @@ -8247,12 +8247,12 @@ impl<'a, C, A> ReferencesetSearchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReferencesetSearchCall<'a, C, A> @@ -8503,12 +8503,12 @@ impl<'a, C, A> ReferencesetGetCall<'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) -> ReferencesetGetCall<'a, C, A> @@ -8757,12 +8757,12 @@ impl<'a, C, A> CallsetSearchCall<'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) -> CallsetSearchCall<'a, C, A> @@ -9058,12 +9058,12 @@ impl<'a, C, A> CallsetPatchCall<'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) -> CallsetPatchCall<'a, C, A> @@ -9309,12 +9309,12 @@ impl<'a, C, A> CallsetCreateCall<'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) -> CallsetCreateCall<'a, C, A> @@ -9562,12 +9562,12 @@ impl<'a, C, A> CallsetDeleteCall<'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) -> CallsetDeleteCall<'a, C, A> @@ -9815,12 +9815,12 @@ impl<'a, C, A> CallsetGetCall<'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) -> CallsetGetCall<'a, C, A> @@ -10085,12 +10085,12 @@ impl<'a, C, A> ReadSearchCall<'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) -> ReadSearchCall<'a, C, A> @@ -10375,12 +10375,12 @@ impl<'a, C, A> ReadgroupsetExportCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetExportCall<'a, C, A> @@ -10639,12 +10639,12 @@ impl<'a, C, A> ReadgroupsetImportCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetImportCall<'a, C, A> @@ -10944,12 +10944,12 @@ impl<'a, C, A> ReadgroupsetPatchCall<'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) -> ReadgroupsetPatchCall<'a, C, A> @@ -11197,12 +11197,12 @@ impl<'a, C, A> ReadgroupsetGetCall<'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) -> ReadgroupsetGetCall<'a, C, A> @@ -11543,12 +11543,12 @@ impl<'a, C, A> ReadgroupsetCoveragebucketListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetCoveragebucketListCall<'a, C, A> @@ -11797,12 +11797,12 @@ impl<'a, C, A> ReadgroupsetDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetDeleteCall<'a, C, A> @@ -12051,12 +12051,12 @@ impl<'a, C, A> ReadgroupsetSearchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetSearchCall<'a, C, A> @@ -12360,12 +12360,12 @@ impl<'a, C, A> ReferenceBaseListCall<'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) -> ReferenceBaseListCall<'a, C, A> @@ -12614,12 +12614,12 @@ impl<'a, C, A> ReferenceSearchCall<'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) -> ReferenceSearchCall<'a, C, A> @@ -12870,12 +12870,12 @@ impl<'a, C, A> ReferenceGetCall<'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) -> ReferenceGetCall<'a, C, A> @@ -13124,12 +13124,12 @@ impl<'a, C, A> VariantSearchCall<'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) -> VariantSearchCall<'a, C, A> @@ -13377,12 +13377,12 @@ impl<'a, C, A> VariantDeleteCall<'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) -> VariantDeleteCall<'a, C, A> @@ -13630,12 +13630,12 @@ impl<'a, C, A> VariantGetCall<'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) -> VariantGetCall<'a, C, A> @@ -13967,12 +13967,12 @@ impl<'a, C, A> VariantMergeCall<'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) -> VariantMergeCall<'a, C, A> @@ -14218,12 +14218,12 @@ impl<'a, C, A> VariantCreateCall<'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) -> VariantCreateCall<'a, C, A> @@ -14482,12 +14482,12 @@ impl<'a, C, A> VariantImportCall<'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) -> VariantImportCall<'a, C, A> @@ -14784,12 +14784,12 @@ impl<'a, C, A> VariantPatchCall<'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) -> VariantPatchCall<'a, C, A> @@ -15082,12 +15082,12 @@ impl<'a, C, A> AnnotationUpdateCall<'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) -> AnnotationUpdateCall<'a, C, A> @@ -15332,12 +15332,12 @@ impl<'a, C, A> AnnotationGetCall<'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) -> AnnotationGetCall<'a, C, A> @@ -15585,12 +15585,12 @@ impl<'a, C, A> AnnotationSearchCall<'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) -> AnnotationSearchCall<'a, C, A> @@ -15835,12 +15835,12 @@ impl<'a, C, A> AnnotationDeleteCall<'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) -> AnnotationDeleteCall<'a, C, A> @@ -16103,12 +16103,12 @@ impl<'a, C, A> AnnotationCreateCall<'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) -> AnnotationCreateCall<'a, C, A> @@ -16363,12 +16363,12 @@ impl<'a, C, A> AnnotationBatchCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationBatchCreateCall<'a, C, A> @@ -16661,12 +16661,12 @@ impl<'a, C, A> AnnotationsetUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetUpdateCall<'a, C, A> @@ -16912,12 +16912,12 @@ impl<'a, C, A> AnnotationsetSearchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetSearchCall<'a, C, A> @@ -17168,12 +17168,12 @@ impl<'a, C, A> AnnotationsetCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetCreateCall<'a, C, A> @@ -17418,12 +17418,12 @@ impl<'a, C, A> AnnotationsetDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetDeleteCall<'a, C, A> @@ -17668,12 +17668,12 @@ impl<'a, C, A> AnnotationsetGetCall<'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) -> AnnotationsetGetCall<'a, C, A> @@ -17923,12 +17923,12 @@ impl<'a, C, A> VariantsetCreateCall<'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) -> VariantsetCreateCall<'a, C, A> @@ -18177,12 +18177,12 @@ impl<'a, C, A> VariantsetDeleteCall<'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) -> VariantsetDeleteCall<'a, C, A> @@ -18462,12 +18462,12 @@ impl<'a, C, A> VariantsetExportCall<'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) -> VariantsetExportCall<'a, C, A> @@ -18765,12 +18765,12 @@ impl<'a, C, A> VariantsetPatchCall<'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) -> VariantsetPatchCall<'a, C, A> @@ -19019,12 +19019,12 @@ impl<'a, C, A> VariantsetSearchCall<'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) -> VariantsetSearchCall<'a, C, A> @@ -19272,12 +19272,12 @@ impl<'a, C, A> VariantsetGetCall<'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) -> VariantsetGetCall<'a, C, A> diff --git a/gen/gmail1-cli/Cargo.toml b/gen/gmail1-cli/Cargo.toml index 6440d63973..0984f3cf45 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+20170913" +version = "1.0.6+20171128" 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+20170913" +version = "1.0.6+20171128" diff --git a/gen/gmail1-cli/README.md b/gen/gmail1-cli/README.md index de123be1af..730ded3928 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 *20170913*. The CLI is at version *1.0.6*. +This documentation was generated from the *gmail* API at revision *20171128*. 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 820f7ee486..28451da907 100644 --- a/gen/gmail1-cli/mkdocs.yml +++ b/gen/gmail1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: gmail v1.0.6+20170913 +site_name: gmail v1.0.6+20171128 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 1f31aab9a7..7f783c26a4 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+20170913") + .version("1.0.6+20171128") .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 58027b9d04..a6cb5f7726 100644 --- a/gen/gmail1/Cargo.toml +++ b/gen/gmail1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-gmail1" -version = "1.0.6+20170913" +version = "1.0.6+20171128" 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+20170913" +documentation = "https://docs.rs/google-gmail1/1.0.6+20171128" license = "MIT" keywords = ["gmail", "google", "protocol", "web", "api"] diff --git a/gen/gmail1/README.md b/gen/gmail1/README.md index 634febacc0..f7302e38dd 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+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*. +This documentation was generated from *gmail* crate version *1.0.6+20171128*, where *20171128* 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+20170913/google_gmail1/struct.Gmail.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.Gmail.html) ... * users - * [*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) + * [*drafts create*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserDraftCreateCall.html), [*drafts delete*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserDraftDeleteCall.html), [*drafts get*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserDraftGetCall.html), [*drafts list*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserDraftListCall.html), [*drafts send*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserDraftSendCall.html), [*drafts update*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserDraftUpdateCall.html), [*get profile*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserGetProfileCall.html), [*history list*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserHistoryListCall.html), [*labels create*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserLabelCreateCall.html), [*labels delete*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserLabelDeleteCall.html), [*labels get*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserLabelGetCall.html), [*labels list*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserLabelListCall.html), [*labels patch*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserLabelPatchCall.html), [*labels update*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserLabelUpdateCall.html), [*messages attachments get*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageAttachmentGetCall.html), [*messages batch delete*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageBatchDeleteCall.html), [*messages batch modify*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageBatchModifyCall.html), [*messages delete*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageDeleteCall.html), [*messages get*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageGetCall.html), [*messages import*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageImportCall.html), [*messages insert*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageInsertCall.html), [*messages list*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageListCall.html), [*messages modify*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageModifyCall.html), [*messages send*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageSendCall.html), [*messages trash*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageTrashCall.html), [*messages untrash*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageUntrashCall.html), [*settings filters create*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingFilterCreateCall.html), [*settings filters delete*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingFilterDeleteCall.html), [*settings filters get*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingFilterGetCall.html), [*settings filters list*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingFilterListCall.html), [*settings forwarding addresses create*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingForwardingAddresseCreateCall.html), [*settings forwarding addresses delete*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingForwardingAddresseDeleteCall.html), [*settings forwarding addresses get*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingForwardingAddresseGetCall.html), [*settings forwarding addresses list*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingForwardingAddresseListCall.html), [*settings get auto forwarding*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingGetAutoForwardingCall.html), [*settings get imap*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingGetImapCall.html), [*settings get pop*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingGetPopCall.html), [*settings get vacation*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingGetVacationCall.html), [*settings send as create*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendACreateCall.html), [*settings send as delete*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendADeleteCall.html), [*settings send as get*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendAGetCall.html), [*settings send as list*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendAListCall.html), [*settings send as patch*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendAPatchCall.html), [*settings send as smime info delete*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendASmimeInfoDeleteCall.html), [*settings send as smime info get*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendASmimeInfoGetCall.html), [*settings send as smime info insert*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendASmimeInfoInsertCall.html), [*settings send as smime info list*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendASmimeInfoListCall.html), [*settings send as smime info set default*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendASmimeInfoSetDefaultCall.html), [*settings send as update*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendAUpdateCall.html), [*settings send as verify*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingSendAVerifyCall.html), [*settings update auto forwarding*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingUpdateAutoForwardingCall.html), [*settings update imap*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingUpdateImapCall.html), [*settings update pop*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingUpdatePopCall.html), [*settings update vacation*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserSettingUpdateVacationCall.html), [*stop*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserStopCall.html), [*threads delete*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserThreadDeleteCall.html), [*threads get*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserThreadGetCall.html), [*threads list*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserThreadListCall.html), [*threads modify*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserThreadModifyCall.html), [*threads trash*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserThreadTrashCall.html), [*threads untrash*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserThreadUntrashCall.html) and [*watch*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserWatchCall.html) Upload supported by ... -* [*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) +* [*messages import users*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageImportCall.html) +* [*drafts create users*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserDraftCreateCall.html) +* [*drafts send users*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserDraftSendCall.html) +* [*messages send users*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserMessageSendCall.html) +* [*drafts update users*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/struct.UserDraftUpdateCall.html) +* [*messages insert users*](https://docs.rs/google-gmail1/1.0.6+20171128/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+20170913/google_gmail1/struct.Gmail.html)** +* **[Hub](https://docs.rs/google-gmail1/1.0.6+20171128/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+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)** + * creates [*Method Builders*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gmail1/1.0.6+20171128/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+20170913/google_gmail1/trait.Part.html)** + * **[Parts](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-gmail1/1.0.6+20170913/google_gmail1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gmail1/1.0.6+20171128/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+20170913/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+20171128/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+20170913/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+20171128/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+20170913/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+20171128/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+20170913/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+20171128/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gmail1/1.0.6+20171128/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+20170913/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+20171128/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-gmail1/1.0.6+20171128/google_gmail1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gmail1/1.0.6+20171128/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+20170913/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+20171128/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+20170913/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+20171128/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+20170913/google_gmail1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gmail1/1.0.6+20171128/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 0331af4a05..a708d1386e 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+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*. +//! This documentation was generated from *gmail* crate version *1.0.6+20171128*, where *20171128* 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/). diff --git a/gen/iam1-cli/Cargo.toml b/gen/iam1-cli/Cargo.toml index e8764f39d6..f23bf65ccc 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+20170919" +version = "1.0.6+20171130" 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+20170919" +version = "1.0.6+20171130" diff --git a/gen/iam1-cli/README.md b/gen/iam1-cli/README.md index ccc85221cd..f441cca5c6 100644 --- a/gen/iam1-cli/README.md +++ b/gen/iam1-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 *iam* API at revision *20170919*. The CLI is at version *1.0.6*. +This documentation was generated from the *iam* API at revision *20171130*. The CLI is at version *1.0.6*. ```bash iam1 [options] diff --git a/gen/iam1-cli/mkdocs.yml b/gen/iam1-cli/mkdocs.yml index 328607f82b..10ec45355f 100644 --- a/gen/iam1-cli/mkdocs.yml +++ b/gen/iam1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: iam v1.0.6+20170919 +site_name: iam v1.0.6+20171130 site_url: http://byron.github.io/google-apis-rs/google-iam1-cli site_description: A complete library to interact with iam (protocol v1) diff --git a/gen/iam1-cli/src/main.rs b/gen/iam1-cli/src/main.rs index c7e5946716..e48655f4ac 100644 --- a/gen/iam1-cli/src/main.rs +++ b/gen/iam1-cli/src/main.rs @@ -70,13 +70,13 @@ impl<'n> Engine<'n> { 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.name" => Some(("role.name", 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.description" => Some(("role.description", JsonTypeInfo { jtype: JsonType::String, 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())))); @@ -334,13 +334,13 @@ 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 })), + "name" => Some(("name", 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 })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, 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())))); @@ -602,13 +602,13 @@ impl<'n> Engine<'n> { 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.name" => Some(("role.name", 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.description" => Some(("role.description", JsonTypeInfo { jtype: JsonType::String, 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())))); @@ -866,13 +866,13 @@ 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 })), + "name" => Some(("name", 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 })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, 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())))); @@ -2842,9 +2842,9 @@ fn main() { (Some(r##"name"##), None, Some(r##"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 + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + Using `-` as a wildcard for the `PROJECT_ID` will infer the project from + the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account."##), Some(true), Some(false)), @@ -2868,9 +2868,9 @@ fn main() { (Some(r##"name"##), None, Some(r##"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 + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + Using `-` as a wildcard for the `PROJECT_ID` will infer the project from + the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account."##), Some(true), Some(false)), @@ -2919,9 +2919,9 @@ fn main() { (Some(r##"name"##), None, Some(r##"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 + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + Using `-` as a wildcard for the `PROJECT_ID` will infer the project from + the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account."##), Some(true), Some(false)), @@ -2951,9 +2951,9 @@ fn main() { (Some(r##"name"##), None, Some(r##"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 + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. + Using `-` as a wildcard for the `PROJECT_ID` will infer the project from + the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account."##), Some(true), Some(false)), @@ -2978,10 +2978,10 @@ fn main() { (Some(r##"name"##), None, Some(r##"The resource name of the service account key in the following format: - `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/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 + Using `-` as a wildcard for the `PROJECT_ID` will infer the project from + the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account."##), Some(true), Some(false)), @@ -3005,10 +3005,10 @@ fn main() { (Some(r##"name"##), None, Some(r##"The resource name of the service account in the following format: - `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - Using `-` as a wildcard for the project, will infer the project from - the account. The `account` value can be the `email` address or the + Using `-` as a wildcard for the `PROJECT_ID`, will infer the project from + the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account."##), Some(true), Some(false)), @@ -3085,9 +3085,9 @@ fn main() { (Some(r##"name"##), None, Some(r##"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 + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + Using `-` as a wildcard for the `PROJECT_ID` will infer the project from + the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account."##), Some(true), Some(false)), @@ -3121,9 +3121,9 @@ fn main() { (Some(r##"name"##), None, Some(r##"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 + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + Using `-` as a wildcard for the `PROJECT_ID` will infer the project from + the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account."##), Some(true), Some(false)), @@ -3187,14 +3187,14 @@ fn main() { (Some(r##"name"##), None, Some(r##"The resource name of the service account in the following format: - `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - 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. + Requests using `-` as a wildcard for the `PROJECT_ID` 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}`."##), + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`."##), Some(true), Some(false)), @@ -3290,7 +3290,7 @@ fn main() { let mut app = App::new("iam1") .author("Sebastian Thiel ") - .version("1.0.6+20170919") + .version("1.0.6+20171130") .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 552b1595c7..149541dfe0 100644 --- a/gen/iam1/Cargo.toml +++ b/gen/iam1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-iam1" -version = "1.0.6+20170919" +version = "1.0.6+20171130" 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+20170919" +documentation = "https://docs.rs/google-iam1/1.0.6+20171130" license = "MIT" keywords = ["iam", "google", "protocol", "web", "api"] diff --git a/gen/iam1/README.md b/gen/iam1/README.md index 94e9457ab5..941cb5290c 100644 --- a/gen/iam1/README.md +++ b/gen/iam1/README.md @@ -5,22 +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+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*. +This documentation was generated from *iam* crate version *1.0.6+20171130*, where *20171130* 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+20170919/google_iam1/struct.Iam.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-iam1/1.0.6+20171130/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) + * [*roles create*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.OrganizationRoleCreateCall.html), [*roles delete*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.OrganizationRoleDeleteCall.html), [*roles get*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.OrganizationRoleGetCall.html), [*roles list*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.OrganizationRoleListCall.html), [*roles patch*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.OrganizationRolePatchCall.html) and [*roles undelete*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.OrganizationRoleUndeleteCall.html) +* [permissions](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.Permission.html) + * [*query testable permissions*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.PermissionQueryTestablePermissionCall.html) * projects - * [*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) + * [*roles create*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectRoleCreateCall.html), [*roles delete*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectRoleDeleteCall.html), [*roles get*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectRoleGetCall.html), [*roles list*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectRoleListCall.html), [*roles patch*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectRolePatchCall.html), [*roles undelete*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectRoleUndeleteCall.html), [*service accounts create*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountDeleteCall.html), [*service accounts get*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountKeyListCall.html), [*service accounts list*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountListCall.html), [*service accounts set iam policy*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountSignBlobCall.html), [*service accounts sign jwt*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountSignJwtCall.html), [*service accounts test iam permissions*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountTestIamPermissionCall.html) and [*service accounts update*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.ProjectServiceAccountUpdateCall.html) +* [roles](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.Role.html) + * [*get*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.RoleGetCall.html), [*list*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.RoleListCall.html) and [*query grantable roles*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/struct.RoleQueryGrantableRoleCall.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-iam1/1.0.6+20170919/google_iam1/struct.Iam.html)** +* **[Hub](https://docs.rs/google-iam1/1.0.6+20171130/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+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)** + * creates [*Method Builders*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-iam1/1.0.6+20171130/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+20170919/google_iam1/trait.Part.html)** + * **[Parts](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-iam1/1.0.6+20170919/google_iam1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/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-iam1/1.0.6+20170919/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+20171130/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+20170919/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+20171130/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+20170919/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+20171130/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+20170919/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+20171130/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-iam1/1.0.6+20171130/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+20170919/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+20171130/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-iam1/1.0.6+20171130/google_iam1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-iam1/1.0.6+20171130/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+20170919/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+20171130/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+20170919/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+20171130/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+20170919/google_iam1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-iam1/1.0.6+20171130/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 18cf468f3c..672a8cffe3 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+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*. +//! This documentation was generated from *iam* crate version *1.0.6+20171130*, where *20171130* 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/). @@ -492,14 +492,13 @@ impl RequestValue for SignJwtRequest {} /// `unique_id`. /// /// If the account already exists, the account's resource name is returned -/// in util::Status's ResourceInfo.resource_name in the format of -/// projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}. The caller can -/// use the name in other methods to access the account. +/// in the format of projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}. The caller +/// can use the name in other methods to access the account. /// /// All other methods can identify the service account using the 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 +/// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. +/// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from +/// the account. The `ACCOUNT` value can be the `email` address or the /// `unique_id` of the service account. /// /// # Activities @@ -513,7 +512,7 @@ impl RequestValue for SignJwtRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ServiceAccount { - /// @OutputOnly. The OAuth2 client id for the service account. + /// @OutputOnly The OAuth2 client id for the service account. /// This is used in conjunction with the OAuth2 clientconfig API to make /// three legged OAuth2 (3LO) flows to access the data of Google users. #[serde(rename="oauth2ClientId")] @@ -525,14 +524,14 @@ pub struct ServiceAccount { #[serde(rename="displayName")] pub display_name: Option, /// The resource name of the service account in the following format: - /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. /// - /// 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. + /// Requests using `-` as a wildcard for the `PROJECT_ID` 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}`. + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. pub name: Option, /// @OutputOnly The unique and stable id of the service account. #[serde(rename="uniqueId")] @@ -648,8 +647,6 @@ impl ResponseResult for QueryTestablePermissionsResponse {} 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. /// /// When Role is used in CreateRole, the role name must not be set. @@ -669,6 +666,8 @@ pub struct Role { pub included_permissions: Option>, /// The current launch stage of the role. pub stage: Option, + /// Optional. A human-readable description for the role. + pub description: Option, } impl RequestValue for Role {} @@ -983,9 +982,9 @@ 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, + /// The key can be used after this timestamp. + #[serde(rename="validAfterTime")] + pub valid_after_time: Option, /// Specifies the algorithm (and possibly key size) for the key. #[serde(rename="keyAlgorithm")] pub key_algorithm: Option, @@ -1004,9 +1003,9 @@ pub struct ServiceAccountKey { /// The public key data. Only provided in `GetServiceAccountKey` responses. #[serde(rename="publicKeyData")] pub public_key_data: Option, - /// The key can be used after this timestamp. - #[serde(rename="validAfterTime")] - pub valid_after_time: Option, + /// The resource name of the service account key in the following format + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. + pub name: Option, } impl ResponseResult for ServiceAccountKey {} @@ -1457,9 +1456,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # 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 + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. + /// Using `-` as a wildcard for the `PROJECT_ID` 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_delete(&self, name: &str) -> ProjectServiceAccountKeyDeleteCall<'a, C, A> { ProjectServiceAccountKeyDeleteCall { @@ -1586,9 +1585,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `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 + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + /// Using `-` as a wildcard for the `PROJECT_ID` 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_sign_blob(&self, request: SignBlobRequest, name: &str) -> ProjectServiceAccountSignBlobCall<'a, C, A> { ProjectServiceAccountSignBlobCall { @@ -1629,9 +1628,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # 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 + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + /// Using `-` as a wildcard for the `PROJECT_ID` 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_delete(&self, name: &str) -> ProjectServiceAccountDeleteCall<'a, C, A> { ProjectServiceAccountDeleteCall { @@ -1744,12 +1743,12 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `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. + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + /// Requests using `-` as a wildcard for the `PROJECT_ID` 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}`. + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. pub fn service_accounts_update(&self, request: ServiceAccount, name: &str) -> ProjectServiceAccountUpdateCall<'a, C, A> { ProjectServiceAccountUpdateCall { hub: self.hub, @@ -1773,9 +1772,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `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 + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + /// Using `-` as a wildcard for the `PROJECT_ID` 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_sign_jwt(&self, request: SignJwtRequest, name: &str) -> ProjectServiceAccountSignJwtCall<'a, C, A> { ProjectServiceAccountSignJwtCall { @@ -1795,9 +1794,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # 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 + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + /// Using `-` as a wildcard for the `PROJECT_ID`, 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 { @@ -1819,9 +1818,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `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 + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + /// Using `-` as a wildcard for the `PROJECT_ID` 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 { @@ -1862,9 +1861,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # 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 + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. + /// Using `-` as a wildcard for the `PROJECT_ID` 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 { @@ -1884,9 +1883,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # 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 + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + /// Using `-` as a wildcard for the `PROJECT_ID` 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_get(&self, name: &str) -> ProjectServiceAccountGetCall<'a, C, A> { ProjectServiceAccountGetCall { @@ -2183,12 +2182,12 @@ impl<'a, C, A> OrganizationRoleGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationRoleGetCall<'a, C, A> @@ -2469,12 +2468,12 @@ impl<'a, C, A> OrganizationRoleUndeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationRoleUndeleteCall<'a, C, A> @@ -2742,12 +2741,12 @@ impl<'a, C, A> OrganizationRoleDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationRoleDeleteCall<'a, C, A> @@ -3028,12 +3027,12 @@ impl<'a, C, A> OrganizationRoleCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationRoleCreateCall<'a, C, A> @@ -3327,12 +3326,12 @@ impl<'a, C, A> OrganizationRolePatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationRolePatchCall<'a, C, A> @@ -3631,12 +3630,12 @@ impl<'a, C, A> OrganizationRoleListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationRoleListCall<'a, C, A> @@ -3887,12 +3886,12 @@ impl<'a, C, A> RoleGetCall<'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) -> RoleGetCall<'a, C, A> @@ -4166,12 +4165,12 @@ impl<'a, C, A> RoleListCall<'a, C, A> where C: BorrowMut, A: oaut /// * *prettyPrint* (query-boolean) - Returns response 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) -> RoleListCall<'a, C, A> @@ -4415,12 +4414,12 @@ impl<'a, C, A> RoleQueryGrantableRoleCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RoleQueryGrantableRoleCall<'a, C, A> @@ -4634,9 +4633,9 @@ impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountKeyDeleteCall<'a, C, A> @@ -4928,12 +4927,12 @@ impl<'a, C, A> ProjectRoleGetCall<'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) -> ProjectRoleGetCall<'a, C, A> @@ -5183,12 +5182,12 @@ impl<'a, C, A> ProjectServiceAccountGetIamPolicyCall<'a, C, A> where C: BorrowMu /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectServiceAccountGetIamPolicyCall<'a, C, A> @@ -5469,12 +5468,12 @@ impl<'a, C, A> ProjectRoleUndeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRoleUndeleteCall<'a, C, A> @@ -5742,12 +5741,12 @@ impl<'a, C, A> ProjectRoleDeleteCall<'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) -> ProjectRoleDeleteCall<'a, C, A> @@ -6028,12 +6027,12 @@ impl<'a, C, A> ProjectServiceAccountTestIamPermissionCall<'a, C, A> where C: Bor /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectServiceAccountTestIamPermissionCall<'a, C, A> @@ -6278,9 +6277,9 @@ impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountSignBlobCall<'a, C, A> @@ -6602,12 +6601,12 @@ impl<'a, C, A> ProjectServiceAccountSetIamPolicyCall<'a, C, A> where C: BorrowMu /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectServiceAccountSetIamPolicyCall<'a, C, A> @@ -6821,9 +6820,9 @@ impl<'a, C, A> ProjectServiceAccountDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountDeleteCall<'a, C, A> @@ -7145,12 +7144,12 @@ impl<'a, C, A> ProjectServiceAccountCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountCreateCall<'a, C, A> @@ -7444,12 +7443,12 @@ impl<'a, C, A> ProjectRolePatchCall<'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) -> ProjectRolePatchCall<'a, C, A> @@ -7730,12 +7729,12 @@ impl<'a, C, A> ProjectRoleCreateCall<'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) -> ProjectRoleCreateCall<'a, C, A> @@ -8034,12 +8033,12 @@ impl<'a, C, A> ProjectRoleListCall<'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) -> ProjectRoleListCall<'a, C, A> @@ -8288,14 +8287,14 @@ impl<'a, C, A> ProjectServiceAccountUpdateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountUpdateCall<'a, C, A> @@ -8584,9 +8583,9 @@ impl<'a, C, A> ProjectServiceAccountSignJwtCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignJwtCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountSignJwtCall<'a, C, A> @@ -8848,10 +8847,10 @@ impl<'a, C, A> ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountKeyListCall<'a, C, A> @@ -9148,9 +9147,9 @@ impl<'a, C, A> ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountKeyCreateCall<'a, C, A> @@ -9468,12 +9467,12 @@ impl<'a, C, A> ProjectServiceAccountListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountListCall<'a, C, A> @@ -9693,10 +9692,10 @@ impl<'a, C, A> ProjectServiceAccountKeyGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountKeyGetCall<'a, C, A> @@ -9959,9 +9958,9 @@ impl<'a, C, A> ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountGetCall<'a, C, A> @@ -10245,12 +10244,12 @@ impl<'a, C, A> PermissionQueryTestablePermissionCall<'a, C, A> where C: BorrowMu /// * *prettyPrint* (query-boolean) - Returns response 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) -> PermissionQueryTestablePermissionCall<'a, C, A> diff --git a/gen/identitytoolkit3-cli/Cargo.toml b/gen/identitytoolkit3-cli/Cargo.toml index 7701003bd5..b489e79cf8 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+20170828" +version = "1.0.6+20171122" 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+20170828" +version = "1.0.6+20171122" diff --git a/gen/identitytoolkit3-cli/README.md b/gen/identitytoolkit3-cli/README.md index 6d9c595ff3..6d9ce61901 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 *20170828*. The CLI is at version *1.0.6*. +This documentation was generated from the *Identity Toolkit* API at revision *20171122*. The CLI is at version *1.0.6*. ```bash identitytoolkit3 [options] @@ -33,6 +33,7 @@ identitytoolkit3 [options] create-auth-uri (-r )... [-p ]... [-o ] delete-account (-r )... [-p ]... [-o ] download-account (-r )... [-p ]... [-o ] + email-link-signin (-r )... [-p ]... [-o ] get-account-info (-r )... [-p ]... [-o ] get-oob-confirmation-code (-r )... [-p ]... [-o ] get-project-config [-p ]... [-o ] diff --git a/gen/identitytoolkit3-cli/mkdocs.yml b/gen/identitytoolkit3-cli/mkdocs.yml index 93532363bc..795431d9ed 100644 --- a/gen/identitytoolkit3-cli/mkdocs.yml +++ b/gen/identitytoolkit3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Identity Toolkit v1.0.6+20170828 +site_name: Identity Toolkit v1.0.6+20171122 site_url: http://byron.github.io/google-apis-rs/google-identitytoolkit3-cli site_description: A complete library to interact with Identity Toolkit (protocol v3) @@ -12,6 +12,7 @@ pages: - ['relyingparty_create-auth-uri.md', 'Relyingparty', 'Create Auth Uri'] - ['relyingparty_delete-account.md', 'Relyingparty', 'Delete Account'] - ['relyingparty_download-account.md', 'Relyingparty', 'Download Account'] +- ['relyingparty_email-link-signin.md', 'Relyingparty', 'Email Link Signin'] - ['relyingparty_get-account-info.md', 'Relyingparty', 'Get Account Info'] - ['relyingparty_get-oob-confirmation-code.md', 'Relyingparty', 'Get Oob Confirmation Code'] - ['relyingparty_get-project-config.md', 'Relyingparty', 'Get Project Config'] diff --git a/gen/identitytoolkit3-cli/src/main.rs b/gen/identitytoolkit3-cli/src/main.rs index 2cd36c68ec..581222438c 100644 --- a/gen/identitytoolkit3-cli/src/main.rs +++ b/gen/identitytoolkit3-cli/src/main.rs @@ -319,6 +319,93 @@ impl<'n> Engine<'n> { } } + fn _relyingparty_email_link_signin(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "id-token" => Some(("idToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "oob-code" => Some(("oobCode", 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!["email", "id-token", "oob-code"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::IdentitytoolkitRelyingpartyEmailLinkSigninRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.relyingparty().email_link_signin(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_get_account_info(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1729,6 +1816,9 @@ impl<'n> Engine<'n> { ("download-account", Some(opt)) => { call_result = self._relyingparty_download_account(opt, dry_run, &mut err); }, + ("email-link-signin", Some(opt)) => { + call_result = self._relyingparty_email_link_signin(opt, dry_run, &mut err); + }, ("get-account-info", Some(opt)) => { call_result = self._relyingparty_get_account_info(opt, dry_run, &mut err); }, @@ -1865,7 +1955,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', '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![ + ("relyingparty", "methods: 'create-auth-uri', 'delete-account', 'download-account', 'email-link-signin', '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", @@ -1926,6 +2016,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)), + ]), + ("email-link-signin", + Some(r##"Reset password for a user."##), + "Details at http://byron.github.io/google-apis-rs/google_identitytoolkit3_cli/relyingparty_email-link-signin", + 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"##), @@ -2272,7 +2384,7 @@ fn main() { let mut app = App::new("identitytoolkit3") .author("Sebastian Thiel ") - .version("1.0.6+20170828") + .version("1.0.6+20171122") .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 372b5d664a..096f13f585 100644 --- a/gen/identitytoolkit3/Cargo.toml +++ b/gen/identitytoolkit3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-identitytoolkit3" -version = "1.0.6+20170828" +version = "1.0.6+20171122" 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+20170828" +documentation = "https://docs.rs/google-identitytoolkit3/1.0.6+20171122" license = "MIT" keywords = ["identitytoolkit", "google", "protocol", "web", "api"] diff --git a/gen/identitytoolkit3/README.md b/gen/identitytoolkit3/README.md index f43c8ee0c5..a8395e04da 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+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*. +This documentation was generated from *Identity Toolkit* crate version *1.0.6+20171122*, where *20171122* 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+20170828/google_identitytoolkit3/struct.IdentityToolkit.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.IdentityToolkit.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) +* [relyingparty](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.Relyingparty.html) + * [*create auth uri*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyCreateAuthUriCall.html), [*delete account*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyDeleteAccountCall.html), [*download account*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyDownloadAccountCall.html), [*email link signin*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyEmailLinkSigninCall.html), [*get account info*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyGetAccountInfoCall.html), [*get oob confirmation code*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyGetOobConfirmationCodeCall.html), [*get project config*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyGetProjectConfigCall.html), [*get public keys*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyGetPublicKeyCall.html), [*get recaptcha param*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyGetRecaptchaParamCall.html), [*reset password*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyResetPasswordCall.html), [*send verification code*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartySendVerificationCodeCall.html), [*set account info*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartySetAccountInfoCall.html), [*set project config*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartySetProjectConfigCall.html), [*sign out user*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartySignOutUserCall.html), [*signup new user*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartySignupNewUserCall.html), [*upload account*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyUploadAccountCall.html), [*verify assertion*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyVerifyAssertionCall.html), [*verify custom token*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyVerifyCustomTokenCall.html), [*verify password*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/struct.RelyingpartyVerifyPasswordCall.html) and [*verify phone number*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/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+20170828/google_identitytoolkit3/struct.IdentityToolkit.html)** +* **[Hub](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/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+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)** + * creates [*Method Builders*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/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+20170828/google_identitytoolkit3/trait.Part.html)** + * **[Parts](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-identitytoolkit3/1.0.6+20170828/google_identitytoolkit3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/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+20170828/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+20171122/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+20170828/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+20171122/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+20170828/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+20171122/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+20170828/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+20171122/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/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+20170828/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+20171122/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/google_identitytoolkit3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/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+20170828/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+20171122/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+20170828/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+20171122/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+20170828/google_identitytoolkit3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-identitytoolkit3/1.0.6+20171122/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 79daef676d..9f74b5d021 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+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*. +//! This documentation was generated from *Identity Toolkit* crate version *1.0.6+20171122*, where *20171122* 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), [*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) +//! * [*create auth uri*](struct.RelyingpartyCreateAuthUriCall.html), [*delete account*](struct.RelyingpartyDeleteAccountCall.html), [*download account*](struct.RelyingpartyDownloadAccountCall.html), [*email link signin*](struct.RelyingpartyEmailLinkSigninCall.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) //! //! //! @@ -390,6 +390,9 @@ pub struct CreateAuthUriResponse { /// True if the authUri is for user's existing provider. #[serde(rename="forExistingProvider")] pub for_existing_provider: Option, + /// All sign-in methods this user has used. + #[serde(rename="signinMethods")] + pub signin_methods: Option>, /// Session ID which should be passed in the following verifyAssertion request. #[serde(rename="sessionId")] pub session_id: Option, @@ -503,6 +506,30 @@ pub struct IdentitytoolkitRelyingpartySendVerificationCodeRequest { impl RequestValue for IdentitytoolkitRelyingpartySendVerificationCodeRequest {} +/// Request to sign in with email. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [email link signin relyingparty](struct.RelyingpartyEmailLinkSigninCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IdentitytoolkitRelyingpartyEmailLinkSigninRequest { + /// Token for linking flow. + #[serde(rename="idToken")] + pub id_token: Option, + /// The confirmation code. + #[serde(rename="oobCode")] + pub oob_code: Option, + /// The email address of the user. + pub email: Option, +} + +impl RequestValue for IdentitytoolkitRelyingpartyEmailLinkSigninRequest {} + + /// Request to get the account information. /// /// # Activities @@ -678,47 +705,6 @@ pub struct IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse { impl ResponseResult for IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse {} -/// Request to verify 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*). -/// -/// * [verify password relyingparty](struct.RelyingpartyVerifyPasswordCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IdentitytoolkitRelyingpartyVerifyPasswordRequest { - /// GCP project number of the requesting delegated app. Currently only intended for Firebase V1 migration. - #[serde(rename="delegatedProjectNumber")] - pub delegated_project_number: Option, - /// Instance id token of the app. - #[serde(rename="instanceId")] - pub instance_id: Option, - /// The GITKit token of the authenticated user. - #[serde(rename="idToken")] - pub id_token: Option, - /// The GITKit token for the non-trusted IDP, which is to be confirmed by the user. - #[serde(rename="pendingIdToken")] - pub pending_id_token: Option, - /// The captcha challenge. - #[serde(rename="captchaChallenge")] - pub captcha_challenge: Option, - /// Response to the captcha. - #[serde(rename="captchaResponse")] - pub captcha_response: Option, - /// Whether return sts id token and refresh token instead of gitkit token. - #[serde(rename="returnSecureToken")] - pub return_secure_token: Option, - /// The password inputed by the user. - pub password: Option, - /// The email of the user. - pub email: Option, -} - -impl RequestValue for IdentitytoolkitRelyingpartyVerifyPasswordRequest {} - - /// Request of verifying the password. /// /// # Activities @@ -1017,28 +1003,39 @@ pub struct IdentitytoolkitRelyingpartyDownloadAccountRequest { impl RequestValue for IdentitytoolkitRelyingpartyDownloadAccountRequest {} -/// The user's profiles at the associated IdPs. +/// Response of email signIn. /// -/// 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*). +/// +/// * [email link signin relyingparty](struct.RelyingpartyEmailLinkSigninCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SetAccountInfoResponseProviderUserInfo { - /// User's identifier at IDP. - #[serde(rename="federatedId")] - pub federated_id: Option, - /// The IdP ID. For whitelisted IdPs it's a short domain name, e.g., google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier. - #[serde(rename="providerId")] - pub provider_id: Option, - /// The user's display name at the IDP. - #[serde(rename="displayName")] - pub display_name: Option, - /// The user's photo url at the IDP. - #[serde(rename="photoUrl")] - pub photo_url: Option, +pub struct EmailLinkSigninResponse { + /// Expiration time of STS id token in seconds. + #[serde(rename="expiresIn")] + pub expires_in: Option, + /// The fixed string "identitytoolkit#EmailLinkSigninResponse". + pub kind: Option, + /// The refresh token for the signed in user. + #[serde(rename="refreshToken")] + pub refresh_token: Option, + /// The RP local ID of the user. + #[serde(rename="localId")] + pub local_id: Option, + /// The STS id token to login the newly signed in user. + #[serde(rename="idToken")] + pub id_token: Option, + /// Whether the user is new. + #[serde(rename="isNewUser")] + pub is_new_user: Option, + /// The user's email. + pub email: Option, } -impl NestedType for SetAccountInfoResponseProviderUserInfo {} -impl Part for SetAccountInfoResponseProviderUserInfo {} +impl ResponseResult for EmailLinkSigninResponse {} /// Request to verify a custom token @@ -1138,53 +1135,39 @@ pub struct SetAccountInfoResponse { impl ResponseResult for SetAccountInfoResponse {} -/// Request to verify the IDP assertion. +/// Response of signing up new user, creating anonymous user or anonymous user reauth. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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 assertion relyingparty](struct.RelyingpartyVerifyAssertionCall.html) (request) +/// * [signup new user relyingparty](struct.RelyingpartySignupNewUserCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IdentitytoolkitRelyingpartyVerifyAssertionRequest { - /// The post body if the request is a HTTP POST. - #[serde(rename="postBody")] - pub post_body: Option, - /// GCP project number of the requesting delegated app. Currently only intended for Firebase V1 migration. - #[serde(rename="delegatedProjectNumber")] - pub delegated_project_number: Option, - /// Instance id token of the app. - #[serde(rename="instanceId")] - pub instance_id: Option, - /// The GITKit token of the authenticated user. +pub struct SignupNewUserResponse { + /// If idToken is STS id token, then this field will be expiration time of STS id token in seconds. + #[serde(rename="expiresIn")] + pub expires_in: Option, + /// The fixed string "identitytoolkit#SignupNewUserResponse". + pub kind: Option, + /// The name of the user. + #[serde(rename="displayName")] + pub display_name: Option, + /// The RP local ID of the user. + #[serde(rename="localId")] + pub local_id: Option, + /// The Gitkit id token to login the newly sign up user. #[serde(rename="idToken")] pub id_token: Option, - /// The GITKit token for the non-trusted IDP pending to be confirmed by the user. - #[serde(rename="pendingIdToken")] - pub pending_id_token: Option, - /// Session ID, which should match the one in previous createAuthUri request. - #[serde(rename="sessionId")] - pub session_id: Option, - /// The URI to which the IDP redirects the user back. It may contain federated login result params added by the IDP. - #[serde(rename="requestUri")] - pub request_uri: Option, - /// Whether return sts id token and refresh token instead of gitkit token. - #[serde(rename="returnSecureToken")] - pub return_secure_token: Option, - /// When it's true, automatically creates a new account if the user doesn't exist. When it's false, allows existing user to sign in normally and throws exception if the user doesn't exist. - #[serde(rename="autoCreate")] - pub auto_create: Option, - /// Whether to return refresh tokens. - #[serde(rename="returnRefreshToken")] - pub return_refresh_token: Option, - /// Whether return 200 and IDP credential rather than throw exception when federated id is already linked. - #[serde(rename="returnIdpCredential")] - pub return_idp_credential: Option, + /// If idToken is STS id token, then this field will be refresh token. + #[serde(rename="refreshToken")] + pub refresh_token: Option, + /// The email of the user. + pub email: Option, } -impl RequestValue for IdentitytoolkitRelyingpartyVerifyAssertionRequest {} +impl ResponseResult for SignupNewUserResponse {} /// Request of getting a code for user confirmation (reset password, change email etc.) @@ -1348,39 +1331,92 @@ pub struct EmailTemplate { impl Part for EmailTemplate {} -/// The IDP of the user. +/// The user's profiles at the associated IdPs. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UserInfoProviderUserInfo { +pub struct SetAccountInfoResponseProviderUserInfo { /// User's identifier at IDP. #[serde(rename="federatedId")] pub federated_id: Option, + /// The IdP ID. For whitelisted IdPs it's a short domain name, e.g., google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier. + #[serde(rename="providerId")] + pub provider_id: Option, /// The user's display name at the IDP. #[serde(rename="displayName")] pub display_name: Option, /// The user's photo url at the IDP. #[serde(rename="photoUrl")] pub photo_url: Option, - /// The IdP ID. For white listed IdPs it's a short domain name, e.g., google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier. - #[serde(rename="providerId")] - pub provider_id: Option, +} + +impl NestedType for SetAccountInfoResponseProviderUserInfo {} +impl Part for SetAccountInfoResponseProviderUserInfo {} + + +/// Template for an individual account 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 UserInfo { + /// The user's plain text password. + #[serde(rename="rawPassword")] + pub raw_password: Option, + /// The user's hashed password. + #[serde(rename="passwordHash")] + pub password_hash: 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 URL of the user profile photo. + #[serde(rename="photoUrl")] + pub photo_url: Option, + /// last login timestamp. + #[serde(rename="lastLoginAt")] + pub last_login_at: Option, + /// Whether the user is authenticated by the developer. + #[serde(rename="customAuth")] + pub custom_auth: Option, + /// Whether the user is disabled. + pub disabled: Option, + /// The timestamp when the password was last updated. + #[serde(rename="passwordUpdatedAt")] + pub password_updated_at: Option, + /// User creation timestamp. + #[serde(rename="createdAt")] + pub created_at: Option, + /// The name of the user. + #[serde(rename="displayName")] + pub display_name: Option, + /// 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. #[serde(rename="phoneNumber")] pub phone_number: Option, - /// User's raw identifier directly returned from IDP. - #[serde(rename="rawId")] - pub raw_id: Option, - /// User's email at IDP. + /// The IDP of the user. + #[serde(rename="providerUserInfo")] + pub provider_user_info: Option>, + /// The user's password salt. + pub salt: Option, + /// The email of the user. pub email: Option, /// User's screen name at Twitter or login name at Github. #[serde(rename="screenName")] pub screen_name: Option, } -impl NestedType for UserInfoProviderUserInfo {} -impl Part for UserInfoProviderUserInfo {} +impl Part for UserInfo {} /// Request to set the project configuration. @@ -1712,68 +1748,80 @@ pub struct IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest { impl RequestValue for IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest {} -/// Template for an individual account info. +/// The IDP of the 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 UserInfo { - /// The user's plain text password. - #[serde(rename="rawPassword")] - pub raw_password: Option, - /// The user's hashed password. - #[serde(rename="passwordHash")] - pub password_hash: 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 URL of the user profile photo. - #[serde(rename="photoUrl")] - pub photo_url: Option, - /// last login timestamp. - #[serde(rename="lastLoginAt")] - pub last_login_at: Option, - /// Whether the user is authenticated by the developer. - #[serde(rename="customAuth")] - pub custom_auth: Option, - /// Whether the user is disabled. - pub disabled: Option, - /// The timestamp when the password was last updated. - #[serde(rename="passwordUpdatedAt")] - pub password_updated_at: Option, - /// User creation timestamp. - #[serde(rename="createdAt")] - pub created_at: Option, - /// The name of the user. +pub struct UserInfoProviderUserInfo { + /// User's identifier at IDP. + #[serde(rename="federatedId")] + pub federated_id: Option, + /// The user's display name at the IDP. #[serde(rename="displayName")] pub display_name: Option, - /// 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, + /// The user's photo url at the IDP. + #[serde(rename="photoUrl")] + pub photo_url: Option, + /// The IdP ID. For white listed IdPs it's a short domain name, e.g., google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier. + #[serde(rename="providerId")] + pub provider_id: Option, /// User's phone number. #[serde(rename="phoneNumber")] pub phone_number: Option, - /// The IDP of the user. - #[serde(rename="providerUserInfo")] - pub provider_user_info: Option>, - /// The user's password salt. - pub salt: Option, - /// The email of the user. + /// User's raw identifier directly returned from IDP. + #[serde(rename="rawId")] + pub raw_id: Option, + /// User's email at IDP. pub email: Option, /// User's screen name at Twitter or login name at Github. #[serde(rename="screenName")] pub screen_name: Option, } -impl Part for UserInfo {} +impl NestedType for UserInfoProviderUserInfo {} +impl Part for UserInfoProviderUserInfo {} + + +/// Request to verify 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*). +/// +/// * [verify password relyingparty](struct.RelyingpartyVerifyPasswordCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IdentitytoolkitRelyingpartyVerifyPasswordRequest { + /// GCP project number of the requesting delegated app. Currently only intended for Firebase V1 migration. + #[serde(rename="delegatedProjectNumber")] + pub delegated_project_number: Option, + /// Instance id token of the app. + #[serde(rename="instanceId")] + pub instance_id: Option, + /// The GITKit token of the authenticated user. + #[serde(rename="idToken")] + pub id_token: Option, + /// The GITKit token for the non-trusted IDP, which is to be confirmed by the user. + #[serde(rename="pendingIdToken")] + pub pending_id_token: Option, + /// The captcha challenge. + #[serde(rename="captchaChallenge")] + pub captcha_challenge: Option, + /// Response to the captcha. + #[serde(rename="captchaResponse")] + pub captcha_response: Option, + /// Whether return sts id token and refresh token instead of gitkit token. + #[serde(rename="returnSecureToken")] + pub return_secure_token: Option, + /// The password inputed by the user. + pub password: Option, + /// The email of the user. + pub email: Option, +} + +impl RequestValue for IdentitytoolkitRelyingpartyVerifyPasswordRequest {} /// Response of getting a code for user confirmation (reset password, change email etc.). @@ -1818,39 +1866,53 @@ pub struct IdentitytoolkitRelyingpartySendVerificationCodeResponse { impl ResponseResult for IdentitytoolkitRelyingpartySendVerificationCodeResponse {} -/// Response of signing up new user, creating anonymous user or anonymous user reauth. +/// Request to verify the IDP assertion. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [signup new user relyingparty](struct.RelyingpartySignupNewUserCall.html) (response) +/// * [verify assertion relyingparty](struct.RelyingpartyVerifyAssertionCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SignupNewUserResponse { - /// If idToken is STS id token, then this field will be expiration time of STS id token in seconds. - #[serde(rename="expiresIn")] - pub expires_in: Option, - /// The fixed string "identitytoolkit#SignupNewUserResponse". - pub kind: Option, - /// The name of the user. - #[serde(rename="displayName")] - pub display_name: Option, - /// The RP local ID of the user. - #[serde(rename="localId")] - pub local_id: Option, - /// The Gitkit id token to login the newly sign up user. +pub struct IdentitytoolkitRelyingpartyVerifyAssertionRequest { + /// The post body if the request is a HTTP POST. + #[serde(rename="postBody")] + pub post_body: Option, + /// GCP project number of the requesting delegated app. Currently only intended for Firebase V1 migration. + #[serde(rename="delegatedProjectNumber")] + pub delegated_project_number: Option, + /// Instance id token of the app. + #[serde(rename="instanceId")] + pub instance_id: Option, + /// The GITKit token of the authenticated user. #[serde(rename="idToken")] pub id_token: Option, - /// If idToken is STS id token, then this field will be refresh token. - #[serde(rename="refreshToken")] - pub refresh_token: Option, - /// The email of the user. - pub email: Option, + /// The GITKit token for the non-trusted IDP pending to be confirmed by the user. + #[serde(rename="pendingIdToken")] + pub pending_id_token: Option, + /// Session ID, which should match the one in previous createAuthUri request. + #[serde(rename="sessionId")] + pub session_id: Option, + /// The URI to which the IDP redirects the user back. It may contain federated login result params added by the IDP. + #[serde(rename="requestUri")] + pub request_uri: Option, + /// Whether return sts id token and refresh token instead of gitkit token. + #[serde(rename="returnSecureToken")] + pub return_secure_token: Option, + /// When it's true, automatically creates a new account if the user doesn't exist. When it's false, allows existing user to sign in normally and throws exception if the user doesn't exist. + #[serde(rename="autoCreate")] + pub auto_create: Option, + /// Whether to return refresh tokens. + #[serde(rename="returnRefreshToken")] + pub return_refresh_token: Option, + /// Whether return 200 and IDP credential rather than throw exception when federated id is already linked. + #[serde(rename="returnIdpCredential")] + pub return_idp_credential: Option, } -impl ResponseResult for SignupNewUserResponse {} +impl RequestValue for IdentitytoolkitRelyingpartyVerifyAssertionRequest {} /// Respone of deleting account. @@ -1900,7 +1962,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(...)`, `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(...)` +/// // like `create_auth_uri(...)`, `delete_account(...)`, `download_account(...)`, `email_link_signin(...)`, `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(); /// # } @@ -1915,6 +1977,23 @@ impl<'a, C, A> MethodsBuilder for RelyingpartyMethods<'a, C, A> {} impl<'a, C, A> RelyingpartyMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Reset password for a user. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn email_link_signin(&self, request: IdentitytoolkitRelyingpartyEmailLinkSigninRequest) -> RelyingpartyEmailLinkSigninCall<'a, C, A> { + RelyingpartyEmailLinkSigninCall { + 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 a code for user action confirmation. @@ -2234,6 +2313,247 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> { // CallBuilders ### // ################# +/// Reset password for a user. +/// +/// A builder for the *emailLinkSignin* method supported by a *relyingparty* resource. +/// It is not used directly, but through a `RelyingpartyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_identitytoolkit3 as identitytoolkit3; +/// use identitytoolkit3::IdentitytoolkitRelyingpartyEmailLinkSigninRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use identitytoolkit3::IdentityToolkit; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # 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 = IdentitytoolkitRelyingpartyEmailLinkSigninRequest::default(); +/// +/// // You can configure optional parameters by calling 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().email_link_signin(req) +/// .doit(); +/// # } +/// ``` +pub struct RelyingpartyEmailLinkSigninCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a IdentityToolkit, + _request: IdentitytoolkitRelyingpartyEmailLinkSigninRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RelyingpartyEmailLinkSigninCall<'a, C, A> {} + +impl<'a, C, A> RelyingpartyEmailLinkSigninCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, EmailLinkSigninResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.emailLinkSignin", + 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() + "emailLinkSignin"; + 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: IdentitytoolkitRelyingpartyEmailLinkSigninRequest) -> RelyingpartyEmailLinkSigninCall<'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) -> RelyingpartyEmailLinkSigninCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RelyingpartyEmailLinkSigninCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RelyingpartyEmailLinkSigninCall<'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 code for user action confirmation. /// /// A builder for the *getOobConfirmationCode* method supported by a *relyingparty* resource. diff --git a/gen/logging2-cli/Cargo.toml b/gen/logging2-cli/Cargo.toml index 4ca7a15ae9..02bc61f9e7 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+20170918" +version = "1.0.6+20171204" 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+20170918" +version = "1.0.6+20171204" diff --git a/gen/logging2-cli/README.md b/gen/logging2-cli/README.md index f0830bbc7f..d1af1c3ddc 100644 --- a/gen/logging2-cli/README.md +++ b/gen/logging2-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 *20170918*. The CLI is at version *1.0.6*. +This documentation was generated from the *Logging* API at revision *20171204*. The CLI is at version *1.0.6*. ```bash logging2 [options] @@ -46,6 +46,12 @@ logging2 [options] entries list (-r )... [-p ]... [-o ] write (-r )... [-p ]... [-o ] + exclusions + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] folders exclusions-create (-r )... [-p ]... [-o ] exclusions-delete [-p ]... [-o ] @@ -60,6 +66,9 @@ logging2 [options] sinks-list [-p ]... [-o ] sinks-patch (-r )... [-p ]... [-o ] sinks-update (-r )... [-p ]... [-o ] + logs + delete [-p ]... [-o ] + list [-p ]... [-o ] monitored-resource-descriptors list [-p ]... [-o ] organizations @@ -95,6 +104,12 @@ logging2 [options] sinks-list [-p ]... [-o ] sinks-patch (-r )... [-p ]... [-o ] sinks-update (-r )... [-p ]... [-o ] + sinks + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + list [-p ]... [-o ] + update (-r )... [-p ]... [-o ] logging2 --help Configuration: diff --git a/gen/logging2-cli/mkdocs.yml b/gen/logging2-cli/mkdocs.yml index 6e5c8e17af..29d7544267 100644 --- a/gen/logging2-cli/mkdocs.yml +++ b/gen/logging2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Logging v1.0.6+20170918 +site_name: Logging v1.0.6+20171204 site_url: http://byron.github.io/google-apis-rs/google-logging2-cli site_description: A complete library to interact with Logging (protocol v2) @@ -24,6 +24,11 @@ pages: - ['billing-accounts_sinks-update.md', 'Billing Accounts', 'Sinks Update'] - ['entries_list.md', 'Entries', 'List'] - ['entries_write.md', 'Entries', 'Write'] +- ['exclusions_create.md', 'Exclusions', 'Create'] +- ['exclusions_delete.md', 'Exclusions', 'Delete'] +- ['exclusions_get.md', 'Exclusions', 'Get'] +- ['exclusions_list.md', 'Exclusions', 'List'] +- ['exclusions_patch.md', 'Exclusions', 'Patch'] - ['folders_exclusions-create.md', 'Folders', 'Exclusions Create'] - ['folders_exclusions-delete.md', 'Folders', 'Exclusions Delete'] - ['folders_exclusions-get.md', 'Folders', 'Exclusions Get'] @@ -37,6 +42,8 @@ pages: - ['folders_sinks-list.md', 'Folders', 'Sinks List'] - ['folders_sinks-patch.md', 'Folders', 'Sinks Patch'] - ['folders_sinks-update.md', 'Folders', 'Sinks Update'] +- ['logs_delete.md', 'Logs', 'Delete'] +- ['logs_list.md', 'Logs', 'List'] - ['monitored-resource-descriptors_list.md', 'Monitored Resource Descriptors', 'List'] - ['organizations_exclusions-create.md', 'Organizations', 'Exclusions Create'] - ['organizations_exclusions-delete.md', 'Organizations', 'Exclusions Delete'] @@ -69,6 +76,11 @@ pages: - ['projects_sinks-list.md', 'Projects', 'Sinks List'] - ['projects_sinks-patch.md', 'Projects', 'Sinks Patch'] - ['projects_sinks-update.md', 'Projects', 'Sinks Update'] +- ['sinks_create.md', 'Sinks', 'Create'] +- ['sinks_delete.md', 'Sinks', 'Delete'] +- ['sinks_get.md', 'Sinks', 'Get'] +- ['sinks_list.md', 'Sinks', 'List'] +- ['sinks_update.md', 'Sinks', 'Update'] theme: readthedocs diff --git a/gen/logging2-cli/src/main.rs b/gen/logging2-cli/src/main.rs index 69ba93b9fe..1b9ed4b115 100644 --- a/gen/logging2-cli/src/main.rs +++ b/gen/logging2-cli/src/main.rs @@ -69,8 +69,8 @@ impl<'n> Engine<'n> { 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 })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -320,8 +320,8 @@ impl<'n> Engine<'n> { 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 })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -523,12 +523,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -782,12 +782,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -881,12 +881,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -1070,11 +1070,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "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 })), "resource.labels" => Some(("resource.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "resource.type" => Some(("resource.type", 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 })), _ => { 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())))); @@ -1136,6 +1136,349 @@ impl<'n> Engine<'n> { } } + fn _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()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, 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.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 _exclusions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.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 _exclusions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.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 _exclusions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.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 _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()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, 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.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_exclusions_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1159,8 +1502,8 @@ impl<'n> Engine<'n> { 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 })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -1410,8 +1753,8 @@ impl<'n> Engine<'n> { 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 })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -1613,12 +1956,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -1872,12 +2215,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -1971,12 +2314,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -2047,6 +2390,117 @@ impl<'n> Engine<'n> { } } + fn _logs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.logs().delete(opt.value_of("log-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 _logs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.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")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + 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 _monitored_resource_descriptors_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.monitored_resource_descriptors().list(); @@ -2129,8 +2583,8 @@ impl<'n> Engine<'n> { 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 })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -2380,8 +2834,8 @@ impl<'n> Engine<'n> { 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 })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -2583,12 +3037,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -2842,12 +3296,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -2941,12 +3395,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -3040,8 +3494,8 @@ impl<'n> Engine<'n> { 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 })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -3291,8 +3745,8 @@ impl<'n> Engine<'n> { 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 })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -3496,12 +3950,12 @@ impl<'n> Engine<'n> { 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.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.description" => Some(("metricDescriptor.description", 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 })), @@ -3763,12 +4217,12 @@ impl<'n> Engine<'n> { 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.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.description" => Some(("metricDescriptor.description", 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 })), @@ -3865,12 +4319,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -4124,12 +4578,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -4223,12 +4677,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", 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 })), + "output-version-format" => Some(("outputVersionFormat", 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 })), _ => { @@ -4299,6 +4753,364 @@ impl<'n> Engine<'n> { } } + fn _sinks_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()[..] { + "end-time" => Some(("endTime", 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 })), + "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.sinks().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 { + "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"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sinks_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.sinks().delete(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 { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sinks_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.sinks().get(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 { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sinks_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.sinks().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 _sinks_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()[..] { + "end-time" => Some(("endTime", 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 })), + "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.sinks().update(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 _doit(&self, dry_run: bool) -> Result, Option> { let mut err = InvalidOptionsError::new(); let mut call_result: Result<(), DoitError> = Ok(()); @@ -4365,6 +5177,29 @@ impl<'n> Engine<'n> { } } }, + ("exclusions", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._exclusions_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._exclusions_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._exclusions_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._exclusions_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._exclusions_patch(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("exclusions".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("folders", Some(opt)) => { match opt.subcommand() { ("exclusions-create", Some(opt)) => { @@ -4412,6 +5247,20 @@ impl<'n> Engine<'n> { } } }, + ("logs", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._logs_delete(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._logs_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("logs".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("monitored-resource-descriptors", Some(opt)) => { match opt.subcommand() { ("list", Some(opt)) => { @@ -4532,6 +5381,29 @@ impl<'n> Engine<'n> { } } }, + ("sinks", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._sinks_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._sinks_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._sinks_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._sinks_list(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._sinks_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("sinks".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, _ => { err.issues.push(CLIError::MissingCommandError); writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); @@ -5049,6 +5921,156 @@ fn main() { ]), ]), + ("exclusions", "methods: 'create', 'delete', 'get', 'list' and 'patch'", vec![ + ("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/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)), + ]), + ("delete", + Some(r##"Deletes an exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/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)), + ]), + ("get", + Some(r##"Gets the description of an exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/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)), + ]), + ("list", + Some(r##"Lists all the exclusions in a parent resource."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/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)), + ]), + ("patch", + Some(r##"Changes one or more properties of an existing exclusion."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/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)), + ]), + ]), + ("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."##), @@ -5433,6 +6455,63 @@ fn main() { ]), ]), + ("logs", "methods: 'delete' and 'list'", vec![ + ("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/logs_delete", + vec![ + (Some(r##"log-name"##), + None, + Some(r##"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."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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 logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/logs_list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The resource name that owns the logs: + "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)), + ]), + ]), + ("monitored-resource-descriptors", "methods: 'list'", vec![ ("list", Some(r##"Lists the descriptors for monitored resource types used by Stackdriver Logging."##), @@ -6352,11 +7431,161 @@ fn main() { ]), ]), + ("sinks", "methods: 'create', 'delete', 'get', 'list' and 'update'", vec![ + ("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 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/sinks_create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"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"."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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 sink. If the sink has a unique writer_identity, then that service account is also deleted."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/sinks_delete", + vec![ + (Some(r##"sink-name"##), + None, + Some(r##"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"."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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 sink."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/sinks_get", + vec![ + (Some(r##"sink-name"##), + None, + Some(r##"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"."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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 sinks."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/sinks_list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource whose sinks 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)), + ]), + ("update", + 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/sinks_update", + 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"##), + Some(false), + Some(false)), + ]), + ]), + ]; let mut app = App::new("logging2") .author("Sebastian Thiel ") - .version("1.0.6+20170918") + .version("1.0.6+20171204") .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 4dea119612..315ae87f7f 100644 --- a/gen/logging2/Cargo.toml +++ b/gen/logging2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-logging2" -version = "1.0.6+20170918" +version = "1.0.6+20171204" 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+20170918" +documentation = "https://docs.rs/google-logging2/1.0.6+20171204" license = "MIT" keywords = ["logging", "google", "protocol", "web", "api"] diff --git a/gen/logging2/README.md b/gen/logging2/README.md index 801be0d29f..1749aa3fc3 100644 --- a/gen/logging2/README.md +++ b/gen/logging2/README.md @@ -5,26 +5,32 @@ 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+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*. +This documentation was generated from *Logging* crate version *1.0.6+20171204*, where *20171204* 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+20170918/google_logging2/struct.Logging.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.Logging.html) ... * billing accounts - * [*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) + * [*exclusions create*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.BillingAccountSinkUpdateCall.html) * entries - * [*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) + * [*list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.EntryWriteCall.html) +* exclusions + * [*create*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ExclusionCreateCall.html), [*delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ExclusionDeleteCall.html), [*get*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ExclusionGetCall.html), [*list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ExclusionListCall.html) and [*patch*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ExclusionPatchCall.html) * folders - * [*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) + * [*exclusions create*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.FolderSinkUpdateCall.html) +* logs + * [*delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.LogDeleteCall.html) and [*list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.LogListCall.html) +* [monitored resource descriptors](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.MonitoredResourceDescriptor.html) + * [*list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.MonitoredResourceDescriptorListCall.html) * organizations - * [*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) + * [*exclusions create*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.OrganizationSinkUpdateCall.html) * projects - * [*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) + * [*exclusions create*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.ProjectSinkUpdateCall.html) +* sinks + * [*create*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.SinkCreateCall.html), [*delete*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.SinkDeleteCall.html), [*get*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.SinkGetCall.html), [*list*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.SinkListCall.html) and [*update*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/struct.SinkUpdateCall.html) @@ -33,17 +39,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+20170918/google_logging2/struct.Logging.html)** +* **[Hub](https://docs.rs/google-logging2/1.0.6+20171204/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+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)** + * creates [*Method Builders*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-logging2/1.0.6+20171204/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+20170918/google_logging2/trait.Part.html)** + * **[Parts](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-logging2/1.0.6+20170918/google_logging2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-logging2/1.0.6+20171204/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,6 +63,7 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore +let r = hub.sinks().create(...).doit() let r = hub.organizations().sinks_patch(...).doit() let r = hub.projects().sinks_get(...).doit() let r = hub.billing_accounts().sinks_get(...).doit() @@ -70,7 +77,9 @@ let r = hub.organizations().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.sinks().update(...).doit() let r = hub.folders().sinks_update(...).doit() +let r = hub.sinks().get(...).doit() let r = hub.billing_accounts().sinks_update(...).doit() let r = hub.folders().sinks_get(...).doit() ``` @@ -149,17 +158,17 @@ match result { ``` ## Handling Errors -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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-logging2/1.0.6+20171204/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+20170918/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+20171204/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+20170918/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+20171204/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+20170918/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+20171204/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")`. @@ -169,29 +178,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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-logging2/1.0.6+20171204/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+20170918/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+20171204/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-logging2/1.0.6+20171204/google_logging2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-logging2/1.0.6+20171204/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+20170918/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+20171204/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+20170918/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+20171204/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+20170918/google_logging2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-logging2/1.0.6+20171204/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 0c06b3ba8f..e42699bc1d 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+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*. +//! This documentation was generated from *Logging* crate version *1.0.6+20171204*, where *20171204* 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/). @@ -15,14 +15,20 @@ //! * [*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) +//! * exclusions +//! * [*create*](struct.ExclusionCreateCall.html), [*delete*](struct.ExclusionDeleteCall.html), [*get*](struct.ExclusionGetCall.html), [*list*](struct.ExclusionListCall.html) and [*patch*](struct.ExclusionPatchCall.html) //! * folders //! * [*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) +//! * logs +//! * [*delete*](struct.LogDeleteCall.html) and [*list*](struct.LogListCall.html) //! * [monitored resource descriptors](struct.MonitoredResourceDescriptor.html) //! * [*list*](struct.MonitoredResourceDescriptorListCall.html) //! * organizations //! * [*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 //! * [*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) +//! * sinks +//! * [*create*](struct.SinkCreateCall.html), [*delete*](struct.SinkDeleteCall.html), [*get*](struct.SinkGetCall.html), [*list*](struct.SinkListCall.html) and [*update*](struct.SinkUpdateCall.html) //! //! //! @@ -57,6 +63,7 @@ //! Or specifically ... //! //! ```ignore +//! let r = hub.sinks().create(...).doit() //! let r = hub.organizations().sinks_patch(...).doit() //! let r = hub.projects().sinks_get(...).doit() //! let r = hub.billing_accounts().sinks_get(...).doit() @@ -70,7 +77,9 @@ //! let r = hub.folders().sinks_patch(...).doit() //! let r = hub.organizations().sinks_get(...).doit() //! let r = hub.projects().sinks_create(...).doit() +//! let r = hub.sinks().update(...).doit() //! let r = hub.folders().sinks_update(...).doit() +//! let r = hub.sinks().get(...).doit() //! let r = hub.billing_accounts().sinks_update(...).doit() //! let r = hub.folders().sinks_get(...).doit() //! ``` @@ -250,14 +259,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 { - /// Submit log data for your projects - Write, + /// Administrate log data for your projects + Admin, /// View log data for your projects Read, - /// Administrate log data for your projects - Admin, + /// Submit log data for your projects + Write, /// View and manage your data across Google Cloud Platform services CloudPlatform, @@ -269,9 +278,9 @@ pub enum Scope { impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { - 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::Read => "https://www.googleapis.com/auth/logging.read", + Scope::Write => "https://www.googleapis.com/auth/logging.write", Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", } @@ -380,9 +389,15 @@ impl<'a, C, A> Logging pub fn entries(&'a self) -> EntryMethods<'a, C, A> { EntryMethods { hub: &self } } + pub fn exclusions(&'a self) -> ExclusionMethods<'a, C, A> { + ExclusionMethods { hub: &self } + } pub fn folders(&'a self) -> FolderMethods<'a, C, A> { FolderMethods { hub: &self } } + pub fn logs(&'a self) -> LogMethods<'a, C, A> { + LogMethods { hub: &self } + } pub fn monitored_resource_descriptors(&'a self) -> MonitoredResourceDescriptorMethods<'a, C, A> { MonitoredResourceDescriptorMethods { hub: &self } } @@ -392,6 +407,9 @@ impl<'a, C, A> Logging pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { ProjectMethods { hub: &self } } + pub fn sinks(&'a self) -> SinkMethods<'a, C, A> { + SinkMethods { 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`. @@ -490,6 +508,7 @@ impl Part for Exponential {} /// * [logs list organizations](struct.OrganizationLogListCall.html) (response) /// * [logs list billing accounts](struct.BillingAccountLogListCall.html) (response) /// * [logs list projects](struct.ProjectLogListCall.html) (response) +/// * [list logs](struct.LogListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListLogsResponse { @@ -511,10 +530,12 @@ impl ResponseResult for ListLogsResponse {} /// This type is used in activities, which are methods you may call on this type or where 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 exclusions](struct.ExclusionPatchCall.html) (request|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) +/// * [create exclusions](struct.ExclusionCreateCall.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) @@ -522,16 +543,17 @@ impl ResponseResult for ListLogsResponse {} /// * [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) +/// * [get exclusions](struct.ExclusionGetCall.html) (response) /// * [exclusions create folders](struct.FolderExclusionCreateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] 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, + /// 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. 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. @@ -601,6 +623,7 @@ impl Part for MonitoredResource {} /// * [exclusions list billing accounts](struct.BillingAccountExclusionListCall.html) (response) /// * [exclusions list folders](struct.FolderExclusionListCall.html) (response) /// * [exclusions list organizations](struct.OrganizationExclusionListCall.html) (response) +/// * [list exclusions](struct.ExclusionListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListExclusionsResponse { @@ -621,6 +644,7 @@ impl ResponseResult for ListExclusionsResponse {} /// This type is used in activities, which are methods you may call on this type or where 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 sinks](struct.SinkCreateCall.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) @@ -634,15 +658,17 @@ impl ResponseResult for ListExclusionsResponse {} /// * [sinks patch folders](struct.FolderSinkPatchCall.html) (request|response) /// * [sinks get organizations](struct.OrganizationSinkGetCall.html) (response) /// * [sinks create projects](struct.ProjectSinkCreateCall.html) (request|response) +/// * [update sinks](struct.SinkUpdateCall.html) (request|response) /// * [sinks update folders](struct.FolderSinkUpdateCall.html) (request|response) +/// * [get sinks](struct.SinkGetCall.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 { - /// Deprecated. This field is ignored when creating or updating sinks. - #[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, /// 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: @@ -658,9 +684,9 @@ pub struct LogSink { /// Deprecated. This field is ignored when creating or updating sinks. #[serde(rename="startTime")] pub start_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, + /// Deprecated. This field is ignored when creating or updating sinks. + #[serde(rename="endTime")] + pub end_time: 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, @@ -727,16 +753,19 @@ impl RequestValue for ListLogEntriesRequest {} /// /// * [logs delete organizations](struct.OrganizationLogDeleteCall.html) (response) /// * [logs delete projects](struct.ProjectLogDeleteCall.html) (response) +/// * [delete exclusions](struct.ExclusionDeleteCall.html) (response) /// * [sinks delete folders](struct.FolderSinkDeleteCall.html) (response) +/// * [delete sinks](struct.SinkDeleteCall.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 billing accounts](struct.BillingAccountLogDeleteCall.html) (response) +/// * [delete logs](struct.LogDeleteCall.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) +/// * [sinks delete projects](struct.ProjectSinkDeleteCall.html) (response) +/// * [sinks delete billing accounts](struct.BillingAccountSinkDeleteCall.html) (response) /// * [exclusions delete folders](struct.FolderExclusionDeleteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -753,31 +782,31 @@ impl ResponseResult for Empty {} pub struct HttpRequest { /// The response code indicating the status of response. Examples: 200, 404. pub status: Option, - /// The request processing latency on the server, from the time the request was received until the response was sent. - pub latency: 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, /// 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 request processing latency on the server, from the time the request was received until the response was sent. + pub latency: 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, - /// 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 request method. Examples: "GET", "HEAD", "PUT", "POST". + #[serde(rename="requestMethod")] + pub request_method: 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". @@ -843,13 +872,11 @@ impl Part for Linear {} /// #[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". + /// A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota. #[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, + /// 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, @@ -905,8 +932,8 @@ pub struct MetricDescriptor { /// 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, + /// The resource name of the metric descriptor. + pub name: Option, } impl Part for MetricDescriptor {} @@ -923,6 +950,7 @@ impl Part for MetricDescriptor {} /// * [sinks list billing accounts](struct.BillingAccountSinkListCall.html) (response) /// * [sinks list organizations](struct.OrganizationSinkListCall.html) (response) /// * [sinks list folders](struct.FolderSinkListCall.html) (response) +/// * [list sinks](struct.SinkListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListSinksResponse { @@ -995,17 +1023,6 @@ impl Resource for MonitoredResourceDescriptor {} /// #[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]" @@ -1014,6 +1031,17 @@ 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 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>, } @@ -1050,6 +1078,8 @@ 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). @@ -1071,7 +1101,7 @@ pub struct LogEntry { /// "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 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. + /// A project number may optionally be used in place of PROJECT_ID. The project number is translated to its corresponding PROJECT_ID internally and the log_name field will contain PROJECT_ID in queries and exports.[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, /// 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. @@ -1079,13 +1109,14 @@ pub struct LogEntry { /// 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. The span ID within the trace associated with the log entry. For Stackdriver Trace spans, this is the same format that the Stackdriver Trace API v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such as "000000000000004a". + #[serde(rename="spanId")] + pub span_id: 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 {} @@ -1118,8 +1149,8 @@ impl Part for LogEntryOperation {} /// 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 get projects](struct.ProjectMetricGetCall.html) (response) /// * [metrics update projects](struct.ProjectMetricUpdateCall.html) (request|response) +/// * [metrics get projects](struct.ProjectMetricGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LogMetric { @@ -1162,11 +1193,11 @@ impl ResponseResult for LogMetric {} /// #[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, - /// A list of logs-based metrics. - pub metrics: Option>, } impl ResponseResult for ListLogMetricsResponse {} @@ -1360,28 +1391,6 @@ 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. @@ -1502,6 +1511,28 @@ 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: /// /// Deletes an exclusion. @@ -1590,24 +1621,20 @@ impl<'a, C, A> OrganizationMethods<'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. + /// 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 /// - /// * `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 { + /// * `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) -> OrganizationLogDeleteCall<'a, C, A> { + OrganizationLogDeleteCall { hub: self.hub, - _request: request, - _sink_name: sink_name.to_string(), - _update_mask: Default::default(), - _unique_writer_identity: Default::default(), + _log_name: log_name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1687,20 +1714,24 @@ impl<'a, C, A> OrganizationMethods<'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. + /// 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 /// - /// * `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) -> OrganizationLogDeleteCall<'a, C, A> { - OrganizationLogDeleteCall { + /// * `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, - _log_name: log_name.to_string(), + _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(), @@ -1801,6 +1832,30 @@ impl<'a, C, A> OrganizationMethods<'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) -> OrganizationExclusionCreateCall<'a, C, A> { + OrganizationExclusionCreateCall { + 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 sinks. @@ -1849,25 +1904,218 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { _additional_params: Default::default(), } } +} + + + +/// A builder providing access to all methods supported on *sink* resources. +/// It is not used directly, but through the `Logging` 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_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); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)`, `delete(...)`, `get(...)`, `list(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.sinks(); +/// # } +/// ``` +pub struct SinkMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, +} + +impl<'a, C, A> MethodsBuilder for SinkMethods<'a, C, A> {} + +impl<'a, C, A> SinkMethods<'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. + /// Gets a sink. + /// + /// # Arguments + /// + /// * `sinkName` - 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". + pub fn get(&self, sink_name: &str) -> SinkGetCall<'a, C, A> { + SinkGetCall { + 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: + /// + /// 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 delete(&self, sink_name: &str) -> SinkDeleteCall<'a, C, A> { + SinkDeleteCall { + 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. - /// * `parent` - Required. The parent resource in which to create the exclusion: + /// * `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 update(&self, request: LogSink, sink_name: &str) -> SinkUpdateCall<'a, C, A> { + SinkUpdateCall { + 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. + /// + /// # 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 list(&self, parent: &str) -> SinkListCall<'a, C, A> { + SinkListCall { + 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 + /// + /// * `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 exclusions_create(&self, request: LogExclusion, parent: &str) -> OrganizationExclusionCreateCall<'a, C, A> { - OrganizationExclusionCreateCall { + pub fn create(&self, request: LogSink, parent: &str) -> SinkCreateCall<'a, C, A> { + SinkCreateCall { hub: self.hub, _request: request, _parent: parent.to_string(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *monitoredResourceDescriptor* resources. +/// It is not used directly, but through the `Logging` 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_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); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.monitored_resource_descriptors(); +/// # } +/// ``` +pub struct MonitoredResourceDescriptorMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, +} + +impl<'a, C, A> MethodsBuilder for MonitoredResourceDescriptorMethods<'a, C, A> {} + +impl<'a, C, A> MonitoredResourceDescriptorMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists the descriptors for monitored resource types used by Stackdriver Logging. + pub fn list(&self) -> MonitoredResourceDescriptorListCall<'a, C, A> { + MonitoredResourceDescriptorListCall { + hub: self.hub, + _page_token: Default::default(), + _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2303,7 +2551,7 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { -/// A builder providing access to all methods supported on *monitoredResourceDescriptor* resources. +/// A builder providing access to all methods supported on *exclusion* resources. /// It is not used directly, but through the `Logging` hub. /// /// # Example @@ -2327,27 +2575,86 @@ impl<'a, C, A> BillingAccountMethods<'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 `list(...)` +/// // like `create(...)`, `delete(...)`, `get(...)`, `list(...)` and `patch(...)` /// // to build up your call. -/// let rb = hub.monitored_resource_descriptors(); +/// let rb = hub.exclusions(); /// # } /// ``` -pub struct MonitoredResourceDescriptorMethods<'a, C, A> +pub struct ExclusionMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, } -impl<'a, C, A> MethodsBuilder for MonitoredResourceDescriptorMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for ExclusionMethods<'a, C, A> {} -impl<'a, C, A> MonitoredResourceDescriptorMethods<'a, C, A> { +impl<'a, C, A> ExclusionMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the descriptors for monitored resource types used by Stackdriver Logging. - pub fn list(&self) -> MonitoredResourceDescriptorListCall<'a, C, A> { - MonitoredResourceDescriptorListCall { + /// 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 patch(&self, request: LogExclusion, name: &str) -> ExclusionPatchCall<'a, C, A> { + ExclusionPatchCall { 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 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 create(&self, request: LogExclusion, parent: &str) -> ExclusionCreateCall<'a, C, A> { + ExclusionCreateCall { + 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 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 list(&self, parent: &str) -> ExclusionListCall<'a, C, A> { + ExclusionListCall { + hub: self.hub, + _parent: parent.to_string(), _page_token: Default::default(), _page_size: Default::default(), _delegate: Default::default(), @@ -2355,6 +2662,50 @@ impl<'a, C, A> MonitoredResourceDescriptorMethods<'a, C, A> { _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 get(&self, name: &str) -> ExclusionGetCall<'a, C, A> { + ExclusionGetCall { + 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 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 delete(&self, name: &str) -> ExclusionDeleteCall<'a, C, A> { + ExclusionDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -2400,20 +2751,48 @@ 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. + /// Lists all the exclusions in a parent resource. /// /// # 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 { + /// * `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, - _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_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(), @@ -2465,32 +2844,6 @@ 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_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. @@ -2515,6 +2868,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: /// /// Lists sinks. @@ -2607,23 +2982,20 @@ 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. + /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. /// /// # 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 { + /// * `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) -> ProjectSinkDeleteCall<'a, C, A> { + ProjectSinkDeleteCall { hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), + _sink_name: sink_name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2702,20 +3074,23 @@ impl<'a, C, A> ProjectMethods<'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. + /// Changes one or more properties of an existing exclusion. /// /// # 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) -> ProjectSinkDeleteCall<'a, C, A> { - ProjectSinkDeleteCall { + /// * `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, - _sink_name: sink_name.to_string(), + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2743,30 +3118,6 @@ 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. @@ -2810,6 +3161,94 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { +/// A builder providing access to all methods supported on *log* resources. +/// It is not used directly, but through the `Logging` 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_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); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.logs(); +/// # } +/// ``` +pub struct LogMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, +} + +impl<'a, C, A> MethodsBuilder for LogMethods<'a, C, A> {} + +impl<'a, C, A> LogMethods<'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 delete(&self, log_name: &str) -> LogDeleteCall<'a, C, A> { + LogDeleteCall { + 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 the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. + /// + /// # Arguments + /// + /// * `parent` - Required. The resource name that owns the logs: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + pub fn list(&self, parent: &str) -> LogListCall<'a, C, A> { + LogListCall { + 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(), + } + } +} + + + // ################### @@ -3072,10 +3511,10 @@ impl<'a, C, A> FolderExclusionPatchCall<'a, C, A> where C: BorrowMut FolderSinkUpdateCall<'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. @@ -3646,10 +4085,10 @@ impl<'a, C, A> FolderSinkGetCall<'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. @@ -3904,10 +4343,10 @@ impl<'a, C, A> FolderExclusionGetCall<'a, C, A> where C: BorrowMut FolderExclusionListCall<'a, C, A> where C: BorrowMut FolderSinkCreateCall<'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. @@ -4532,264 +4971,6 @@ impl<'a, C, A> FolderSinkCreateCall<'a, C, A> where C: BorrowMut, } -/// 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. -/// 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_delete("logName") -/// .doit(); -/// # } -/// ``` -pub struct FolderLogDeleteCall<'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 FolderLogDeleteCall<'a, C, A> {} - -impl<'a, C, A> FolderLogDeleteCall<'a, C, 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.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() + "v2/{+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) -> FolderLogDeleteCall<'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) -> FolderLogDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response 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) -> FolderLogDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> FolderLogDeleteCall<'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 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. @@ -5034,10 +5215,10 @@ impl<'a, C, A> FolderExclusionCreateCall<'a, C, A> where C: BorrowMut FolderSinkDeleteCall<'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. @@ -5365,8 +5546,8 @@ impl<'a, C, A> FolderSinkDeleteCall<'a, C, A> where C: BorrowMut, /// // 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) +/// .page_token("et") +/// .page_size(-41) /// .doit(); /// # } /// ``` @@ -5574,10 +5755,10 @@ impl<'a, C, A> FolderLogListCall<'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. @@ -5647,8 +5828,8 @@ impl<'a, C, A> FolderLogListCall<'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_list("parent") -/// .page_token("et") -/// .page_size(-70) +/// .page_token("Lorem") +/// .page_size(-21) /// .doit(); /// # } /// ``` @@ -5856,10 +6037,10 @@ impl<'a, C, A> FolderSinkListCall<'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. @@ -5935,8 +6116,8 @@ 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_patch(req, "sinkName") -/// .update_mask("sea") -/// .unique_writer_identity(false) +/// .update_mask("aliquyam") +/// .unique_writer_identity(true) /// .doit(); /// # } /// ``` @@ -6172,10 +6353,10 @@ impl<'a, C, A> FolderSinkPatchCall<'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. @@ -6217,6 +6398,264 @@ impl<'a, C, A> FolderSinkPatchCall<'a, C, A> where C: BorrowMut, } +/// 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. +/// 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_delete("logName") +/// .doit(); +/// # } +/// ``` +pub struct FolderLogDeleteCall<'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 FolderLogDeleteCall<'a, C, A> {} + +impl<'a, C, A> FolderLogDeleteCall<'a, C, 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.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() + "v2/{+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) -> FolderLogDeleteCall<'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) -> FolderLogDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> FolderLogDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderLogDeleteCall<'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. @@ -6430,10 +6869,10 @@ impl<'a, C, A> FolderExclusionDeleteCall<'a, C, A> where C: BorrowMut OrganizationSinkDeleteCall<'a, C, A> where C: BorrowMut OrganizationSinkDeleteCall<'a, C, A> where C: BorrowMut OrganizationSinkDeleteCall<'a, C, A> where C: BorrowMut OrganizationSinkDeleteCall<'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.organizations().sinks_patch(req, "sinkName") -/// .update_mask("dolor") -/// .unique_writer_identity(true) +/// let result = hub.organizations().logs_delete("logName") /// .doit(); /// # } /// ``` -pub struct OrganizationSinkPatchCall<'a, C, A> +pub struct OrganizationLogDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogSink, - _sink_name: String, - _update_mask: Option, - _unique_writer_identity: Option, + _log_name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrganizationSinkPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrganizationLogDeleteCall<'a, C, A> {} -impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrganizationLogDeleteCall<'a, C, 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, Empty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -6800,17 +7228,11 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut 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() { + dlg.begin(MethodInfo { id: "logging.organizations.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)); @@ -6822,12 +7244,12 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { + for param_name in ["logName"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -6857,17 +7279,6 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut 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); + pub fn log_name(mut self, new_value: &str) -> OrganizationLogDeleteCall<'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 @@ -6990,7 +7371,7 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrganizationLogDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -7004,10 +7385,10 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSinkPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> OrganizationLogDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -7037,7 +7418,7 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> OrganizationSinkPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrganizationLogDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -7083,7 +7464,7 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationExclusionPatchCall<'a, C, A> where C: BorrowMut OrganizationExclusionDeleteCall<'a, C, A> where C: BorrowMut OrganizationExclusionDeleteCall<'a, C, A> where C: BorrowMut OrganizationLogListCall<'a, C, A> where C: BorrowMut OrganizationLogListCall<'a, C, A> where C: BorrowMut OrganizationLogListCall<'a, C, A> where C: BorrowMut OrganizationLogListCall<'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.organizations().logs_delete("logName") +/// let result = hub.organizations().sinks_patch(req, "sinkName") +/// .update_mask("dolore") +/// .unique_writer_identity(true) /// .doit(); /// # } /// ``` -pub struct OrganizationLogDeleteCall<'a, C, A> +pub struct OrganizationSinkPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _log_name: String, + _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 OrganizationLogDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrganizationSinkPatchCall<'a, C, A> {} -impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +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, Empty)> { + 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}; @@ -7946,11 +8338,17 @@ impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.organizations.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() { + 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)); @@ -7962,12 +8360,12 @@ impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["logName"].iter() { + for param_name in ["sinkName"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -7997,6 +8395,17 @@ impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut OrganizationLogDeleteCall<'a, C, A> { - self._log_name = new_value.to_string(); + 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 @@ -8089,7 +8528,7 @@ impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut OrganizationLogDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrganizationSinkPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8103,10 +8542,10 @@ impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationLogDeleteCall<'a, C, A> + 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 @@ -8136,7 +8575,7 @@ impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> OrganizationLogDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrganizationSinkPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8419,10 +8858,10 @@ impl<'a, C, A> OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut OrganizationSinkGetCall<'a, C, A> where C: BorrowMut OrganizationExclusionListCall<'a, C, A> where C: BorrowMut OrganizationExclusionGetCall<'a, C, A> where C: BorrowMut OrganizationExclusionGetCall<'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 + /// + /// * *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) -> 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 + } +} + + /// Lists sinks. /// /// A builder for the *sinks.list* method supported by a *organization* resource. @@ -9290,8 +10018,8 @@ impl<'a, C, A> OrganizationExclusionGetCall<'a, C, A> where C: BorrowMut OrganizationSinkListCall<'a, C, A> where C: BorrowMut OrganizationSinkCreateCall<'a, C, A> where C: BorrowMut OrganizationSinkCreateCall<'a, C, A> where C: BorrowMut 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); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.sinks().get("sinkName") +/// .doit(); +/// # } +/// ``` +pub struct SinkGetCall<'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 SinkGetCall<'a, C, A> {} + +impl<'a, C, A> SinkGetCall<'a, C, 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.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) -> SinkGetCall<'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) -> SinkGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> SinkGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SinkGetCall<'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 *delete* method supported by a *sink* resource. +/// It is not used directly, but through a `SinkMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.sinks().delete("sinkName") +/// .doit(); +/// # } +/// ``` +pub struct SinkDeleteCall<'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 SinkDeleteCall<'a, C, A> {} + +impl<'a, C, A> SinkDeleteCall<'a, C, 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.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) -> SinkDeleteCall<'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) -> SinkDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> SinkDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SinkDeleteCall<'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 *update* method supported by a *sink* resource. +/// It is not used directly, but through a `SinkMethods` instance. +/// +/// # Example +/// +/// Instantiate 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}; @@ -9873,33 +11117,37 @@ impl<'a, C, A> OrganizationSinkCreateCall<'a, C, A> where C: BorrowMut +pub struct SinkUpdateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogExclusion, - _parent: String, + _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 OrganizationExclusionCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for SinkUpdateCall<'a, C, A> {} -impl<'a, C, A> OrganizationExclusionCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> SinkUpdateCall<'a, C, 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)> { + 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}; @@ -9908,11 +11156,17 @@ impl<'a, C, A> OrganizationExclusionCreateCall<'a, C, A> where C: BorrowMut 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() { + dlg.begin(MethodInfo { id: "logging.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)); @@ -9924,7 +11178,600 @@ impl<'a, C, A> OrganizationExclusionCreateCall<'a, C, A> where C: BorrowMut = 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) -> SinkUpdateCall<'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) -> SinkUpdateCall<'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) -> SinkUpdateCall<'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) -> SinkUpdateCall<'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) -> SinkUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> SinkUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SinkUpdateCall<'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 *list* method supported by a *sink* resource. +/// It is not used directly, but through a `SinkMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.sinks().list("parent") +/// .page_token("consetetur") +/// .page_size(-52) +/// .doit(); +/// # } +/// ``` +pub struct SinkListCall<'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 SinkListCall<'a, C, A> {} + +impl<'a, C, A> SinkListCall<'a, C, 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.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) -> SinkListCall<'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) -> SinkListCall<'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) -> SinkListCall<'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) -> SinkListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> SinkListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SinkListCall<'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 *create* method supported by a *sink* resource. +/// It is not used directly, but through a `SinkMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.sinks().create(req, "parent") +/// .unique_writer_identity(false) +/// .doit(); +/// # } +/// ``` +pub struct SinkCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _parent: String, + _unique_writer_identity: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SinkCreateCall<'a, C, A> {} + +impl<'a, C, A> SinkCreateCall<'a, C, 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.sinks.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._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "parent", "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/{+parent}/sinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10050,11 +11897,11 @@ impl<'a, C, A> OrganizationExclusionCreateCall<'a, C, A> where C: BorrowMut OrganizationExclusionCreateCall<'a, C, A> { + pub fn request(mut self, new_value: LogSink) -> SinkCreateCall<'a, C, A> { self._request = new_value; self } - /// Required. The parent resource in which to create the exclusion: + /// Required. The resource in which to create the sink: /// "projects/[PROJECT_ID]" /// "organizations/[ORGANIZATION_ID]" /// "billingAccounts/[BILLING_ACCOUNT_ID]" @@ -10065,17 +11912,24 @@ impl<'a, C, A> OrganizationExclusionCreateCall<'a, C, A> where C: BorrowMut OrganizationExclusionCreateCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> SinkCreateCall<'a, C, A> { self._parent = new_value.to_string(); self } + /// 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. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> SinkCreateCall<'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) -> OrganizationExclusionCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> SinkCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -10089,10 +11943,10 @@ impl<'a, C, A> OrganizationExclusionCreateCall<'a, C, A> where C: BorrowMut OrganizationExclusionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationExclusionCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> SinkCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -10122,7 +11976,247 @@ impl<'a, C, A> OrganizationExclusionCreateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> OrganizationExclusionCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> SinkCreateCall<'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 descriptors for monitored resource types used by Stackdriver Logging. +/// +/// A builder for the *list* method supported by a *monitoredResourceDescriptor* resource. +/// It is not used directly, but through a `MonitoredResourceDescriptorMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.monitored_resource_descriptors().list() +/// .page_token("gubergren") +/// .page_size(-20) +/// .doit(); +/// # } +/// ``` +pub struct MonitoredResourceDescriptorListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MonitoredResourceDescriptorListCall<'a, C, A> {} + +impl<'a, C, A> MonitoredResourceDescriptorListCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.monitoredResourceDescriptors.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() + "v2/monitoredResourceDescriptors"; + 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. 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) -> MonitoredResourceDescriptorListCall<'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) -> MonitoredResourceDescriptorListCall<'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) -> MonitoredResourceDescriptorListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> MonitoredResourceDescriptorListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MonitoredResourceDescriptorListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -10336,10 +12430,10 @@ impl<'a, C, A> EntryWriteCall<'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. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -10583,10 +12677,10 @@ impl<'a, C, A> EntryListCall<'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. @@ -10662,7 +12756,7 @@ impl<'a, C, A> EntryListCall<'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.billing_accounts().sinks_create(req, "parent") -/// .unique_writer_identity(false) +/// .unique_writer_identity(true) /// .doit(); /// # } /// ``` @@ -10884,10 +12978,10 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountExclusionPatchCall<'a, C, A> where C: BorrowMut BillingAccountExclusionPatchCall<'a, C, A> where C: BorrowMut BillingAccountLogListCall<'a, C, A> where C: BorrowMut BillingAccountExclusionDeleteCall<'a, C, A> where C: BorrowMut BillingAccountExclusionDeleteCall<'a, C, A> where C: BorrowMut BillingAccountExclusionListCall<'a, C, A> where C: BorrowMut BillingAccountExclusionListCall<'a, C, A> where C: BorrowMut BillingAccountSinkPatchCall<'a, C, A> where C: BorrowMut BillingAccountSinkPatchCall<'a, C, A> where C: BorrowMut BillingAccountSinkListCall<'a, C, A> where C: BorrowMut BillingAccountExclusionCreateCall<'a, C, A> where C: BorrowMut BillingAccountSinkDeleteCall<'a, C, A> where C: BorrowMut BillingAccountSinkDeleteCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut BillingAccountExclusionGetCall<'a, C, A> where C: BorrowMut BillingAccountLogDeleteCall<'a, C, A> where C: BorrowMut BillingAccountLogDeleteCall<'a, C, A> where C: BorrowMut BillingAccountLogDeleteCall<'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.monitored_resource_descriptors().list() -/// .page_token("Lorem") -/// .page_size(-17) -/// .doit(); -/// # } -/// ``` -pub struct MonitoredResourceDescriptorListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for MonitoredResourceDescriptorListCall<'a, C, A> {} - -impl<'a, C, A> MonitoredResourceDescriptorListCall<'a, C, 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 std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.monitoredResourceDescriptors.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() + "v2/monitoredResourceDescriptors"; - 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. 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) -> MonitoredResourceDescriptorListCall<'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) -> MonitoredResourceDescriptorListCall<'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) -> MonitoredResourceDescriptorListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response 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) -> MonitoredResourceDescriptorListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> MonitoredResourceDescriptorListCall<'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 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().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() + "v2/{+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 - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response 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) -> 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 - } -} - - -/// 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 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().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() + "v2/{+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 - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response 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) -> 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.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; +/// use logging2::LogExclusion; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -15068,37 +16409,35 @@ impl<'a, C, A> ProjectMetricGetCall<'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 = LogSink::default(); +/// 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().sinks_patch(req, "sinkName") -/// .update_mask("nonumy") -/// .unique_writer_identity(true) +/// let result = hub.exclusions().patch(req, "name") +/// .update_mask("sadipscing") /// .doit(); /// # } /// ``` -pub struct ProjectSinkPatchCall<'a, C, A> +pub struct ExclusionPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogSink, - _sink_name: String, + _request: LogExclusion, + _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> CallBuilder for ExclusionPatchCall<'a, C, A> {} -impl<'a, C, A> ProjectSinkPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ExclusionPatchCall<'a, C, 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}; @@ -15107,17 +16446,14 @@ impl<'a, C, A> ProjectSinkPatchCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.projects.sinks.patch", + dlg.begin(MethodInfo { id: "logging.exclusions.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())); + 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())); } - if let Some(value) = self._unique_writer_identity { - params.push(("uniqueWriterIdentity", value.to_string())); - } - for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15129,12 +16465,12 @@ impl<'a, C, A> ProjectSinkPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + 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 [("{+sinkName}", "sinkName")].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 { @@ -15149,7 +16485,7 @@ impl<'a, C, A> ProjectSinkPatchCall<'a, C, A> where C: BorrowMut, } { let mut indices_for_removal: Vec = 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); } @@ -15255,49 +16591,39 @@ impl<'a, C, A> ProjectSinkPatchCall<'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: LogSink) -> ProjectSinkPatchCall<'a, C, A> { + pub fn request(mut self, new_value: LogExclusion) -> ExclusionPatchCall<'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". + /// 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 *sink name* path property to the given value. + /// 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 sink_name(mut self, new_value: &str) -> ProjectSinkPatchCall<'a, C, A> { - self._sink_name = new_value.to_string(); + pub fn name(mut self, new_value: &str) -> ExclusionPatchCall<'a, C, A> { + self._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. + /// 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) -> ProjectSinkPatchCall<'a, C, A> { + pub fn update_mask(mut self, new_value: &str) -> ExclusionPatchCall<'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> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ExclusionPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -15311,10 +16637,10 @@ impl<'a, C, A> ProjectSinkPatchCall<'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. @@ -15324,7 +16650,7 @@ impl<'a, C, A> ProjectSinkPatchCall<'a, C, A> where C: BorrowMut, /// * *fields* (query-string) - Selector specifying which fields to include in a 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> + pub fn param(mut self, name: T, value: T) -> ExclusionPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -15344,7 +16670,1376 @@ impl<'a, C, A> ProjectSinkPatchCall<'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) -> ProjectSinkPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ExclusionPatchCall<'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 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 *create* method supported by a *exclusion* resource. +/// It is not used directly, but through a `ExclusionMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.exclusions().create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ExclusionCreateCall<'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 ExclusionCreateCall<'a, C, A> {} + +impl<'a, C, A> ExclusionCreateCall<'a, C, 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.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) -> ExclusionCreateCall<'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) -> ExclusionCreateCall<'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) -> ExclusionCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ExclusionCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ExclusionCreateCall<'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 *list* method supported by a *exclusion* resource. +/// It is not used directly, but through a `ExclusionMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.exclusions().list("parent") +/// .page_token("nonumy") +/// .page_size(-29) +/// .doit(); +/// # } +/// ``` +pub struct ExclusionListCall<'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 ExclusionListCall<'a, C, A> {} + +impl<'a, C, A> ExclusionListCall<'a, C, 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.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) -> ExclusionListCall<'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) -> ExclusionListCall<'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) -> ExclusionListCall<'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) -> ExclusionListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ExclusionListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ExclusionListCall<'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 *get* method supported by a *exclusion* resource. +/// It is not used directly, but through a `ExclusionMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.exclusions().get("name") +/// .doit(); +/// # } +/// ``` +pub struct ExclusionGetCall<'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 ExclusionGetCall<'a, C, A> {} + +impl<'a, C, A> ExclusionGetCall<'a, C, 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.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) -> ExclusionGetCall<'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) -> ExclusionGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ExclusionGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ExclusionGetCall<'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 *delete* method supported by a *exclusion* resource. +/// It is not used directly, but through a `ExclusionMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.exclusions().delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ExclusionDeleteCall<'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 ExclusionDeleteCall<'a, C, A> {} + +impl<'a, C, A> ExclusionDeleteCall<'a, C, 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.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) -> ExclusionDeleteCall<'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) -> ExclusionDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ExclusionDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ExclusionDeleteCall<'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 *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_list("parent") +/// .page_token("consetetur") +/// .page_size(-85) +/// .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 + /// + /// * *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) -> 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() { @@ -15390,8 +18085,8 @@ impl<'a, C, A> ProjectSinkPatchCall<'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_update(req, "sinkName") -/// .update_mask("takimata") -/// .unique_writer_identity(true) +/// .update_mask("ea") +/// .unique_writer_identity(false) /// .doit(); /// # } /// ``` @@ -15627,10 +18322,10 @@ impl<'a, C, A> ProjectSinkUpdateCall<'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. @@ -15672,6 +18367,577 @@ impl<'a, C, A> ProjectSinkUpdateCall<'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 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().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() + "v2/{+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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a 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> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing 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.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("tempor") +/// .unique_writer_identity(false) +/// .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 + /// + /// * *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) -> 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 + } +} + + /// 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. @@ -15700,8 +18966,8 @@ impl<'a, C, A> ProjectSinkUpdateCall<'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("invidunt") -/// .page_size(-66) +/// .page_token("ipsum") +/// .page_size(-31) /// .doit(); /// # } /// ``` @@ -15909,10 +19175,10 @@ impl<'a, C, A> ProjectLogListCall<'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. @@ -15954,6 +19220,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 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().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() + "v2/{+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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a 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> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing 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. @@ -15982,8 +19506,8 @@ impl<'a, C, A> ProjectLogListCall<'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().sinks_list("parent") -/// .page_token("rebum.") -/// .page_size(-33) +/// .page_token("diam") +/// .page_size(-37) /// .doit(); /// # } /// ``` @@ -16191,10 +19715,10 @@ impl<'a, C, A> ProjectSinkListCall<'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. @@ -16449,10 +19973,10 @@ impl<'a, C, A> ProjectExclusionDeleteCall<'a, C, A> where C: BorrowMut ProjectExclusionGetCall<'a, C, A> where C: BorrowMut ProjectSinkGetCall<'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. @@ -17010,9 +20534,9 @@ impl<'a, C, A> ProjectSinkGetCall<'a, C, A> where C: BorrowMut, A } -/// Changes one or more properties of an existing exclusion. +/// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. /// -/// A builder for the *exclusions.patch* method supported by a *project* resource. +/// A builder for the *sinks.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -17024,7 +20548,6 @@ impl<'a, C, A> ProjectSinkGetCall<'a, C, A> where C: BorrowMut, 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}; @@ -17035,38 +20558,30 @@ impl<'a, C, A> ProjectSinkGetCall<'a, C, A> where C: BorrowMut, 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.projects().exclusions_patch(req, "name") -/// .update_mask("eirmod") +/// let result = hub.projects().sinks_delete("sinkName") /// .doit(); /// # } /// ``` -pub struct ProjectExclusionPatchCall<'a, C, A> +pub struct ProjectSinkDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogExclusion, - _name: String, - _update_mask: Option, + _sink_name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectExclusionPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectSinkDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +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, LogExclusion)> { + 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}; @@ -17075,14 +20590,11 @@ impl<'a, C, A> ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut 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() { + 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)); @@ -17094,12 +20606,12 @@ impl<'a, C, A> ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["sinkName"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -17129,17 +20641,6 @@ impl<'a, C, A> ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut 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()); + 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 @@ -17252,7 +20733,7 @@ impl<'a, C, A> ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut ProjectExclusionPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectSinkDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -17266,10 +20747,10 @@ impl<'a, C, A> ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectExclusionPatchCall<'a, C, A> + 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 @@ -17299,7 +20780,7 @@ impl<'a, C, A> ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectExclusionPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectSinkDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -17552,10 +21033,10 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut ProjectMetricCreateCall<'a, C, A> where C: BorrowMut ProjectSinkCreateCall<'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. @@ -18142,10 +21623,10 @@ impl<'a, C, A> ProjectExclusionCreateCall<'a, C, A> where C: BorrowMut ProjectExclusionCreateCall<'a, C, A> where C: BorrowMut ProjectExclusionCreateCall<'a, C, A> where C: BorrowMut ProjectExclusionCreateCall<'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.projects().sinks_delete("sinkName") +/// let result = hub.projects().exclusions_patch(req, "name") +/// .update_mask("invidunt") /// .doit(); /// # } /// ``` -pub struct ProjectSinkDeleteCall<'a, C, A> +pub struct ProjectExclusionPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _sink_name: String, + _request: LogExclusion, + _name: String, + _update_mask: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectSinkDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectExclusionPatchCall<'a, C, A> {} -impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +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, Empty)> { + 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}; @@ -18243,11 +21733,14 @@ impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut 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() { + 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)); @@ -18259,12 +21752,12 @@ impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + 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 [("{+sinkName}", "sinkName")].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 { @@ -18279,7 +21772,7 @@ impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut } { let mut indices_for_removal: Vec = 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); } @@ -18294,6 +21787,17 @@ impl<'a, C, A> ProjectSinkDeleteCall<'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 { @@ -18310,11 +21814,15 @@ impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut } }; let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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) + 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() @@ -18365,19 +21873,35 @@ impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut } - /// 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. + /// Sets the *request* property to 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(); + 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 @@ -18386,7 +21910,7 @@ impl<'a, C, A> ProjectSinkDeleteCall<'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) -> ProjectSinkDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectExclusionPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -18400,10 +21924,10 @@ impl<'a, C, A> ProjectSinkDeleteCall<'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. @@ -18413,7 +21937,7 @@ impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut /// * *fields* (query-string) - Selector specifying which fields to include in a 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> + 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 @@ -18433,7 +21957,7 @@ impl<'a, C, A> ProjectSinkDeleteCall<'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) -> ProjectSinkDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectExclusionPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -18686,10 +22210,10 @@ impl<'a, C, A> ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut 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. @@ -19223,10 +22465,10 @@ impl<'a, C, A> ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricListCall<'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. @@ -19547,3 +22789,543 @@ impl<'a, C, A> ProjectMetricListCall<'a, C, A> where C: BorrowMut } +/// 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 *delete* method supported by a *log* resource. +/// It is not used directly, but through a `LogMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.logs().delete("logName") +/// .doit(); +/// # } +/// ``` +pub struct LogDeleteCall<'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 LogDeleteCall<'a, C, A> {} + +impl<'a, C, A> LogDeleteCall<'a, C, 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.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() + "v2/{+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) -> LogDeleteCall<'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) -> LogDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> LogDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LogDeleteCall<'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 *list* method supported by a *log* resource. +/// It is not used directly, but through a `LogMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.logs().list("parent") +/// .page_token("ea") +/// .page_size(-17) +/// .doit(); +/// # } +/// ``` +pub struct LogListCall<'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 LogListCall<'a, C, A> {} + +impl<'a, C, A> LogListCall<'a, C, 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.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) -> LogListCall<'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) -> LogListCall<'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) -> LogListCall<'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) -> LogListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> LogListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LogListCall<'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 fc34a2d856..30664d0d4b 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+20170918" +version = "1.0.6+20171204" 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+20170918" +version = "1.0.6+20171204" diff --git a/gen/logging2_beta1-cli/README.md b/gen/logging2_beta1-cli/README.md index 7348381622..b3d283e16f 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 *20170918*. The CLI is at version *1.0.6*. +This documentation was generated from the *Logging* API at revision *20171204*. 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 25026ce320..e0defbd75c 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+20170918 +site_name: Logging v1.0.6+20171204 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 b87ceaae11..09e7242c34 100644 --- a/gen/logging2_beta1-cli/src/main.rs +++ b/gen/logging2_beta1-cli/src/main.rs @@ -270,11 +270,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())))); @@ -642,12 +642,12 @@ impl<'n> Engine<'n> { 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.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.name" => Some(("metricDescriptor.name", 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 })), @@ -909,12 +909,12 @@ impl<'n> Engine<'n> { 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.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.name" => Some(("metricDescriptor.name", 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 })), @@ -2054,7 +2054,7 @@ fn main() { let mut app = App::new("logging2-beta1") .author("Sebastian Thiel ") - .version("1.0.6+20170918") + .version("1.0.6+20171204") .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 78c0e487b6..c9412f0269 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+20170918" +version = "1.0.6+20171204" 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+20170918" +documentation = "https://docs.rs/google-logging2_beta1/1.0.6+20171204" license = "MIT" keywords = ["logging", "google", "protocol", "web", "api"] diff --git a/gen/logging2_beta1/README.md b/gen/logging2_beta1/README.md index c3129b55c6..c0538d22a7 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+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*. +This documentation was generated from *Logging* crate version *1.0.6+20171204*, where *20171204* 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+20170918/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+20171204/google_logging2_beta1/struct.Logging.html) ... * billing accounts - * [*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) + * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.BillingAccountLogDeleteCall.html) and [*logs list*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.BillingAccountLogListCall.html) * entries - * [*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) + * [*list*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.EntryWriteCall.html) +* [monitored resource descriptors](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.MonitoredResourceDescriptor.html) + * [*list*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.MonitoredResourceDescriptorListCall.html) * organizations - * [*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) + * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.OrganizationLogDeleteCall.html) and [*logs list*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.OrganizationLogListCall.html) * projects - * [*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) + * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/struct.ProjectSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/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+20170918/google_logging2_beta1/struct.Logging.html)** +* **[Hub](https://docs.rs/google-logging2_beta1/1.0.6+20171204/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+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)** + * creates [*Method Builders*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-logging2_beta1/1.0.6+20171204/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+20170918/google_logging2_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-logging2_beta1/1.0.6+20171204/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+20170918/google_logging2_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-logging2_beta1/1.0.6+20171204/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+20170918/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+20171204/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+20170918/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+20171204/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+20170918/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+20171204/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+20170918/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+20171204/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-logging2_beta1/1.0.6+20171204/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+20170918/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+20171204/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-logging2_beta1/1.0.6+20171204/google_logging2_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-logging2_beta1/1.0.6+20171204/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+20170918/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+20171204/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+20170918/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+20171204/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+20170918/google_logging2_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-logging2_beta1/1.0.6+20171204/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 edbea56f74..bd44ee11ed 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+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*. +//! This documentation was generated from *Logging* crate version *1.0.6+20171204*, where *20171204* 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 { - /// Submit log data for your projects - Write, + /// Administrate log data for your projects + Admin, /// View log data for your projects Read, - /// Administrate log data for your projects - Admin, + /// Submit log data for your projects + Write, /// 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::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::Read => "https://www.googleapis.com/auth/logging.read", + Scope::Write => "https://www.googleapis.com/auth/logging.write", Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", } @@ -681,27 +681,27 @@ pub struct HttpRequest { 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, + /// 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 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, - /// 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 request method. Examples: "GET", "HEAD", "PUT", "POST". + #[serde(rename="requestMethod")] + pub request_method: 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". @@ -767,11 +767,11 @@ impl Part for Linear {} /// #[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". + /// A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota. #[serde(rename="displayName")] pub display_name: Option, - /// A detailed description of the metric, which can be used in documentation. - pub description: Option, + /// The resource name of the metric descriptor. + 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, @@ -827,10 +827,8 @@ pub struct MetricDescriptor { /// 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, + /// A detailed description of the metric, which can be used in documentation. + pub description: Option, } impl Part for MetricDescriptor {} @@ -888,6 +886,17 @@ impl Part for BucketOptions {} /// #[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]" @@ -896,17 +905,6 @@ 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 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>, } @@ -943,11 +941,11 @@ 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. 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. 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, /// 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. @@ -963,7 +961,7 @@ pub struct LogEntry { /// "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 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. + /// A project number may optionally be used in place of PROJECT_ID. The project number is translated to its corresponding PROJECT_ID internally and the log_name field will contain PROJECT_ID in queries and exports.[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. @@ -972,6 +970,9 @@ pub struct LogEntry { /// 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. The span ID within the trace associated with the log entry. For Stackdriver Trace spans, this is the same format that the Stackdriver Trace API v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such as "000000000000004a". + #[serde(rename="spanId")] + pub span_id: 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. @@ -992,8 +993,8 @@ 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 get projects](struct.ProjectMetricGetCall.html) (response) /// * [metrics update projects](struct.ProjectMetricUpdateCall.html) (request|response) +/// * [metrics get projects](struct.ProjectMetricGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LogMetric { @@ -1329,6 +1330,47 @@ 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. @@ -1396,25 +1438,6 @@ 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: /// /// 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. @@ -1465,28 +1488,6 @@ 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. @@ -1893,17 +1894,17 @@ impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationLogDeleteCall<'a, C, A> @@ -2175,17 +2176,17 @@ impl<'a, C, A> OrganizationLogListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationLogListCall<'a, C, A> @@ -2433,17 +2434,17 @@ impl<'a, C, A> BillingAccountLogDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountLogDeleteCall<'a, C, A> @@ -2715,17 +2716,17 @@ impl<'a, C, A> BillingAccountLogListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountLogListCall<'a, C, A> @@ -2955,17 +2956,17 @@ impl<'a, C, A> MonitoredResourceDescriptorListCall<'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) -> MonitoredResourceDescriptorListCall<'a, C, A> @@ -3000,6 +3001,519 @@ 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 + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> 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 + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> 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. @@ -3028,8 +3542,8 @@ impl<'a, C, A> MonitoredResourceDescriptorListCall<'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("nonumy") -/// .page_size(-19) +/// .page_token("gubergren") +/// .page_size(-95) /// .doit(); /// # } /// ``` @@ -3237,17 +3751,17 @@ impl<'a, C, A> ProjectSinkListCall<'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) -> ProjectSinkListCall<'a, C, A> @@ -3495,17 +4009,17 @@ impl<'a, C, A> ProjectSinkGetCall<'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) -> ProjectSinkGetCall<'a, C, A> @@ -3781,17 +4295,17 @@ impl<'a, C, A> ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricUpdateCall<'a, C, A> @@ -3826,261 +4340,6 @@ 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. @@ -4115,7 +4374,7 @@ 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().sinks_update(req, "sinkName") -/// .update_mask("no") +/// .update_mask("justo") /// .unique_writer_identity(true) /// .doit(); /// # } @@ -4352,17 +4611,17 @@ impl<'a, C, A> ProjectSinkUpdateCall<'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) -> ProjectSinkUpdateCall<'a, C, A> @@ -4426,7 +4685,7 @@ impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().logs_list("parent") /// .page_token("et") -/// .page_size(-17) +/// .page_size(-41) /// .doit(); /// # } /// ``` @@ -4634,17 +4893,17 @@ impl<'a, C, A> ProjectLogListCall<'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) -> ProjectLogListCall<'a, C, A> @@ -4679,264 +4938,6 @@ 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. @@ -5147,17 +5148,17 @@ impl<'a, C, A> ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricDeleteCall<'a, C, A> @@ -5448,17 +5449,17 @@ impl<'a, C, A> ProjectSinkCreateCall<'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) -> ProjectSinkCreateCall<'a, C, A> @@ -5734,17 +5735,17 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricCreateCall<'a, C, A> @@ -6013,17 +6014,17 @@ impl<'a, C, A> ProjectMetricListCall<'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) -> ProjectMetricListCall<'a, C, A> @@ -6271,17 +6272,17 @@ impl<'a, C, A> ProjectSinkDeleteCall<'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) -> ProjectSinkDeleteCall<'a, C, A> @@ -6518,17 +6519,17 @@ impl<'a, C, A> EntryListCall<'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) -> EntryListCall<'a, C, A> @@ -6765,17 +6766,17 @@ impl<'a, C, A> EntryWriteCall<'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. - /// * *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> diff --git a/gen/manufacturers1-cli/Cargo.toml b/gen/manufacturers1-cli/Cargo.toml index 6ddad4f55a..1315fb2445 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+20170808" +version = "1.0.6+20171207" 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+20170808" +version = "1.0.6+20171207" diff --git a/gen/manufacturers1-cli/README.md b/gen/manufacturers1-cli/README.md index 5a71487be2..d447d36ad8 100644 --- a/gen/manufacturers1-cli/README.md +++ b/gen/manufacturers1-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 *Manufacturer Center* API at revision *20170808*. The CLI is at version *1.0.6*. +This documentation was generated from the *Manufacturer Center* API at revision *20171207*. The CLI is at version *1.0.6*. ```bash manufacturers1 [options] diff --git a/gen/manufacturers1-cli/mkdocs.yml b/gen/manufacturers1-cli/mkdocs.yml index 36bba7ca32..ee31af59f3 100644 --- a/gen/manufacturers1-cli/mkdocs.yml +++ b/gen/manufacturers1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Manufacturer Center v1.0.6+20170808 +site_name: Manufacturer Center v1.0.6+20171207 site_url: http://byron.github.io/google-apis-rs/google-manufacturers1-cli site_description: A complete library to interact with Manufacturer Center (protocol v1) diff --git a/gen/manufacturers1-cli/src/main.rs b/gen/manufacturers1-cli/src/main.rs index f34bc8b92e..f098df255d 100644 --- a/gen/manufacturers1-cli/src/main.rs +++ b/gen/manufacturers1-cli/src/main.rs @@ -234,18 +234,20 @@ impl<'n> Engine<'n> { 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 })), + "content-language" => Some(("contentLanguage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", 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.target-client-id" => Some(("manuallyProvidedAttributes.targetClientId", 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.capacity.value" => Some(("manuallyProvidedAttributes.capacity.value", 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 })), @@ -260,15 +262,14 @@ impl<'n> Engine<'n> { "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.count.value" => Some(("manuallyProvidedAttributes.count.value", 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 })), @@ -277,10 +278,11 @@ impl<'n> Engine<'n> { "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.target-client-id" => Some(("finalAttributes.targetClientId", 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.capacity.value" => Some(("finalAttributes.capacity.value", 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 })), @@ -295,15 +297,14 @@ impl<'n> Engine<'n> { "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.count.value" => Some(("finalAttributes.count.value", 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 })), @@ -312,10 +313,11 @@ impl<'n> Engine<'n> { "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.target-client-id" => Some(("uploadedAttributes.targetClientId", 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.capacity.value" => Some(("uploadedAttributes.capacity.value", 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 })), @@ -330,21 +332,19 @@ impl<'n> Engine<'n> { "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.count.value" => Some(("uploadedAttributes.count.value", 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"]); + 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-client-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 } @@ -686,7 +686,7 @@ fn main() { let mut app = App::new("manufacturers1") .author("Sebastian Thiel ") - .version("1.0.6+20170808") + .version("1.0.6+20171207") .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 b873da5083..87ca89084d 100644 --- a/gen/manufacturers1/Cargo.toml +++ b/gen/manufacturers1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-manufacturers1" -version = "1.0.6+20170808" +version = "1.0.6+20171207" 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+20170808" +documentation = "https://docs.rs/google-manufacturers1/1.0.6+20171207" license = "MIT" keywords = ["manufacturers", "google", "protocol", "web", "api"] diff --git a/gen/manufacturers1/README.md b/gen/manufacturers1/README.md index d8f6d0af78..7969d37634 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+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*. +This documentation was generated from *Manufacturer Center* crate version *1.0.6+20171207*, where *20171207* 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+20170808/google_manufacturers1/struct.ManufacturerCenter.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-manufacturers1/1.0.6+20171207/google_manufacturers1/struct.ManufacturerCenter.html) ... * accounts - * [*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) + * [*products delete*](https://docs.rs/google-manufacturers1/1.0.6+20171207/google_manufacturers1/struct.AccountProductDeleteCall.html), [*products get*](https://docs.rs/google-manufacturers1/1.0.6+20171207/google_manufacturers1/struct.AccountProductGetCall.html), [*products list*](https://docs.rs/google-manufacturers1/1.0.6+20171207/google_manufacturers1/struct.AccountProductListCall.html) and [*products update*](https://docs.rs/google-manufacturers1/1.0.6+20171207/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+20170808/google_manufacturers1/struct.ManufacturerCenter.html)** +* **[Hub](https://docs.rs/google-manufacturers1/1.0.6+20171207/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+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)** + * creates [*Method Builders*](https://docs.rs/google-manufacturers1/1.0.6+20171207/google_manufacturers1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-manufacturers1/1.0.6+20171207/google_manufacturers1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-manufacturers1/1.0.6+20171207/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+20170808/google_manufacturers1/trait.Part.html)** + * **[Parts](https://docs.rs/google-manufacturers1/1.0.6+20171207/google_manufacturers1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-manufacturers1/1.0.6+20170808/google_manufacturers1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-manufacturers1/1.0.6+20171207/google_manufacturers1/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-manufacturers1/1.0.6+20170808/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+20171207/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+20170808/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+20171207/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+20170808/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+20171207/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+20170808/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+20171207/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-manufacturers1/1.0.6+20171207/google_manufacturers1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-manufacturers1/1.0.6+20171207/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+20170808/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+20171207/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-manufacturers1/1.0.6+20171207/google_manufacturers1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-manufacturers1/1.0.6+20171207/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+20170808/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+20171207/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+20170808/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+20171207/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+20170808/google_manufacturers1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-manufacturers1/1.0.6+20171207/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 efd16a2a16..53be2a556d 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+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*. +//! This documentation was generated from *Manufacturer Center* crate version *1.0.6+20171207*, where *20171207* 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/). @@ -370,10 +370,10 @@ impl<'a, C, A> ManufacturerCenter /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Count { - /// 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, + /// The unit in which these products are counted. + pub unit: Option, } impl Part for Count {} @@ -401,18 +401,11 @@ pub struct Product { /// @OutputOnly #[serde(rename="manuallyDeletedAttributes")] pub manually_deleted_attributes: Option>, - /// 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. + /// The content language of the product as a two-letter ISO 639-1 language code + /// (for example, en). /// @OutputOnly - pub name: Option, + #[serde(rename="contentLanguage")] + pub content_language: Option, /// Parent ID in the format `accounts/{account_id}`. /// /// `account_id` - The ID of the Manufacturer Center account. @@ -433,19 +426,26 @@ 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>, /// The ID of the product. For more information, see /// https://support.google.com/manufacturers/answer/6124116#id. /// @OutputOnly #[serde(rename="productId")] pub product_id: Option, + /// A server-generated list of issues associated with the product. + /// @OutputOnly + pub issues: Option>, + /// 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. + /// @OutputOnly + pub name: Option, } impl RequestValue for Product {} @@ -459,10 +459,10 @@ impl ResponseResult for Product {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Capacity { - /// The unit of the capacity, i.e., MB, GB, or TB. - pub unit: Option, /// The numeric value of the capacity. pub value: Option, + /// The unit of the capacity, i.e., MB, GB, or TB. + pub unit: Option, } impl Part for Capacity {} @@ -581,6 +581,10 @@ pub struct Attributes { /// The flavor of the product. For more information, see /// https://support.google.com/manufacturers/answer/6124116#flavor. pub flavor: Option, + /// The target client id. Should only be used in the accounts of the data + /// partners. + #[serde(rename="targetClientId")] + pub target_client_id: Option, /// The scent of the product. For more information, see /// https://support.google.com/manufacturers/answer/6124116#scent. pub scent: Option, @@ -660,14 +664,10 @@ pub struct Attributes { /// https://support.google.com/manufacturers/answer/6124116#image. #[serde(rename="imageLink")] pub image_link: Option, - /// The category of the product. For more information, see + /// The type or category of the product. For more information, see /// 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>, @@ -1148,17 +1148,17 @@ impl<'a, C, A> AccountProductListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountProductListCall<'a, C, A> @@ -1466,17 +1466,17 @@ impl<'a, C, A> AccountProductUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountProductUpdateCall<'a, C, A> @@ -1742,17 +1742,17 @@ impl<'a, C, A> AccountProductDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountProductDeleteCall<'a, C, A> @@ -2024,17 +2024,17 @@ impl<'a, C, A> AccountProductGetCall<'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) -> AccountProductGetCall<'a, C, A> diff --git a/gen/ml1-cli/Cargo.toml b/gen/ml1-cli/Cargo.toml index aa29587867..a535b89a7d 100644 --- a/gen/ml1-cli/Cargo.toml +++ b/gen/ml1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-ml1-cli" -version = "1.0.6+20170926" +version = "1.0.6+20171208" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-ml1] path = "../ml1" -version = "1.0.6+20170926" +version = "1.0.6+20171208" diff --git a/gen/ml1-cli/README.md b/gen/ml1-cli/README.md index 4dbc5e3978..1ff682949b 100644 --- a/gen/ml1-cli/README.md +++ b/gen/ml1-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 Machine Learning Engine* API at revision *20170926*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud Machine Learning Engine* API at revision *20171208*. The CLI is at version *1.0.6*. ```bash ml1 [options] @@ -36,19 +36,24 @@ ml1 [options] jobs-get [-p ]... [-o ] jobs-get-iam-policy [-p ]... [-o ] jobs-list [-p ]... [-o ] + jobs-patch (-r )... [-p ]... [-o ] jobs-set-iam-policy (-r )... [-p ]... [-o ] jobs-test-iam-permissions (-r )... [-p ]... [-o ] + locations-get [-p ]... [-o ] + locations-list [-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-patch (-r )... [-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-patch (-r )... [-p ]... [-o ] models-versions-set-default (-r )... [-p ]... [-o ] operations-cancel [-p ]... [-o ] operations-delete [-p ]... [-o ] diff --git a/gen/ml1-cli/mkdocs.yml b/gen/ml1-cli/mkdocs.yml index c7cce46641..ceef673788 100644 --- a/gen/ml1-cli/mkdocs.yml +++ b/gen/ml1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Machine Learning Engine v1.0.6+20170926 +site_name: Cloud Machine Learning Engine v1.0.6+20171208 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) @@ -15,19 +15,24 @@ pages: - ['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-patch.md', 'Projects', 'Jobs Patch'] - ['projects_jobs-set-iam-policy.md', 'Projects', 'Jobs Set Iam Policy'] - ['projects_jobs-test-iam-permissions.md', 'Projects', 'Jobs Test Iam Permissions'] +- ['projects_locations-get.md', 'Projects', 'Locations Get'] +- ['projects_locations-list.md', 'Projects', 'Locations List'] - ['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-patch.md', 'Projects', 'Models Patch'] - ['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-patch.md', 'Projects', 'Models Versions Patch'] - ['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'] diff --git a/gen/ml1-cli/src/main.rs b/gen/ml1-cli/src/main.rs index a863d0cb63..61983c377f 100644 --- a/gen/ml1-cli/src/main.rs +++ b/gen/ml1-cli/src/main.rs @@ -205,9 +205,7 @@ impl<'n> Engine<'n> { 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 })), + "error-message" => Some(("errorMessage", JsonTypeInfo { jtype: JsonType::String, 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 })), @@ -219,33 +217,39 @@ impl<'n> Engine<'n> { "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.python-version" => Some(("trainingInput.pythonVersion", 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.signature-name" => Some(("predictionInput.signatureName", 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 })), + "prediction-input.input-paths" => Some(("predictionInput.inputPaths", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "job-id" => Some(("jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "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 })), + "etag" => Some(("etag", 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.node-hours" => Some(("predictionOutput.nodeHours", JsonTypeInfo { jtype: JsonType::Float, 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"]); + 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", "etag", "goal", "hyperparameter-metric-tag", "hyperparameters", "input-paths", "is-hyperparameter-tuning-job", "job-dir", "job-id", "labels", "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", "python-version", "region", "runtime-version", "scale-tier", "signature-name", "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 } @@ -471,6 +475,137 @@ impl<'n> Engine<'n> { } } + fn _projects_jobs_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()[..] { + "error-message" => Some(("errorMessage", JsonTypeInfo { jtype: JsonType::String, 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.python-version" => Some(("trainingInput.pythonVersion", 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.signature-name" => Some(("predictionInput.signatureName", 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.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 })), + "prediction-input.input-paths" => Some(("predictionInput.inputPaths", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job-id" => Some(("jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "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 })), + "etag" => Some(("etag", 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.output-path" => Some(("predictionOutput.outputPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-output.node-hours" => Some(("predictionOutput.nodeHours", JsonTypeInfo { jtype: JsonType::Float, 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", "etag", "goal", "hyperparameter-metric-tag", "hyperparameters", "input-paths", "is-hyperparameter-tuning-job", "job-dir", "job-id", "labels", "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", "python-version", "region", "runtime-version", "scale-tier", "signature-name", "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_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_jobs_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -644,6 +779,117 @@ 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("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_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -667,23 +913,27 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "regions" => Some(("regions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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.labels" => Some(("defaultVersion.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "default-version.description" => Some(("defaultVersion.description", 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.etag" => Some(("defaultVersion.etag", 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 })), + "default-version.name" => Some(("defaultVersion.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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-scaling", "create-time", "default-version", "deployment-uri", "description", "error-message", "etag", "is-default", "labels", "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 } @@ -911,6 +1161,9 @@ impl<'n> Engine<'n> { "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 { @@ -924,7 +1177,114 @@ 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", "page-size"].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_models_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 })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "regions" => Some(("regions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.error-message" => Some(("defaultVersion.errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.labels" => Some(("defaultVersion.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "default-version.description" => Some(("defaultVersion.description", 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.etag" => Some(("defaultVersion.etag", 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.name" => Some(("defaultVersion.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", "etag", "is-default", "labels", "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_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 } )); } } @@ -1155,18 +1515,20 @@ impl<'n> Engine<'n> { 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 })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "description" => Some(("description", 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 })), + "etag" => Some(("etag", 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 })), + "name" => Some(("name", 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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-scaling", "create-time", "deployment-uri", "description", "error-message", "etag", "is-default", "labels", "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 } @@ -1342,6 +1704,9 @@ impl<'n> Engine<'n> { "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 { @@ -1355,7 +1720,108 @@ 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", "page-size"].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_models_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()[..] { + "error-message" => Some(("errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "description" => Some(("description", 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 })), + "etag" => Some(("etag", 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 })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-scaling", "create-time", "deployment-uri", "description", "error-message", "etag", "is-default", "labels", "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_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 } )); } } @@ -1714,8 +2180,8 @@ impl<'n> Engine<'n> { 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 })), + "http-body.data" => Some(("httpBody.data", 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())))); @@ -1802,12 +2268,21 @@ impl<'n> Engine<'n> { ("jobs-list", Some(opt)) => { call_result = self._projects_jobs_list(opt, dry_run, &mut err); }, + ("jobs-patch", Some(opt)) => { + call_result = self._projects_jobs_patch(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); }, + ("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); + }, ("models-create", Some(opt)) => { call_result = self._projects_models_create(opt, dry_run, &mut err); }, @@ -1823,6 +2298,9 @@ impl<'n> Engine<'n> { ("models-list", Some(opt)) => { call_result = self._projects_models_list(opt, dry_run, &mut err); }, + ("models-patch", Some(opt)) => { + call_result = self._projects_models_patch(opt, dry_run, &mut err); + }, ("models-set-iam-policy", Some(opt)) => { call_result = self._projects_models_set_iam_policy(opt, dry_run, &mut err); }, @@ -1841,6 +2319,9 @@ impl<'n> Engine<'n> { ("models-versions-list", Some(opt)) => { call_result = self._projects_models_versions_list(opt, dry_run, &mut err); }, + ("models-versions-patch", Some(opt)) => { + call_result = self._projects_models_versions_patch(opt, dry_run, &mut err); + }, ("models-versions-set-default", Some(opt)) => { call_result = self._projects_models_versions_set_default(opt, dry_run, &mut err); }, @@ -1951,7 +2432,7 @@ impl<'n> Engine<'n> { 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![ + ("projects", "methods: 'get-config', 'jobs-cancel', 'jobs-create', 'jobs-get', 'jobs-get-iam-policy', 'jobs-list', 'jobs-patch', 'jobs-set-iam-policy', 'jobs-test-iam-permissions', 'locations-get', 'locations-list', 'models-create', 'models-delete', 'models-get', 'models-get-iam-policy', 'models-list', 'models-patch', 'models-set-iam-policy', 'models-test-iam-permissions', 'models-versions-create', 'models-versions-delete', 'models-versions-get', 'models-versions-list', 'models-versions-patch', '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 @@ -2096,6 +2577,36 @@ 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)), + ]), + ("jobs-patch", + Some(r##"Updates a specific job resource. + + Currently the only supported fields to update are `labels`."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_jobs-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The job 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"##), @@ -2161,6 +2672,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)), + ]), + ("locations-get", + Some(r##"Get the complete list of CMLE capabilities in a location, along with their + location-specific properties."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of 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##"List all locations that provides at least one type of CMLE capability."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the project for which available locations are to be + listed (since some locations might be whitelisted for specific 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"##), @@ -2293,6 +2850,37 @@ 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)), + ]), + ("models-patch", + Some(r##"Updates a specific model resource. + + Currently the only supported fields to update are `description` and + `default_version.name`."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-patch", + vec![ + (Some(r##"name"##), + 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"##), @@ -2476,6 +3064,36 @@ 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)), + ]), + ("models-versions-patch", + Some(r##"Updates the specified Version resource. + + Currently the only supported field to update is `description`."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-versions-patch", + vec![ + (Some(r##"name"##), + 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"##), @@ -2632,8 +3250,9 @@ fn main() { ]), ("predict", Some(r##"Performs prediction on the data in the request. - - **** REMOVE FROM GENERATED DOCUMENTATION"##), + Cloud ML Engine implements a custom `predict` verb on top of an HTTP POST + method. For details of the format, see the **guide to the + [predict request format](/ml-engine/docs/v1/predict-request)**."##), "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_predict", vec![ (Some(r##"name"##), @@ -2668,7 +3287,7 @@ fn main() { let mut app = App::new("ml1") .author("Sebastian Thiel ") - .version("1.0.6+20170926") + .version("1.0.6+20171208") .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") diff --git a/gen/ml1/Cargo.toml b/gen/ml1/Cargo.toml index 8beed8710b..7774018df3 100644 --- a/gen/ml1/Cargo.toml +++ b/gen/ml1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-ml1" -version = "1.0.6+20170926" +version = "1.0.6+20171208" 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" +documentation = "https://docs.rs/google-ml1/1.0.6+20171208" license = "MIT" keywords = ["ml", "google", "protocol", "web", "api"] diff --git a/gen/ml1/README.md b/gen/ml1/README.md index 9cc0bbdc96..4beb9ec1e6 100644 --- a/gen/ml1/README.md +++ b/gen/ml1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Cloud Machine Learning Engine* crate version *1.0.6+20171208*, where *20171208* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-ml1/1.0.6+20171208/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) + * [*get config*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectGetConfigCall.html), [*jobs cancel*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectJobCancelCall.html), [*jobs create*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectJobCreateCall.html), [*jobs get*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectJobGetCall.html), [*jobs get iam policy*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectJobGetIamPolicyCall.html), [*jobs list*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectJobListCall.html), [*jobs patch*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectJobPatchCall.html), [*jobs set iam policy*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectJobSetIamPolicyCall.html), [*jobs test iam permissions*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectJobTestIamPermissionCall.html), [*locations get*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectLocationListCall.html), [*models create*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelCreateCall.html), [*models delete*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelDeleteCall.html), [*models get*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelGetCall.html), [*models get iam policy*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelGetIamPolicyCall.html), [*models list*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelListCall.html), [*models patch*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelPatchCall.html), [*models set iam policy*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelSetIamPolicyCall.html), [*models test iam permissions*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelTestIamPermissionCall.html), [*models versions create*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelVersionCreateCall.html), [*models versions delete*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelVersionDeleteCall.html), [*models versions get*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelVersionGetCall.html), [*models versions list*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelVersionListCall.html), [*models versions patch*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelVersionPatchCall.html), [*models versions set default*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectModelVersionSetDefaultCall.html), [*operations cancel*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectOperationCancelCall.html), [*operations delete*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectOperationDeleteCall.html), [*operations get*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectOperationGetCall.html), [*operations list*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectOperationListCall.html) and [*predict*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/struct.ProjectPredictCall.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-ml1/1.0.6+20170926/google_ml1/struct.CloudMachineLearningEngine.html)** +* **[Hub](https://docs.rs/google-ml1/1.0.6+20171208/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)** + * creates [*Method Builders*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-ml1/1.0.6+20171208/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)** + * **[Parts](https://docs.rs/google-ml1/1.0.6+20171208/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)** +* **[Activities](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/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,12 @@ 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() +let r = hub.projects().models_versions_create(...).doit() +let r = hub.projects().models_versions_patch(...).doit() +let r = hub.projects().operations_get(...).doit() +let r = hub.projects().models_versions_delete(...).doit() +let r = hub.projects().models_delete(...).doit() +let r = hub.projects().models_patch(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -76,7 +78,7 @@ 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::GoogleCloudMlV1__Version; use ml1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -97,12 +99,13 @@ let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hype // As the method needs a request, you would usually fill it with the desired information // into the 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(); +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_set_iam_policy(req, "resource") +let result = hub.projects().models_versions_patch(req, "name") + .update_mask("sit") .doit(); match result { @@ -125,17 +128,17 @@ match result { ``` ## 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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-ml1/1.0.6+20171208/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). +[Hub Delegate](https://docs.rs/google-ml1/1.0.6+20171208/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-ml1/1.0.6+20171208/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. +If such a method also supports a [Response Result](https://docs.rs/google-ml1/1.0.6+20171208/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")`. @@ -145,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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-ml1/1.0.6+20171208/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. +The [delegate trait](https://docs.rs/google-ml1/1.0.6+20171208/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-ml1/1.0.6+20171208/google_ml1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-ml1/1.0.6+20171208/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 +Most optionals are are considered [Parts](https://docs.rs/google-ml1/1.0.6+20171208/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. +Using [method builders](https://docs.rs/google-ml1/1.0.6+20171208/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 +* [request values](https://docs.rs/google-ml1/1.0.6+20171208/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. diff --git a/gen/ml1/src/lib.rs b/gen/ml1/src/lib.rs index 367aee682e..6a32ab3154 100644 --- a/gen/ml1/src/lib.rs +++ b/gen/ml1/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 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*. +//! This documentation was generated from *Cloud Machine Learning Engine* crate version *1.0.6+20171208*, where *20171208* 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/). @@ -12,7 +12,7 @@ //! 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) +//! * [*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 patch*](struct.ProjectJobPatchCall.html), [*jobs set iam policy*](struct.ProjectJobSetIamPolicyCall.html), [*jobs test iam permissions*](struct.ProjectJobTestIamPermissionCall.html), [*locations get*](struct.ProjectLocationGetCall.html), [*locations list*](struct.ProjectLocationListCall.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 patch*](struct.ProjectModelPatchCall.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 patch*](struct.ProjectModelVersionPatchCall.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) //! //! //! @@ -47,10 +47,12 @@ //! 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() +//! let r = hub.projects().models_versions_create(...).doit() +//! let r = hub.projects().models_versions_patch(...).doit() +//! let r = hub.projects().operations_get(...).doit() +//! let r = hub.projects().models_versions_delete(...).doit() +//! let r = hub.projects().models_delete(...).doit() +//! let r = hub.projects().models_patch(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -76,7 +78,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_ml1 as ml1; -//! use ml1::GoogleIamV1__SetIamPolicyRequest; +//! use ml1::GoogleCloudMlV1__Version; //! use ml1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -98,12 +100,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 = GoogleIamV1__SetIamPolicyRequest::default(); +//! 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_set_iam_policy(req, "resource") +//! let result = hub.projects().models_versions_patch(req, "name") +//! .update_mask("sed") //! .doit(); //! //! match result { @@ -261,7 +264,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_ml1 as ml1; -/// use ml1::GoogleIamV1__SetIamPolicyRequest; +/// use ml1::GoogleCloudMlV1__Version; /// use ml1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -283,12 +286,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 = GoogleIamV1__SetIamPolicyRequest::default(); +/// 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_set_iam_policy(req, "resource") +/// let result = hub.projects().models_versions_patch(req, "name") +/// .update_mask("dolores") /// .doit(); /// /// match result { @@ -376,11 +380,11 @@ impl<'a, C, A> CloudMachineLearningEngine /// #[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, + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, } impl ResponseResult for GoogleLongrunning__ListOperationsResponse {} @@ -430,19 +434,53 @@ pub struct GoogleCloudMlV1__ListVersionsResponse { impl ResponseResult for GoogleCloudMlV1__ListVersionsResponse {} -/// Request message for the SetDefaultVersion request. +/// 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 versions set default projects](struct.ProjectModelVersionSetDefaultCall.html) (request) +/// * [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 GoogleCloudMlV1__SetDefaultVersionRequest { _never_set: Option } +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 GoogleCloudMlV1__SetDefaultVersionRequest {} +impl RequestValue for GoogleIamV1__SetIamPolicyRequest {} + + +/// 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*). +/// +/// * [locations get projects](struct.ProjectLocationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__Location { + /// no description provided + pub name: Option, + /// Capabilities available in the location. + pub capabilities: Option>, +} + +impl ResponseResult for GoogleCloudMlV1__Location {} /// Represents the result of a single hyperparameter tuning trial from a @@ -531,46 +569,76 @@ pub struct GoogleIamV1__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, + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, } impl ResponseResult for GoogleIamV1__Policy {} -/// Represents an expression text. Example: +/// 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. /// -/// 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. +/// 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 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, +pub struct GoogleApi__HttpBody { + /// HTTP body binary data. + pub data: Option, + /// 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>>, } -impl Part for GoogleType__Expr {} +impl ResponseResult for GoogleApi__HttpBody {} /// A generic empty message that you can re-use to avoid defining duplicated @@ -598,47 +666,27 @@ pub struct GoogleProtobuf__Empty { _never_set: Option } impl ResponseResult for GoogleProtobuf__Empty {} -/// Represents a set of hyperparameters to optimize. +/// 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__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, +pub struct GoogleCloudMlV1__PredictionOutput { + /// The output Google Cloud Storage location provided at the job creation time. + #[serde(rename="outputPath")] + pub output_path: Option, + /// Node hours used by the batch prediction job. + #[serde(rename="nodeHours")] + pub node_hours: 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__HyperparameterSpec {} +impl Part for GoogleCloudMlV1__PredictionOutput {} /// An observed value of a metric. @@ -666,10 +714,12 @@ impl Part for GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric {} /// This type is used in activities, which are methods you may call on this type or where 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 versions patch projects](struct.ProjectModelVersionPatchCall.html) (response) +/// * [operations get projects](struct.ProjectOperationGetCall.html) (response) +/// * [models versions delete projects](struct.ProjectModelVersionDeleteCall.html) (response) /// * [models delete projects](struct.ProjectModelDeleteCall.html) (response) +/// * [models patch projects](struct.ProjectModelPatchCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleLongrunning__Operation { @@ -702,55 +752,66 @@ pub struct GoogleLongrunning__Operation { 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 +/// Represents a training or prediction job. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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) +/// * [jobs create projects](struct.ProjectJobCreateCall.html) (request|response) +/// * [jobs patch projects](struct.ProjectJobPatchCall.html) (request|response) +/// * [jobs get projects](struct.ProjectJobGetCall.html) (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, +pub struct GoogleCloudMlV1__Job { + /// Input parameters to create a training job. + #[serde(rename="trainingInput")] + pub training_input: Option, + /// Output only. When the job processing was started. + #[serde(rename="startTime")] + pub start_time: Option, + /// Output only. The details of a failure or a cancellation. + #[serde(rename="errorMessage")] + pub error_message: Option, + /// Required. The user-specified id of the job. + #[serde(rename="jobId")] + pub job_id: Option, + /// Optional. One or more labels that you can add, to organize your jobs. + /// Each label is a key-value pair, where both the key and the value are + /// arbitrary strings that you supply. + /// For more information, see the documentation on + /// using labels. + pub labels: Option>, + /// Output only. The detailed state of a job. + pub state: Option, + /// The current training job result. + #[serde(rename="trainingOutput")] + pub training_output: Option, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a job from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform job updates in order to avoid race + /// conditions: An `etag` is returned in the response to `GetJob`, and + /// systems are expected to put that etag in the request to `UpdateJob` to + /// ensure that their change will be applied to the same version of the job. + pub etag: 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__Model {} -impl ResponseResult for GoogleCloudMlV1__Model {} +impl RequestValue for GoogleCloudMlV1__Job {} +impl ResponseResult for GoogleCloudMlV1__Job {} /// Request message for `TestIamPermissions` method. @@ -798,9 +859,11 @@ pub struct GoogleCloudMlV1__ParameterSpec { /// 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 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, /// Required. The type of the parameter. #[serde(rename="type")] pub type_: Option, @@ -809,11 +872,9 @@ pub struct GoogleCloudMlV1__ParameterSpec { /// 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, + /// Required if type is `CATEGORICAL`. The list of possible categories. + #[serde(rename="categoricalValues")] + pub categorical_values: Option>, } impl Part for GoogleCloudMlV1__ParameterSpec {} @@ -951,15 +1012,34 @@ pub struct GoogleCloudMlV1__TrainingInput { ///
standard_gpu
///
/// A machine equivalent to standard that - /// also includes a + /// also includes a single NVIDIA Tesla K80 GPU. See more about /// - /// GPU that you can use in your trainer. + /// using GPUs for training your model. ///
///
complex_model_m_gpu
///
/// A machine equivalent to /// complex_model_m that also includes - /// four GPUs. + /// four NVIDIA Tesla K80 GPUs. + ///
+ ///
complex_model_l_gpu
+ ///
+ /// A machine equivalent to + /// complex_model_l that also includes + /// eight NVIDIA Tesla K80 GPUs. + ///
+ ///
standard_p100
+ ///
+ /// A machine equivalent to standard that + /// also includes a single NVIDIA Tesla P100 GPU. The availability of these + /// GPUs is in the Alpha launch stage. + ///
+ ///
complex_model_m_p100
+ ///
+ /// A machine equivalent to + /// complex_model_m that also includes + /// four NVIDIA Tesla P100 GPUs. The availability of these GPUs is in + /// the Alpha launch stage. ///
/// /// @@ -975,6 +1055,10 @@ pub struct GoogleCloudMlV1__TrainingInput { /// Required. The Python module name to run after installing the packages. #[serde(rename="pythonModule")] pub python_module: Option, + /// Optional. The version of Python used in training. If not set, the default + /// version is '2.7'. + #[serde(rename="pythonVersion")] + pub python_version: 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 @@ -1018,191 +1102,6 @@ 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. @@ -1331,27 +1230,47 @@ pub struct GoogleIamV1__TestIamPermissionsResponse { impl ResponseResult for GoogleIamV1__TestIamPermissionsResponse {} -/// Represents results of a prediction job. +/// 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__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, +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__PredictionOutput {} +impl Part for GoogleCloudMlV1__HyperparameterSpec {} /// Represents results of a training job. Output only. @@ -1360,51 +1279,37 @@ impl Part for GoogleCloudMlV1__PredictionOutput {} /// #[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, + /// Whether this job is a hyperparameter tuning job. + #[serde(rename="isHyperparameterTuningJob")] + pub is_hyperparameter_tuning_job: Option, /// The amount of ML units consumed by the job. #[serde(rename="consumedMLUnits")] pub consumed_ml_units: Option, + /// Results for individual Hyperparameter trials. + /// Only set for hyperparameter tuning jobs. + pub trials: Option>, } impl Part for GoogleCloudMlV1__TrainingOutput {} -/// Request message for `SetIamPolicy` method. +/// 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 set iam policy projects](struct.ProjectModelSetIamPolicyCall.html) (request) -/// * [jobs set iam policy projects](struct.ProjectJobSetIamPolicyCall.html) (request) +/// * [models versions set default projects](struct.ProjectModelVersionSetDefaultCall.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, -} +pub struct GoogleCloudMlV1__SetDefaultVersionRequest { _never_set: Option } -impl RequestValue for GoogleIamV1__SetIamPolicyRequest {} +impl RequestValue for GoogleCloudMlV1__SetDefaultVersionRequest {} /// Associates `members` with a `role`. @@ -1453,114 +1358,121 @@ pub struct GoogleIamV1__Binding { 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. +/// Represents an expression text. Example: /// +/// title: "User account presence" +/// description: "Determines whether the request has a user account" +/// expression: "size(request.user) > 0" /// -/// This message can be used both in streaming and non-streaming API methods in -/// the request as well as the response. +/// This type is not used in any activity, and only used as *part* of another schema. /// -/// 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. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleType__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 GoogleType__Expr {} + + +/// 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*). /// -/// * [predict projects](struct.ProjectPredictCall.html) (response) +/// * [get config projects](struct.ProjectGetConfigCall.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, +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 GoogleApi__HttpBody {} +impl ResponseResult for GoogleCloudMlV1__GetConfigResponse {} -/// Represents a training or prediction job. +/// Represents a machine learning solution. /// -/// Next ID: 16 +/// 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. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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) +/// * [models get projects](struct.ProjectModelGetCall.html) (response) +/// * [models patch projects](struct.ProjectModelPatchCall.html) (request) +/// * [models create projects](struct.ProjectModelCreateCall.html) (request|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, +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>, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a model from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform model updates in order to avoid race + /// conditions: An `etag` is returned in the response to `GetModel`, and + /// systems are expected to put that etag in the request to `UpdateModel` to + /// ensure that their change will be applied to the model as intended. + pub etag: 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. One or more labels that you can add, to organize your models. + /// Each label is a key-value pair, where both the key and the value are + /// arbitrary strings that you supply. + /// For more information, see the documentation on + /// using labels. + pub labels: 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__Job {} -impl ResponseResult for GoogleCloudMlV1__Job {} +impl RequestValue for GoogleCloudMlV1__Model {} +impl ResponseResult for GoogleCloudMlV1__Model {} /// The `Status` type defines a logical error model that is suitable for different @@ -1646,6 +1558,16 @@ pub struct GoogleCloudMlV1__PredictionInput { /// `"projects/[YOUR_PROJECT]/models/[YOUR_MODEL]"` #[serde(rename="modelName")] pub model_name: Option, + /// Optional. The name of the signature defined in the SavedModel to use for + /// this job. Please refer to + /// [SavedModel](https://tensorflow.github.io/serving/serving_basic.html) + /// for information about how to use signatures. + /// + /// Defaults to + /// [DEFAULT_SERVING_SIGNATURE_DEF_KEY](https://www.tensorflow.org/api_docs/python/tf/saved_model/signature_constants) + /// , which is "serving_default". + #[serde(rename="signatureName")] + pub signature_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 @@ -1663,6 +1585,10 @@ pub struct GoogleCloudMlV1__PredictionInput { /// Defaults to 10 if not specified. #[serde(rename="maxWorkerCount")] pub max_worker_count: Option, + /// Required. The Google Cloud Storage location of the input data files. + /// May contain wildcards. + #[serde(rename="inputPaths")] + pub input_paths: Option>, /// Use this field if you want to specify a Google Cloud Storage path for /// the model to use. pub uri: Option, @@ -1681,15 +1607,33 @@ pub struct GoogleCloudMlV1__PredictionInput { 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 {} +/// 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*). +/// +/// * [locations list projects](struct.ProjectLocationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__ListLocationsResponse { + /// Optional. Pass this token as the `page_token` field of the request for a + /// subsequent call. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Locations where at least one type of CMLE capability is available. + pub locations: Option>, +} + +impl ResponseResult for GoogleCloudMlV1__ListLocationsResponse {} + + /// Represents a version of the model. /// /// Each version is a trained model deployed in the cloud, ready to handle @@ -1697,7 +1641,6 @@ impl Part for GoogleCloudMlV1__PredictionInput {} /// 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 @@ -1707,6 +1650,7 @@ impl Part for GoogleCloudMlV1__PredictionInput {} /// /// * [models versions get projects](struct.ProjectModelVersionGetCall.html) (response) /// * [models versions create projects](struct.ProjectModelVersionCreateCall.html) (request) +/// * [models versions patch projects](struct.ProjectModelVersionPatchCall.html) (request) /// * [models versions set default projects](struct.ProjectModelVersionSetDefaultCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1714,10 +1658,8 @@ 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 description specified for the version when it was created. + pub description: 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")] @@ -1736,8 +1678,22 @@ pub struct GoogleCloudMlV1__Version { /// or you will start seeing increases in latency and 429 response codes. #[serde(rename="autoScaling")] pub auto_scaling: Option, + /// Optional. One or more labels that you can add, to organize your model + /// versions. Each label is a key-value pair, where both the key and the value + /// are arbitrary strings that you supply. + /// For more information, see the documentation on + /// using labels. + pub labels: Option>, /// Output only. The state of a version. pub state: Option, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a model from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform model updates in order to avoid race + /// conditions: An `etag` is returned in the response to `GetVersion`, and + /// systems are expected to put that etag in the request to `UpdateVersion` to + /// ensure that their change will be applied to the model as intended. + pub etag: Option, /// Output only. The time the version was last used for prediction. #[serde(rename="lastUseTime")] pub last_use_time: Option, @@ -1765,34 +1721,31 @@ pub struct GoogleCloudMlV1__Version { /// [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, + /// 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, } impl RequestValue for GoogleCloudMlV1__Version {} impl ResponseResult for GoogleCloudMlV1__Version {} -/// Returns service account information associated with a project. +/// 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 config projects](struct.ProjectGetConfigCall.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 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, +pub struct GoogleCloudMlV1__Capability { + /// Available accelerators for the capability. + #[serde(rename="availableAccelerators")] + pub available_accelerators: Option>, + /// no description provided + #[serde(rename="type")] + pub type_: Option, } -impl ResponseResult for GoogleCloudMlV1__GetConfigResponse {} +impl Part for GoogleCloudMlV1__Capability {} /// Options for automatically scaling a model. @@ -1855,7 +1808,7 @@ impl Part for GoogleCloudMlV1__AutoScaling {} /// ::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(...)` +/// // like `get_config(...)`, `jobs_cancel(...)`, `jobs_create(...)`, `jobs_get(...)`, `jobs_get_iam_policy(...)`, `jobs_list(...)`, `jobs_patch(...)`, `jobs_set_iam_policy(...)`, `jobs_test_iam_permissions(...)`, `locations_get(...)`, `locations_list(...)`, `models_create(...)`, `models_delete(...)`, `models_get(...)`, `models_get_iam_policy(...)`, `models_list(...)`, `models_patch(...)`, `models_set_iam_policy(...)`, `models_test_iam_permissions(...)`, `models_versions_create(...)`, `models_versions_delete(...)`, `models_versions_get(...)`, `models_versions_list(...)`, `models_versions_patch(...)`, `models_versions_set_default(...)`, `operations_cancel(...)`, `operations_delete(...)`, `operations_get(...)`, `operations_list(...)` and `predict(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1914,8 +1867,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Performs prediction on the data in the request. - /// - /// **** REMOVE FROM GENERATED DOCUMENTATION + /// Cloud ML Engine implements a custom `predict` verb on top of an HTTP POST + /// method. For details of the format, see the **guide to the + /// [predict request format](/ml-engine/docs/v1/predict-request)**. /// /// # Arguments /// @@ -2031,6 +1985,29 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates a specific model resource. + /// + /// Currently the only supported fields to update are `description` and + /// `default_version.name`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The project name. + pub fn models_patch(&self, request: GoogleCloudMlV1__Model, name: &str) -> ProjectModelPatchCall<'a, C, A> { + ProjectModelPatchCall { + 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: /// /// Sets the access control policy on the specified resource. Replaces any @@ -2072,6 +2049,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// List all locations that provides at least one type of CMLE capability. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the project for which available locations are to be + /// listed (since some locations might be whitelisted for specific projects). + pub fn locations_list(&self, parent: &str) -> ProjectLocationListCall<'a, C, A> { + ProjectLocationListCall { + 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: /// /// Describes a job. @@ -2108,6 +2105,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates the specified Version resource. + /// + /// Currently the only supported field to update is `description`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The name of the model. + pub fn models_versions_patch(&self, request: GoogleCloudMlV1__Version, name: &str) -> ProjectModelVersionPatchCall<'a, C, A> { + ProjectModelVersionPatchCall { + 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 information about a model version. @@ -2130,6 +2149,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates a specific job resource. + /// + /// Currently the only supported fields to update are `labels`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The job name. + pub fn jobs_patch(&self, request: GoogleCloudMlV1__Job, name: &str) -> ProjectJobPatchCall<'a, C, A> { + ProjectJobPatchCall { + 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: /// /// Get the service account information associated with your project. You need @@ -2150,6 +2191,24 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Get the complete list of CMLE capabilities in a location, along with their + /// location-specific properties. + /// + /// # Arguments + /// + /// * `name` - Required. The name of 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. @@ -2268,6 +2327,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _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(), @@ -2418,6 +2478,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _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(), @@ -2644,17 +2705,17 @@ impl<'a, C, A> ProjectOperationDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectOperationDeleteCall<'a, C, A> @@ -2930,17 +2991,17 @@ impl<'a, C, A> ProjectJobSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectJobSetIamPolicyCall<'a, C, A> @@ -2976,8 +3037,9 @@ impl<'a, C, A> ProjectJobSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectPredictCall<'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) -> ProjectPredictCall<'a, C, A> @@ -3479,17 +3541,17 @@ impl<'a, C, A> ProjectModelVersionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelVersionDeleteCall<'a, C, A> @@ -3763,17 +3825,17 @@ impl<'a, C, A> ProjectJobCreateCall<'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) -> ProjectJobCreateCall<'a, C, A> @@ -4054,17 +4116,17 @@ impl<'a, C, A> ProjectJobTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectJobTestIamPermissionCall<'a, C, A> @@ -4347,17 +4409,17 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelVersionSetDefaultCall<'a, C, A> @@ -4392,6 +4454,323 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut::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_patch(req, "name") +/// .update_mask("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__Model, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelPatchCall<'a, C, 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.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: GoogleCloudMlV1__Model) -> ProjectModelPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// 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) -> ProjectModelPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. Specifies the path, relative to `Model`, of the field to update. + /// + /// For example, to change the description of a model to "foo" and set its + /// default version to "version_1", the `update_mask` parameter would be + /// specified as `description`, `default_version.name`, and the `PATCH` + /// request body would specify the new value, as follows: + /// { + /// "description": "foo", + /// "defaultVersion": { + /// "name":"version_1" + /// } + /// } + /// In this example, the model is blindly overwritten since no etag is given. + /// + /// To adopt etag mechanism, include `etag` field in the mask, and include the + /// `etag` value in your model resource. + /// + /// Currently the supported update masks are `description`, + /// `default_version.name`, `labels`, and `etag`. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectModelPatchCall<'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) -> ProjectModelPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectModelPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectModelPatchCall<'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. /// @@ -4633,17 +5012,17 @@ impl<'a, C, A> ProjectModelSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelSetIamPolicyCall<'a, C, A> @@ -4889,17 +5268,17 @@ impl<'a, C, A> ProjectJobGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectJobGetIamPolicyCall<'a, C, A> @@ -4934,6 +5313,291 @@ impl<'a, C, A> ProjectJobGetIamPolicyCall<'a, C, A> where C: BorrowMut::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().locations_list("parent") +/// .page_token("aliquyam") +/// .page_size(-66) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationListCall<'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 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, GoogleCloudMlV1__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: "ml.projects.locations.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}/locations"; + 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 available locations are to be + /// listed (since some locations might be whitelisted for specific 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) -> ProjectLocationListCall<'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) -> ProjectLocationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The number of locations 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) -> ProjectLocationListCall<'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) -> 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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. 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) -> 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 + } +} + + /// Describes a job. /// /// A builder for the *jobs.get* method supported by a *project* resource. @@ -5142,17 +5806,17 @@ impl<'a, C, A> ProjectJobGetCall<'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) -> ProjectJobGetCall<'a, C, A> @@ -5426,17 +6090,17 @@ impl<'a, C, A> ProjectJobCancelCall<'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) -> ProjectJobCancelCall<'a, C, A> @@ -5471,6 +6135,319 @@ impl<'a, C, A> ProjectJobCancelCall<'a, C, A> where C: BorrowMut, } +/// Updates the specified Version resource. +/// +/// Currently the only supported field to update is `description`. +/// +/// A builder for the *models.versions.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_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_patch(req, "name") +/// .update_mask("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectModelVersionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__Version, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectModelVersionPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectModelVersionPatchCall<'a, C, 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.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: GoogleCloudMlV1__Version) -> ProjectModelVersionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// 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) -> ProjectModelVersionPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. Specifies the path, relative to `Version`, of the field to + /// update. Must be present and non-empty. + /// + /// For example, to change the description of a version to "foo", the + /// `update_mask` parameter would be specified as `description`, and the + /// `PATCH` request body would specify the new value, as follows: + /// { + /// "description": "foo" + /// } + /// In this example, the version is blindly overwritten since no etag is given. + /// + /// To adopt etag mechanism, include `etag` field in the mask, and include the + /// `etag` value in your version resource. + /// + /// Currently the only supported update masks are `description`, `labels`, and + /// `etag`. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectModelVersionPatchCall<'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) -> ProjectModelVersionPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectModelVersionPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectModelVersionPatchCall<'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 @@ -5684,17 +6661,17 @@ impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelVersionGetCall<'a, C, A> @@ -5729,6 +6706,322 @@ impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut::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_patch(req, "name") +/// .update_mask("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct ProjectJobPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__Job, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectJobPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectJobPatchCall<'a, C, 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.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: GoogleCloudMlV1__Job) -> ProjectJobPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The job 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) -> ProjectJobPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. Specifies the path, relative to `Job`, of the field to update. + /// To adopt etag mechanism, include `etag` field in the mask, and include the + /// `etag` value in your job resource. + /// + /// For example, to change the labels of a job, the `update_mask` parameter + /// would be specified as `labels`, `etag`, and the + /// `PATCH` request body would specify the new value, as follows: + /// { + /// "labels": { + /// "owner": "Google", + /// "color": "Blue" + /// } + /// "etag": "33a64df551425fcc55e4d42a148795d9f25f89d4" + /// } + /// If `etag` matches the one on the server, the labels of the job will be + /// replaced with the given ones, and the server end `etag` will be + /// recalculated. + /// + /// Currently the only supported update masks are `labels` and `etag`. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectJobPatchCall<'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) -> ProjectJobPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectJobPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectJobPatchCall<'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 @@ -5940,17 +7233,17 @@ impl<'a, C, A> ProjectGetConfigCall<'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) -> ProjectGetConfigCall<'a, C, A> @@ -5985,6 +7278,260 @@ impl<'a, C, A> ProjectGetConfigCall<'a, C, A> where C: BorrowMut, } +/// Get the complete list of CMLE capabilities in a location, along with their +/// location-specific properties. +/// +/// 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_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().locations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationGetCall<'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 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, GoogleCloudMlV1__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: "ml.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) + } + } + } + } + + + /// Required. The name of 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. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. 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) -> 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. @@ -6231,17 +7778,17 @@ impl<'a, C, A> ProjectModelTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelTestIamPermissionCall<'a, C, A> @@ -6313,9 +7860,9 @@ impl<'a, C, A> ProjectModelTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectOperationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectOperationListCall<'a, C, A> @@ -6820,17 +8367,17 @@ impl<'a, C, A> ProjectModelVersionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelVersionCreateCall<'a, C, A> @@ -7076,17 +8623,17 @@ impl<'a, C, A> ProjectModelGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelGetIamPolicyCall<'a, C, A> @@ -7153,8 +8700,9 @@ impl<'a, C, A> ProjectModelGetIamPolicyCall<'a, C, A> where C: BorrowMut _parent: String, _page_token: Option, _page_size: Option, + _filter: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -7187,7 +8736,7 @@ impl<'a, C, A> ProjectModelVersionListCall<'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(("parent", self._parent.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -7195,7 +8744,10 @@ impl<'a, C, A> ProjectModelVersionListCall<'a, C, A> where C: BorrowMut ProjectModelVersionListCall<'a, C, A> where C: BorrowMut ProjectModelVersionListCall<'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. /// @@ -7364,17 +8923,17 @@ impl<'a, C, A> ProjectModelVersionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelVersionListCall<'a, C, A> @@ -7619,17 +9178,17 @@ impl<'a, C, A> ProjectOperationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectOperationGetCall<'a, C, A> @@ -7881,17 +9440,17 @@ impl<'a, C, A> ProjectOperationCancelCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectOperationCancelCall<'a, C, A> @@ -8169,17 +9728,17 @@ impl<'a, C, A> ProjectModelCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelCreateCall<'a, C, A> @@ -8426,17 +9985,17 @@ impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelDeleteCall<'a, C, A> @@ -8499,9 +10058,9 @@ impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut ProjectJobListCall<'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) -> ProjectJobListCall<'a, C, A> @@ -8977,17 +10536,17 @@ impl<'a, C, A> ProjectModelGetCall<'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) -> ProjectModelGetCall<'a, C, A> @@ -9053,8 +10612,9 @@ impl<'a, C, A> ProjectModelGetCall<'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().models_list("parent") -/// .page_token("dolor") -/// .page_size(-39) +/// .page_token("duo") +/// .page_size(-21) +/// .filter("eirmod") /// .doit(); /// # } /// ``` @@ -9065,6 +10625,7 @@ pub struct ProjectModelListCall<'a, C, A> _parent: String, _page_token: Option, _page_size: Option, + _filter: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -9087,7 +10648,7 @@ impl<'a, C, A> ProjectModelListCall<'a, C, A> where C: BorrowMut, }; 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())); + 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())); @@ -9095,7 +10656,10 @@ impl<'a, C, A> ProjectModelListCall<'a, C, A> where C: BorrowMut, if let Some(value) = self._page_size { params.push(("pageSize", value.to_string())); } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + 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)); @@ -9244,6 +10808,13 @@ impl<'a, C, A> ProjectModelListCall<'a, C, A> where C: BorrowMut, self._page_size = Some(new_value); self } + /// Optional. Specifies the subset of models to retrieve. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectModelListCall<'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. /// @@ -9264,17 +10835,17 @@ impl<'a, C, A> ProjectModelListCall<'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) -> ProjectModelListCall<'a, C, A> diff --git a/gen/monitoring3-cli/Cargo.toml b/gen/monitoring3-cli/Cargo.toml index 345f7c029b..f1aa6a2452 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+20170918" +version = "1.0.6+20171204" 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+20170918" +version = "1.0.6+20171204" diff --git a/gen/monitoring3-cli/README.md b/gen/monitoring3-cli/README.md index 23eae1af89..3304944fc0 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 *20170918*. The CLI is at version *1.0.6*. +This documentation was generated from the *Monitoring* API at revision *20171204*. The CLI is at version *1.0.6*. ```bash monitoring3 [options] @@ -45,6 +45,13 @@ monitoring3 [options] monitored-resource-descriptors-list [-p ]... [-o ] time-series-create (-r )... [-p ]... [-o ] time-series-list [-p ]... [-o ] + uptime-check-configs-create (-r )... [-p ]... [-o ] + uptime-check-configs-delete [-p ]... [-o ] + uptime-check-configs-get [-p ]... [-o ] + uptime-check-configs-list [-p ]... [-o ] + uptime-check-configs-patch (-r )... [-p ]... [-o ] + uptime-check-ips + list [-p ]... [-o ] monitoring3 --help Configuration: diff --git a/gen/monitoring3-cli/mkdocs.yml b/gen/monitoring3-cli/mkdocs.yml index d85529fd7d..76ff23a72f 100644 --- a/gen/monitoring3-cli/mkdocs.yml +++ b/gen/monitoring3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Monitoring v1.0.6+20170918 +site_name: Monitoring v1.0.6+20171204 site_url: http://byron.github.io/google-apis-rs/google-monitoring3-cli site_description: A complete library to interact with Monitoring (protocol v3) @@ -24,6 +24,12 @@ pages: - ['projects_monitored-resource-descriptors-list.md', 'Projects', 'Monitored Resource Descriptors List'] - ['projects_time-series-create.md', 'Projects', 'Time Series Create'] - ['projects_time-series-list.md', 'Projects', 'Time Series List'] +- ['projects_uptime-check-configs-create.md', 'Projects', 'Uptime Check Configs Create'] +- ['projects_uptime-check-configs-delete.md', 'Projects', 'Uptime Check Configs Delete'] +- ['projects_uptime-check-configs-get.md', 'Projects', 'Uptime Check Configs Get'] +- ['projects_uptime-check-configs-list.md', 'Projects', 'Uptime Check Configs List'] +- ['projects_uptime-check-configs-patch.md', 'Projects', 'Uptime Check Configs Patch'] +- ['uptime-check-ips_list.md', 'Uptime Check Ips', 'List'] theme: readthedocs diff --git a/gen/monitoring3-cli/src/main.rs b/gen/monitoring3-cli/src/main.rs index 22b555c129..eac3fd60a1 100644 --- a/gen/monitoring3-cli/src/main.rs +++ b/gen/monitoring3-cli/src/main.rs @@ -1100,6 +1100,436 @@ impl<'n> Engine<'n> { } } + fn _projects_uptime_check_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()[..] { + "monitored-resource.labels" => Some(("monitoredResource.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "monitored-resource.type" => Some(("monitoredResource.type", 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 })), + "is-internal" => Some(("isInternal", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tcp-check.port" => Some(("tcpCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "period" => Some(("period", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "selected-regions" => Some(("selectedRegions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource-group.resource-type" => Some(("resourceGroup.resourceType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-group.group-id" => Some(("resourceGroup.groupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-check.use-ssl" => Some(("httpCheck.useSsl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "http-check.headers" => Some(("httpCheck.headers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "http-check.auth-info.username" => Some(("httpCheck.authInfo.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-check.auth-info.password" => Some(("httpCheck.authInfo.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-check.mask-headers" => Some(("httpCheck.maskHeaders", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "http-check.path" => Some(("httpCheck.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-check.port" => Some(("httpCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "timeout" => Some(("timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-info", "display-name", "group-id", "headers", "http-check", "is-internal", "labels", "mask-headers", "monitored-resource", "name", "password", "path", "period", "port", "resource-group", "resource-type", "selected-regions", "tcp-check", "timeout", "type", "use-ssl", "username"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UptimeCheckConfig = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().uptime_check_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 { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_uptime_check_configs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().uptime_check_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_uptime_check_configs_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().uptime_check_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_uptime_check_configs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().uptime_check_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_uptime_check_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()[..] { + "monitored-resource.labels" => Some(("monitoredResource.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "monitored-resource.type" => Some(("monitoredResource.type", 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 })), + "is-internal" => Some(("isInternal", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tcp-check.port" => Some(("tcpCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "period" => Some(("period", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "selected-regions" => Some(("selectedRegions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource-group.resource-type" => Some(("resourceGroup.resourceType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-group.group-id" => Some(("resourceGroup.groupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-check.use-ssl" => Some(("httpCheck.useSsl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "http-check.headers" => Some(("httpCheck.headers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "http-check.auth-info.username" => Some(("httpCheck.authInfo.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-check.auth-info.password" => Some(("httpCheck.authInfo.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-check.mask-headers" => Some(("httpCheck.maskHeaders", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "http-check.path" => Some(("httpCheck.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-check.port" => Some(("httpCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "timeout" => Some(("timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-info", "display-name", "group-id", "headers", "http-check", "is-internal", "labels", "mask-headers", "monitored-resource", "name", "password", "path", "period", "port", "resource-group", "resource-type", "selected-regions", "tcp-check", "timeout", "type", "use-ssl", "username"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UptimeCheckConfig = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().uptime_check_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("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + 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 _uptime_check_ips_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.uptime_check_ips().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); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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(()); @@ -1152,12 +1582,38 @@ impl<'n> Engine<'n> { ("time-series-list", Some(opt)) => { call_result = self._projects_time_series_list(opt, dry_run, &mut err); }, + ("uptime-check-configs-create", Some(opt)) => { + call_result = self._projects_uptime_check_configs_create(opt, dry_run, &mut err); + }, + ("uptime-check-configs-delete", Some(opt)) => { + call_result = self._projects_uptime_check_configs_delete(opt, dry_run, &mut err); + }, + ("uptime-check-configs-get", Some(opt)) => { + call_result = self._projects_uptime_check_configs_get(opt, dry_run, &mut err); + }, + ("uptime-check-configs-list", Some(opt)) => { + call_result = self._projects_uptime_check_configs_list(opt, dry_run, &mut err); + }, + ("uptime-check-configs-patch", Some(opt)) => { + call_result = self._projects_uptime_check_configs_patch(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("projects".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); } } }, + ("uptime-check-ips", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._uptime_check_ips_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("uptime-check-ips".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, _ => { err.issues.push(CLIError::MissingCommandError); writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); @@ -1244,7 +1700,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'collectd-time-series-create', 'groups-create', 'groups-delete', 'groups-get', 'groups-list', 'groups-members-list', 'groups-update', 'metric-descriptors-create', 'metric-descriptors-delete', 'metric-descriptors-get', 'metric-descriptors-list', 'monitored-resource-descriptors-get', 'monitored-resource-descriptors-list', 'time-series-create' and 'time-series-list'", vec![ + ("projects", "methods: 'collectd-time-series-create', 'groups-create', 'groups-delete', 'groups-get', 'groups-list', 'groups-members-list', 'groups-update', 'metric-descriptors-create', 'metric-descriptors-delete', 'metric-descriptors-get', 'metric-descriptors-list', 'monitored-resource-descriptors-get', 'monitored-resource-descriptors-list', 'time-series-create', 'time-series-list', 'uptime-check-configs-create', 'uptime-check-configs-delete', 'uptime-check-configs-get', 'uptime-check-configs-list' and 'uptime-check-configs-patch'", vec![ ("collectd-time-series-create", Some(r##"Stackdriver Monitoring Agent only: Creates a new time series."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_collectd-time-series-create", @@ -1599,6 +2055,147 @@ 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)), + ]), + ("uptime-check-configs-create", + Some(r##"Creates a new uptime check configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_uptime-check-configs-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The project in which to create the uptime check. The format is: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)), + ]), + ("uptime-check-configs-delete", + Some(r##"Deletes an uptime check configuration. Note that this method will fail if the uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_uptime-check-configs-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The uptime check configuration to delete. The format isprojects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_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)), + ]), + ("uptime-check-configs-get", + Some(r##"Gets a single uptime check configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_uptime-check-configs-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The uptime check configuration to retrieve. The format isprojects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_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)), + ]), + ("uptime-check-configs-list", + Some(r##"Lists the existing valid uptime check configurations for the project, leaving out any invalid configurations."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_uptime-check-configs-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The project whose uptime check configurations are listed. The format isprojects/[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)), + ]), + ("uptime-check-configs-patch", + Some(r##"Updates an uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via "updateMask". Returns the updated configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_uptime-check-configs-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"A unique resource name for this UptimeCheckConfig. The format is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field should be omitted when creating the uptime check configuration; on create, the resource name is assigned by the server and included in the response."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("uptime-check-ips", "methods: 'list'", vec![ + ("list", + Some(r##"Returns the list of IPs that checkers run from"##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/uptime-check-ips_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"##), @@ -1611,7 +2208,7 @@ fn main() { let mut app = App::new("monitoring3") .author("Sebastian Thiel ") - .version("1.0.6+20170918") + .version("1.0.6+20171204") .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 9254898f7c..887b5a1550 100644 --- a/gen/monitoring3/Cargo.toml +++ b/gen/monitoring3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-monitoring3" -version = "1.0.6+20170918" +version = "1.0.6+20171204" 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+20170918" +documentation = "https://docs.rs/google-monitoring3/1.0.6+20171204" license = "MIT" keywords = ["monitoring", "google", "protocol", "web", "api"] diff --git a/gen/monitoring3/README.md b/gen/monitoring3/README.md index d250d66afc..9e092429b2 100644 --- a/gen/monitoring3/README.md +++ b/gen/monitoring3/README.md @@ -5,16 +5,18 @@ 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+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*. +This documentation was generated from *Monitoring* crate version *1.0.6+20171204*, where *20171204* 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+20170918/google_monitoring3/struct.Monitoring.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.Monitoring.html) ... * projects - * [*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) + * [*collectd time series create*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectCollectdTimeSeryCreateCall.html), [*groups create*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectGroupCreateCall.html), [*groups delete*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectGroupDeleteCall.html), [*groups get*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectGroupGetCall.html), [*groups list*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectGroupListCall.html), [*groups members list*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectGroupMemberListCall.html), [*groups update*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectGroupUpdateCall.html), [*metric descriptors create*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectMetricDescriptorCreateCall.html), [*metric descriptors delete*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectMetricDescriptorDeleteCall.html), [*metric descriptors get*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectMetricDescriptorGetCall.html), [*metric descriptors list*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectMetricDescriptorListCall.html), [*monitored resource descriptors get*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectMonitoredResourceDescriptorGetCall.html), [*monitored resource descriptors list*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectMonitoredResourceDescriptorListCall.html), [*time series create*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectTimeSeryCreateCall.html), [*time series list*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectTimeSeryListCall.html), [*uptime check configs create*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectUptimeCheckConfigCreateCall.html), [*uptime check configs delete*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectUptimeCheckConfigDeleteCall.html), [*uptime check configs get*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectUptimeCheckConfigGetCall.html), [*uptime check configs list*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectUptimeCheckConfigListCall.html) and [*uptime check configs patch*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.ProjectUptimeCheckConfigPatchCall.html) +* [uptime check ips](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.UptimeCheckIp.html) + * [*list*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/struct.UptimeCheckIpListCall.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-monitoring3/1.0.6+20170918/google_monitoring3/struct.Monitoring.html)** +* **[Hub](https://docs.rs/google-monitoring3/1.0.6+20171204/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+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)** + * creates [*Method Builders*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-monitoring3/1.0.6+20171204/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+20170918/google_monitoring3/trait.Part.html)** + * **[Parts](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-monitoring3/1.0.6+20170918/google_monitoring3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-monitoring3/1.0.6+20171204/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,9 +49,10 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.projects().groups_update(...).doit() -let r = hub.projects().groups_create(...).doit() -let r = hub.projects().groups_get(...).doit() +let r = hub.projects().uptime_check_configs_delete(...).doit() +let r = hub.projects().time_series_create(...).doit() +let r = hub.projects().groups_delete(...).doit() +let r = hub.projects().metric_descriptors_delete(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -75,7 +78,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_monitoring3 as monitoring3; -use monitoring3::Group; +use monitoring3::CreateTimeSeriesRequest; use monitoring3::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -96,13 +99,12 @@ 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 = Group::default(); +let mut req = CreateTimeSeriesRequest::default(); // You can configure optional parameters by calling the 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(true) +let result = hub.projects().time_series_create(req, "name") .doit(); match result { @@ -125,17 +127,17 @@ match result { ``` ## Handling Errors -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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-monitoring3/1.0.6+20171204/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+20170918/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+20171204/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+20170918/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+20171204/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+20170918/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+20171204/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 +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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-monitoring3/1.0.6+20171204/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+20170918/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+20171204/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-monitoring3/1.0.6+20171204/google_monitoring3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-monitoring3/1.0.6+20171204/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+20170918/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+20171204/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+20170918/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+20171204/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+20170918/google_monitoring3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-monitoring3/1.0.6+20171204/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 a23f47b9b5..e48386e69b 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+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*. +//! This documentation was generated from *Monitoring* crate version *1.0.6+20171204*, where *20171204* 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/). @@ -12,7 +12,9 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Monitoring.html) ... //! //! * projects -//! * [*collectd time series create*](struct.ProjectCollectdTimeSeryCreateCall.html), [*groups create*](struct.ProjectGroupCreateCall.html), [*groups delete*](struct.ProjectGroupDeleteCall.html), [*groups get*](struct.ProjectGroupGetCall.html), [*groups list*](struct.ProjectGroupListCall.html), [*groups members list*](struct.ProjectGroupMemberListCall.html), [*groups update*](struct.ProjectGroupUpdateCall.html), [*metric descriptors create*](struct.ProjectMetricDescriptorCreateCall.html), [*metric descriptors delete*](struct.ProjectMetricDescriptorDeleteCall.html), [*metric descriptors get*](struct.ProjectMetricDescriptorGetCall.html), [*metric descriptors list*](struct.ProjectMetricDescriptorListCall.html), [*monitored resource descriptors get*](struct.ProjectMonitoredResourceDescriptorGetCall.html), [*monitored resource descriptors list*](struct.ProjectMonitoredResourceDescriptorListCall.html), [*time series create*](struct.ProjectTimeSeryCreateCall.html) and [*time series list*](struct.ProjectTimeSeryListCall.html) +//! * [*collectd time series create*](struct.ProjectCollectdTimeSeryCreateCall.html), [*groups create*](struct.ProjectGroupCreateCall.html), [*groups delete*](struct.ProjectGroupDeleteCall.html), [*groups get*](struct.ProjectGroupGetCall.html), [*groups list*](struct.ProjectGroupListCall.html), [*groups members list*](struct.ProjectGroupMemberListCall.html), [*groups update*](struct.ProjectGroupUpdateCall.html), [*metric descriptors create*](struct.ProjectMetricDescriptorCreateCall.html), [*metric descriptors delete*](struct.ProjectMetricDescriptorDeleteCall.html), [*metric descriptors get*](struct.ProjectMetricDescriptorGetCall.html), [*metric descriptors list*](struct.ProjectMetricDescriptorListCall.html), [*monitored resource descriptors get*](struct.ProjectMonitoredResourceDescriptorGetCall.html), [*monitored resource descriptors list*](struct.ProjectMonitoredResourceDescriptorListCall.html), [*time series create*](struct.ProjectTimeSeryCreateCall.html), [*time series list*](struct.ProjectTimeSeryListCall.html), [*uptime check configs create*](struct.ProjectUptimeCheckConfigCreateCall.html), [*uptime check configs delete*](struct.ProjectUptimeCheckConfigDeleteCall.html), [*uptime check configs get*](struct.ProjectUptimeCheckConfigGetCall.html), [*uptime check configs list*](struct.ProjectUptimeCheckConfigListCall.html) and [*uptime check configs patch*](struct.ProjectUptimeCheckConfigPatchCall.html) +//! * [uptime check ips](struct.UptimeCheckIp.html) +//! * [*list*](struct.UptimeCheckIpListCall.html) //! //! //! @@ -47,9 +49,10 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.projects().groups_update(...).doit() -//! let r = hub.projects().groups_create(...).doit() -//! let r = hub.projects().groups_get(...).doit() +//! let r = hub.projects().uptime_check_configs_delete(...).doit() +//! let r = hub.projects().time_series_create(...).doit() +//! let r = hub.projects().groups_delete(...).doit() +//! let r = hub.projects().metric_descriptors_delete(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -75,7 +78,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_monitoring3 as monitoring3; -//! use monitoring3::Group; +//! use monitoring3::CreateTimeSeriesRequest; //! use monitoring3::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -97,13 +100,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 = Group::default(); +//! let mut req = CreateTimeSeriesRequest::default(); //! //! // You can configure optional parameters by calling the 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(true) +//! let result = hub.projects().time_series_create(req, "name") //! .doit(); //! //! match result { @@ -273,7 +275,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_monitoring3 as monitoring3; -/// use monitoring3::Group; +/// use monitoring3::CreateTimeSeriesRequest; /// use monitoring3::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -295,13 +297,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 = Group::default(); +/// let mut req = CreateTimeSeriesRequest::default(); /// /// // You can configure optional parameters by calling the 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(true) +/// let result = hub.projects().time_series_create(req, "name") /// .doit(); /// /// match result { @@ -348,6 +349,9 @@ impl<'a, C, A> Monitoring pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { ProjectMethods { hub: &self } } + pub fn uptime_check_ips(&'a self) -> UptimeCheckIpMethods<'a, C, A> { + UptimeCheckIpMethods { 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`. @@ -411,12 +415,12 @@ impl ResponseResult for ListMetricDescriptorsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListGroupMembersResponse { - /// 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, + /// The total number of elements matching this request. + #[serde(rename="totalSize")] + pub total_size: Option, /// A set of monitored resources in the group. pub members: Option>, } @@ -456,6 +460,28 @@ impl RequestValue for Group {} impl ResponseResult for Group {} +/// The protocol for the ListUptimeCheckConfigs 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*). +/// +/// * [uptime check configs list projects](struct.ProjectUptimeCheckConfigListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListUptimeCheckConfigsResponse { + /// This field represents the pagination token to retrieve the next page of results. If the value is empty, it means no further results for the request. To retrieve the next page of results, the value of the next_page_token is passed to the subsequent List method call (in the request message's page_token field). + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The returned uptime check configurations. + #[serde(rename="uptimeCheckConfigs")] + pub uptime_check_configs: Option>, +} + +impl ResponseResult for ListUptimeCheckConfigsResponse {} + + /// 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. @@ -513,6 +539,58 @@ pub struct CollectdValue { impl Part for CollectdValue {} +/// This message configures which resources and services to monitor for availability. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [uptime check configs create projects](struct.ProjectUptimeCheckConfigCreateCall.html) (request|response) +/// * [uptime check configs get projects](struct.ProjectUptimeCheckConfigGetCall.html) (response) +/// * [uptime check configs patch projects](struct.ProjectUptimeCheckConfigPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UptimeCheckConfig { + /// The group resource associated with the configuration. + #[serde(rename="resourceGroup")] + pub resource_group: Option, + /// A human-friendly name for the uptime check configuration. The display name should be unique within a Stackdriver Account in order to make it easier to identify; however, uniqueness is not enforced. Required. + #[serde(rename="displayName")] + pub display_name: Option, + /// A unique resource name for this UptimeCheckConfig. The format is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field should be omitted when creating the uptime check configuration; on create, the resource name is assigned by the server and included in the response. + pub name: Option, + /// Denotes whether this check is a check that egresses from InternalCheckers. + #[serde(rename="isInternal")] + pub is_internal: Option, + /// Contains information needed to make a TCP check. + #[serde(rename="tcpCheck")] + pub tcp_check: Option, + /// How often the uptime check is performed. Currently, only 1, 5, 10, and 15 minutes are supported. Required. + pub period: Option, + /// The list of regions from which the check will be run. If this field is specified, enough regions to include a minimum of 3 locations must be provided, or an error message is returned. Not specifying this field will result in uptime checks running from all regions. + #[serde(rename="selectedRegions")] + pub selected_regions: Option>, + /// The monitored resource associated with the configuration. + #[serde(rename="monitoredResource")] + pub monitored_resource: Option, + /// Contains information needed to make an HTTP or HTTPS check. + #[serde(rename="httpCheck")] + pub http_check: Option, + /// The internal checkers that this check will egress from. If is_internal is true and this list is empty, the check will egress from all InternalCheckers configured for the project that owns this CheckConfig. + #[serde(rename="internalCheckers")] + pub internal_checkers: Option>, + /// The maximum amount of time to wait for the request to complete (must be between 1 and 60 seconds). Required. + pub timeout: Option, + /// The expected content on the page the check is run against. Currently, only the first entry in the list is supported, and other entries will be ignored. The server will look for an exact match of the string in the page response's content. This field is optional and should only be specified if a content match is required. + #[serde(rename="contentMatchers")] + pub content_matchers: Option>, +} + +impl RequestValue for UptimeCheckConfig {} +impl ResponseResult for UptimeCheckConfig {} + + /// 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); @@ -524,9 +602,10 @@ impl Part for CollectdValue {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [metric descriptors delete projects](struct.ProjectMetricDescriptorDeleteCall.html) (response) +/// * [uptime check configs delete projects](struct.ProjectUptimeCheckConfigDeleteCall.html) (response) /// * [time series create projects](struct.ProjectTimeSeryCreateCall.html) (response) /// * [groups delete projects](struct.ProjectGroupDeleteCall.html) (response) +/// * [metric descriptors delete projects](struct.ProjectMetricDescriptorDeleteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } @@ -534,6 +613,19 @@ pub struct Empty { _never_set: Option } impl ResponseResult for Empty {} +/// Used to perform string matching. Currently, this matches on the exact content. In the future, it can be expanded to allow for regular expressions and more complex matching. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ContentMatcher { + /// String content to match + pub content: Option, +} + +impl Part for ContentMatcher {} + + /// 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: @@ -558,24 +650,6 @@ pub struct Status { 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)). -/// -/// 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. /// /// # Activities @@ -588,7 +662,7 @@ impl Part for Linear {} /// #[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". + /// A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota. #[serde(rename="displayName")] pub display_name: Option, /// A detailed description of the metric, which can be used in documentation. @@ -607,50 +681,9 @@ pub struct MetricDescriptor { /// #[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 '}'. + /// Optional. The unit in which the metric value is reported. For example, kBy/s means kilobytes/sec, and 1 is the dimensionless unit. The supported units are a subset of The Unified Code for Units of Measure standard (http://unitsofmeasure.org/ucum.html).

This field is part of the metric's documentation, but it is ignored by Stackdriver. 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" - /// + /// The resource name of the metric descriptor. pub name: Option, } @@ -723,6 +756,28 @@ pub struct CreateCollectdTimeSeriesRequest { impl RequestValue for CreateCollectdTimeSeriesRequest {} +/// 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 {} + + /// 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 @@ -845,6 +900,42 @@ pub struct CollectdPayload { impl Part for CollectdPayload {} +/// Contains the region, location, and list of IP addresses where checkers in the location run from. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 uptime check ips](struct.UptimeCheckIpListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UptimeCheckIp { + /// A broad region category in which the IP address is located. + pub region: Option, + /// The IP address from which the uptime check originates. This is a full IP address (not an IP address range). Most IP addresses, as of this publication, are in IPv4 format; however, one should not rely on the IP addresses being in IPv4 format indefinitely and should support interpreting this field in either IPv4 or IPv6 format. + #[serde(rename="ipAddress")] + pub ip_address: Option, + /// A more specific location within the region that typically encodes a particular city/town/metro (and its containing state/province or country) within the broader umbrella region category. + pub location: Option, +} + +impl Resource for UptimeCheckIp {} + + +/// Information required for a TCP uptime check 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 TcpCheck { + /// The port to the page to run the check against. Will be combined with host (specified within the MonitoredResource) to construct the full URL. Required. + pub port: Option, +} + +impl Part for TcpCheck {} + + /// 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. @@ -858,6 +949,67 @@ pub struct Explicit { impl Part for Explicit {} +/// 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 {} + + +/// The resource submessage for group checks. It can be used instead of a monitored resource, when multiple resources are being monitored. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceGroup { + /// The resource type of the group members. + #[serde(rename="resourceType")] + pub resource_type: Option, + /// The group of resources being monitored. Should be only the group_id, not projects//groups/. + #[serde(rename="groupId")] + pub group_id: Option, +} + +impl Part for ResourceGroup {} + + +/// Information involved in an HTTP/HTTPS uptime check 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 HttpCheck { + /// The list of headers to send as part of the uptime check request. If two headers have the same key and different values, they should be entered as a single header, with the value being a comma-separated list of all the desired values as described at https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). Entering two separate headers with the same key in a Create call will cause the first to be overwritten by the second. + pub headers: Option>, + /// The authentication information. Optional when creating an HTTP check; defaults to empty. + #[serde(rename="authInfo")] + pub auth_info: Option, + /// If true, use HTTPS instead of HTTP to run the check. + #[serde(rename="useSsl")] + pub use_ssl: Option, + /// Boolean specifiying whether to encrypt the header information. Encryption should be specified for any headers related to authentication that you do not wish to be seen when retrieving the configuration. The server will be responsible for encrypting the headers. On Get/List calls, if mask_headers is set to True then the headers will be obscured with ******. + #[serde(rename="maskHeaders")] + pub mask_headers: Option, + /// The path to the page to run the check against. Will be combined with the host (specified within the MonitoredResource) and port to construct the full URL. Optional (defaults to "/"). + pub path: Option, + /// The port to the page to run the check against. Will be combined with host (specified within the MonitoredResource) and path to construct the full URL. Optional (defaults to 80 without SSL, or 443 with SSL). + pub port: Option, +} + +impl Part for HttpCheck {} + + /// The range of the population values. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -901,15 +1053,15 @@ 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 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, /// 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, + /// The associated metric. A fully-specified metric used to identify the time series. + pub metric: Option, } impl Part for TimeSeries {} @@ -943,6 +1095,21 @@ pub struct Distribution { impl Part for Distribution {} +/// A type of authentication to perform against the specified resource or URL that uses username and password. Currently, only Basic authentication is supported in Uptime Monitoring. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BasicAuthentication { + /// The username to authenticate. + pub username: Option, + /// The password to authenticate. + pub password: Option, +} + +impl Part for BasicAuthentication {} + + /// A description of a label. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -961,26 +1128,29 @@ pub struct LabelDescriptor { impl Part for LabelDescriptor {} -/// The ListTimeSeries response. +/// Nimbus InternalCheckers. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 InternalChecker { + /// The GCP project ID. Not necessarily the same as the project_id for the config. + #[serde(rename="projectId")] + pub project_id: Option, + /// The GCP zone the uptime check should egress from. Only respected for internal uptime checks, where internal_network is specified. + #[serde(rename="gcpZone")] + pub gcp_zone: Option, + /// The checker's human-readable name. + #[serde(rename="displayName")] + pub display_name: Option, + /// The internal network to perform this uptime check on. + pub network: Option, + /// The checker ID. + #[serde(rename="checkerId")] + pub checker_id: Option, } -impl ResponseResult for ListTimeSeriesResponse {} +impl Part for InternalChecker {} /// Describes the error status for values that were not written. @@ -1051,6 +1221,28 @@ pub struct ListMonitoredResourceDescriptorsResponse { impl ResponseResult for ListMonitoredResourceDescriptorsResponse {} +/// The protocol for the ListUptimeCheckIps 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 uptime check ips](struct.UptimeCheckIpListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListUptimeCheckIpsResponse { + /// The returned list of IP addresses (including region and location) that the checkers run from. + #[serde(rename="uptimeCheckIps")] + pub uptime_check_ips: Option>, + /// This field represents the pagination token to retrieve the next page of results. If the value is empty, it means no further results for the request. To retrieve the next page of results, the value of the next_page_token is passed to the subsequent List method call (in the request message's page_token field). NOTE: this field is not yet implemented + #[serde(rename="nextPageToken")] + pub next_page_token: Option, +} + +impl ResponseResult for ListUptimeCheckIpsResponse {} + + /// The CreateTimeSeries request. /// /// # Activities @@ -1075,6 +1267,62 @@ impl RequestValue for CreateTimeSeriesRequest {} // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *uptimeCheckIp* resources. +/// It is not used directly, but through the `Monitoring` 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_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); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.uptime_check_ips(); +/// # } +/// ``` +pub struct UptimeCheckIpMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, +} + +impl<'a, C, A> MethodsBuilder for UptimeCheckIpMethods<'a, C, A> {} + +impl<'a, C, A> UptimeCheckIpMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of IPs that checkers run from + pub fn list(&self) -> UptimeCheckIpListCall<'a, C, A> { + UptimeCheckIpListCall { + 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 `Monitoring` hub. /// @@ -1099,7 +1347,7 @@ impl RequestValue for CreateTimeSeriesRequest {} /// ::default(), None); /// let mut hub = Monitoring::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 `collectd_time_series_create(...)`, `groups_create(...)`, `groups_delete(...)`, `groups_get(...)`, `groups_list(...)`, `groups_members_list(...)`, `groups_update(...)`, `metric_descriptors_create(...)`, `metric_descriptors_delete(...)`, `metric_descriptors_get(...)`, `metric_descriptors_list(...)`, `monitored_resource_descriptors_get(...)`, `monitored_resource_descriptors_list(...)`, `time_series_create(...)` and `time_series_list(...)` +/// // like `collectd_time_series_create(...)`, `groups_create(...)`, `groups_delete(...)`, `groups_get(...)`, `groups_list(...)`, `groups_members_list(...)`, `groups_update(...)`, `metric_descriptors_create(...)`, `metric_descriptors_delete(...)`, `metric_descriptors_get(...)`, `metric_descriptors_list(...)`, `monitored_resource_descriptors_get(...)`, `monitored_resource_descriptors_list(...)`, `time_series_create(...)`, `time_series_list(...)`, `uptime_check_configs_create(...)`, `uptime_check_configs_delete(...)`, `uptime_check_configs_get(...)`, `uptime_check_configs_list(...)` and `uptime_check_configs_patch(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1114,6 +1362,25 @@ 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: + /// + /// Creates a new uptime check configuration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The project in which to create the uptime check. The format is:projects/[PROJECT_ID]. + pub fn uptime_check_configs_create(&self, request: UptimeCheckConfig, parent: &str) -> ProjectUptimeCheckConfigCreateCall<'a, C, A> { + ProjectUptimeCheckConfigCreateCall { + 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 metric descriptor. Only user-created custom metrics can be deleted. @@ -1168,6 +1435,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists metric descriptors that match a filter. This method does not require a Stackdriver account. + /// + /// # Arguments + /// + /// * `name` - The project on which to execute the request. The format is "projects/{project_id_or_number}". + pub fn metric_descriptors_list(&self, name: &str) -> ProjectMetricDescriptorListCall<'a, C, A> { + ProjectMetricDescriptorListCall { + 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 a single metric descriptor. This method does not require a Stackdriver account. @@ -1185,6 +1472,51 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes an uptime check configuration. Note that this method will fail if the uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion. + /// + /// # Arguments + /// + /// * `name` - The uptime check configuration to delete. The format isprojects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]. + pub fn uptime_check_configs_delete(&self, name: &str) -> ProjectUptimeCheckConfigDeleteCall<'a, C, A> { + ProjectUptimeCheckConfigDeleteCall { + 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 time series that match a filter. This method does not require a Stackdriver account. + /// + /// # 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 { + 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(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Stackdriver Monitoring Agent only: Creates a new time series. @@ -1228,18 +1560,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(), @@ -1286,26 +1618,15 @@ 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. + /// Deletes an existing group. /// /// # 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 group to delete. The format is "projects/{project_id_or_number}/groups/{group_id}". + pub fn groups_delete(&self, name: &str) -> ProjectGroupDeleteCall<'a, C, A> { + ProjectGroupDeleteCall { 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(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1314,18 +1635,17 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists metric descriptors that match a filter. This method does not require a Stackdriver account. + /// Lists the existing valid uptime check configurations for the project, leaving out any invalid configurations. /// /// # Arguments /// - /// * `name` - The project on which to execute the request. The format is "projects/{project_id_or_number}". - pub fn metric_descriptors_list(&self, name: &str) -> ProjectMetricDescriptorListCall<'a, C, A> { - ProjectMetricDescriptorListCall { + /// * `parent` - The project whose uptime check configurations are listed. The format isprojects/[PROJECT_ID]. + pub fn uptime_check_configs_list(&self, parent: &str) -> ProjectUptimeCheckConfigListCall<'a, C, A> { + ProjectUptimeCheckConfigListCall { hub: self.hub, - _name: name.to_string(), + _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(), @@ -1351,18 +1671,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(), @@ -1371,13 +1691,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes an existing group. + /// Gets a single uptime check configuration. /// /// # Arguments /// - /// * `name` - The group to delete. The format is "projects/{project_id_or_number}/groups/{group_id}". - pub fn groups_delete(&self, name: &str) -> ProjectGroupDeleteCall<'a, C, A> { - ProjectGroupDeleteCall { + /// * `name` - The uptime check configuration to retrieve. The format isprojects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]. + pub fn uptime_check_configs_get(&self, name: &str) -> ProjectUptimeCheckConfigGetCall<'a, C, A> { + ProjectUptimeCheckConfigGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -1386,6 +1706,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates an uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via "updateMask". Returns the updated configuration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - A unique resource name for this UptimeCheckConfig. The format is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field should be omitted when creating the uptime check configuration; on create, the resource name is assigned by the server and included in the response. + pub fn uptime_check_configs_patch(&self, request: UptimeCheckConfig, name: &str) -> ProjectUptimeCheckConfigPatchCall<'a, C, A> { + ProjectUptimeCheckConfigPatchCall { + 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 existing groups. @@ -1417,6 +1757,530 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# +/// Returns the list of IPs that checkers run from +/// +/// A builder for the *list* method supported by a *uptimeCheckIp* resource. +/// It is not used directly, but through a `UptimeCheckIpMethods` instance. +/// +/// # Example +/// +/// Instantiate 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.uptime_check_ips().list() +/// .page_token("sed") +/// .page_size(-85) +/// .doit(); +/// # } +/// ``` +pub struct UptimeCheckIpListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UptimeCheckIpListCall<'a, C, A> {} + +impl<'a, C, A> UptimeCheckIpListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListUptimeCheckIpsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.uptimeCheckIps.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() + "v3/uptimeCheckIps"; + 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) + } + } + } + } + + + /// 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 more results from the previous method call. NOTE: this field is not yet implemented + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> UptimeCheckIpListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned. NOTE: this field is not yet implemented + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> UptimeCheckIpListCall<'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) -> UptimeCheckIpListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> UptimeCheckIpListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UptimeCheckIpListCall<'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 uptime check configuration. +/// +/// A builder for the *uptimeCheckConfigs.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_monitoring3 as monitoring3; +/// use monitoring3::UptimeCheckConfig; +/// # #[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 = UptimeCheckConfig::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().uptime_check_configs_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectUptimeCheckConfigCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _request: UptimeCheckConfig, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectUptimeCheckConfigCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectUptimeCheckConfigCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UptimeCheckConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.uptimeCheckConfigs.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() + "v3/{+parent}/uptimeCheckConfigs"; + 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: UptimeCheckConfig) -> ProjectUptimeCheckConfigCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The project in which to create the uptime check. The format is: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) -> ProjectUptimeCheckConfigCreateCall<'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) -> ProjectUptimeCheckConfigCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectUptimeCheckConfigCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectUptimeCheckConfigCreateCall<'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 metric descriptor. Only user-created custom metrics can be deleted. /// /// A builder for the *metricDescriptors.delete* method supported by a *project* resource. @@ -1625,17 +2489,17 @@ impl<'a, C, A> ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricDescriptorDeleteCall<'a, C, A> @@ -1921,17 +2785,17 @@ impl<'a, C, A> ProjectGroupCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGroupCreateCall<'a, C, A> @@ -2174,17 +3038,17 @@ impl<'a, C, A> ProjectGroupGetCall<'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) -> ProjectGroupGetCall<'a, C, A> @@ -2219,6 +3083,297 @@ impl<'a, C, A> ProjectGroupGetCall<'a, C, A> where C: BorrowMut, } +/// 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("erat") +/// .page_size(-35) +/// .filter("sea") +/// .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 metric descriptor. This method does not require a Stackdriver account. /// /// A builder for the *metricDescriptors.get* method supported by a *project* resource. @@ -2427,17 +3582,17 @@ impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricDescriptorGetCall<'a, C, A> @@ -2472,9 +3627,9 @@ impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMutThis method is only for use by the Stackdriver Monitoring Agent. Use projects.timeSeries.create instead. +/// Deletes an uptime check configuration. Note that this method will fail if the uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion. /// -/// A builder for the *collectdTimeSeries.create* method supported by a *project* resource. +/// A builder for the *uptimeCheckConfigs.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -2486,7 +3641,6 @@ impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorGetCall<'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 = CreateCollectdTimeSeriesRequest::default(); -/// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().collectd_time_series_create(req, "name") +/// let result = hub.projects().uptime_check_configs_delete("name") /// .doit(); /// # } /// ``` -pub struct ProjectCollectdTimeSeryCreateCall<'a, C, A> +pub struct ProjectUptimeCheckConfigDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Monitoring, - _request: CreateCollectdTimeSeriesRequest, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectCollectdTimeSeryCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectUptimeCheckConfigDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectUptimeCheckConfigDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, CreateCollectdTimeSeriesResponse)> { + 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}; @@ -2535,9 +3683,9 @@ impl<'a, C, A> ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "monitoring.projects.collectdTimeSeries.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "monitoring.projects.uptimeCheckConfigs.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) { @@ -2551,309 +3699,7 @@ impl<'a, C, A> ProjectCollectdTimeSeryCreateCall<'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)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).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: CreateCollectdTimeSeriesRequest) -> ProjectCollectdTimeSeryCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// The project in which to create the time series. 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) -> ProjectCollectdTimeSeryCreateCall<'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) -> ProjectCollectdTimeSeryCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not 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) -> ProjectCollectdTimeSeryCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectCollectdTimeSeryCreateCall<'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 monitored resources that are members of a group. -/// -/// A builder for the *groups.members.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_members_list("name") -/// .page_token("sea") -/// .page_size(-90) -/// .interval_start_time("dolores") -/// .interval_end_time("gubergren") -/// .filter("sadipscing") -/// .doit(); -/// # } -/// ``` -pub struct ProjectGroupMemberListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _name: String, - _page_token: Option, - _page_size: Option, - _interval_start_time: Option, - _interval_end_time: Option, - _filter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectGroupMemberListCall<'a, C, A> {} - -impl<'a, C, A> ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListGroupMembersResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.members.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._interval_start_time { - params.push(("interval.startTime", value.to_string())); - } - if let Some(value) = self._interval_end_time { - params.push(("interval.endTime", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "name", "pageToken", "pageSize", "interval.startTime", "interval.endTime", "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}/members"; + let mut url = self.hub._base_url.clone() + "v3/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2906,7 +3752,7 @@ impl<'a, C, A> ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut ProjectGroupMemberListCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectUptimeCheckConfigDeleteCall<'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) -> ProjectGroupMemberListCall<'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) -> ProjectGroupMemberListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// 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. - /// - /// Sets the *interval.start time* query property to the given value. - pub fn interval_start_time(mut self, new_value: &str) -> ProjectGroupMemberListCall<'a, C, A> { - self._interval_start_time = Some(new_value.to_string()); - self - } - /// Required. The end of the time interval. - /// - /// Sets the *interval.end time* query property to the given value. - pub fn interval_end_time(mut self, new_value: &str) -> ProjectGroupMemberListCall<'a, C, A> { - self._interval_end_time = Some(new_value.to_string()); - self - } - /// 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: - /// resource.type = "gce_instance" - /// - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectGroupMemberListCall<'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) -> ProjectGroupMemberListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectUptimeCheckConfigDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3026,20 +3835,20 @@ impl<'a, C, A> ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGroupMemberListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectUptimeCheckConfigDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -3059,871 +3868,7 @@ impl<'a, C, A> ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectGroupMemberListCall<'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 - /// - /// * *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) -> 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 - } -} - - -/// 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. -/// -/// A builder for the *timeSeries.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_monitoring3 as monitoring3; -/// use monitoring3::CreateTimeSeriesRequest; -/// # #[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 = CreateTimeSeriesRequest::default(); -/// -/// // You can configure optional parameters by calling the 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") -/// .doit(); -/// # } -/// ``` -pub struct ProjectTimeSeryCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _request: CreateTimeSeriesRequest, - _name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectTimeSeryCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectTimeSeryCreateCall<'a, C, 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.timeSeries.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() + "v3/{+name}/timeSeries"; - 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: CreateTimeSeriesRequest) -> ProjectTimeSeryCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// 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) -> ProjectTimeSeryCreateCall<'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) -> ProjectTimeSeryCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not 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) -> ProjectTimeSeryCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectTimeSeryCreateCall<'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 metric descriptor. User-created metric descriptors define custom metrics. -/// -/// A builder for the *metricDescriptors.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_monitoring3 as monitoring3; -/// use monitoring3::MetricDescriptor; -/// # #[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 = MetricDescriptor::default(); -/// -/// // You can configure optional parameters by calling the 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_create(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectMetricDescriptorCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _request: MetricDescriptor, - _name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectMetricDescriptorCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectMetricDescriptorCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, MetricDescriptor)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.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() + "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)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).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: MetricDescriptor) -> ProjectMetricDescriptorCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// 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) -> ProjectMetricDescriptorCreateCall<'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) -> ProjectMetricDescriptorCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not 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) -> ProjectMetricDescriptorCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectMetricDescriptorCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectUptimeCheckConfigDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -3963,17 +3908,17 @@ impl<'a, C, A> ProjectMetricDescriptorCreateCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTimeSeryListCall<'a, C, A> @@ -4326,9 +4271,9 @@ impl<'a, C, A> ProjectTimeSeryListCall<'a, C, A> where C: BorrowMutThis method is only for use by the Stackdriver Monitoring Agent. Use projects.timeSeries.create instead. /// -/// A builder for the *metricDescriptors.list* method supported by a *project* resource. +/// A builder for the *collectdTimeSeries.create* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -4340,6 +4285,7 @@ impl<'a, C, A> ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut 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()`. +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! /// // 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 mut req = CreateCollectdTimeSeriesRequest::default(); /// -/// # let secret: ApplicationSecret = Default::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") +/// let result = hub.projects().collectd_time_series_create(req, "name") /// .doit(); /// # } /// ``` -pub struct ProjectMonitoredResourceDescriptorGetCall<'a, C, A> +pub struct ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Monitoring, + _request: CreateCollectdTimeSeriesRequest, _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> CallBuilder for ProjectCollectdTimeSeryCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectCollectdTimeSeryCreateCall<'a, C, 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)> { + 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}; @@ -4673,9 +4334,9 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> where C: Borr 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())); + dlg.begin(MethodInfo { id: "monitoring.projects.collectdTimeSeries.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) { @@ -4689,7 +4350,309 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v3/{+name}"; + let mut url = self.hub._base_url.clone() + "v3/{+name}/collectdTimeSeries"; + 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: CreateCollectdTimeSeriesRequest) -> ProjectCollectdTimeSeryCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The project in which to create the time series. 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) -> ProjectCollectdTimeSeryCreateCall<'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) -> ProjectCollectdTimeSeryCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectCollectdTimeSeryCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectCollectdTimeSeryCreateCall<'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 monitored resources that are members of a group. +/// +/// A builder for the *groups.members.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_members_list("name") +/// .page_token("aliquyam") +/// .page_size(-9) +/// .interval_start_time("Lorem") +/// .interval_end_time("eos") +/// .filter("erat") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGroupMemberListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _page_token: Option, + _page_size: Option, + _interval_start_time: Option, + _interval_end_time: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGroupMemberListCall<'a, C, A> {} + +impl<'a, C, A> ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListGroupMembersResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.members.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._interval_start_time { + params.push(("interval.startTime", value.to_string())); + } + if let Some(value) = self._interval_end_time { + params.push(("interval.endTime", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "interval.startTime", "interval.endTime", "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}/members"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4795,23 +4758,60 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> where C: Borr } - /// 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. + /// The group whose members are listed. 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) -> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectGroupMemberListCall<'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) -> ProjectGroupMemberListCall<'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) -> ProjectGroupMemberListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// 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. + /// + /// Sets the *interval.start time* query property to the given value. + pub fn interval_start_time(mut self, new_value: &str) -> ProjectGroupMemberListCall<'a, C, A> { + self._interval_start_time = Some(new_value.to_string()); + self + } + /// Required. The end of the time interval. + /// + /// Sets the *interval.end time* query property to the given value. + pub fn interval_end_time(mut self, new_value: &str) -> ProjectGroupMemberListCall<'a, C, A> { + self._interval_end_time = Some(new_value.to_string()); + self + } + /// 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: + /// resource.type = "gce_instance" + /// + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectGroupMemberListCall<'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) -> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectGroupMemberListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4825,20 +4825,20 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorGetCall<'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) -> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectGroupMemberListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4858,7 +4858,7 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorGetCall<'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) -> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectGroupMemberListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -4898,9 +4898,9 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> where C: Borr /// // 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") +/// .page_token("dolor") +/// .page_size(-39) +/// .filter("elitr") /// .doit(); /// # } /// ``` @@ -5116,17 +5116,17 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'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) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> @@ -5161,6 +5161,574 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor } +/// 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. +/// +/// A builder for the *timeSeries.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_monitoring3 as monitoring3; +/// use monitoring3::CreateTimeSeriesRequest; +/// # #[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 = CreateTimeSeriesRequest::default(); +/// +/// // You can configure optional parameters by calling the 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") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTimeSeryCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _request: CreateTimeSeriesRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTimeSeryCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectTimeSeryCreateCall<'a, C, 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.timeSeries.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() + "v3/{+name}/timeSeries"; + 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: CreateTimeSeriesRequest) -> ProjectTimeSeryCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// 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) -> ProjectTimeSeryCreateCall<'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) -> ProjectTimeSeryCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectTimeSeryCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectTimeSeryCreateCall<'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 metric descriptor. User-created metric descriptors define custom metrics. +/// +/// A builder for the *metricDescriptors.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_monitoring3 as monitoring3; +/// use monitoring3::MetricDescriptor; +/// # #[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 = MetricDescriptor::default(); +/// +/// // You can configure optional parameters by calling the 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_create(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectMetricDescriptorCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _request: MetricDescriptor, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectMetricDescriptorCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectMetricDescriptorCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, MetricDescriptor)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.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() + "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)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: MetricDescriptor) -> ProjectMetricDescriptorCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// 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) -> ProjectMetricDescriptorCreateCall<'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) -> ProjectMetricDescriptorCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectMetricDescriptorCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectMetricDescriptorCreateCall<'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. @@ -5369,17 +5937,17 @@ impl<'a, C, A> ProjectGroupDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGroupDeleteCall<'a, C, A> @@ -5414,6 +5982,1381 @@ impl<'a, C, A> ProjectGroupDeleteCall<'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().uptime_check_configs_list("parent") +/// .page_token("dolore") +/// .page_size(-37) +/// .doit(); +/// # } +/// ``` +pub struct ProjectUptimeCheckConfigListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectUptimeCheckConfigListCall<'a, C, A> {} + +impl<'a, C, A> ProjectUptimeCheckConfigListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListUptimeCheckConfigsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.uptimeCheckConfigs.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() + "v3/{+parent}/uptimeCheckConfigs"; + 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 project whose uptime check configurations are listed. The format isprojects/[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) -> ProjectUptimeCheckConfigListCall<'a, C, A> { + self._parent = 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 more 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) -> ProjectUptimeCheckConfigListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectUptimeCheckConfigListCall<'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) -> ProjectUptimeCheckConfigListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectUptimeCheckConfigListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectUptimeCheckConfigListCall<'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 + } +} + + +/// Gets a single uptime check configuration. +/// +/// A builder for the *uptimeCheckConfigs.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().uptime_check_configs_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectUptimeCheckConfigGetCall<'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 ProjectUptimeCheckConfigGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectUptimeCheckConfigGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UptimeCheckConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.uptimeCheckConfigs.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 uptime check configuration to retrieve. The format isprojects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_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) -> ProjectUptimeCheckConfigGetCall<'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) -> ProjectUptimeCheckConfigGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectUptimeCheckConfigGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectUptimeCheckConfigGetCall<'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 uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via "updateMask". Returns the updated configuration. +/// +/// A builder for the *uptimeCheckConfigs.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_monitoring3 as monitoring3; +/// use monitoring3::UptimeCheckConfig; +/// # #[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 = UptimeCheckConfig::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().uptime_check_configs_patch(req, "name") +/// .update_mask("duo") +/// .doit(); +/// # } +/// ``` +pub struct ProjectUptimeCheckConfigPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _request: UptimeCheckConfig, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectUptimeCheckConfigPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectUptimeCheckConfigPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UptimeCheckConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.uptimeCheckConfigs.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() + "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::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: UptimeCheckConfig) -> ProjectUptimeCheckConfigPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// A unique resource name for this UptimeCheckConfig. The format is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field should be omitted when creating the uptime check configuration; on create, the resource name is assigned by the server and included in the response. + /// + /// 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) -> ProjectUptimeCheckConfigPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. If present, only the listed fields in the current uptime check configuration are updated with values from the new configuration. If this field is empty, then the current configuration is completely replaced with the new configuration. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectUptimeCheckConfigPatchCall<'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) -> ProjectUptimeCheckConfigPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectUptimeCheckConfigPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectUptimeCheckConfigPatchCall<'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. @@ -5442,10 +7385,10 @@ impl<'a, C, A> ProjectGroupDeleteCall<'a, C, A> where C: BorrowMut ProjectGroupListCall<'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) -> ProjectGroupListCall<'a, C, A> diff --git a/gen/oslogin1-cli/Cargo.toml b/gen/oslogin1-cli/Cargo.toml new file mode 100644 index 0000000000..431050f943 --- /dev/null +++ b/gen/oslogin1-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-cli" +version = "1.0.6+20171120" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud OS Login (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1-cli" +homepage = "https://cloud.google.com/compute/docs/oslogin/rest/" +documentation = "http://byron.github.io/google-apis-rs/google_oslogin1_cli" +license = "MIT" +keywords = ["oslogin", "google", "cli"] + +[[bin]] +name = "oslogin1" + +[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] +path = "../oslogin1" +version = "1.0.6+20171120" diff --git a/gen/oslogin1-cli/LICENSE.md b/gen/oslogin1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/oslogin1-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-cli/README.md b/gen/oslogin1-cli/README.md new file mode 100644 index 0000000000..20309f6add --- /dev/null +++ b/gen/oslogin1-cli/README.md @@ -0,0 +1,119 @@ + +The `oslogin1` 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-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1-cli). + +# Usage + +This documentation was generated from the *Cloud OS Login* API at revision *20171120*. The CLI is at version *1.0.6*. + +```bash +oslogin1 [options] + users + get-login-profile [-p ]... [-o ] + import-ssh-public-key (-r )... [-p ]... [-o ] + projects-delete [-p ]... [-o ] + ssh-public-keys-delete [-p ]... [-o ] + ssh-public-keys-get [-p ]... [-o ] + ssh-public-keys-patch (-r )... [-p ]... [-o ] + oslogin1 --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-`. 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-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-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 --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-cli/mkdocs.yml b/gen/oslogin1-cli/mkdocs.yml new file mode 100644 index 0000000000..5c1d40a3e0 --- /dev/null +++ b/gen/oslogin1-cli/mkdocs.yml @@ -0,0 +1,22 @@ +site_name: Cloud OS Login v1.0.6+20171120 +site_url: http://byron.github.io/google-apis-rs/google-oslogin1-cli +site_description: A complete library to interact with Cloud OS Login (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1-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_projects-delete.md', 'Users', 'Projects Delete'] +- ['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-cli/src/cmn.rs b/gen/oslogin1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/oslogin1-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-cli/src/main.rs b/gen/oslogin1-cli/src/main.rs new file mode 100644 index 0000000000..3372bc34e6 --- /dev/null +++ b/gen/oslogin1-cli/src/main.rs @@ -0,0 +1,812 @@ +// 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 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 { + "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 _users_projects_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().projects_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_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); + }, + ("projects-delete", Some(opt)) => { + call_result = self._users_projects_delete(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-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", + 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', 'projects-delete', '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_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_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)), + ]), + ("projects-delete", + Some(r##"Deletes a POSIX account."##), + "Details at http://byron.github.io/google-apis-rs/google_oslogin1_cli/users_projects-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"A reference to the POSIX account to update. POSIX accounts are identified + by the project ID they are associated with. A reference to the POSIX + account is in format `users/{user}/projects/{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)), + ]), + ("ssh-public-keys-delete", + Some(r##"Deletes an SSH public key."##), + "Details at http://byron.github.io/google-apis-rs/google_oslogin1_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_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_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") + .author("Sebastian Thiel ") + .version("1.0.6+20171120") + .about("Manages OS login configuration for Google account users.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_oslogin1_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/Cargo.toml b/gen/oslogin1/Cargo.toml new file mode 100644 index 0000000000..5354260b7e --- /dev/null +++ b/gen/oslogin1/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" +version = "1.0.6+20171120" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud OS Login (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1" +homepage = "https://cloud.google.com/compute/docs/oslogin/rest/" +documentation = "https://docs.rs/google-oslogin1/1.0.6+20171120" +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/LICENSE.md b/gen/oslogin1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/oslogin1/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/README.md b/gen/oslogin1/README.md new file mode 100644 index 0000000000..f04a50fff1 --- /dev/null +++ b/gen/oslogin1/README.md @@ -0,0 +1,183 @@ + +The `google-oslogin1` 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+20171120*, where *20171120* is the exact revision of the *oslogin:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Cloud OS Login* *v1* 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/1.0.6+20171120/google_oslogin1/struct.CloudOSLogin.html) ... + +* users + * [*get login profile*](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/struct.UserGetLoginProfileCall.html), [*import ssh public key*](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/struct.UserImportSshPublicKeyCall.html), [*projects delete*](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/struct.UserProjectDeleteCall.html), [*ssh public keys delete*](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/struct.UserSshPublicKeyDeleteCall.html), [*ssh public keys get*](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/struct.UserSshPublicKeyGetCall.html) and [*ssh public keys patch*](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/struct.UserSshPublicKeyPatchCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/struct.CloudOSLogin.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/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 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_oslogin1 as oslogin1; +use oslogin1::SshPublicKey; +use oslogin1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use oslogin1::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/1.0.6+20171120/google_oslogin1/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/1.0.6+20171120/google_oslogin1/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/1.0.6+20171120/google_oslogin1/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/1.0.6+20171120/google_oslogin1/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/1.0.6+20171120/google_oslogin1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/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/1.0.6+20171120/google_oslogin1/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/1.0.6+20171120/google_oslogin1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-oslogin1/1.0.6+20171120/google_oslogin1/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/1.0.6+20171120/google_oslogin1/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/1.0.6+20171120/google_oslogin1/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/1.0.6+20171120/google_oslogin1/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** 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/src/cmn.rs b/gen/oslogin1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/oslogin1/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/src/lib.rs b/gen/oslogin1/src/lib.rs new file mode 100644 index 0000000000..ec786dc145 --- /dev/null +++ b/gen/oslogin1/src/lib.rs @@ -0,0 +1,2293 @@ +// 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+20171120*, where *20171120* is the exact revision of the *oslogin:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Cloud OS Login* *v1* 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). +//! # 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), [*projects delete*](struct.UserProjectDeleteCall.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 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_oslogin1 as oslogin1; +//! use oslogin1::SshPublicKey; +//! use oslogin1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use oslogin1::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, +} + +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", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Compute + } +} + + + +// ######## +// 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 as oslogin1; +/// use oslogin1::SshPublicKey; +/// use oslogin1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use oslogin1::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 POSIX account information associated with a Google account. +/// +/// 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, + /// Output only. A POSIX account identifier. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl Part for PosixAccount {} + + +/// 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 {} + + +/// 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) +/// * [projects delete users](struct.UserProjectDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// The SSH public key information associated with a Google 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*). +/// +/// * [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, + /// Output only. The SHA-256 fingerprint of the SSH public key. + pub fingerprint: Option, +} + +impl RequestValue for SshPublicKey {} +impl ResponseResult for SshPublicKey {} + + +/// 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 {} + + + +// ################### +// 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 as oslogin1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use oslogin1::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(...)`, `projects_delete(...)`, `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: + /// + /// Deletes a POSIX account. + /// + /// # Arguments + /// + /// * `name` - A reference to the POSIX account to update. POSIX accounts are identified + /// by the project ID they are associated with. A reference to the POSIX + /// account is in format `users/{user}/projects/{project}`. + pub fn projects_delete(&self, name: &str) -> UserProjectDeleteCall<'a, C, A> { + UserProjectDeleteCall { + 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: + /// + /// 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(), + _project_id: Default::default(), + _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(), + } + } + + /// 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(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Deletes a POSIX account. +/// +/// A builder for the *projects.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 as oslogin1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use oslogin1::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().projects_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct UserProjectDeleteCall<'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 UserProjectDeleteCall<'a, C, A> {} + +impl<'a, C, A> UserProjectDeleteCall<'a, C, 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.projects.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) + } + } + } + } + + + /// A reference to the POSIX account to update. POSIX accounts are identified + /// by the project ID they are associated with. A reference to the POSIX + /// account is in format `users/{user}/projects/{project}`. + /// + /// 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) -> UserProjectDeleteCall<'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) -> UserProjectDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> UserProjectDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserProjectDeleteCall<'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 as oslogin1; +/// use oslogin1::SshPublicKey; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use oslogin1::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") +/// .project_id("takimata") +/// .doit(); +/// # } +/// ``` +pub struct UserImportSshPublicKeyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudOSLogin, + _request: SshPublicKey, + _parent: String, + _project_id: Option, + _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((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._project_id { + params.push(("projectId", value.to_string())); + } + for &field in ["alt", "parent", "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/{+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 project ID of the Google Cloud Platform project. + /// + /// Sets the *project id* query property to the given value. + pub fn project_id(mut self, new_value: &str) -> UserImportSshPublicKeyCall<'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) -> 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 as oslogin1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use oslogin1::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() + "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 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 as oslogin1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use oslogin1::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() + "v1/{+name}/loginProfile"; + 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 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::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing 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 as oslogin1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use oslogin1::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() + "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 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 + } +} + + +/// 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 as oslogin1; +/// use oslogin1::SshPublicKey; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use oslogin1::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("sea") +/// .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() + "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: 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 + } +} + + diff --git a/gen/oslogin1_beta-cli/Cargo.toml b/gen/oslogin1_beta-cli/Cargo.toml index 1ec7986bc4..3444269221 100644 --- a/gen/oslogin1_beta-cli/Cargo.toml +++ b/gen/oslogin1_beta-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-oslogin1_beta-cli" -version = "1.0.6+20170926" +version = "1.0.6+20171120" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-oslogin1_beta] path = "../oslogin1_beta" -version = "1.0.6+20170926" +version = "1.0.6+20171120" diff --git a/gen/oslogin1_beta-cli/README.md b/gen/oslogin1_beta-cli/README.md index 8ece7f7065..8d9e66550a 100644 --- a/gen/oslogin1_beta-cli/README.md +++ b/gen/oslogin1_beta-cli/README.md @@ -25,13 +25,14 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud OS Login* API at revision *20170926*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud OS Login* API at revision *20171120*. 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 ] + projects-delete [-p ]... [-o ] ssh-public-keys-delete [-p ]... [-o ] ssh-public-keys-get [-p ]... [-o ] ssh-public-keys-patch (-r )... [-p ]... [-o ] diff --git a/gen/oslogin1_beta-cli/mkdocs.yml b/gen/oslogin1_beta-cli/mkdocs.yml index 6ab2a67c71..144bc6ff34 100644 --- a/gen/oslogin1_beta-cli/mkdocs.yml +++ b/gen/oslogin1_beta-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud OS Login v1.0.6+20170926 +site_name: Cloud OS Login v1.0.6+20171120 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) @@ -11,6 +11,7 @@ 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_projects-delete.md', 'Users', 'Projects Delete'] - ['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'] diff --git a/gen/oslogin1_beta-cli/src/main.rs b/gen/oslogin1_beta-cli/src/main.rs index b7f8c57b93..5ffd948244 100644 --- a/gen/oslogin1_beta-cli/src/main.rs +++ b/gen/oslogin1_beta-cli/src/main.rs @@ -136,6 +136,62 @@ impl<'n> Engine<'n> { } 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 { + "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 _users_projects_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().projects_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 { @@ -393,6 +449,9 @@ impl<'n> Engine<'n> { ("import-ssh-public-key", Some(opt)) => { call_result = self._users_import_ssh_public_key(opt, dry_run, &mut err); }, + ("projects-delete", Some(opt)) => { + call_result = self._users_projects_delete(opt, dry_run, &mut err); + }, ("ssh-public-keys-delete", Some(opt)) => { call_result = self._users_ssh_public_keys_delete(opt, dry_run, &mut err); }, @@ -494,7 +553,7 @@ impl<'n> Engine<'n> { 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![ + ("users", "methods: 'get-login-profile', 'import-ssh-public-key', 'projects-delete', '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."##), @@ -542,6 +601,30 @@ 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)), + ]), + ("projects-delete", + Some(r##"Deletes a POSIX account."##), + "Details at http://byron.github.io/google-apis-rs/google_oslogin1_beta_cli/users_projects-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"A reference to the POSIX account to update. POSIX accounts are identified + by the project ID they are associated with. A reference to the POSIX + account is in format `users/{user}/projects/{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"##), @@ -633,8 +716,8 @@ fn main() { let mut app = App::new("oslogin1-beta") .author("Sebastian Thiel ") - .version("1.0.6+20170926") - .about("Manages OS login configuration for Directory API users.") + .version("1.0.6+20171120") + .about("Manages OS login configuration for Google account 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") diff --git a/gen/oslogin1_beta/Cargo.toml b/gen/oslogin1_beta/Cargo.toml index 8487d22d8b..06ac8fc894 100644 --- a/gen/oslogin1_beta/Cargo.toml +++ b/gen/oslogin1_beta/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-oslogin1_beta" -version = "1.0.6+20170926" +version = "1.0.6+20171120" 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" +documentation = "https://docs.rs/google-oslogin1_beta/1.0.6+20171120" license = "MIT" keywords = ["oslogin", "google", "protocol", "web", "api"] diff --git a/gen/oslogin1_beta/README.md b/gen/oslogin1_beta/README.md index 7b22c6b4f3..057378fce6 100644 --- a/gen/oslogin1_beta/README.md +++ b/gen/oslogin1_beta/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Cloud OS Login* crate version *1.0.6+20171120*, where *20171120* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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) + * [*get login profile*](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/google_oslogin1_beta/struct.UserGetLoginProfileCall.html), [*import ssh public key*](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/google_oslogin1_beta/struct.UserImportSshPublicKeyCall.html), [*projects delete*](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/google_oslogin1_beta/struct.UserProjectDeleteCall.html), [*ssh public keys delete*](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/google_oslogin1_beta/struct.UserSshPublicKeyDeleteCall.html), [*ssh public keys get*](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/google_oslogin1_beta/struct.UserSshPublicKeyGetCall.html) and [*ssh public keys patch*](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/google_oslogin1_beta/struct.UserSshPublicKeyPatchCall.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-oslogin1_beta/1.0.6+20170926/google_oslogin1_beta/struct.CloudOSLogin.html)** +* **[Hub](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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)** + * creates [*Method Builders*](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/google_oslogin1_beta/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/google_oslogin1_beta/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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)** + * **[Parts](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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)** +* **[Activities](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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. @@ -125,17 +125,17 @@ match result { ``` ## 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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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). +[Hub Delegate](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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. +If such a method also supports a [Response Result](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/google_oslogin1_beta/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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. +The [delegate trait](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/google_oslogin1_beta/trait.RequestValue.html) and +[decodable](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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 +Most optionals are are considered [Parts](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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. +Using [method builders](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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 +* [request values](https://docs.rs/google-oslogin1_beta/1.0.6+20171120/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. diff --git a/gen/oslogin1_beta/src/lib.rs b/gen/oslogin1_beta/src/lib.rs index a29b5a562e..fb526a3a36 100644 --- a/gen/oslogin1_beta/src/lib.rs +++ b/gen/oslogin1_beta/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 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*. +//! This documentation was generated from *Cloud OS Login* crate version *1.0.6+20171120*, where *20171120* 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/). @@ -12,7 +12,7 @@ //! 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) +//! * [*get login profile*](struct.UserGetLoginProfileCall.html), [*import ssh public key*](struct.UserImportSshPublicKeyCall.html), [*projects delete*](struct.UserProjectDeleteCall.html), [*ssh public keys delete*](struct.UserSshPublicKeyDeleteCall.html), [*ssh public keys get*](struct.UserSshPublicKeyGetCall.html) and [*ssh public keys patch*](struct.UserSshPublicKeyPatchCall.html) //! //! //! @@ -425,7 +425,7 @@ pub struct ImportSshPublicKeyResponse { impl ResponseResult for ImportSshPublicKeyResponse {} -/// The SSH public key information associated with a Directory API User. +/// The SSH public key information associated with a Google account. /// /// # Activities /// @@ -445,8 +445,7 @@ pub struct SshPublicKey { /// RFC4253 /// section 6.6. pub key: Option, - /// The SHA-256 fingerprint of the SSH public key. - /// Output only. + /// Output only. The SHA-256 fingerprint of the SSH public key. pub fingerprint: Option, } @@ -470,6 +469,7 @@ impl ResponseResult for SshPublicKey {} /// 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) +/// * [projects delete users](struct.UserProjectDeleteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } @@ -477,7 +477,7 @@ pub struct Empty { _never_set: Option } impl ResponseResult for Empty {} -/// The POSIX account information associated with a Directory API User. +/// The POSIX account information associated with a Google account. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -502,6 +502,9 @@ pub struct PosixAccount { pub home_directory: Option, /// The GECOS (user information) entry for this account. pub gecos: Option, + /// Output only. A POSIX account identifier. + #[serde(rename="accountId")] + pub account_id: Option, } impl Part for PosixAccount {} @@ -536,7 +539,7 @@ impl Part for PosixAccount {} /// ::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(...)` +/// // like `get_login_profile(...)`, `import_ssh_public_key(...)`, `projects_delete(...)`, `ssh_public_keys_delete(...)`, `ssh_public_keys_get(...)` and `ssh_public_keys_patch(...)` /// // to build up your call. /// let rb = hub.users(); /// # } @@ -553,21 +556,17 @@ 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. + /// Deletes a POSIX account. /// /// # 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 { + /// * `name` - A reference to the POSIX account to update. POSIX accounts are identified + /// by the project ID they are associated with. A reference to the POSIX + /// account is in format `users/{user}/projects/{project}`. + pub fn projects_delete(&self, name: &str) -> UserProjectDeleteCall<'a, C, A> { + UserProjectDeleteCall { hub: self.hub, - _request: request, _name: name.to_string(), - _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -589,6 +588,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { hub: self.hub, _request: request, _parent: parent.to_string(), + _project_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -650,6 +650,29 @@ impl<'a, C, A> UserMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// 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(), + } + } } @@ -660,10 +683,9 @@ impl<'a, C, A> UserMethods<'a, C, A> { // CallBuilders ### // ################# -/// Updates an SSH public key and returns the profile information. This method -/// supports patch semantics. +/// Deletes a POSIX account. /// -/// A builder for the *sshPublicKeys.patch* method supported by a *user* resource. +/// A builder for the *projects.delete* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. /// /// # Example @@ -675,7 +697,6 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// # 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}; @@ -686,38 +707,30 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// # 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") +/// let result = hub.users().projects_delete("name") /// .doit(); /// # } /// ``` -pub struct UserSshPublicKeyPatchCall<'a, C, A> +pub struct UserProjectDeleteCall<'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> CallBuilder for UserProjectDeleteCall<'a, C, A> {} -impl<'a, C, A> UserSshPublicKeyPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> UserProjectDeleteCall<'a, C, 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)> { + 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}; @@ -726,14 +739,11 @@ impl<'a, C, A> UserSshPublicKeyPatchCall<'a, C, A> where C: BorrowMut 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())); + dlg.begin(MethodInfo { id: "oslogin.users.projects.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 let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -780,17 +790,6 @@ impl<'a, C, A> UserSshPublicKeyPatchCall<'a, C, A> where C: BorrowMut UserSshPublicKeyPatchCall<'a, C, A> where C: BorrowMut UserSshPublicKeyPatchCall<'a, C, A> where C: BorrowMut 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}`. + /// A reference to the POSIX account to update. POSIX accounts are identified + /// by the project ID they are associated with. A reference to the POSIX + /// account is in format `users/{user}/projects/{project}`. /// /// 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> { + pub fn name(mut self, new_value: &str) -> UserProjectDeleteCall<'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> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserProjectDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -914,20 +893,20 @@ impl<'a, C, A> UserSshPublicKeyPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserSshPublicKeyPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> UserProjectDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -947,7 +926,7 @@ impl<'a, C, A> UserSshPublicKeyPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> UserSshPublicKeyPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> UserProjectDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -995,6 +974,7 @@ impl<'a, C, A> UserSshPublicKeyPatchCall<'a, C, A> where C: BorrowMut hub: &'a CloudOSLogin, _request: SshPublicKey, _parent: String, + _project_id: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -1026,9 +1007,12 @@ impl<'a, C, A> UserImportSshPublicKeyCall<'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())); params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { + if let Some(value) = self._project_id { + params.push(("projectId", value.to_string())); + } + for &field in ["alt", "parent", "projectId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -1180,6 +1164,13 @@ impl<'a, C, A> UserImportSshPublicKeyCall<'a, C, A> where C: BorrowMut UserImportSshPublicKeyCall<'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. /// @@ -1200,17 +1191,17 @@ impl<'a, C, A> UserImportSshPublicKeyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserImportSshPublicKeyCall<'a, C, A> @@ -1455,17 +1446,17 @@ impl<'a, C, A> UserSshPublicKeyDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserSshPublicKeyDeleteCall<'a, C, A> @@ -1709,17 +1700,17 @@ impl<'a, C, A> UserGetLoginProfileCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserGetLoginProfileCall<'a, C, A> @@ -1964,17 +1955,17 @@ impl<'a, C, A> UserSshPublicKeyGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserSshPublicKeyGetCall<'a, C, A> @@ -2009,3 +2000,302 @@ impl<'a, C, A> UserSshPublicKeyGetCall<'a, C, A> where C: BorrowMut::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("sea") +/// .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 + /// + /// * *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) -> 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 + } +} + + diff --git a/gen/partners2-cli/Cargo.toml b/gen/partners2-cli/Cargo.toml index ca9958e563..7de3237945 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+20170912" +version = "1.0.6+20171206" 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+20170912" +version = "1.0.6+20171206" diff --git a/gen/partners2-cli/README.md b/gen/partners2-cli/README.md index ea5666d105..76f460865c 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 *20170912*. The CLI is at version *1.0.6*. +This documentation was generated from the *Partners* API at revision *20171206*. 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 70ee06141e..580522e31c 100644 --- a/gen/partners2-cli/mkdocs.yml +++ b/gen/partners2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Partners v1.0.6+20170912 +site_name: Partners v1.0.6+20171206 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 b5e47b9c03..b6ce085a28 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.experiment-ids" => Some(("requestMetadata.experimentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "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.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.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.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 })), + "request-metadata.experiment-ids" => Some(("requestMetadata.experimentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "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,15 +320,15 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "request-metadata.experiment-ids" => Some(("requestMetadata.experimentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "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.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.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.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 })), + "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 })), + "recaptcha-challenge.response" => Some(("recaptchaChallenge.response", 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 })), @@ -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-action" => Some(("eventAction", 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 })), + "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 })), "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.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.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 })), + "request-metadata.experiment-ids" => Some(("requestMetadata.experimentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "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"]); @@ -1650,15 +1650,16 @@ impl<'n> Engine<'n> { "industries" => Some(("industries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "primary-country-code" => Some(("primaryCountryCode", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "adwords-manager-account" => Some(("adwordsManagerAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "markets" => Some(("markets", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-functions" => Some(("jobFunctions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "email-opt-ins.special-offers" => Some(("emailOptIns.specialOffers", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "email-opt-ins.market-comm" => Some(("emailOptIns.marketComm", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "email-opt-ins.phone-contact" => Some(("emailOptIns.phoneContact", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "email-opt-ins.physical-mail" => Some(("emailOptIns.physicalMail", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "email-opt-ins.performance-suggestions" => Some(("emailOptIns.performanceSuggestions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "family-name" => Some(("familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "migrate-to-afa" => Some(("migrateToAfa", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "languages" => Some(("languages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "email-address" => Some(("emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "phone-number" => Some(("phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "address.language-code" => Some(("address.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "address.address-line" => Some(("address.addressLine", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "address.dependent-locality" => Some(("address.dependentLocality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1670,13 +1671,13 @@ impl<'n> Engine<'n> { "address.administrative-area" => Some(("address.administrativeArea", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "address.address" => Some(("address.address", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "address.postal-code" => Some(("address.postalCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "phone-number" => Some(("phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "email-address" => Some(("emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "given-name" => Some(("givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job-functions" => Some(("jobFunctions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "markets" => Some(("markets", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "profile-public" => Some(("profilePublic", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "channels" => Some(("channels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["address", "address-line", "administrative-area", "adwords-manager-account", "channels", "dependent-locality", "email-address", "email-opt-ins", "family-name", "given-name", "industries", "job-functions", "language-code", "languages", "lat-lng", "latitude", "locality", "longitude", "market-comm", "markets", "performance-suggestions", "phone-contact", "phone-number", "physical-mail", "postal-code", "primary-country-code", "profile-public", "region-code", "sorting-code", "special-offers"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["address", "address-line", "administrative-area", "adwords-manager-account", "channels", "dependent-locality", "email-address", "email-opt-ins", "family-name", "given-name", "industries", "job-functions", "language-code", "languages", "lat-lng", "latitude", "locality", "longitude", "market-comm", "markets", "migrate-to-afa", "performance-suggestions", "phone-contact", "phone-number", "physical-mail", "postal-code", "primary-country-code", "profile-public", "region-code", "sorting-code", "special-offers"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2390,7 +2391,7 @@ fn main() { let mut app = App::new("partners2") .author("Sebastian Thiel ") - .version("1.0.6+20170912") + .version("1.0.6+20171206") .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 b52a1a8b53..a2db917374 100644 --- a/gen/partners2/Cargo.toml +++ b/gen/partners2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-partners2" -version = "1.0.6+20170912" +version = "1.0.6+20171206" 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+20170912" +documentation = "https://docs.rs/google-partners2/1.0.6+20171206" license = "MIT" keywords = ["partners", "google", "protocol", "web", "api"] diff --git a/gen/partners2/README.md b/gen/partners2/README.md index ec02b3a80e..07f822e571 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+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*. +This documentation was generated from *Partners* crate version *1.0.6+20171206*, where *20171206* 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+20170912/google_partners2/struct.Partners.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.Partners.html) ... * analytics - * [*list*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.AnalyticListCall.html) + * [*list*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.AnalyticListCall.html) * client messages - * [*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) + * [*log*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.ClientMessageLogCall.html) +* [companies](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.Company.html) + * [*get*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.CompanyGetCall.html), [*leads create*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.CompanyLeadCreateCall.html) and [*list*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.CompanyListCall.html) * exams - * [*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) + * [*get token*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.ExamGetTokenCall.html) +* [leads](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.Lead.html) + * [*list*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.LeadListCall.html) * offers - * [*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) + * [*history list*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.OfferHistoryListCall.html) and [*list*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.OfferListCall.html) * user events - * [*log*](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/struct.UserEventLogCall.html) + * [*log*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.UserEventLogCall.html) * user states - * [*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) + * [*list*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.UserStateListCall.html) +* [users](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.User.html) + * [*create company relation*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.UserCreateCompanyRelationCall.html), [*delete company relation*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.UserDeleteCompanyRelationCall.html), [*get*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.UserGetCall.html) and [*update profile*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.UserUpdateProfileCall.html) Other activities are ... -* [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) +* [get partnersstatus](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.MethodGetPartnersstatuCall.html) +* [update companies](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/struct.MethodUpdateCompanyCall.html) +* [update leads](https://docs.rs/google-partners2/1.0.6+20171206/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+20170912/google_partners2/struct.Partners.html)** +* **[Hub](https://docs.rs/google-partners2/1.0.6+20171206/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+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)** + * creates [*Method Builders*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-partners2/1.0.6+20171206/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+20170912/google_partners2/trait.Part.html)** + * **[Parts](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-partners2/1.0.6+20170912/google_partners2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-partners2/1.0.6+20171206/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+20170912/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+20171206/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+20170912/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+20171206/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+20170912/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+20171206/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+20170912/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+20171206/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-partners2/1.0.6+20171206/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+20170912/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+20171206/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-partners2/1.0.6+20171206/google_partners2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-partners2/1.0.6+20171206/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+20170912/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+20171206/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+20170912/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+20171206/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+20170912/google_partners2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-partners2/1.0.6+20171206/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 c7b7cba9e4..d9160240ab 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+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*. +//! This documentation was generated from *Partners* crate version *1.0.6+20171206*, where *20171206* 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/). @@ -565,8 +565,8 @@ pub struct AvailableOffer { pub qualified_customer: Option>, /// Terms of the offer. pub terms: Option, - /// Description of the offer. - pub description: Option, + /// Name of the offer. + pub name: Option, /// The maximum age of an account [in days] to be eligible. #[serde(rename="maxAccountAge")] pub max_account_age: Option, @@ -584,8 +584,8 @@ pub struct AvailableOffer { /// Whether or not the list of qualified customers is definitely complete. #[serde(rename="qualifiedCustomersComplete")] pub qualified_customers_complete: Option, - /// Name of the offer. - pub name: Option, + /// Description of the offer. + pub description: Option, } impl Part for AvailableOffer {} @@ -616,37 +616,6 @@ 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. @@ -656,16 +625,16 @@ pub struct LocalizedCompanyInfo { /// List of country codes for the localized company info. #[serde(rename="countryCodes")] pub country_codes: Option>, + /// Localized brief description that the company uses to advertise themselves. + pub overview: Option, + /// Localized display name. + #[serde(rename="displayName")] + pub display_name: Option, /// Language code of the localized company info, as defined by /// BCP 47 /// (IETF BCP 47, "Tags for Identifying Languages"). #[serde(rename="languageCode")] pub language_code: Option, - /// Localized display name. - #[serde(rename="displayName")] - pub display_name: Option, - /// Localized brief description that the company uses to advertise themselves. - pub overview: Option, } impl Part for LocalizedCompanyInfo {} @@ -743,21 +712,6 @@ 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: @@ -846,37 +800,46 @@ pub struct ListAnalyticsResponse { /// 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>, + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, + /// Aggregated information across the response's + /// analytics. + #[serde(rename="analyticsSummary")] + pub analytics_summary: Option, } impl ResponseResult for ListAnalyticsResponse {} -/// Agency specialization status +/// Response message for CreateLead. /// -/// 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*). +/// +/// * [leads create companies](struct.CompanyLeadCreateCall.html) (response) /// #[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 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, + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, } -impl Part for SpecializationStatus {} +impl ResponseResult for CreateLeadResponse {} /// A company resource in the Google Partners API. Once certified, it qualifies @@ -1092,21 +1055,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, - /// Google Partners session ID. - #[serde(rename="partnersSessionId")] - pub partners_session_id: Option, + /// Source of traffic for the current request. + #[serde(rename="trafficSource")] + pub traffic_source: Option, } impl Part for RequestMetadata {} @@ -1126,13 +1089,13 @@ impl Part for RequestMetadata {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct User { + /// The profile information of a Partners user, contains all the directly + /// editable user information. + pub profile: Option, /// The email address used by the user used for company verification. /// @OutputOnly #[serde(rename="companyVerificationEmail")] pub company_verification_email: Option, - /// The profile information of a Partners user, contains all the directly - /// editable user information. - pub profile: Option, /// The list of achieved certifications. These are calculated based on exam /// results and other requirements. /// @OutputOnly @@ -1221,30 +1184,33 @@ pub struct UserProfile { /// 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>, + /// A list of ids representing which markets the user was interested in. + pub markets: 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, + /// Whether or not to migrate the user's exam data to Academy for Ads. + #[serde(rename="migrateToAfa")] + pub migrate_to_afa: 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 mailing address, contains multiple fields. + pub address: Option, + /// The email address the user has selected on the Partners site as primary. + #[serde(rename="emailAddress")] + pub email_address: 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>, + /// A list of ids represnting which job categories the user selected. + #[serde(rename="jobFunctions")] + pub job_functions: Option>, /// Whether the user's public profile is visible to anyone with the URL. #[serde(rename="profilePublic")] pub profile_public: Option, @@ -1326,20 +1292,66 @@ pub struct CertificationStatus { /// 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>, + /// Whether certification is passing. + #[serde(rename="isCertified")] + pub is_certified: Option, + /// Number of people who are certified, + #[serde(rename="userCount")] + pub user_count: 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 { + /// Offer code. + #[serde(rename="offerCode")] + pub offer_code: Option, + /// Status of the offer. + pub status: 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 this offer expires. + #[serde(rename="expirationTime")] + pub expiration_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 last action was taken. + #[serde(rename="lastModifiedTime")] + pub last_modified_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. @@ -1422,20 +1434,45 @@ pub struct LogUserEventRequest { /// List of event data for the event. #[serde(rename="eventDatas")] pub event_datas: 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, + /// The scope of the event. + #[serde(rename="eventScope")] + pub event_scope: Option, + /// The action that occurred. + #[serde(rename="eventAction")] + pub event_action: 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. @@ -1479,38 +1516,44 @@ impl Part for OfferCustomer {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RecaptchaChallenge { - /// The response to the reCaptcha challenge. - pub response: Option, /// The ID of the reCaptcha challenge. pub id: Option, + /// The response to the reCaptcha challenge. + pub response: Option, } impl Part for RecaptchaChallenge {} -/// A user's information on a specific exam. +/// Response message for ListLeads. /// -/// 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 leads](struct.LeadListCall.html) (response) /// #[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, +pub struct ListLeadsResponse { + /// The total count of leads for the given company. + #[serde(rename="totalSize")] + pub total_size: Option, + /// The list of leads. + pub leads: Option>, + /// 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, + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, } -impl Part for ExamStatus {} +impl ResponseResult for ListLeadsResponse {} /// Status for a Google Partners certification exam. @@ -1530,30 +1573,21 @@ pub struct CertificationExamStatus { impl Part for CertificationExamStatus {} -/// Response message for CreateLead. +/// Agency specialization status /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[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, +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 ResponseResult for CreateLeadResponse {} +impl Part for SpecializationStatus {} /// Basic information from a public profile. @@ -1633,40 +1667,6 @@ impl Part for Money {} /// 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)] @@ -1702,6 +1702,12 @@ 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 contacting the `Company` + /// on the specified date. + pub contacts: Option, /// Instances of users seeing the `Company` in Google Partners Search results /// on the specified date. #[serde(rename="searchViews")] @@ -1710,12 +1716,6 @@ pub struct Analytics { /// 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, } impl Part for Analytics {} @@ -1820,50 +1820,19 @@ impl RequestValue for CompanyRelation {} impl ResponseResult for CompanyRelation {} -/// Historical information about a Google Partners Offer. +/// 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 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, +pub struct EventData { + /// Data values. + pub values: Option>, + /// Data type. + pub key: Option, } -impl Part for HistoricalOffer {} +impl Part for EventData {} @@ -3004,10 +2973,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 /// - /// * *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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3824,10 +3793,10 @@ impl<'a, C, A> UserEventLogCall<'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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4044,10 +4013,10 @@ impl<'a, C, A> ClientMessageLogCall<'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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4410,10 +4379,10 @@ impl<'a, C, A> CompanyGetCall<'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. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4661,10 +4630,10 @@ impl<'a, C, A> CompanyLeadCreateCall<'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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5199,10 +5168,10 @@ impl<'a, C, A> CompanyListCall<'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. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5519,10 +5488,10 @@ impl<'a, C, A> LeadListCall<'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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5834,10 +5803,10 @@ impl<'a, C, A> AnalyticListCall<'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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6164,10 +6133,10 @@ impl<'a, C, A> OfferHistoryListCall<'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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6442,10 +6411,10 @@ impl<'a, C, A> OfferListCall<'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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6753,10 +6722,10 @@ impl<'a, C, A> ExamGetTokenCall<'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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -7031,10 +7000,10 @@ impl<'a, C, A> UserStateListCall<'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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -7341,10 +7310,10 @@ impl<'a, C, A> UserUpdateProfileCall<'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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -7684,10 +7653,10 @@ impl<'a, C, A> UserCreateCompanyRelationCall<'a, C, A> where C: BorrowMut UserGetCall<'a, C, A> where C: BorrowMut, A: oauth /// /// # 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. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -8320,10 +8289,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+20170925" +version = "1.0.6+20171211" diff --git a/gen/people1-cli/README.md b/gen/people1-cli/README.md index de8228664a..ae5e4ad18f 100644 --- a/gen/people1-cli/README.md +++ b/gen/people1-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 *People Service* API at revision *20170925*. The CLI is at version *1.0.6*. +This documentation was generated from the *People Service* API at revision *20171211*. The CLI is at version *1.0.6*. ```bash people1 [options] diff --git a/gen/people1-cli/mkdocs.yml b/gen/people1-cli/mkdocs.yml index 30ea99ea42..7cfe5a2a1f 100644 --- a/gen/people1-cli/mkdocs.yml +++ b/gen/people1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: People Service v1.0.6+20170925 +site_name: People Service v1.0.6+20171211 site_url: http://byron.github.io/google-apis-rs/google-people1-cli site_description: A complete library to interact with People Service (protocol v1) diff --git a/gen/people1-cli/src/main.rs b/gen/people1-cli/src/main.rs index 93af0f36bb..e2ef3fd990 100644 --- a/gen/people1-cli/src/main.rs +++ b/gen/people1-cli/src/main.rs @@ -128,11 +128,11 @@ impl<'n> Engine<'n> { 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.group-type" => Some(("contactGroup.groupType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.name" => Some(("contactGroup.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.member-resource-names" => Some(("contactGroup.memberResourceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "contact-group.member-count" => Some(("contactGroup.memberCount", JsonTypeInfo { jtype: JsonType::Int, 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 })), @@ -481,11 +481,11 @@ impl<'n> Engine<'n> { 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.group-type" => Some(("contactGroup.groupType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.name" => Some(("contactGroup.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "contact-group.member-resource-names" => Some(("contactGroup.memberResourceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "contact-group.member-count" => Some(("contactGroup.memberCount", JsonTypeInfo { jtype: JsonType::Int, 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 })), @@ -1466,7 +1466,7 @@ fn main() { let mut app = App::new("people1") .author("Sebastian Thiel ") - .version("1.0.6+20170925") + .version("1.0.6+20171211") .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 e79f434178..7ac459cdb9 100644 --- a/gen/people1/Cargo.toml +++ b/gen/people1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-people1" -version = "1.0.6+20170925" +version = "1.0.6+20171211" 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+20170925" +documentation = "https://docs.rs/google-people1/1.0.6+20171211" license = "MIT" keywords = ["people", "google", "protocol", "web", "api"] diff --git a/gen/people1/README.md b/gen/people1/README.md index b68bab8fe7..a2d401b589 100644 --- a/gen/people1/README.md +++ b/gen/people1/README.md @@ -5,18 +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+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*. +This documentation was generated from *People Service* crate version *1.0.6+20171211*, where *20171211* 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+20170925/google_people1/struct.PeopleService.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-people1/1.0.6+20171211/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) +* [contact groups](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.ContactGroup.html) + * [*batch get*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.ContactGroupBatchGetCall.html), [*create*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.ContactGroupCreateCall.html), [*delete*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.ContactGroupDeleteCall.html), [*get*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.ContactGroupGetCall.html), [*list*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.ContactGroupListCall.html), [*members modify*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.ContactGroupMemberModifyCall.html) and [*update*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.ContactGroupUpdateCall.html) * people - * [*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) + * [*connections list*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.PeopleConnectionListCall.html), [*create contact*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.PeopleCreateContactCall.html), [*delete contact*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.PeopleDeleteContactCall.html), [*get*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.PeopleGetCall.html), [*get batch get*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.PeopleGetBatchGetCall.html) and [*update contact*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/struct.PeopleUpdateContactCall.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-people1/1.0.6+20170925/google_people1/struct.PeopleService.html)** +* **[Hub](https://docs.rs/google-people1/1.0.6+20171211/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+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)** + * creates [*Method Builders*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-people1/1.0.6+20171211/google_people1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-people1/1.0.6+20171211/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+20170925/google_people1/trait.Part.html)** + * **[Parts](https://docs.rs/google-people1/1.0.6+20171211/google_people1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-people1/1.0.6+20170925/google_people1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-people1/1.0.6+20171211/google_people1/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-people1/1.0.6+20170925/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+20171211/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+20170925/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+20171211/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+20170925/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+20171211/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+20170925/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+20171211/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-people1/1.0.6+20171211/google_people1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-people1/1.0.6+20171211/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+20170925/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+20171211/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-people1/1.0.6+20171211/google_people1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-people1/1.0.6+20171211/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+20170925/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+20171211/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+20170925/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+20171211/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+20170925/google_people1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-people1/1.0.6+20171211/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 488e1d7050..694acca7e4 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+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*. +//! This documentation was generated from *People Service* crate version *1.0.6+20171211*, where *20171211* 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/). @@ -246,14 +246,14 @@ pub enum Scope { /// Manage your contacts Contact, - /// View your phone numbers - UserPhonenumberRead, + /// View your email address + UserinfoEmail, /// View your basic profile info UserinfoProfile, - /// View your email address - UserinfoEmail, + /// View your phone numbers + UserPhonenumberRead, } impl AsRef for Scope { @@ -265,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::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", + Scope::UserinfoProfile => "https://www.googleapis.com/auth/userinfo.profile", + Scope::UserPhonenumberRead => "https://www.googleapis.com/auth/user.phonenumbers.read", } } } @@ -495,14 +495,8 @@ impl Part for RelationshipStatus {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PersonResponse { - /// The original requested resource name. May be different than the resource - /// name on the returned person. - /// - /// The resource name can change when adding or removing fields that link a - /// contact and profile such as a verified email, verified phone number, or a - /// profile URL. - #[serde(rename="requestedResourceName")] - pub requested_resource_name: Option, + /// The status of the response. + pub status: Option, /// The person. pub person: Option, /// **DEPRECATED** (Please use status instead) @@ -511,8 +505,14 @@ pub struct PersonResponse { /// (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, + /// The original requested resource name. May be different than the resource + /// name on the returned person. + /// + /// The resource name can change when adding or removing fields that link a + /// contact and profile such as a verified email, verified phone number, or a + /// profile URL. + #[serde(rename="requestedResourceName")] + pub requested_resource_name: Option, } impl Part for PersonResponse {} @@ -602,6 +602,7 @@ impl Part for Source {} /// One of the person's interests. +/// **DEPRECATED** (Message will not be returned.) /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -654,24 +655,28 @@ pub struct CoverPhoto { impl Part for CoverPhoto {} -/// Metadata about a field. +/// 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: /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// 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 FieldMetadata { - /// The source of the field. - pub source: Option, - /// True if the field is verified; false if the field is unverified. A - /// verified field is typically a name, email address, phone number, or - /// website that has been confirmed to be owned by the person. - pub verified: Option, - /// True if the field is the primary field; false if the field is a secondary - /// field. - pub primary: Option, -} +pub struct Empty { _never_set: Option } -impl Part for FieldMetadata {} +impl ResponseResult for Empty {} /// A person's name. If the name is a mononym, the family name is empty. @@ -683,6 +688,9 @@ pub struct Name { /// The middle name(s) spelled as they sound. #[serde(rename="phoneticMiddleName")] pub phonetic_middle_name: Option, + /// The given name spelled as it sounds. + #[serde(rename="phoneticGivenName")] + pub phonetic_given_name: Option, /// The honorific prefixes, such as `Mrs.` or `Dr.` #[serde(rename="honorificPrefix")] pub honorific_prefix: Option, @@ -693,11 +701,6 @@ pub struct Name { /// 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, @@ -710,9 +713,11 @@ pub struct Name { /// The full name spelled as it sounds. #[serde(rename="phoneticFullName")] pub phonetic_full_name: Option, - /// The given name spelled as it sounds. - #[serde(rename="phoneticGivenName")] - pub phonetic_given_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 honorific suffixes spelled as they sound. #[serde(rename="phoneticHonorificSuffix")] pub phonetic_honorific_suffix: Option, @@ -788,27 +793,27 @@ impl Part for BraggingRights {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ContactGroup { + /// 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 read-only contact group type. #[serde(rename="groupType")] pub group_type: Option, + /// The contact group name set by the group owner or a system provided name + /// for system groups. + pub name: 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, @@ -862,54 +867,76 @@ pub struct Birthday { impl Part for Birthday {} -/// 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. +/// Metadata about 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 Gender { - /// The read-only value of the gender translated and formatted in the viewer's +pub struct FieldMetadata { + /// The source of the field. + pub source: Option, + /// True if the field is verified; false if the field is unverified. A + /// verified field is typically a name, email address, phone number, or + /// website that has been confirmed to be owned by the person. + pub verified: Option, + /// True if the field is the primary field; false if the field is a secondary + /// field. + pub primary: Option, +} + +impl Part for FieldMetadata {} + + +/// 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 gender for the person. The gender can be custom or predefined. - /// Possible values include, but are not limited to, the - /// following: + /// 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: /// - /// * `male` - /// * `female` + /// * `home` + /// * `work` /// * `other` - /// * `unknown` - pub value: Option, - /// Metadata about the gender. + #[serde(rename="type")] + pub type_: Option, + /// Metadata about the address. pub metadata: Option, } -impl Part for Gender {} +impl Part for Address {} /// Represents a whole calendar date, for example a date of birth. The time @@ -1204,58 +1231,6 @@ 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 @@ -1317,21 +1292,20 @@ impl ResponseResult for BatchGetContactGroupsResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Person { /// The person's interests. + /// **DEPRECATED** (No values will be returned.) pub interests: Option>, - /// The person's read-only taglines. - pub taglines: Option>, - /// The person's bragging rights. - #[serde(rename="braggingRights")] - pub bragging_rights: Option>, + /// The person's phone numbers. + #[serde(rename="phoneNumbers")] + pub phone_numbers: Option>, /// The person's street addresses. pub addresses: Option>, /// The person's nicknames. pub nicknames: Option>, /// The person's occupations. pub occupations: Option>, - /// The person's phone numbers. - #[serde(rename="phoneNumbers")] - pub phone_numbers: Option>, + /// The person's bragging rights. + #[serde(rename="braggingRights")] + pub bragging_rights: Option>, /// The person's read-only photos. pub photos: Option>, /// The person's names. @@ -1372,11 +1346,13 @@ pub struct Person { pub relations: Option>, /// The person's read-only group memberships. pub memberships: Option>, - /// The person's biographies. - pub biographies: Option>, + /// The person's read-only taglines. + pub taglines: Option>, /// The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the /// resource. Used for web cache validation. pub etag: Option, + /// The person's biographies. + pub biographies: Option>, /// The person's associated URLs. pub urls: Option>, /// The person's read-only relationship statuses. @@ -1400,22 +1376,30 @@ impl RequestValue for Person {} impl ResponseResult for Person {} -/// The read-only metadata about a contact group. +/// 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 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, +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, } -impl Part for ContactGroupMetadata {} +impl Part for Gender {} /// A person's phone number. @@ -1428,10 +1412,8 @@ pub struct PhoneNumber { /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: 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, /// The type of the phone number. The type can be custom or predefined. /// Possible values include, but are not limited to, the following: /// @@ -1451,8 +1433,10 @@ pub struct PhoneNumber { pub type_: Option, /// The phone number. pub value: 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, } impl Part for PhoneNumber {} @@ -1465,9 +1449,10 @@ impl Part for PhoneNumber {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Organization { - /// The start date when the person joined the organization. - #[serde(rename="startDate")] - pub start_date: 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 domain name associated with the organization; for example, `google.com`. pub domain: Option, /// The end date when the person left the organization. @@ -1475,15 +1460,14 @@ pub struct Organization { pub end_date: Option, /// The name of the organization. pub name: 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 person's job title at the organization. + pub title: 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, + /// The start date when the person joined the organization. + #[serde(rename="startDate")] + pub start_date: Option, /// True if the organization is the person's current organization; /// false if the organization is a past organization. pub current: Option, @@ -1567,6 +1551,24 @@ pub struct Photo { impl Part for Photo {} +/// 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 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 ContactGroupMetadata {} + + /// The read-only metadata about a person. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1629,8 +1631,10 @@ impl ResponseResult for ModifyContactGroupMembersResponse {} pub struct Relation { /// The name of the other person this relation refers to. pub person: Option, - /// Metadata about the relation. - 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, /// 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: /// @@ -1650,10 +1654,8 @@ pub struct Relation { /// * `partner` #[serde(rename="type")] pub type_: 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, + /// Metadata about the relation. + pub metadata: Option, } impl Part for Relation {} @@ -1674,21 +1676,19 @@ pub struct Skill { impl Part for Skill {} -/// 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 user types. - #[serde(rename="userTypes")] - pub user_types: Option>, - /// 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 {} /// A Google Apps Domain membership. @@ -1749,19 +1749,21 @@ pub struct Biography { impl Part for Biography {} -/// 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 {} @@ -2326,17 +2328,17 @@ impl<'a, C, A> ContactGroupBatchGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ContactGroupBatchGetCall<'a, C, A> @@ -2582,17 +2584,17 @@ impl<'a, C, A> ContactGroupListCall<'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) -> ContactGroupListCall<'a, C, A> @@ -2829,17 +2831,17 @@ impl<'a, C, A> ContactGroupCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ContactGroupCreateCall<'a, C, A> @@ -3115,17 +3117,17 @@ impl<'a, C, A> ContactGroupUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ContactGroupUpdateCall<'a, C, A> @@ -3381,17 +3383,17 @@ impl<'a, C, A> ContactGroupDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ContactGroupDeleteCall<'a, C, A> @@ -3665,17 +3667,17 @@ impl<'a, C, A> ContactGroupMemberModifyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ContactGroupMemberModifyCall<'a, C, A> @@ -3931,17 +3933,17 @@ impl<'a, C, A> ContactGroupGetCall<'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) -> ContactGroupGetCall<'a, C, A> @@ -4248,7 +4250,6 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PeopleConnectionListCall<'a, C, A> @@ -4565,17 +4566,17 @@ impl<'a, C, A> PeopleCreateContactCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PeopleCreateContactCall<'a, C, A> @@ -4818,17 +4819,17 @@ impl<'a, C, A> PeopleDeleteContactCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PeopleDeleteContactCall<'a, C, A> @@ -5093,7 +5094,6 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau /// * events /// * genders /// * imClients - /// * interests /// * locales /// * memberships /// * metadata @@ -5136,17 +5136,17 @@ impl<'a, C, A> PeopleGetCall<'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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> PeopleGetCall<'a, C, A> @@ -5429,7 +5429,6 @@ impl<'a, C, A> PeopleUpdateContactCall<'a, C, A> where C: BorrowMut PeopleUpdateContactCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PeopleUpdateContactCall<'a, C, A> @@ -5722,7 +5721,6 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut /// * events /// * genders /// * imClients - /// * interests /// * locales /// * memberships /// * metadata @@ -5765,17 +5763,17 @@ impl<'a, C, A> PeopleGetBatchGetCall<'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) -> PeopleGetBatchGetCall<'a, C, A> diff --git a/gen/plus1-cli/Cargo.toml b/gen/plus1-cli/Cargo.toml index 88f344b77b..b06d5eb91d 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+20170828" +version = "1.0.6+20171030" 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+20170828" +version = "1.0.6+20171030" diff --git a/gen/plus1-cli/README.md b/gen/plus1-cli/README.md index a85d2f7ac2..86a8e6b8d0 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 *20170828*. The CLI is at version *1.0.6*. +This documentation was generated from the *plus* API at revision *20171030*. 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 b0a2df5917..0838d3608f 100644 --- a/gen/plus1-cli/mkdocs.yml +++ b/gen/plus1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plus v1.0.6+20170828 +site_name: plus v1.0.6+20171030 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 c2d9d5baad..ec08dcee81 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+20170828") + .version("1.0.6+20171030") .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 70c691ab9a..fa5a88e2a0 100644 --- a/gen/plus1/Cargo.toml +++ b/gen/plus1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-plus1" -version = "1.0.6+20170828" +version = "1.0.6+20171030" 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+20170828" +documentation = "https://docs.rs/google-plus1/1.0.6+20171030" license = "MIT" keywords = ["plus", "google", "protocol", "web", "api"] diff --git a/gen/plus1/README.md b/gen/plus1/README.md index 42e1e17fcc..12ebaf4914 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+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*. +This documentation was generated from *plus* crate version *1.0.6+20171030*, where *20171030* 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+20170828/google_plus1/struct.Plus.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/struct.Plus.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) +* [activities](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/struct.Activity.html) + * [*get*](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/struct.ActivityGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/struct.ActivityListCall.html) and [*search*](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/struct.ActivitySearchCall.html) +* [comments](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/struct.Comment.html) + * [*get*](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/struct.CommentGetCall.html) and [*list*](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/struct.CommentListCall.html) * people - * [*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) + * [*get*](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/struct.PeopleListByActivityCall.html) and [*search*](https://docs.rs/google-plus1/1.0.6+20171030/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+20170828/google_plus1/struct.Plus.html)** +* **[Hub](https://docs.rs/google-plus1/1.0.6+20171030/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+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)** + * creates [*Method Builders*](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-plus1/1.0.6+20171030/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+20170828/google_plus1/trait.Part.html)** + * **[Parts](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-plus1/1.0.6+20170828/google_plus1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-plus1/1.0.6+20171030/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+20170828/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+20171030/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+20170828/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+20171030/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+20170828/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+20171030/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+20170828/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+20171030/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-plus1/1.0.6+20171030/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+20170828/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+20171030/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-plus1/1.0.6+20171030/google_plus1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-plus1/1.0.6+20171030/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+20170828/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+20171030/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+20170828/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+20171030/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+20170828/google_plus1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-plus1/1.0.6+20171030/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 2201517a18..fac9f9e519 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+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*. +//! This documentation was generated from *plus* crate version *1.0.6+20171030*, where *20171030* 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 df070c7ab7..aa67d7f5c1 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+20170828" +version = "1.0.6+20171030" 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+20170828" +version = "1.0.6+20171030" diff --git a/gen/plusdomains1-cli/README.md b/gen/plusdomains1-cli/README.md index 8b42cbb73b..a01b76907d 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 *20170828*. The CLI is at version *1.0.6*. +This documentation was generated from the *plusDomains* API at revision *20171030*. 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 55063edc3e..3898f56933 100644 --- a/gen/plusdomains1-cli/mkdocs.yml +++ b/gen/plusdomains1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plusDomains v1.0.6+20170828 +site_name: plusDomains v1.0.6+20171030 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 6dd449eb7a..60172505a1 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+20170828") + .version("1.0.6+20171030") .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 8fd64ebef3..132d80dd63 100644 --- a/gen/plusdomains1/Cargo.toml +++ b/gen/plusdomains1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-plusdomains1" -version = "1.0.6+20170828" +version = "1.0.6+20171030" 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+20170828" +documentation = "https://docs.rs/google-plusdomains1/1.0.6+20171030" license = "MIT" keywords = ["plusDomains", "google", "protocol", "web", "api"] diff --git a/gen/plusdomains1/README.md b/gen/plusdomains1/README.md index b6ef5b5214..d3d639a850 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+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*. +This documentation was generated from *plusDomains* crate version *1.0.6+20171030*, where *20171030* 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+20170828/google_plusdomains1/struct.PlusDomains.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.PlusDomains.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) +* [activities](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.Activity.html) + * [*get*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.ActivityGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.ActivityListCall.html) +* [audiences](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.Audience.html) + * [*list*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.AudienceListCall.html) +* [circles](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.Circle.html) + * [*add people*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.CircleAddPeopleCall.html), [*get*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.CircleGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.CircleInsertCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.CircleListCall.html), [*patch*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.CirclePatchCall.html), [*remove*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.CircleRemoveCall.html), [*remove people*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.CircleRemovePeopleCall.html) and [*update*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.CircleUpdateCall.html) +* [comments](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.Comment.html) + * [*get*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.CommentInsertCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.CommentListCall.html) +* [media](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.Media.html) + * [*insert*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.MediaInsertCall.html) * people - * [*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) + * [*get*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.PeopleListByActivityCall.html) and [*list by circle*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/struct.PeopleListByCircleCall.html) Upload supported by ... -* [*insert media*](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/struct.MediaInsertCall.html) +* [*insert media*](https://docs.rs/google-plusdomains1/1.0.6+20171030/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+20170828/google_plusdomains1/struct.PlusDomains.html)** +* **[Hub](https://docs.rs/google-plusdomains1/1.0.6+20171030/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+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)** + * creates [*Method Builders*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-plusdomains1/1.0.6+20171030/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+20170828/google_plusdomains1/trait.Part.html)** + * **[Parts](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-plusdomains1/1.0.6+20170828/google_plusdomains1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-plusdomains1/1.0.6+20171030/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+20170828/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+20171030/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+20170828/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+20171030/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+20170828/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+20171030/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+20170828/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+20171030/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-plusdomains1/1.0.6+20171030/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+20170828/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+20171030/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-plusdomains1/1.0.6+20171030/google_plusdomains1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-plusdomains1/1.0.6+20171030/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+20170828/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+20171030/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+20170828/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+20171030/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+20170828/google_plusdomains1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-plusdomains1/1.0.6+20171030/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 80cd11b88f..e6a51724fd 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+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*. +//! This documentation was generated from *plusDomains* crate version *1.0.6+20171030*, where *20171030* 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/poly1-cli/Cargo.toml b/gen/poly1-cli/Cargo.toml new file mode 100644 index 0000000000..d4b8d281d6 --- /dev/null +++ b/gen/poly1-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-poly1-cli" +version = "1.0.6+20171209" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Poly Service (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/poly1-cli" +homepage = "https://developers.google.com/poly/" +documentation = "http://byron.github.io/google-apis-rs/google_poly1_cli" +license = "MIT" +keywords = ["poly", "google", "cli"] + +[[bin]] +name = "poly1" + +[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-poly1] +path = "../poly1" +version = "1.0.6+20171209" diff --git a/gen/poly1-cli/LICENSE.md b/gen/poly1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/poly1-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/poly1-cli/README.md b/gen/poly1-cli/README.md new file mode 100644 index 0000000000..8a7272dfad --- /dev/null +++ b/gen/poly1-cli/README.md @@ -0,0 +1,114 @@ + +The `poly1` command-line interface *(CLI)* allows to use most features of the *Google Poly Service* 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 *Poly Service* API can be found at the +[official documentation site](https://developers.google.com/poly/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-poly1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/poly1-cli). + +# Usage + +This documentation was generated from the *Poly Service* API at revision *20171209*. The CLI is at version *1.0.6*. + +```bash +poly1 [options] + assets + get [-p ]... [-o ] + list [-p ]... [-o ] + users + assets-list [-p ]... [-o ] + likedassets-list [-p ]... [-o ] + poly1 --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 `poly1-`. 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/poly1-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/poly1-secret.json`, assuming that the required *poly* 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. `poly1 --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/poly1-cli/mkdocs.yml b/gen/poly1-cli/mkdocs.yml new file mode 100644 index 0000000000..820331fe59 --- /dev/null +++ b/gen/poly1-cli/mkdocs.yml @@ -0,0 +1,20 @@ +site_name: Poly Service v1.0.6+20171209 +site_url: http://byron.github.io/google-apis-rs/google-poly1-cli +site_description: A complete library to interact with Poly Service (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/poly1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['assets_get.md', 'Assets', 'Get'] +- ['assets_list.md', 'Assets', 'List'] +- ['users_assets-list.md', 'Users', 'Assets List'] +- ['users_likedassets-list.md', 'Users', 'Likedassets List'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/poly1-cli/src/cmn.rs b/gen/poly1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/poly1-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/poly1-cli/src/main.rs b/gen/poly1-cli/src/main.rs new file mode 100644 index 0000000000..6395a83e46 --- /dev/null +++ b/gen/poly1-cli/src/main.rs @@ -0,0 +1,614 @@ +// 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_poly1 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::PolyService>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _assets_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.assets().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 _assets_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.assets().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")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-complexity" => { + call = call.max_complexity(value.unwrap_or("")); + }, + "keywords" => { + call = call.keywords(value.unwrap_or("")); + }, + "format" => { + call = call.format(value.unwrap_or("")); + }, + "curated" => { + call = call.curated(arg_from_str(value.unwrap_or("false"), err, "curated", "boolean")); + }, + "category" => { + call = call.category(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", "category", "curated", "page-size", "format", "page-token", "max-complexity", "keywords"].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 _users_assets_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().assets_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 { + "visibility" => { + call = call.visibility(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("")); + }, + "format" => { + call = call.format(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", "visibility", "format"].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 _users_likedassets_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().likedassets_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")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "format" => { + call = call.format(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", "format"].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() { + ("assets", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._assets_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._assets_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("assets".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("users", Some(opt)) => { + match opt.subcommand() { + ("assets-list", Some(opt)) => { + call_result = self._users_assets_list(opt, dry_run, &mut err); + }, + ("likedassets-list", Some(opt)) => { + call_result = self._users_likedassets_list(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, "poly1-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: "poly1", + 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::PolyService::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 = [ + ("assets", "methods: 'get' and 'list'", vec![ + ("get", + Some(r##"Returns detailed information about an asset given its name. + PRIVATE assets are returned only if + the currently authenticated user (via OAuth token) is the author of the asset."##), + "Details at http://byron.github.io/google-apis-rs/google_poly1_cli/assets_get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. An asset's name in the form `assets/{ASSET_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 public, remixable assets. These are assets with an access level of + PUBLIC and published under the + CC-By license."##), + "Details at http://byron.github.io/google-apis-rs/google_poly1_cli/assets_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)), + ]), + ]), + + ("users", "methods: 'assets-list' and 'likedassets-list'", vec![ + ("assets-list", + Some(r##"Lists assets authored by the given user. Only the value 'me', representing + the currently-authenticated user, is supported. May include assets with an + access level of PRIVATE or + UNLISTED and assets which are + All Rights Reserved for the + currently-authenticated user."##), + "Details at http://byron.github.io/google-apis-rs/google_poly1_cli/users_assets-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"A valid user id. Currently, only the special value 'me', representing the + currently-authenticated user is supported. To use 'me', you must pass + an OAuth token with the 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)), + ]), + ("likedassets-list", + Some(r##"Lists assets that the user has liked. Only the value 'me', representing + the currently-authenticated user, is supported. May include assets with an + access level of UNLISTED."##), + "Details at http://byron.github.io/google-apis-rs/google_poly1_cli/users_likedassets-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"A valid user id. Currently, only the special value 'me', representing the + currently-authenticated user is supported. To use 'me', you must pass + an OAuth token with the 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("poly1") + .author("Sebastian Thiel ") + .version("1.0.6+20171209") + .about("The Poly API provides read-only access to assets hosted on poly.google.com. + ") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_poly1_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/poly1/Cargo.toml b/gen/poly1/Cargo.toml new file mode 100644 index 0000000000..f4b8f64119 --- /dev/null +++ b/gen/poly1/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-poly1" +version = "1.0.6+20171209" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Poly Service (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/poly1" +homepage = "https://developers.google.com/poly/" +documentation = "https://docs.rs/google-poly1/1.0.6+20171209" +license = "MIT" +keywords = ["poly", "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/poly1/LICENSE.md b/gen/poly1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/poly1/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/poly1/README.md b/gen/poly1/README.md new file mode 100644 index 0000000000..dafebe1a80 --- /dev/null +++ b/gen/poly1/README.md @@ -0,0 +1,185 @@ + +The `google-poly1` library allows access to all features of the *Google Poly Service* service. + +This documentation was generated from *Poly Service* crate version *1.0.6+20171209*, where *20171209* is the exact revision of the *poly:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Poly Service* *v1* API can be found at the +[official documentation site](https://developers.google.com/poly/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/struct.PolyService.html) ... + +* [assets](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/struct.Asset.html) + * [*get*](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/struct.AssetGetCall.html) and [*list*](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/struct.AssetListCall.html) +* users + * [*assets list*](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/struct.UserAssetListCall.html) and [*likedassets list*](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/struct.UserLikedassetListCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/struct.PolyService.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/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.assets().get(...).doit() +let r = hub.assets().list(...).doit() +``` + +The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` +supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be +specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired. +The `doit()` method performs the actual communication with the server and returns the respective result. + +# Usage + +## Setting up your Project + +To use this library, you would put the following lines into your `Cargo.toml` file: + +```toml +[dependencies] +google-poly1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_poly1 as poly1; +use poly1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use poly1::PolyService; + +// 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 = PolyService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +// You can configure optional parameters by calling the respective setters at will, and +// execute the final call using `doit()`. +// Values shown here are possibly random and not representative ! +let result = hub.assets().list() + .page_token("eirmod") + .page_size(-48) + .order_by("Stet") + .max_complexity("sed") + .keywords("et") + .format("dolores") + .curated(false) + .category("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](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/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-poly1/1.0.6+20171209/google_poly1/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-poly1/1.0.6+20171209/google_poly1/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-poly1/1.0.6+20171209/google_poly1/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-poly1/1.0.6+20171209/google_poly1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/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-poly1/1.0.6+20171209/google_poly1/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-poly1/1.0.6+20171209/google_poly1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-poly1/1.0.6+20171209/google_poly1/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-poly1/1.0.6+20171209/google_poly1/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-poly1/1.0.6+20171209/google_poly1/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-poly1/1.0.6+20171209/google_poly1/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 **poly1** 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/poly1/src/cmn.rs b/gen/poly1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/poly1/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/poly1/src/lib.rs b/gen/poly1/src/lib.rs new file mode 100644 index 0000000000..21e4926ec0 --- /dev/null +++ b/gen/poly1/src/lib.rs @@ -0,0 +1,1931 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Poly Service* crate version *1.0.6+20171209*, where *20171209* is the exact revision of the *poly:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Poly Service* *v1* API can be found at the +//! [official documentation site](https://developers.google.com/poly/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/poly1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.PolyService.html) ... +//! +//! * [assets](struct.Asset.html) +//! * [*get*](struct.AssetGetCall.html) and [*list*](struct.AssetListCall.html) +//! * users +//! * [*assets list*](struct.UserAssetListCall.html) and [*likedassets list*](struct.UserLikedassetListCall.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.PolyService.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.assets().get(...).doit() +//! let r = hub.assets().list(...).doit() +//! ``` +//! +//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` +//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be +//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired. +//! The `doit()` method performs the actual communication with the server and returns the respective result. +//! +//! # Usage +//! +//! ## Setting up your Project +//! +//! To use this library, you would put the following lines into your `Cargo.toml` file: +//! +//! ```toml +//! [dependencies] +//! google-poly1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_poly1 as poly1; +//! use poly1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use poly1::PolyService; +//! +//! // 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 = PolyService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +//! // You can configure optional parameters by calling the respective setters at will, and +//! // execute the final call using `doit()`. +//! // Values shown here are possibly random and not representative ! +//! let result = hub.assets().list() +//! .page_token("takimata") +//! .page_size(-70) +//! .order_by("amet.") +//! .max_complexity("erat") +//! .keywords("labore") +//! .format("sea") +//! .curated(false) +//! .category("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 ### +// ############ + + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all PolyService 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_poly1 as poly1; +/// use poly1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use poly1::PolyService; +/// +/// // 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 = PolyService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.assets().list() +/// .page_token("gubergren") +/// .page_size(-95) +/// .order_by("aliquyam") +/// .max_complexity("ea") +/// .keywords("no") +/// .format("justo") +/// .curated(true) +/// .category("et") +/// .doit(); +/// +/// match result { +/// Err(e) => match e { +/// // The Error enum provides details about what exactly happened. +/// // You can also just use its `Debug`, `Display` or `Error` traits +/// Error::HttpError(_) +/// |Error::MissingAPIKey +/// |Error::MissingToken(_) +/// |Error::Cancelled +/// |Error::UploadSizeLimitExceeded(_, _) +/// |Error::Failure(_) +/// |Error::BadRequest(_) +/// |Error::FieldClash(_) +/// |Error::JsonDecodeError(_, _) => println!("{}", e), +/// }, +/// Ok(res) => println!("Success: {:?}", res), +/// } +/// # } +/// ``` +pub struct PolyService { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for PolyService {} + +impl<'a, C, A> PolyService + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> PolyService { + PolyService { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://poly.googleapis.com/".to_string(), + _root_url: "https://poly.googleapis.com/".to_string(), + } + } + + pub fn assets(&'a self) -> AssetMethods<'a, C, A> { + AssetMethods { hub: &self } + } + 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://poly.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://poly.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 same asset can be represented in different formats, for example, +/// a [WaveFront .obj](//en.wikipedia.org/wiki/Wavefront_.obj_file) file with its +/// corresponding .mtl file or a [Khronos glTF](//www.khronos.org/gltf) file +/// with its corresponding .glb binary data. A format refers to a specific +/// representation of an asset and contains all information needed to +/// retrieve and describe this representation. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Format { + /// A short string that identifies the format type of this representation. + /// Possible values are: `FBX`, `GLTF`, `GLTF2`, `OBJ`, and `TILT`. + #[serde(rename="formatType")] + pub format_type: Option, + /// The root of the file hierarchy. This will always be populated. + /// For some format_types - such as `TILT`, which are self-contained - + /// this is all of the data. + /// + /// Other types - such as `OBJ` - often reference other data elements. + /// These are contained in the resources field. + pub root: Option, + /// Complexity stats about this representation of the asset. + #[serde(rename="formatComplexity")] + pub format_complexity: Option, + /// A list of dependencies of the root element. May include, but is not + /// limited to, materials, textures, and shader programs. + pub resources: Option>, +} + +impl Part for Format {} + + +/// A response message from a request to 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*). +/// +/// * [assets list users](struct.UserAssetListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListUserAssetsResponse { + /// The continuation token for retrieving the next page. If empty, + /// indicates that there are no more pages. To get the next page, submit the + /// same request specifying this value as the + /// page_token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total number of assets in the list, without pagination. + #[serde(rename="totalSize")] + pub total_size: Option, + /// A list of UserAssets matching the request. + #[serde(rename="userAssets")] + pub user_assets: Option>, +} + +impl ResponseResult for ListUserAssetsResponse {} + + +/// A response message from a request to 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*). +/// +/// * [likedassets list users](struct.UserLikedassetListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListLikedAssetsResponse { + /// The continuation token for retrieving the next page. If empty, + /// indicates that there are no more pages. To get the next page, submit the + /// same request specifying this value as the + /// page_token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total number of assets in the list, without pagination. + #[serde(rename="totalSize")] + pub total_size: Option, + /// A list of assets that match the criteria specified in the request. + pub assets: Option>, +} + +impl ResponseResult for ListLikedAssetsResponse {} + + +/// Information on the complexity of 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 FormatComplexity { + /// The estimated number of triangles. + #[serde(rename="triangleCount")] + pub triangle_count: Option, + /// A non-negative integer that represents the level of detail (LOD) of this + /// format relative to other formats of the same asset with the same + /// format_type. + /// This hint allows you to sort formats from the most-detailed (0) to + /// least-detailed (integers greater than 0). + #[serde(rename="lodHint")] + pub lod_hint: Option, +} + +impl Part for FormatComplexity {} + + +/// Data about the user's asset. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserAsset { + /// An Asset. + pub asset: Option, +} + +impl Part for UserAsset {} + + +/// Hints for displaying the asset, based on information available when the asset +/// was uploaded. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PresentationParams { + /// A rotation that should be applied to the object root to make it upright. + /// More precisely, this quaternion transforms from "object space" (the space + /// in which the object is defined) to "presentation space", a coordinate + /// system where +Y is up, +X is right, -Z is forward. For example, if + /// the object is the Eiffel Tower, in its local coordinate system the + /// object might be laid out such that the base of the tower is on the + /// YZ plane and the tip of the tower is towards positive X. In this case + /// this quaternion would specify a rotation (of 90 degrees about the Z + /// axis) such that in the presentation space the base of the tower is + /// aligned with the XZ plane, and the tip of the tower lies towards +Y. + /// + /// This rotation is unrelated to the object's pose in the web preview, + /// which is just a camera position setting and is *not* reflected in this + /// rotation. + /// + /// Please note: this is applicable only to the gLTF. + #[serde(rename="orientingRotation")] + pub orienting_rotation: Option, + /// The materials' diffuse/albedo color. This does not apply to vertex colors + /// or texture maps. + #[serde(rename="colorSpace")] + pub color_space: Option, +} + +impl Part for PresentationParams {} + + +/// A [Quaternion](//en.wikipedia.org/wiki/Quaternion). Please note: if in the +/// response you see "w: 1" and nothing else this is the default value of +/// [0, 0, 0, 1] where x,y, and z are 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 Quaternion { + /// The y component. + pub y: Option, + /// The x component. + pub x: Option, + /// The z component. + pub z: Option, + /// The scalar component. + pub w: Option, +} + +impl Part for Quaternion {} + + +/// Represents and describes an asset in the Poly library. An asset is a 3D model +/// or scene created using [Tilt Brush](//www.tiltbrush.com), +/// [Blocks](//vr.google.com/blocks/), or any 3D program that produces a file +/// that can be upload to Poly. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 assets](struct.AssetGetCall.html) (response) +/// * [list assets](struct.AssetListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Asset { + /// The time when the asset was last modified. For published assets, whose + /// contents are immutable, the update time changes only when metadata + /// properties, such as visibility, are updated. + #[serde(rename="updateTime")] + pub update_time: Option, + /// The human-readable name, set by the asset's author. + #[serde(rename="displayName")] + pub display_name: Option, + /// The human-readable description, set by the asset's author. + pub description: Option, + /// The license under which the author has made the asset available + /// for use, if any. + pub license: Option, + /// The visibility of the asset and who can access it. + pub visibility: Option, + /// The thumbnail image for the asset. + pub thumbnail: Option, + /// Hints for displaying the asset. Note that these parameters are not + /// immutable; the author of an asset may change them post-publication. + #[serde(rename="presentationParams")] + pub presentation_params: Option, + /// The author's publicly visible name. Use this name when giving credit to the + /// author. For more information, see [Licensing](/poly/discover/licensing). + #[serde(rename="authorName")] + pub author_name: Option, + /// Whether this asset has been curated by the Poly team. + #[serde(rename="isCurated")] + pub is_curated: Option, + /// A list of Formats where each + /// format describes one representation of the asset. + pub formats: Option>, + /// For published assets, the time when the asset was published. + /// For unpublished assets, the time when the asset was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// The unique identifier for the asset in the form: + /// `assets/{ASSET_ID}`. + pub name: Option, +} + +impl Resource for Asset {} +impl ResponseResult for Asset {} + + +/// Represents a file in Poly, which can be a root, +/// resource, or thumbnail 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 File { + /// The URL where the file data can be retrieved. + pub url: Option, + /// The path of the resource file relative to the root file. + /// For root or thumbnail files, this is just the filename. + #[serde(rename="relativePath")] + pub relative_path: Option, + /// The MIME content-type, such as `image/png`. + /// For more information, see + /// [MIME types](//developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types). + #[serde(rename="contentType")] + pub content_type: Option, +} + +impl Part for File {} + + +/// A response message from a request to 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*). +/// +/// * [list assets](struct.AssetListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListAssetsResponse { + /// The continuation token for retrieving the next page. If empty, + /// indicates that there are no more pages. To get the next page, submit the + /// same request specifying this value as the + /// page_token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total number of assets in the list, without pagination. + #[serde(rename="totalSize")] + pub total_size: Option, + /// A list of assets that match the criteria specified in the request. + pub assets: Option>, +} + +impl ResponseResult for ListAssetsResponse {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *asset* resources. +/// It is not used directly, but through the `PolyService` 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_poly1 as poly1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use poly1::PolyService; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = PolyService::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.assets(); +/// # } +/// ``` +pub struct AssetMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PolyService, +} + +impl<'a, C, A> MethodsBuilder for AssetMethods<'a, C, A> {} + +impl<'a, C, A> AssetMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists all public, remixable assets. These are assets with an access level of + /// PUBLIC and published under the + /// CC-By license. + pub fn list(&self) -> AssetListCall<'a, C, A> { + AssetListCall { + hub: self.hub, + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _max_complexity: Default::default(), + _keywords: Default::default(), + _format: Default::default(), + _curated: Default::default(), + _category: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns detailed information about an asset given its name. + /// PRIVATE assets are returned only if + /// the currently authenticated user (via OAuth token) is the author of the asset. + /// + /// # Arguments + /// + /// * `name` - Required. An asset's name in the form `assets/{ASSET_ID}`. + pub fn get(&self, name: &str) -> AssetGetCall<'a, C, A> { + AssetGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *user* resources. +/// It is not used directly, but through the `PolyService` 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_poly1 as poly1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use poly1::PolyService; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = PolyService::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 `assets_list(...)` and `likedassets_list(...)` +/// // to build up your call. +/// let rb = hub.users(); +/// # } +/// ``` +pub struct UserMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PolyService, +} + +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: + /// + /// Lists assets that the user has liked. Only the value 'me', representing + /// the currently-authenticated user, is supported. May include assets with an + /// access level of UNLISTED. + /// + /// # Arguments + /// + /// * `name` - A valid user id. Currently, only the special value 'me', representing the + /// currently-authenticated user is supported. To use 'me', you must pass + /// an OAuth token with the request. + pub fn likedassets_list(&self, name: &str) -> UserLikedassetListCall<'a, C, A> { + UserLikedassetListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _format: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists assets authored by the given user. Only the value 'me', representing + /// the currently-authenticated user, is supported. May include assets with an + /// access level of PRIVATE or + /// UNLISTED and assets which are + /// All Rights Reserved for the + /// currently-authenticated user. + /// + /// # Arguments + /// + /// * `name` - A valid user id. Currently, only the special value 'me', representing the + /// currently-authenticated user is supported. To use 'me', you must pass + /// an OAuth token with the request. + pub fn assets_list(&self, name: &str) -> UserAssetListCall<'a, C, A> { + UserAssetListCall { + hub: self.hub, + _name: name.to_string(), + _visibility: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _format: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Lists all public, remixable assets. These are assets with an access level of +/// PUBLIC and published under the +/// CC-By license. +/// +/// A builder for the *list* method supported by a *asset* resource. +/// It is not used directly, but through a `AssetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_poly1 as poly1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use poly1::PolyService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PolyService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.assets().list() +/// .page_token("et") +/// .page_size(-41) +/// .order_by("ipsum") +/// .max_complexity("Lorem") +/// .keywords("et") +/// .format("duo") +/// .curated(true) +/// .category("sea") +/// .doit(); +/// # } +/// ``` +pub struct AssetListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PolyService, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _max_complexity: Option, + _keywords: Option, + _format: Option, + _curated: Option, + _category: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for AssetListCall<'a, C, A> {} + +impl<'a, C, A> AssetListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAssetsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "poly.assets.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + 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._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_complexity { + params.push(("maxComplexity", value.to_string())); + } + if let Some(value) = self._keywords { + params.push(("keywords", value.to_string())); + } + if let Some(value) = self._format { + params.push(("format", value.to_string())); + } + if let Some(value) = self._curated { + params.push(("curated", value.to_string())); + } + if let Some(value) = self._category { + params.push(("category", value.to_string())); + } + for &field in ["alt", "pageToken", "pageSize", "orderBy", "maxComplexity", "keywords", "format", "curated", "category"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/assets"; + + 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) + } + } + } + } + + + /// Specifies a continuation token from a previous search whose results were + /// split into multiple pages. To get the next page, submit the same request + /// specifying the value from next_page_token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AssetListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of assets to be returned. This value must be between `1` + /// and `100`. Defaults to `20`. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AssetListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Specifies an ordering for assets. Acceptable values are: + /// `BEST`, `NEWEST`, `OLDEST`. Defaults to `BEST`, which ranks assets + /// based on a combination of popularity and other features. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> AssetListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// Returns assets that are of the specified complexity or less. Defaults to + /// COMPLEX. For example, a request for + /// MEDIUM assets also includes + /// SIMPLE assets. + /// + /// Sets the *max complexity* query property to the given value. + pub fn max_complexity(mut self, new_value: &str) -> AssetListCall<'a, C, A> { + self._max_complexity = Some(new_value.to_string()); + self + } + /// One or more search terms to be matched against all text that Poly has + /// indexed for assets, which includes display_name, + /// description, and tags. Multiple keywords should be + /// separated by spaces. + /// + /// Sets the *keywords* query property to the given value. + pub fn keywords(mut self, new_value: &str) -> AssetListCall<'a, C, A> { + self._keywords = Some(new_value.to_string()); + self + } + /// Return only assets with the matching format. Acceptable values are: + /// `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, `TILT`. + /// + /// Sets the *format* query property to the given value. + pub fn format(mut self, new_value: &str) -> AssetListCall<'a, C, A> { + self._format = Some(new_value.to_string()); + self + } + /// Return only assets that have been curated by the Poly team. + /// + /// Sets the *curated* query property to the given value. + pub fn curated(mut self, new_value: bool) -> AssetListCall<'a, C, A> { + self._curated = Some(new_value); + self + } + /// Filter assets based on the specified category. Supported values are: + /// `animals`, `architecture`, `art`, `food`, `nature`, `objects`, `people`, `scenes`, + /// `technology`, and `transport`. + /// + /// Sets the *category* query property to the given value. + pub fn category(mut self, new_value: &str) -> AssetListCall<'a, C, A> { + self._category = 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) -> AssetListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> AssetListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Returns detailed information about an asset given its name. +/// PRIVATE assets are returned only if +/// the currently authenticated user (via OAuth token) is the author of the asset. +/// +/// A builder for the *get* method supported by a *asset* resource. +/// It is not used directly, but through a `AssetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_poly1 as poly1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use poly1::PolyService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PolyService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.assets().get("name") +/// .doit(); +/// # } +/// ``` +pub struct AssetGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PolyService, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for AssetGetCall<'a, C, A> {} + +impl<'a, C, A> AssetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Asset)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "poly.assets.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) + } + } + } + } + + + /// Required. An asset's name in the form `assets/{ASSET_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) -> AssetGetCall<'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) -> AssetGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> AssetGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Lists assets that the user has liked. Only the value 'me', representing +/// the currently-authenticated user, is supported. May include assets with an +/// access level of UNLISTED. +/// +/// A builder for the *likedassets.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_poly1 as poly1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use poly1::PolyService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PolyService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling 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().likedassets_list("name") +/// .page_token("erat") +/// .page_size(-95) +/// .order_by("dolor") +/// .format("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct UserLikedassetListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PolyService, + _name: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _format: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for UserLikedassetListCall<'a, C, A> {} + +impl<'a, C, A> UserLikedassetListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListLikedAssetsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "poly.users.likedassets.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + 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._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._format { + params.push(("format", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "orderBy", "format"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in 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}/likedassets"; + + 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) + } + } + } + } + + + /// A valid user id. Currently, only the special value 'me', representing the + /// currently-authenticated user is supported. To use 'me', you must pass + /// an OAuth token with the request. + /// + /// 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) -> UserLikedassetListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Specifies a continuation token from a previous search whose results were + /// split into multiple pages. To get the next page, submit the same request + /// specifying the value from + /// next_page_token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> UserLikedassetListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of assets to be returned. This value must be between `1` + /// and `100`. Defaults to `20`. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> UserLikedassetListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Specifies an ordering for assets. Acceptable values are: + /// `BEST`, `NEWEST`, `OLDEST`, 'LIKED_TIME'. Defaults to `LIKED_TIME`, which + /// ranks assets based on how recently they were liked. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> UserLikedassetListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// Return only assets with the matching format. Acceptable values are: + /// `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, `TILT`. + /// + /// Sets the *format* query property to the given value. + pub fn format(mut self, new_value: &str) -> UserLikedassetListCall<'a, C, A> { + self._format = 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) -> UserLikedassetListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> UserLikedassetListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Lists assets authored by the given user. Only the value 'me', representing +/// the currently-authenticated user, is supported. May include assets with an +/// access level of PRIVATE or +/// UNLISTED and assets which are +/// All Rights Reserved for the +/// currently-authenticated user. +/// +/// A builder for the *assets.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_poly1 as poly1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use poly1::PolyService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PolyService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling 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().assets_list("name") +/// .visibility("amet") +/// .page_token("no") +/// .page_size(-36) +/// .order_by("eirmod") +/// .format("dolore") +/// .doit(); +/// # } +/// ``` +pub struct UserAssetListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PolyService, + _name: String, + _visibility: Option, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _format: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for UserAssetListCall<'a, C, A> {} + +impl<'a, C, A> UserAssetListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListUserAssetsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "poly.users.assets.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._visibility { + params.push(("visibility", 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())); + } + if let Some(value) = self._format { + params.push(("format", value.to_string())); + } + for &field in ["alt", "name", "visibility", "pageToken", "pageSize", "orderBy", "format"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in 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}/assets"; + + 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) + } + } + } + } + + + /// A valid user id. Currently, only the special value 'me', representing the + /// currently-authenticated user is supported. To use 'me', you must pass + /// an OAuth token with the request. + /// + /// 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) -> UserAssetListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The visibility of the assets to be returned. + /// Defaults to VISIBILITY_UNSPECIFIED which returns all assets. + /// + /// Sets the *visibility* query property to the given value. + pub fn visibility(mut self, new_value: &str) -> UserAssetListCall<'a, C, A> { + self._visibility = Some(new_value.to_string()); + self + } + /// Specifies a continuation token from a previous search whose results were + /// split into multiple pages. To get the next page, submit the same request + /// specifying the value from + /// next_page_token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> UserAssetListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of assets to be returned. This value must be between `1` + /// and `100`. Defaults to `20`. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> UserAssetListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Specifies an ordering for assets. Acceptable values are: + /// `BEST`, `NEWEST`, `OLDEST`. Defaults to `BEST`, which ranks assets + /// based on a combination of popularity and other features. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> UserAssetListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// Return only assets with the matching format. Acceptable values are: + /// `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, and `TILT`. + /// + /// Sets the *format* query property to the given value. + pub fn format(mut self, new_value: &str) -> UserAssetListCall<'a, C, A> { + self._format = 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) -> UserAssetListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> UserAssetListCall<'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/proximitybeacon1_beta1-cli/Cargo.toml b/gen/proximitybeacon1_beta1-cli/Cargo.toml index 11656274c6..5b9785e494 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+20170913" +version = "1.0.6+20171112" 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+20170913" +version = "1.0.6+20171112" diff --git a/gen/proximitybeacon1_beta1-cli/README.md b/gen/proximitybeacon1_beta1-cli/README.md index 66443867ca..6ba9b43056 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 *20170913*. The CLI is at version *1.0.6*. +This documentation was generated from the *proximitybeacon* API at revision *20171112*. 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 58a2d4615e..f21200daaf 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+20170913 +site_name: proximitybeacon v1.0.6+20171112 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 1300fe44ff..fb13fc331b 100644 --- a/gen/proximitybeacon1_beta1-cli/src/main.rs +++ b/gen/proximitybeacon1_beta1-cli/src/main.rs @@ -266,12 +266,13 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "data" => Some(("data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "creation-time-ms" => Some(("creationTimeMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "max-distance-meters" => Some(("maxDistanceMeters", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "attachment-name" => Some(("attachmentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-time-ms" => Some(("creationTimeMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "data" => Some(("data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "namespaced-type" => Some(("namespacedType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-name", "creation-time-ms", "data", "namespaced-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-name", "creation-time-ms", "data", "max-distance-meters", "namespaced-type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1147,8 +1148,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "serving-visibility" => Some(("servingVisibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "namespace-name" => Some(("namespaceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "serving-visibility" => Some(("servingVisibility", 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 +1962,7 @@ fn main() { let mut app = App::new("proximitybeacon1-beta1") .author("Sebastian Thiel ") - .version("1.0.6+20170913") + .version("1.0.6+20171112") .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 4244098a85..c0035a2562 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+20170913" +version = "1.0.6+20171112" 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+20170913" +documentation = "https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112" license = "MIT" keywords = ["proximitybeacon", "google", "protocol", "web", "api"] diff --git a/gen/proximitybeacon1_beta1/README.md b/gen/proximitybeacon1_beta1/README.md index dab01639f2..ab023dd4fd 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+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*. +This documentation was generated from *proximitybeacon* crate version *1.0.6+20171112*, where *20171112* 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+20170913/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+20171112/google_proximitybeacon1_beta1/struct.Proximitybeacon.html) ... * beaconinfo - * [*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) + * [*getforobserved*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconinfoGetforobservedCall.html) +* [beacons](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.Beacon.html) + * [*activate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconActivateCall.html), [*attachments batch delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconAttachmentBatchDeleteCall.html), [*attachments create*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconAttachmentCreateCall.html), [*attachments delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconAttachmentDeleteCall.html), [*attachments list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconAttachmentListCall.html), [*deactivate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconDeactivateCall.html), [*decommission*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconDecommissionCall.html), [*delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconDeleteCall.html), [*diagnostics list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconDiagnosticListCall.html), [*get*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconGetCall.html), [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconListCall.html), [*register*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconRegisterCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.BeaconUpdateCall.html) +* [namespaces](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.Namespace.html) + * [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.NamespaceListCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/struct.NamespaceUpdateCall.html) Other activities are ... -* [get eidparams](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20170913/google_proximitybeacon1_beta1/struct.MethodGetEidparamCall.html) +* [get eidparams](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/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+20170913/google_proximitybeacon1_beta1/struct.Proximitybeacon.html)** +* **[Hub](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/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+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)** + * creates [*Method Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/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+20170913/google_proximitybeacon1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/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+20170913/google_proximitybeacon1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/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+20170913/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+20171112/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+20170913/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+20171112/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+20170913/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+20171112/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+20170913/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+20171112/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/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+20170913/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+20171112/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/google_proximitybeacon1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/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+20170913/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+20171112/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+20170913/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+20171112/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+20170913/google_proximitybeacon1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-proximitybeacon1_beta1/1.0.6+20171112/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 2e714d92c5..626f77a64c 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+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*. +//! This documentation was generated from *proximitybeacon* crate version *1.0.6+20171112*, where *20171112* 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/). @@ -397,20 +397,39 @@ impl<'a, C, A> Proximitybeacon /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BeaconAttachment { - /// Resource name of this attachment. Attachment names have the format: - /// beacons/beacon_id/attachments/attachment_id. - /// Leave this empty on creation. - #[serde(rename="attachmentName")] - pub attachment_name: Option, - /// The UTC time when this attachment was created, in milliseconds since the - /// UNIX epoch. - #[serde(rename="creationTimeMs")] - pub creation_time_ms: Option, + /// The distance away from the beacon at which this attachment should be + /// delivered to a mobile app. + /// + /// Setting this to a value greater than zero indicates that the app should + /// behave as if the beacon is "seen" when the mobile device is less than this + /// distance away from the beacon. + /// + /// Different attachments on the same beacon can have different max distances. + /// + /// Note that even though this value is expressed with fractional meter + /// precision, real-world behavior is likley to be much less precise than one + /// meter, due to the nature of current Bluetooth radio technology. + /// + /// Optional. When not set or zero, the attachment should be delivered at the + /// beacon's outer limit of detection. + /// + /// Negative values are invalid and return an error. + #[serde(rename="maxDistanceMeters")] + pub max_distance_meters: Option, /// An opaque data container for client-provided data. Must be /// [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP /// requests, and will be so encoded (with padding) in responses. /// Required. pub data: Option, + /// The UTC time when this attachment was created, in milliseconds since the + /// UNIX epoch. + #[serde(rename="creationTimeMs")] + pub creation_time_ms: Option, + /// Resource name of this attachment. Attachment names have the format: + /// beacons/beacon_id/attachments/attachment_id. + /// Leave this empty on creation. + #[serde(rename="attachmentName")] + pub attachment_name: Option, /// Specifies what kind of attachment this is. Tells a client how to /// interpret the `data` field. Format is namespace/type. Namespace /// provides type separation between clients. Type describes the type of @@ -479,12 +498,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 +551,14 @@ impl RequestValue for GetInfoForObservedBeaconsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Namespace { - /// 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, + /// Specifies what clients may receive attachments under this namespace + /// via `beaconinfo.getforobserved`. + #[serde(rename="servingVisibility")] + pub serving_visibility: Option, } impl RequestValue for Namespace {} @@ -555,6 +574,23 @@ impl ResponseResult for Namespace {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AttachmentInfo { + /// The distance away from the beacon at which this attachment should be + /// delivered to a mobile app. + /// + /// Setting this to a value greater than zero indicates that the app should + /// behave as if the beacon is "seen" when the mobile device is less than this + /// distance away from the beacon. + /// + /// Different attachments on the same beacon can have different max distances. + /// + /// Note that even though this value is expressed with fractional meter + /// precision, real-world behavior is likley to be much less precise than one + /// meter, due to the nature of current Bluetooth radio technology. + /// + /// Optional. When not set or zero, the attachment should be delivered at the + /// beacon's outer limit of detection. + #[serde(rename="maxDistanceMeters")] + pub max_distance_meters: Option, /// An opaque data container for client-provided data. pub data: Option, /// Specifies what kind of attachment this is. Tells a client how to @@ -709,40 +745,6 @@ impl ResponseResult for EphemeralIdRegistrationParams {} /// 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)] @@ -1000,14 +1002,14 @@ impl ResponseResult for Empty {} /// #[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, + /// 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 Date {} @@ -1950,17 +1952,17 @@ impl<'a, C, A> BeaconAttachmentListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconAttachmentListCall<'a, C, A> @@ -2234,17 +2236,17 @@ impl<'a, C, A> BeaconGetCall<'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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> BeaconGetCall<'a, C, A> @@ -2554,17 +2556,17 @@ impl<'a, C, A> BeaconAttachmentCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconAttachmentCreateCall<'a, C, A> @@ -2835,17 +2837,17 @@ impl<'a, C, A> BeaconDecommissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconDecommissionCall<'a, C, A> @@ -3116,17 +3118,17 @@ impl<'a, C, A> BeaconActivateCall<'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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> BeaconActivateCall<'a, C, A> @@ -3455,17 +3457,17 @@ impl<'a, C, A> BeaconListCall<'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. - /// * *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) -> BeaconListCall<'a, C, A> @@ -3770,17 +3772,17 @@ impl<'a, C, A> BeaconUpdateCall<'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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> BeaconUpdateCall<'a, C, A> @@ -4050,17 +4052,17 @@ impl<'a, C, A> BeaconAttachmentDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconAttachmentDeleteCall<'a, C, A> @@ -4331,17 +4333,17 @@ impl<'a, C, A> BeaconDeactivateCall<'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) -> BeaconDeactivateCall<'a, C, A> @@ -4598,17 +4600,17 @@ impl<'a, C, A> BeaconRegisterCall<'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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> BeaconRegisterCall<'a, C, A> @@ -4877,17 +4879,17 @@ impl<'a, C, A> BeaconDeleteCall<'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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> BeaconDeleteCall<'a, C, A> @@ -5189,17 +5191,17 @@ impl<'a, C, A> BeaconDiagnosticListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconDiagnosticListCall<'a, C, A> @@ -5490,17 +5492,17 @@ impl<'a, C, A> BeaconAttachmentBatchDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconAttachmentBatchDeleteCall<'a, C, A> @@ -5734,17 +5736,17 @@ impl<'a, C, A> BeaconinfoGetforobservedCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconinfoGetforobservedCall<'a, C, A> @@ -5933,17 +5935,17 @@ impl<'a, C, A> MethodGetEidparamCall<'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) -> MethodGetEidparamCall<'a, C, A> @@ -6168,17 +6170,17 @@ impl<'a, C, A> NamespaceListCall<'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"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, 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) -> NamespaceListCall<'a, C, A> @@ -6469,17 +6471,17 @@ impl<'a, C, A> NamespaceUpdateCall<'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) -> NamespaceUpdateCall<'a, C, A> diff --git a/gen/pubsub1-cli/Cargo.toml b/gen/pubsub1-cli/Cargo.toml index 49637cb60b..ad629b4e4e 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+20170829" +version = "1.0.6+20171129" 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+20170829" +version = "1.0.6+20171129" diff --git a/gen/pubsub1-cli/README.md b/gen/pubsub1-cli/README.md index d7b57a20a5..c887791120 100644 --- a/gen/pubsub1-cli/README.md +++ b/gen/pubsub1-cli/README.md @@ -25,12 +25,16 @@ 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 *20170829*. The CLI is at version *1.0.6*. +This documentation was generated from the *Pubsub* API at revision *20171129*. The CLI is at version *1.0.6*. ```bash pubsub1 [options] projects + snapshots-create (-r )... [-p ]... [-o ] + snapshots-delete [-p ]... [-o ] snapshots-get-iam-policy [-p ]... [-o ] + snapshots-list [-p ]... [-o ] + snapshots-patch (-r )... [-p ]... [-o ] snapshots-set-iam-policy (-r )... [-p ]... [-o ] snapshots-test-iam-permissions (-r )... [-p ]... [-o ] subscriptions-acknowledge (-r )... [-p ]... [-o ] @@ -41,7 +45,9 @@ pubsub1 [options] subscriptions-list [-p ]... [-o ] subscriptions-modify-ack-deadline (-r )... [-p ]... [-o ] subscriptions-modify-push-config (-r )... [-p ]... [-o ] + subscriptions-patch (-r )... [-p ]... [-o ] subscriptions-pull (-r )... [-p ]... [-o ] + subscriptions-seek (-r )... [-p ]... [-o ] subscriptions-set-iam-policy (-r )... [-p ]... [-o ] subscriptions-test-iam-permissions (-r )... [-p ]... [-o ] topics-create (-r )... [-p ]... [-o ] @@ -51,6 +57,7 @@ pubsub1 [options] topics-list [-p ]... [-o ] topics-publish (-r )... [-p ]... [-o ] topics-set-iam-policy (-r )... [-p ]... [-o ] + topics-snapshots-list [-p ]... [-o ] topics-subscriptions-list [-p ]... [-o ] topics-test-iam-permissions (-r )... [-p ]... [-o ] pubsub1 --help diff --git a/gen/pubsub1-cli/mkdocs.yml b/gen/pubsub1-cli/mkdocs.yml index 788706b6fe..94f5d8b4d7 100644 --- a/gen/pubsub1-cli/mkdocs.yml +++ b/gen/pubsub1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Pubsub v1.0.6+20170829 +site_name: Pubsub v1.0.6+20171129 site_url: http://byron.github.io/google-apis-rs/google-pubsub1-cli site_description: A complete library to interact with Pubsub (protocol v1) @@ -9,7 +9,11 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['projects_snapshots-create.md', 'Projects', 'Snapshots Create'] +- ['projects_snapshots-delete.md', 'Projects', 'Snapshots Delete'] - ['projects_snapshots-get-iam-policy.md', 'Projects', 'Snapshots Get Iam Policy'] +- ['projects_snapshots-list.md', 'Projects', 'Snapshots List'] +- ['projects_snapshots-patch.md', 'Projects', 'Snapshots Patch'] - ['projects_snapshots-set-iam-policy.md', 'Projects', 'Snapshots Set Iam Policy'] - ['projects_snapshots-test-iam-permissions.md', 'Projects', 'Snapshots Test Iam Permissions'] - ['projects_subscriptions-acknowledge.md', 'Projects', 'Subscriptions Acknowledge'] @@ -20,7 +24,9 @@ pages: - ['projects_subscriptions-list.md', 'Projects', 'Subscriptions List'] - ['projects_subscriptions-modify-ack-deadline.md', 'Projects', 'Subscriptions Modify Ack Deadline'] - ['projects_subscriptions-modify-push-config.md', 'Projects', 'Subscriptions Modify Push Config'] +- ['projects_subscriptions-patch.md', 'Projects', 'Subscriptions Patch'] - ['projects_subscriptions-pull.md', 'Projects', 'Subscriptions Pull'] +- ['projects_subscriptions-seek.md', 'Projects', 'Subscriptions Seek'] - ['projects_subscriptions-set-iam-policy.md', 'Projects', 'Subscriptions Set Iam Policy'] - ['projects_subscriptions-test-iam-permissions.md', 'Projects', 'Subscriptions Test Iam Permissions'] - ['projects_topics-create.md', 'Projects', 'Topics Create'] @@ -30,6 +36,7 @@ pages: - ['projects_topics-list.md', 'Projects', 'Topics List'] - ['projects_topics-publish.md', 'Projects', 'Topics Publish'] - ['projects_topics-set-iam-policy.md', 'Projects', 'Topics Set Iam Policy'] +- ['projects_topics-snapshots-list.md', 'Projects', 'Topics Snapshots List'] - ['projects_topics-subscriptions-list.md', 'Projects', 'Topics Subscriptions List'] - ['projects_topics-test-iam-permissions.md', 'Projects', 'Topics Test Iam Permissions'] diff --git a/gen/pubsub1-cli/src/main.rs b/gen/pubsub1-cli/src/main.rs index 143d93c657..539755e676 100644 --- a/gen/pubsub1-cli/src/main.rs +++ b/gen/pubsub1-cli/src/main.rs @@ -46,6 +46,143 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _projects_snapshots_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()[..] { + "subscription" => Some(("subscription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["subscription"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CreateSnapshotRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().snapshots_create(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_snapshots_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().snapshots_delete(opt.value_of("snapshot").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_snapshots_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().snapshots_get_iam_policy(opt.value_of("resource").unwrap_or("")); @@ -98,6 +235,153 @@ impl<'n> Engine<'n> { } } + fn _projects_snapshots_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().snapshots_list(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 { + "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_snapshots_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()[..] { + "snapshot.topic" => Some(("snapshot.topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snapshot.expire-time" => Some(("snapshot.expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snapshot.name" => Some(("snapshot.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["expire-time", "name", "snapshot", "topic", "update-mask"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UpdateSnapshotRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().snapshots_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_snapshots_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -121,8 +405,8 @@ impl<'n> Engine<'n> { 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.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())))); @@ -377,13 +661,15 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "topic" => Some(("topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ack-deadline-seconds" => Some(("ackDeadlineSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "push-config.attributes" => Some(("pushConfig.attributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "push-config.push-endpoint" => Some(("pushConfig.pushEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "topic" => Some(("topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message-retention-duration" => Some(("messageRetentionDuration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retain-acked-messages" => Some(("retainAckedMessages", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["ack-deadline-seconds", "attributes", "name", "push-config", "push-endpoint", "topic"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["ack-deadline-seconds", "attributes", "message-retention-duration", "name", "push-config", "push-endpoint", "retain-acked-messages", "topic"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -830,6 +1116,98 @@ impl<'n> Engine<'n> { } } + fn _projects_subscriptions_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-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subscription.name" => Some(("subscription.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subscription.ack-deadline-seconds" => Some(("subscription.ackDeadlineSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "subscription.push-config.attributes" => Some(("subscription.pushConfig.attributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "subscription.push-config.push-endpoint" => Some(("subscription.pushConfig.pushEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subscription.topic" => Some(("subscription.topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subscription.message-retention-duration" => Some(("subscription.messageRetentionDuration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subscription.retain-acked-messages" => Some(("subscription.retainAckedMessages", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["ack-deadline-seconds", "attributes", "message-retention-duration", "name", "push-config", "push-endpoint", "retain-acked-messages", "subscription", "topic", "update-mask"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UpdateSubscriptionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().subscriptions_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_subscriptions_pull(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -916,6 +1294,92 @@ impl<'n> Engine<'n> { } } + fn _projects_subscriptions_seek(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "snapshot" => Some(("snapshot", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "time" => Some(("time", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["snapshot", "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::SeekRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().subscriptions_seek(request, opt.value_of("subscription").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_subscriptions_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -939,8 +1403,8 @@ impl<'n> Engine<'n> { 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.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())))); @@ -1494,8 +1958,8 @@ impl<'n> Engine<'n> { 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.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())))); @@ -1557,6 +2021,65 @@ impl<'n> Engine<'n> { } } + fn _projects_topics_snapshots_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().topics_snapshots_list(opt.value_of("topic").unwrap_or("")); + for parg in 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_topics_subscriptions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().topics_subscriptions_list(opt.value_of("topic").unwrap_or("")); @@ -1708,9 +2231,21 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("projects", Some(opt)) => { match opt.subcommand() { + ("snapshots-create", Some(opt)) => { + call_result = self._projects_snapshots_create(opt, dry_run, &mut err); + }, + ("snapshots-delete", Some(opt)) => { + call_result = self._projects_snapshots_delete(opt, dry_run, &mut err); + }, ("snapshots-get-iam-policy", Some(opt)) => { call_result = self._projects_snapshots_get_iam_policy(opt, dry_run, &mut err); }, + ("snapshots-list", Some(opt)) => { + call_result = self._projects_snapshots_list(opt, dry_run, &mut err); + }, + ("snapshots-patch", Some(opt)) => { + call_result = self._projects_snapshots_patch(opt, dry_run, &mut err); + }, ("snapshots-set-iam-policy", Some(opt)) => { call_result = self._projects_snapshots_set_iam_policy(opt, dry_run, &mut err); }, @@ -1741,9 +2276,15 @@ impl<'n> Engine<'n> { ("subscriptions-modify-push-config", Some(opt)) => { call_result = self._projects_subscriptions_modify_push_config(opt, dry_run, &mut err); }, + ("subscriptions-patch", Some(opt)) => { + call_result = self._projects_subscriptions_patch(opt, dry_run, &mut err); + }, ("subscriptions-pull", Some(opt)) => { call_result = self._projects_subscriptions_pull(opt, dry_run, &mut err); }, + ("subscriptions-seek", Some(opt)) => { + call_result = self._projects_subscriptions_seek(opt, dry_run, &mut err); + }, ("subscriptions-set-iam-policy", Some(opt)) => { call_result = self._projects_subscriptions_set_iam_policy(opt, dry_run, &mut err); }, @@ -1771,6 +2312,9 @@ impl<'n> Engine<'n> { ("topics-set-iam-policy", Some(opt)) => { call_result = self._projects_topics_set_iam_policy(opt, dry_run, &mut err); }, + ("topics-snapshots-list", Some(opt)) => { + call_result = self._projects_topics_snapshots_list(opt, dry_run, &mut err); + }, ("topics-subscriptions-list", Some(opt)) => { call_result = self._projects_topics_subscriptions_list(opt, dry_run, &mut err); }, @@ -1869,7 +2413,78 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'snapshots-get-iam-policy', 'snapshots-set-iam-policy', 'snapshots-test-iam-permissions', 'subscriptions-acknowledge', 'subscriptions-create', 'subscriptions-delete', 'subscriptions-get', 'subscriptions-get-iam-policy', 'subscriptions-list', 'subscriptions-modify-ack-deadline', 'subscriptions-modify-push-config', 'subscriptions-pull', 'subscriptions-set-iam-policy', 'subscriptions-test-iam-permissions', 'topics-create', 'topics-delete', 'topics-get', 'topics-get-iam-policy', 'topics-list', 'topics-publish', 'topics-set-iam-policy', 'topics-subscriptions-list' and 'topics-test-iam-permissions'", vec![ + ("projects", "methods: 'snapshots-create', 'snapshots-delete', 'snapshots-get-iam-policy', 'snapshots-list', 'snapshots-patch', 'snapshots-set-iam-policy', 'snapshots-test-iam-permissions', 'subscriptions-acknowledge', 'subscriptions-create', 'subscriptions-delete', 'subscriptions-get', 'subscriptions-get-iam-policy', 'subscriptions-list', 'subscriptions-modify-ack-deadline', 'subscriptions-modify-push-config', 'subscriptions-patch', 'subscriptions-pull', 'subscriptions-seek', 'subscriptions-set-iam-policy', 'subscriptions-test-iam-permissions', 'topics-create', 'topics-delete', 'topics-get', 'topics-get-iam-policy', 'topics-list', 'topics-publish', 'topics-set-iam-policy', 'topics-snapshots-list', 'topics-subscriptions-list' and 'topics-test-iam-permissions'", vec![ + ("snapshots-create", + Some(r##"Creates a snapshot from the requested subscription. + If the snapshot already exists, returns `ALREADY_EXISTS`. + If the requested subscription doesn't exist, returns `NOT_FOUND`. + If the backlog in the subscription is too old -- and the resulting snapshot + would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. + See also the `Snapshot.expire_time` field. + + If the name is not provided in the request, the server will assign a random + name for this snapshot on the same project as the subscription, conforming + to the + [resource name + format](https://cloud.google.com/pubsub/docs/overview#names). The generated + name is populated in the returned Snapshot object. Note that for REST API + requests, you must specify a name in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_snapshots-create", + vec![ + (Some(r##"name"##), + None, + Some(r##"Optional user-provided name for this snapshot. + If the name is not provided in the request, the server will assign a random + name for this snapshot on the same project as the subscription. + Note that for REST API requests, you must specify a name. + Format is `projects/{project}/snapshots/{snap}`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("snapshots-delete", + Some(r##"Removes an existing snapshot. All messages retained in the snapshot + are immediately dropped. After a snapshot is deleted, a new one may be + created with the same name, but the new one has no association with the old + snapshot or its subscription, unless the same subscription is specified."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_snapshots-delete", + vec![ + (Some(r##"snapshot"##), + None, + Some(r##"The name of the snapshot to delete. + Format is `projects/{project}/snapshots/{snap}`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("snapshots-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 @@ -1889,6 +2504,58 @@ 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)), + ]), + ("snapshots-list", + Some(r##"Lists the existing snapshots."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_snapshots-list", + vec![ + (Some(r##"project"##), + None, + Some(r##"The name of the cloud project that snapshots belong to. + Format is `projects/{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)), + ]), + ("snapshots-patch", + Some(r##"Updates an existing snapshot. Note that certain properties of a + snapshot are not modifiable."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_snapshots-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the snapshot."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -2196,6 +2863,40 @@ 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)), + ]), + ("subscriptions-patch", + Some(r##"Updates an existing subscription. Note that certain properties of a + subscription, such as its topic, are not modifiable."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_subscriptions-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the subscription. It must have the format + `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + start with a letter, and contain only letters (`[A-Za-z]`), numbers + (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + in length, and it must not start with `"goog"`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -2228,6 +2929,35 @@ 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)), + ]), + ("subscriptions-seek", + Some(r##"Seeks an existing subscription to a point in time or to a given snapshot, + whichever is provided in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_subscriptions-seek", + vec![ + (Some(r##"subscription"##), + None, + Some(r##"The subscription to affect."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -2485,6 +3215,29 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("topics-snapshots-list", + Some(r##"Lists the names of the snapshots on this topic."##), + "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_topics-snapshots-list", + vec![ + (Some(r##"topic"##), + None, + Some(r##"The name of the topic that snapshots are attached to. + Format is `projects/{project}/topics/{topic}`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -2492,7 +3245,7 @@ fn main() { Some(false)), ]), ("topics-subscriptions-list", - Some(r##"Lists the name of the subscriptions for this topic."##), + Some(r##"Lists the names of the subscriptions on this topic."##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_topics-subscriptions-list", vec![ (Some(r##"topic"##), @@ -2555,7 +3308,7 @@ fn main() { let mut app = App::new("pubsub1") .author("Sebastian Thiel ") - .version("1.0.6+20170829") + .version("1.0.6+20171129") .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 96d812c408..e44f03df14 100644 --- a/gen/pubsub1/Cargo.toml +++ b/gen/pubsub1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-pubsub1" -version = "1.0.6+20170829" +version = "1.0.6+20171129" 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+20170829" +documentation = "https://docs.rs/google-pubsub1/1.0.6+20171129" license = "MIT" keywords = ["pubsub", "google", "protocol", "web", "api"] diff --git a/gen/pubsub1/README.md b/gen/pubsub1/README.md index 51e95e8f3d..f8a47a7a22 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+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*. +This documentation was generated from *Pubsub* crate version *1.0.6+20171129*, where *20171129* 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+20170829/google_pubsub1/struct.Pubsub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.Pubsub.html) ... * projects - * [*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) + * [*snapshots create*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSnapshotCreateCall.html), [*snapshots delete*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSnapshotDeleteCall.html), [*snapshots get iam policy*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSnapshotGetIamPolicyCall.html), [*snapshots list*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSnapshotListCall.html), [*snapshots patch*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSnapshotPatchCall.html), [*snapshots set iam policy*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSnapshotSetIamPolicyCall.html), [*snapshots test iam permissions*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSnapshotTestIamPermissionCall.html), [*subscriptions acknowledge*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions patch*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionPatchCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionPullCall.html), [*subscriptions seek*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionSeekCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectTopicSetIamPolicyCall.html), [*topics snapshots list*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectTopicSnapshotListCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1/1.0.6+20171129/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+20170829/google_pubsub1/struct.Pubsub.html)** +* **[Hub](https://docs.rs/google-pubsub1/1.0.6+20171129/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+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)** + * creates [*Method Builders*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-pubsub1/1.0.6+20171129/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+20170829/google_pubsub1/trait.Part.html)** + * **[Parts](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-pubsub1/1.0.6+20170829/google_pubsub1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-pubsub1/1.0.6+20171129/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+20170829/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+20171129/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+20170829/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+20171129/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+20170829/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+20171129/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+20170829/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+20171129/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-pubsub1/1.0.6+20171129/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+20170829/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+20171129/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-pubsub1/1.0.6+20171129/google_pubsub1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-pubsub1/1.0.6+20171129/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+20170829/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+20171129/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+20170829/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+20171129/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+20170829/google_pubsub1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-pubsub1/1.0.6+20171129/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 e922a069c5..ad5ffa869c 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+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*. +//! This documentation was generated from *Pubsub* crate version *1.0.6+20171129*, where *20171129* 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). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Pubsub.html) ... //! //! * projects -//! * [*snapshots get iam policy*](struct.ProjectSnapshotGetIamPolicyCall.html), [*snapshots set iam policy*](struct.ProjectSnapshotSetIamPolicyCall.html), [*snapshots test iam permissions*](struct.ProjectSnapshotTestIamPermissionCall.html), [*subscriptions acknowledge*](struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](struct.ProjectTopicCreateCall.html), [*topics delete*](struct.ProjectTopicDeleteCall.html), [*topics get*](struct.ProjectTopicGetCall.html), [*topics get iam policy*](struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](struct.ProjectTopicListCall.html), [*topics publish*](struct.ProjectTopicPublishCall.html), [*topics set iam policy*](struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](struct.ProjectTopicTestIamPermissionCall.html) +//! * [*snapshots create*](struct.ProjectSnapshotCreateCall.html), [*snapshots delete*](struct.ProjectSnapshotDeleteCall.html), [*snapshots get iam policy*](struct.ProjectSnapshotGetIamPolicyCall.html), [*snapshots list*](struct.ProjectSnapshotListCall.html), [*snapshots patch*](struct.ProjectSnapshotPatchCall.html), [*snapshots set iam policy*](struct.ProjectSnapshotSetIamPolicyCall.html), [*snapshots test iam permissions*](struct.ProjectSnapshotTestIamPermissionCall.html), [*subscriptions acknowledge*](struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions patch*](struct.ProjectSubscriptionPatchCall.html), [*subscriptions pull*](struct.ProjectSubscriptionPullCall.html), [*subscriptions seek*](struct.ProjectSubscriptionSeekCall.html), [*subscriptions set iam policy*](struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](struct.ProjectTopicCreateCall.html), [*topics delete*](struct.ProjectTopicDeleteCall.html), [*topics get*](struct.ProjectTopicGetCall.html), [*topics get iam policy*](struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](struct.ProjectTopicListCall.html), [*topics publish*](struct.ProjectTopicPublishCall.html), [*topics set iam policy*](struct.ProjectTopicSetIamPolicyCall.html), [*topics snapshots list*](struct.ProjectTopicSnapshotListCall.html), [*topics subscriptions list*](struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](struct.ProjectTopicTestIamPermissionCall.html) //! //! //! @@ -371,6 +371,21 @@ impl<'a, C, A> Pubsub // ############ // SCHEMAS ### // ########## +/// 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*). +/// +/// * [subscriptions seek projects](struct.ProjectSubscriptionSeekCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SeekResponse { _never_set: Option } + +impl ResponseResult for SeekResponse {} + + /// Request message for `TestIamPermissions` method. /// /// # Activities @@ -456,6 +471,28 @@ pub struct ReceivedMessage { impl Part for ReceivedMessage {} +/// Request for the UpdateSnapshot 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*). +/// +/// * [snapshots patch projects](struct.ProjectSnapshotPatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateSnapshotRequest { + /// The updated snpashot object. + pub snapshot: Option, + /// Indicates which fields in the provided snapshot to update. + /// Must be specified and non-empty. + #[serde(rename="updateMask")] + pub update_mask: Option, +} + +impl RequestValue for UpdateSnapshotRequest {} + + /// Request for the Acknowledge method. /// /// # Activities @@ -504,6 +541,38 @@ pub struct ModifyAckDeadlineRequest { impl RequestValue for ModifyAckDeadlineRequest {} +/// Request for the `Seek` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [subscriptions seek projects](struct.ProjectSubscriptionSeekCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SeekRequest { + /// The snapshot to seek to. The snapshot's topic must be the same as that of + /// the provided subscription. + /// Format is `projects/{project}/snapshots/{snap}`. + pub snapshot: Option, + /// The time to seek to. + /// Messages retained in the subscription that were published before this + /// time are marked as acknowledged, and messages retained in the + /// subscription that were published after this time are marked as + /// unacknowledged. Note that this operation affects only those messages + /// retained in the subscription (configured by the combination of + /// `message_retention_duration` and `retain_acked_messages`). For example, + /// if `time` corresponds to a point before the message retention + /// window (or to a point before the system's notion of the subscription + /// creation time), only retained messages will be marked as unacknowledged, + /// and already-expunged messages will not be restored. + pub time: Option, +} + +impl RequestValue for SeekRequest {} + + /// Request for the Publish method. /// /// # Activities @@ -522,6 +591,61 @@ pub struct PublishRequest { impl RequestValue for PublishRequest {} +/// A snapshot 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*). +/// +/// * [snapshots create projects](struct.ProjectSnapshotCreateCall.html) (response) +/// * [snapshots patch projects](struct.ProjectSnapshotPatchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Snapshot { + /// The name of the topic from which this snapshot is retaining messages. + pub topic: Option, + /// The snapshot is guaranteed to exist up until this time. + /// A newly-created snapshot expires no later than 7 days from the time of its + /// creation. Its exact lifetime is determined at creation by the existing + /// backlog in the source subscription. Specifically, the lifetime of the + /// snapshot is `7 days - (age of oldest unacked message in the subscription)`. + /// For example, consider a subscription whose oldest unacked message is 3 days + /// old. If a snapshot is created from this subscription, the snapshot -- which + /// will always capture this 3-day-old backlog as long as the snapshot + /// exists -- will expire in 4 days. The service will refuse to create a + /// snapshot that would expire in less than 1 hour after creation. + #[serde(rename="expireTime")] + pub expire_time: Option, + /// The name of the snapshot. + pub name: Option, +} + +impl ResponseResult for Snapshot {} + + +/// Response for the `ListSnapshots` 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*). +/// +/// * [snapshots list projects](struct.ProjectSnapshotListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListSnapshotsResponse { + /// If not empty, indicates that there may be more snapshot that match the + /// request; this value should be passed in a new `ListSnapshotsRequest`. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The resulting snapshots. + pub snapshots: Option>, +} + +impl ResponseResult for ListSnapshotsResponse {} + + /// Defines an Identity and Access Management (IAM) policy. It is used to /// specify access control policies for Cloud Platform resources. /// @@ -571,8 +695,6 @@ 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 @@ -584,6 +706,8 @@ 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 {} @@ -650,7 +774,7 @@ pub struct ModifyPushConfigRequest { /// An empty `pushConfig` indicates that the Pub/Sub system should /// stop pushing messages from the given subscription and allow /// messages to be pulled and acknowledged - effectively pausing - /// the subscription if `Pull` is not called. + /// the subscription if `Pull` or `StreamingPull` is not called. #[serde(rename="pushConfig")] pub push_config: Option, } @@ -673,11 +797,12 @@ impl RequestValue for ModifyPushConfigRequest {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [subscriptions acknowledge projects](struct.ProjectSubscriptionAcknowledgeCall.html) (response) /// * [subscriptions modify push config projects](struct.ProjectSubscriptionModifyPushConfigCall.html) (response) -/// * [subscriptions delete projects](struct.ProjectSubscriptionDeleteCall.html) (response) /// * [topics delete projects](struct.ProjectTopicDeleteCall.html) (response) /// * [subscriptions modify ack deadline projects](struct.ProjectSubscriptionModifyAckDeadlineCall.html) (response) +/// * [snapshots delete projects](struct.ProjectSnapshotDeleteCall.html) (response) +/// * [subscriptions acknowledge projects](struct.ProjectSubscriptionAcknowledgeCall.html) (response) +/// * [subscriptions delete projects](struct.ProjectSubscriptionDeleteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } @@ -706,6 +831,33 @@ pub struct TestIamPermissionsResponse { impl ResponseResult for TestIamPermissionsResponse {} +/// A message data and its attributes. The message payload must not be empty; +/// it must contain either a non-empty data field, or at least one attribute. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PubsubMessage { + /// Optional attributes for this message. + pub attributes: Option>, + /// The message payload. + pub data: Option, + /// The time at which the message was published, populated by the server when + /// it receives the `Publish` call. It must not be populated by the + /// publisher in a `Publish` call. + #[serde(rename="publishTime")] + pub publish_time: Option, + /// ID of this message, assigned by the server when the message is published. + /// Guaranteed to be unique within the topic. This value may be read by a + /// subscriber that receives a `PubsubMessage` via a `Pull` call or a push + /// delivery. It must not be populated by the publisher in a `Publish` call. + #[serde(rename="messageId")] + pub message_id: Option, +} + +impl Part for PubsubMessage {} + + /// Request for the `Pull` method. /// /// # Activities @@ -774,6 +926,32 @@ pub struct Binding { impl Part for Binding {} +/// Request for the `CreateSnapshot` 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*). +/// +/// * [snapshots create projects](struct.ProjectSnapshotCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateSnapshotRequest { + /// The subscription whose backlog the snapshot retains. + /// Specifically, the created snapshot is guaranteed to retain: + /// (a) The existing backlog on the subscription. More precisely, this is + /// defined as the messages in the subscription's backlog that are + /// unacknowledged upon the successful completion of the + /// `CreateSnapshot` request; as well as: + /// (b) Any messages published to the subscription's topic following the + /// successful completion of the CreateSnapshot request. + /// Format is `projects/{project}/subscriptions/{sub}`. + pub subscription: Option, +} + +impl RequestValue for CreateSnapshotRequest {} + + /// A topic resource. /// /// # Activities @@ -799,6 +977,28 @@ impl RequestValue for Topic {} impl ResponseResult for Topic {} +/// Request for the UpdateSubscription method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [subscriptions patch projects](struct.ProjectSubscriptionPatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateSubscriptionRequest { + /// Indicates which fields in the provided subscription to update. + /// Must be specified and non-empty. + #[serde(rename="updateMask")] + pub update_mask: Option, + /// The updated subscription object. + pub subscription: Option, +} + +impl RequestValue for UpdateSubscriptionRequest {} + + /// Response for the `Publish` method. /// /// # Activities @@ -842,31 +1042,27 @@ pub struct PullResponse { impl ResponseResult for PullResponse {} -/// A message data and its attributes. The message payload must not be empty; -/// it must contain either a non-empty data field, or at least one attribute. +/// Response for the `ListTopicSnapshots` method. /// -/// 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*). +/// +/// * [topics snapshots list projects](struct.ProjectTopicSnapshotListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PubsubMessage { - /// Optional attributes for this message. - pub attributes: Option>, - /// The message payload. - pub data: Option, - /// The time at which the message was published, populated by the server when - /// it receives the `Publish` call. It must not be populated by the - /// publisher in a `Publish` call. - #[serde(rename="publishTime")] - pub publish_time: Option, - /// ID of this message, assigned by the server when the message is published. - /// Guaranteed to be unique within the topic. This value may be read by a - /// subscriber that receives a `PubsubMessage` via a `Pull` call or a push - /// delivery. It must not be populated by the publisher in a `Publish` call. - #[serde(rename="messageId")] - pub message_id: Option, +pub struct ListTopicSnapshotsResponse { + /// If not empty, indicates that there may be more snapshots that match + /// the request; this value should be passed in a new + /// `ListTopicSnapshotsRequest` to get more snapshots. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The names of the snapshots that match the request. + pub snapshots: Option>, } -impl Part for PubsubMessage {} +impl ResponseResult for ListTopicSnapshotsResponse {} /// Configuration for a push delivery endpoint. @@ -913,6 +1109,7 @@ impl Part for PushConfig {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [subscriptions patch projects](struct.ProjectSubscriptionPatchCall.html) (response) /// * [subscriptions create projects](struct.ProjectSubscriptionCreateCall.html) (request|response) /// * [subscriptions get projects](struct.ProjectSubscriptionGetCall.html) (response) /// @@ -923,6 +1120,27 @@ pub struct Subscription { /// The value of this field will be `_deleted-topic_` if the topic has been /// deleted. pub topic: Option, + /// How long to retain unacknowledged messages in the subscription's backlog, + /// from the moment a message is published. + /// If `retain_acked_messages` is true, then this also configures the retention + /// of acknowledged messages, and thus configures how far back in time a `Seek` + /// can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 + /// minutes. + #[serde(rename="messageRetentionDuration")] + pub message_retention_duration: Option, + /// Indicates whether to retain acknowledged messages. If true, then + /// messages are not expunged from the subscription's backlog, even if they are + /// acknowledged, until they fall out of the `message_retention_duration` + /// window. + #[serde(rename="retainAckedMessages")] + pub retain_acked_messages: Option, + /// The name of the subscription. It must have the format + /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + /// start with a letter, and contain only letters (`[A-Za-z]`), numbers + /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + /// plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + /// in length, and it must not start with `"goog"`. + pub name: Option, /// This value is the maximum time after a subscriber receives a message /// before the subscriber should acknowledge the message. After message /// delivery but before the ack deadline expires and before the message is @@ -932,7 +1150,8 @@ pub struct Subscription { /// For pull subscriptions, this value is used as the initial value for the ack /// deadline. To override this value for a given message, call /// `ModifyAckDeadline` with the corresponding `ack_id` if using - /// pull. + /// non-streaming pull or send the `ack_id` in a + /// `StreamingModifyAckDeadlineRequest` if using streaming pull. /// The minimum custom deadline you can specify is 10 seconds. /// The maximum custom deadline you can specify is 600 seconds (10 minutes). /// If this parameter is 0, a default value of 10 seconds is used. @@ -949,13 +1168,6 @@ pub struct Subscription { /// will pull and ack messages using API methods. #[serde(rename="pushConfig")] pub push_config: Option, - /// The name of the subscription. It must have the format - /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - /// start with a letter, and contain only letters (`[A-Za-z]`), numbers - /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - /// plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - /// in length, and it must not start with `"goog"`. - pub name: Option, } impl RequestValue for Subscription {} @@ -991,7 +1203,7 @@ impl ResponseResult for Subscription {} /// ::default(), None); /// let mut hub = Pubsub::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 `snapshots_get_iam_policy(...)`, `snapshots_set_iam_policy(...)`, `snapshots_test_iam_permissions(...)`, `subscriptions_acknowledge(...)`, `subscriptions_create(...)`, `subscriptions_delete(...)`, `subscriptions_get(...)`, `subscriptions_get_iam_policy(...)`, `subscriptions_list(...)`, `subscriptions_modify_ack_deadline(...)`, `subscriptions_modify_push_config(...)`, `subscriptions_pull(...)`, `subscriptions_set_iam_policy(...)`, `subscriptions_test_iam_permissions(...)`, `topics_create(...)`, `topics_delete(...)`, `topics_get(...)`, `topics_get_iam_policy(...)`, `topics_list(...)`, `topics_publish(...)`, `topics_set_iam_policy(...)`, `topics_subscriptions_list(...)` and `topics_test_iam_permissions(...)` +/// // like `snapshots_create(...)`, `snapshots_delete(...)`, `snapshots_get_iam_policy(...)`, `snapshots_list(...)`, `snapshots_patch(...)`, `snapshots_set_iam_policy(...)`, `snapshots_test_iam_permissions(...)`, `subscriptions_acknowledge(...)`, `subscriptions_create(...)`, `subscriptions_delete(...)`, `subscriptions_get(...)`, `subscriptions_get_iam_policy(...)`, `subscriptions_list(...)`, `subscriptions_modify_ack_deadline(...)`, `subscriptions_modify_push_config(...)`, `subscriptions_patch(...)`, `subscriptions_pull(...)`, `subscriptions_seek(...)`, `subscriptions_set_iam_policy(...)`, `subscriptions_test_iam_permissions(...)`, `topics_create(...)`, `topics_delete(...)`, `topics_get(...)`, `topics_get_iam_policy(...)`, `topics_list(...)`, `topics_publish(...)`, `topics_set_iam_policy(...)`, `topics_snapshots_list(...)`, `topics_subscriptions_list(...)` and `topics_test_iam_permissions(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1328,6 +1540,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates an existing snapshot. Note that certain properties of a + /// snapshot are not modifiable. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the snapshot. + pub fn snapshots_patch(&self, request: UpdateSnapshotRequest, name: &str) -> ProjectSnapshotPatchCall<'a, C, A> { + ProjectSnapshotPatchCall { + 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: /// /// Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic @@ -1368,6 +1600,27 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Removes an existing snapshot. All messages retained in the snapshot + /// are immediately dropped. After a snapshot is deleted, a new one may be + /// created with the same name, but the new one has no association with the old + /// snapshot or its subscription, unless the same subscription is specified. + /// + /// # Arguments + /// + /// * `snapshot` - The name of the snapshot to delete. + /// Format is `projects/{project}/snapshots/{snap}`. + pub fn snapshots_delete(&self, snapshot: &str) -> ProjectSnapshotDeleteCall<'a, C, A> { + ProjectSnapshotDeleteCall { + hub: self.hub, + _snapshot: snapshot.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 @@ -1411,6 +1664,67 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates an existing subscription. Note that certain properties of a + /// subscription, such as its topic, are not modifiable. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the subscription. It must have the format + /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + /// start with a letter, and contain only letters (`[A-Za-z]`), numbers + /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + /// plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + /// in length, and it must not start with `"goog"`. + pub fn subscriptions_patch(&self, request: UpdateSubscriptionRequest, name: &str) -> ProjectSubscriptionPatchCall<'a, C, A> { + ProjectSubscriptionPatchCall { + 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 a snapshot from the requested subscription. + /// If the snapshot already exists, returns `ALREADY_EXISTS`. + /// If the requested subscription doesn't exist, returns `NOT_FOUND`. + /// If the backlog in the subscription is too old -- and the resulting snapshot + /// would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. + /// See also the `Snapshot.expire_time` field. + /// + /// If the name is not provided in the request, the server will assign a random + /// name for this snapshot on the same project as the subscription, conforming + /// to the + /// [resource name + /// format](https://cloud.google.com/pubsub/docs/overview#names). The generated + /// name is populated in the returned Snapshot object. Note that for REST API + /// requests, you must specify a name in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Optional user-provided name for this snapshot. + /// If the name is not provided in the request, the server will assign a random + /// name for this snapshot on the same project as the subscription. + /// Note that for REST API requests, you must specify a name. + /// Format is `projects/{project}/snapshots/{snap}`. + pub fn snapshots_create(&self, request: CreateSnapshotRequest, name: &str) -> ProjectSnapshotCreateCall<'a, C, A> { + ProjectSnapshotCreateCall { + 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 a subscription to a given topic. @@ -1444,6 +1758,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the existing snapshots. + /// + /// # Arguments + /// + /// * `project` - The name of the cloud project that snapshots belong to. + /// Format is `projects/{project}`. + pub fn snapshots_list(&self, project: &str) -> ProjectSnapshotListCall<'a, C, A> { + ProjectSnapshotListCall { + hub: self.hub, + _project: project.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: /// /// Sets the access control policy on the specified resource. Replaces any @@ -1465,6 +1799,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Seeks an existing subscription to a point in time or to a given snapshot, + /// whichever is provided in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `subscription` - The subscription to affect. + pub fn subscriptions_seek(&self, request: SeekRequest, subscription: &str) -> ProjectSubscriptionSeekCall<'a, C, A> { + ProjectSubscriptionSeekCall { + hub: self.hub, + _request: request, + _subscription: subscription.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the configuration details of a subscription. @@ -1485,7 +1839,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the name of the subscriptions for this topic. + /// Lists the names of the subscriptions on this topic. /// /// # Arguments /// @@ -1503,6 +1857,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the names of the snapshots on this topic. + /// + /// # Arguments + /// + /// * `topic` - The name of the topic that snapshots are attached to. + /// Format is `projects/{project}/topics/{topic}`. + pub fn topics_snapshots_list(&self, topic: &str) -> ProjectTopicSnapshotListCall<'a, C, A> { + ProjectTopicSnapshotListCall { + hub: self.hub, + _topic: topic.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: /// /// Sets the access control policy on the specified resource. Replaces any @@ -5439,6 +5813,291 @@ impl<'a, C, A> ProjectTopicListCall<'a, C, A> where C: BorrowMut, } +/// Updates an existing snapshot. Note that certain properties of a +/// snapshot are not modifiable. +/// +/// A builder for the *snapshots.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_pubsub1 as pubsub1; +/// use pubsub1::UpdateSnapshotRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use pubsub1::Pubsub; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Pubsub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = UpdateSnapshotRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().snapshots_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSnapshotPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _request: UpdateSnapshotRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSnapshotPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectSnapshotPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Snapshot)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "pubsub.projects.snapshots.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: UpdateSnapshotRequest) -> ProjectSnapshotPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the snapshot. + /// + /// 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) -> ProjectSnapshotPatchCall<'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) -> ProjectSnapshotPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectSnapshotPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSnapshotPatchCall<'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 one or more messages to the topic. Returns `NOT_FOUND` if the topic /// does not exist. The message payload must not be empty; it must contain /// either a non-empty data field, or at least one attribute. @@ -5980,6 +6639,263 @@ impl<'a, C, A> ProjectTopicGetCall<'a, C, A> where C: BorrowMut, } +/// Removes an existing snapshot. All messages retained in the snapshot +/// are immediately dropped. After a snapshot is deleted, a new one may be +/// created with the same name, but the new one has no association with the old +/// snapshot or its subscription, unless the same subscription is specified. +/// +/// A builder for the *snapshots.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_pubsub1 as pubsub1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use pubsub1::Pubsub; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Pubsub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().snapshots_delete("snapshot") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSnapshotDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _snapshot: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSnapshotDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectSnapshotDeleteCall<'a, C, 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: "pubsub.projects.snapshots.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("snapshot", self._snapshot.to_string())); + for &field in ["alt", "snapshot"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+snapshot}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+snapshot}", "snapshot")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["snapshot"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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 snapshot to delete. + /// Format is `projects/{project}/snapshots/{snap}`. + /// + /// Sets the *snapshot* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn snapshot(mut self, new_value: &str) -> ProjectSnapshotDeleteCall<'a, C, A> { + self._snapshot = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectSnapshotDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectSnapshotDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSnapshotDeleteCall<'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. /// @@ -6524,6 +7440,597 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Pubsub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = UpdateSubscriptionRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().subscriptions_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSubscriptionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _request: UpdateSubscriptionRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSubscriptionPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectSubscriptionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Subscription)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "pubsub.projects.subscriptions.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: UpdateSubscriptionRequest) -> ProjectSubscriptionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the subscription. It must have the format + /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + /// start with a letter, and contain only letters (`[A-Za-z]`), numbers + /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + /// plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + /// in length, and it must not start with `"goog"`. + /// + /// 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) -> ProjectSubscriptionPatchCall<'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) -> ProjectSubscriptionPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectSubscriptionPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSubscriptionPatchCall<'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 snapshot from the requested subscription. +/// If the snapshot already exists, returns `ALREADY_EXISTS`. +/// If the requested subscription doesn't exist, returns `NOT_FOUND`. +/// If the backlog in the subscription is too old -- and the resulting snapshot +/// would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. +/// See also the `Snapshot.expire_time` field. +/// +/// If the name is not provided in the request, the server will assign a random +/// name for this snapshot on the same project as the subscription, conforming +/// to the +/// [resource name +/// format](https://cloud.google.com/pubsub/docs/overview#names). The generated +/// name is populated in the returned Snapshot object. Note that for REST API +/// requests, you must specify a name in the request. +/// +/// A builder for the *snapshots.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_pubsub1 as pubsub1; +/// use pubsub1::CreateSnapshotRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use pubsub1::Pubsub; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Pubsub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CreateSnapshotRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().snapshots_create(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSnapshotCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _request: CreateSnapshotRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSnapshotCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectSnapshotCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Snapshot)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "pubsub.projects.snapshots.create", + http_method: hyper::method::Method::Put }); + 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::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: CreateSnapshotRequest) -> ProjectSnapshotCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Optional user-provided name for this snapshot. + /// If the name is not provided in the request, the server will assign a random + /// name for this snapshot on the same project as the subscription. + /// Note that for REST API requests, you must specify a name. + /// Format is `projects/{project}/snapshots/{snap}`. + /// + /// 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) -> ProjectSnapshotCreateCall<'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) -> ProjectSnapshotCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectSnapshotCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSnapshotCreateCall<'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 subscription to a given topic. /// If the subscription already exists, returns `ALREADY_EXISTS`. /// If the corresponding topic doesn't exist, returns `NOT_FOUND`. @@ -6822,6 +8329,286 @@ impl<'a, C, A> ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Pubsub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().snapshots_list("project") +/// .page_token("sea") +/// .page_size(-55) +/// .doit(); +/// # } +/// ``` +pub struct ProjectSnapshotListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _project: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSnapshotListCall<'a, C, A> {} + +impl<'a, C, A> ProjectSnapshotListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListSnapshotsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "pubsub.projects.snapshots.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + 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", "project", "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/{+project}/snapshots"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+project}", "project")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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 token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 cloud project that snapshots belong to. + /// Format is `projects/{project}`. + /// + /// 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) -> ProjectSnapshotListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The value returned by the last `ListSnapshotsResponse`; indicates that this + /// is a continuation of a prior `ListSnapshots` 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) -> ProjectSnapshotListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of snapshots to return. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectSnapshotListCall<'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) -> ProjectSnapshotListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectSnapshotListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSnapshotListCall<'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. /// @@ -7108,6 +8895,291 @@ impl<'a, C, A> ProjectSnapshotSetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Pubsub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SeekRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().subscriptions_seek(req, "subscription") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSubscriptionSeekCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _request: SeekRequest, + _subscription: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSubscriptionSeekCall<'a, C, A> {} + +impl<'a, C, A> ProjectSubscriptionSeekCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SeekResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "pubsub.projects.subscriptions.seek", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("subscription", self._subscription.to_string())); + for &field in ["alt", "subscription"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+subscription}:seek"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+subscription}", "subscription")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["subscription"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: SeekRequest) -> ProjectSubscriptionSeekCall<'a, C, A> { + self._request = new_value; + self + } + /// The subscription to affect. + /// + /// Sets the *subscription* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn subscription(mut self, new_value: &str) -> ProjectSubscriptionSeekCall<'a, C, A> { + self._subscription = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectSubscriptionSeekCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectSubscriptionSeekCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSubscriptionSeekCall<'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 configuration details of a subscription. /// /// A builder for the *subscriptions.get* method supported by a *project* resource. @@ -7362,7 +9434,7 @@ impl<'a, C, A> ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Pubsub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().topics_snapshots_list("topic") +/// .page_token("no") +/// .page_size(-36) +/// .doit(); +/// # } +/// ``` +pub struct ProjectTopicSnapshotListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Pubsub, + _topic: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTopicSnapshotListCall<'a, C, A> {} + +impl<'a, C, A> ProjectTopicSnapshotListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListTopicSnapshotsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "pubsub.projects.topics.snapshots.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("topic", self._topic.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", "topic", "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/{+topic}/snapshots"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+topic}", "topic")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["topic"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 topic that snapshots are attached to. + /// Format is `projects/{project}/topics/{topic}`. + /// + /// Sets the *topic* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn topic(mut self, new_value: &str) -> ProjectTopicSnapshotListCall<'a, C, A> { + self._topic = new_value.to_string(); + self + } + /// The value returned by the last `ListTopicSnapshotsResponse`; indicates + /// that this is a continuation of a prior `ListTopicSnapshots` 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) -> ProjectTopicSnapshotListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of snapshot names to return. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectTopicSnapshotListCall<'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) -> ProjectTopicSnapshotListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectTopicSnapshotListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectTopicSnapshotListCall<'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. /// diff --git a/gen/pubsub1_beta2-cli/Cargo.toml b/gen/pubsub1_beta2-cli/Cargo.toml index 34bd0bb376..85f83950ce 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+20170829" +version = "1.0.6+20171129" 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+20170829" +version = "1.0.6+20171129" diff --git a/gen/pubsub1_beta2-cli/README.md b/gen/pubsub1_beta2-cli/README.md index 4c90c6cca7..90a39fe726 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 *20170829*. The CLI is at version *1.0.6*. +This documentation was generated from the *Pubsub* API at revision *20171129*. 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 5850b66f8f..2e2364459b 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+20170829 +site_name: Pubsub v1.0.6+20171129 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 524112a7bc..8f3ba738e7 100644 --- a/gen/pubsub1_beta2-cli/src/main.rs +++ b/gen/pubsub1_beta2-cli/src/main.rs @@ -154,8 +154,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 })), "topic" => Some(("topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ack-deadline-seconds" => Some(("ackDeadlineSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "push-config.attributes" => Some(("pushConfig.attributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "push-config.push-endpoint" => Some(("pushConfig.pushEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -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-ids" => Some(("ackIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "ack-id" => Some(("ackId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ack-ids" => Some(("ackIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["ack-deadline-seconds", "ack-id", "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.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "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())))); @@ -1272,8 +1272,8 @@ impl<'n> Engine<'n> { 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.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())))); @@ -2219,7 +2219,7 @@ fn main() { let mut app = App::new("pubsub1-beta2") .author("Sebastian Thiel ") - .version("1.0.6+20170829") + .version("1.0.6+20171129") .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 9815b81099..5f022e5025 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+20170829" +version = "1.0.6+20171129" 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+20170829" +documentation = "https://docs.rs/google-pubsub1_beta2/1.0.6+20171129" license = "MIT" keywords = ["pubsub", "google", "protocol", "web", "api"] diff --git a/gen/pubsub1_beta2/README.md b/gen/pubsub1_beta2/README.md index 52739f7e00..3a6401f46e 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+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*. +This documentation was generated from *Pubsub* crate version *1.0.6+20171129*, where *20171129* 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+20170829/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+20171129/google_pubsub1_beta2/struct.Pubsub.html) ... * projects - * [*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) + * [*subscriptions acknowledge*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/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+20170829/google_pubsub1_beta2/struct.Pubsub.html)** +* **[Hub](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/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+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)** + * creates [*Method Builders*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/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+20170829/google_pubsub1_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/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+20170829/google_pubsub1_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/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+20170829/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+20171129/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+20170829/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+20171129/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+20170829/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+20171129/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+20170829/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+20171129/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/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+20170829/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+20171129/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/google_pubsub1_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/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+20170829/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+20171129/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+20170829/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+20171129/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+20170829/google_pubsub1_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-pubsub1_beta2/1.0.6+20171129/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 7491d6f551..617970a3c2 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+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*. +//! This documentation was generated from *Pubsub* crate version *1.0.6+20171129*, where *20171129* 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). @@ -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 {} @@ -568,8 +568,6 @@ 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 @@ -581,6 +579,8 @@ 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 {} @@ -729,69 +729,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 push message. This attribute - /// indicates the version of the data expected by the endpoint. This - /// controls the shape of the envelope (i.e. its fields and metadata). - /// The endpoint version is based on the version of the Pub/Sub - /// API. - /// - /// If not present during the `CreateSubscription` call, it will default to - /// the version of the API used to make such call. If not present during a - /// `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - /// calls will always return a valid version, even if the subscription was - /// created without this attribute. - /// - /// The possible values for this attribute are: - /// - /// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - /// * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - pub attributes: Option>, - /// A URL locating the endpoint to which messages should be pushed. - /// For example, a Webhook endpoint might use "https://example.com/push". - #[serde(rename="pushEndpoint")] - pub push_endpoint: Option, -} - -impl Part for PushConfig {} - - -/// 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. @@ -832,6 +769,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 @@ -903,6 +865,44 @@ 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 push message. This attribute + /// indicates the version of the data expected by the endpoint. This + /// controls the shape of the envelope (i.e. its fields and metadata). + /// The endpoint version is based on the version of the Pub/Sub + /// API. + /// + /// If not present during the `CreateSubscription` call, it will default to + /// the version of the API used to make such call. If not present during a + /// `ModifyPushConfig` call, its value will not be changed. `GetSubscription` + /// calls will always return a valid version, even if the subscription was + /// created without this attribute. + /// + /// The possible values for this attribute are: + /// + /// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + /// * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + pub attributes: Option>, + /// A URL locating the endpoint to which messages should be pushed. + /// For example, a Webhook endpoint might use "https://example.com/push". + #[serde(rename="pushEndpoint")] + pub push_endpoint: Option, +} + +impl Part for PushConfig {} + + /// A subscription resource. /// /// # Activities @@ -915,6 +915,10 @@ impl Part for PubsubMessage {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Subscription { + /// The name of the topic from which this subscription is receiving messages. + /// The value of this field will be `_deleted-topic_` if the topic has been + /// deleted. + pub topic: Option, /// This value is the maximum time after a subscriber receives a message /// before the subscriber should acknowledge the message. After message /// delivery but before the ack deadline expires and before the message is @@ -935,10 +939,6 @@ pub struct Subscription { /// If this parameter is 0, a default value of 10 seconds is used. #[serde(rename="ackDeadlineSeconds")] pub ack_deadline_seconds: Option, - /// The name of the topic from which this subscription is receiving messages. - /// The value of this field will be `_deleted-topic_` if the topic has been - /// deleted. - pub topic: Option, /// If push delivery is used with this subscription, this field is /// used to configure it. An empty `pushConfig` signifies that the subscriber /// will pull and ack messages using API methods. @@ -1685,12 +1685,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. - /// * *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) -> ProjectTopicListCall<'a, C, A> @@ -1972,12 +1972,12 @@ impl<'a, C, A> ProjectSubscriptionPullCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionPullCall<'a, C, A> @@ -2261,12 +2261,12 @@ impl<'a, C, A> ProjectTopicCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicCreateCall<'a, C, A> @@ -2552,12 +2552,12 @@ impl<'a, C, A> ProjectTopicTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicTestIamPermissionCall<'a, C, A> @@ -2841,12 +2841,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. - /// * *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) -> ProjectSubscriptionModifyPushConfigCall<'a, C, A> @@ -3127,12 +3127,12 @@ impl<'a, C, A> ProjectTopicPublishCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicPublishCall<'a, C, A> @@ -3380,12 +3380,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. - /// * *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) -> ProjectTopicGetCall<'a, C, A> @@ -3636,12 +3636,12 @@ impl<'a, C, A> ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicGetIamPolicyCall<'a, C, A> @@ -3924,12 +3924,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. - /// * *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) -> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> @@ -4181,12 +4181,12 @@ impl<'a, C, A> ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionDeleteCall<'a, C, A> @@ -4467,12 +4467,12 @@ impl<'a, C, A> ProjectTopicSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicSetIamPolicyCall<'a, C, A> @@ -4762,12 +4762,12 @@ impl<'a, C, A> ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionCreateCall<'a, C, A> @@ -5052,12 +5052,12 @@ impl<'a, C, A> ProjectSubscriptionAcknowledgeCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> @@ -5308,12 +5308,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. - /// * *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) -> ProjectSubscriptionGetIamPolicyCall<'a, C, A> @@ -5599,12 +5599,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. - /// * *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) -> ProjectSubscriptionTestIamPermissionCall<'a, C, A> @@ -5856,12 +5856,12 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicDeleteCall<'a, C, A> @@ -6109,12 +6109,12 @@ impl<'a, C, A> ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionGetCall<'a, C, A> @@ -6388,12 +6388,12 @@ impl<'a, C, A> ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicSubscriptionListCall<'a, C, A> @@ -6667,12 +6667,12 @@ impl<'a, C, A> ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionListCall<'a, C, A> @@ -6953,12 +6953,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. - /// * *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) -> ProjectSubscriptionSetIamPolicyCall<'a, C, A> diff --git a/gen/safebrowsing4-cli/Cargo.toml b/gen/safebrowsing4-cli/Cargo.toml index 638d832f0b..df1006377b 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+20170921" +version = "1.0.6+20171204" 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+20170921" +version = "1.0.6+20171204" diff --git a/gen/safebrowsing4-cli/README.md b/gen/safebrowsing4-cli/README.md index ad2583de58..d823a794d1 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 *20170921*. The CLI is at version *1.0.6*. +This documentation was generated from the *safebrowsing* API at revision *20171204*. The CLI is at version *1.0.6*. ```bash safebrowsing4 [options] @@ -35,6 +35,8 @@ safebrowsing4 [options] get [-p ]... [-o ] full-hashes find (-r )... [-p ]... [-o ] + threat-hits + create (-r )... [-p ]... [-o ] threat-list-updates fetch (-r )... [-p ]... [-o ] threat-lists diff --git a/gen/safebrowsing4-cli/mkdocs.yml b/gen/safebrowsing4-cli/mkdocs.yml index 98e2722fd3..1d5a2ca96c 100644 --- a/gen/safebrowsing4-cli/mkdocs.yml +++ b/gen/safebrowsing4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: safebrowsing v1.0.6+20170921 +site_name: safebrowsing v1.0.6+20171204 site_url: http://byron.github.io/google-apis-rs/google-safebrowsing4-cli site_description: A complete library to interact with safebrowsing (protocol v4) @@ -12,6 +12,7 @@ pages: - ['encoded-full-hashes_get.md', 'Encoded Full Hashes', 'Get'] - ['encoded-updates_get.md', 'Encoded Updates', 'Get'] - ['full-hashes_find.md', 'Full Hashes', 'Find'] +- ['threat-hits_create.md', 'Threat Hits', 'Create'] - ['threat-list-updates_fetch.md', 'Threat List Updates', 'Fetch'] - ['threat-lists_list.md', 'Threat Lists', 'List'] - ['threat-matches_find.md', 'Threat Matches', 'Find'] diff --git a/gen/safebrowsing4-cli/src/main.rs b/gen/safebrowsing4-cli/src/main.rs index 311f586402..cd83e5a9c6 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-id" => Some(("client.clientId", 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 })), + "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 })), + "api-client.client-id" => Some(("apiClient.clientId", 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 })), @@ -247,6 +247,96 @@ impl<'n> Engine<'n> { } } + fn _threat_hits_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()[..] { + "entry.url" => Some(("entry.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entry.hash" => Some(("entry.hash", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entry.digest" => Some(("entry.digest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "threat-type" => Some(("threatType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "client-info.client-version" => Some(("clientInfo.clientVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "client-info.client-id" => Some(("clientInfo.clientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-info.region-code" => Some(("userInfo.regionCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-info.user-id" => Some(("userInfo.userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "platform-type" => Some(("platformType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["client-id", "client-info", "client-version", "digest", "entry", "hash", "platform-type", "region-code", "threat-type", "url", "user-id", "user-info"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ThreatHit = json::value::from_value(object).unwrap(); + let mut call = self.hub.threat_hits().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); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _threat_list_updates_fetch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -270,8 +360,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "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 })), + "client.client-id" => Some(("client.clientId", 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 +492,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "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 })), + "client.client-id" => Some(("client.clientId", 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 })), @@ -503,6 +593,17 @@ impl<'n> Engine<'n> { } } }, + ("threat-hits", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._threat_hits_create(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("threat-hits".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("threat-list-updates", Some(opt)) => { match opt.subcommand() { ("fetch", Some(opt)) => { @@ -697,6 +798,32 @@ fn main() { ]), ]), + ("threat-hits", "methods: 'create'", vec![ + ("create", + Some(r##"Reports a Safe Browsing threat list hit to Google. Only projects with + TRUSTED_REPORTER visibility can use this method."##), + "Details at http://byron.github.io/google-apis-rs/google_safebrowsing4_cli/threat-hits_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)), + ]), + ]), + ("threat-list-updates", "methods: 'fetch'", vec![ ("fetch", Some(r##"Fetches the most recent threat list updates. A client can request updates @@ -771,7 +898,7 @@ fn main() { let mut app = App::new("safebrowsing4") .author("Sebastian Thiel ") - .version("1.0.6+20170921") + .version("1.0.6+20171204") .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") diff --git a/gen/safebrowsing4/Cargo.toml b/gen/safebrowsing4/Cargo.toml index 5e90301a84..2895f6dd2b 100644 --- a/gen/safebrowsing4/Cargo.toml +++ b/gen/safebrowsing4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-safebrowsing4" -version = "1.0.6+20170921" +version = "1.0.6+20171204" 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+20170921" +documentation = "https://docs.rs/google-safebrowsing4/1.0.6+20171204" license = "MIT" keywords = ["safebrowsing", "google", "protocol", "web", "api"] diff --git a/gen/safebrowsing4/README.md b/gen/safebrowsing4/README.md index 62a1133a69..0e7362e1a6 100644 --- a/gen/safebrowsing4/README.md +++ b/gen/safebrowsing4/README.md @@ -5,26 +5,28 @@ 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+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*. +This documentation was generated from *safebrowsing* crate version *1.0.6+20171204*, where *20171204* 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+20170921/google_safebrowsing4/struct.Safebrowsing.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/struct.Safebrowsing.html) ... * encoded full hashes - * [*get*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.EncodedFullHasheGetCall.html) + * [*get*](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/struct.EncodedFullHasheGetCall.html) * encoded updates - * [*get*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.EncodedUpdateGetCall.html) + * [*get*](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/struct.EncodedUpdateGetCall.html) * full hashes - * [*find*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.FullHasheFindCall.html) + * [*find*](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/struct.FullHasheFindCall.html) +* [threat hits](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/struct.ThreatHit.html) + * [*create*](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/struct.ThreatHitCreateCall.html) * threat list updates - * [*fetch*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.ThreatListUpdateFetchCall.html) + * [*fetch*](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/struct.ThreatListUpdateFetchCall.html) * threat lists - * [*list*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.ThreatListListCall.html) + * [*list*](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/struct.ThreatListListCall.html) * threat matches - * [*find*](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.ThreatMatcheFindCall.html) + * [*find*](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/struct.ThreatMatcheFindCall.html) @@ -33,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-safebrowsing4/1.0.6+20170921/google_safebrowsing4/struct.Safebrowsing.html)** +* **[Hub](https://docs.rs/google-safebrowsing4/1.0.6+20171204/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+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)** + * creates [*Method Builders*](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-safebrowsing4/1.0.6+20171204/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+20170921/google_safebrowsing4/trait.Part.html)** + * **[Parts](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-safebrowsing4/1.0.6+20170921/google_safebrowsing4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-safebrowsing4/1.0.6+20171204/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 +131,17 @@ match result { ``` ## Handling Errors -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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-safebrowsing4/1.0.6+20171204/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+20170921/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+20171204/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+20170921/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+20171204/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+20170921/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+20171204/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 +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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-safebrowsing4/1.0.6+20171204/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+20170921/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+20171204/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-safebrowsing4/1.0.6+20171204/google_safebrowsing4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-safebrowsing4/1.0.6+20171204/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+20170921/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+20171204/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+20170921/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+20171204/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+20170921/google_safebrowsing4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-safebrowsing4/1.0.6+20171204/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 0cb972a22d..e1420619ce 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+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*. +//! This documentation was generated from *safebrowsing* crate version *1.0.6+20171204*, where *20171204* 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/). @@ -17,6 +17,8 @@ //! * [*get*](struct.EncodedUpdateGetCall.html) //! * full hashes //! * [*find*](struct.FullHasheFindCall.html) +//! * [threat hits](struct.ThreatHit.html) +//! * [*create*](struct.ThreatHitCreateCall.html) //! * threat list updates //! * [*fetch*](struct.ThreatListUpdateFetchCall.html) //! * threat lists @@ -319,6 +321,9 @@ impl<'a, C, A> Safebrowsing pub fn full_hashes(&'a self) -> FullHasheMethods<'a, C, A> { FullHasheMethods { hub: &self } } + pub fn threat_hits(&'a self) -> ThreatHitMethods<'a, C, A> { + ThreatHitMethods { hub: &self } + } pub fn threat_list_updates(&'a self) -> ThreatListUpdateMethods<'a, C, A> { ThreatListUpdateMethods { hub: &self } } @@ -450,6 +455,27 @@ pub struct Checksum { impl Part for Checksum {} +/// A single resource related to a threat hit. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ThreatSource { + /// The URL of the resource. + pub url: Option, + /// Referrer of the resource. Only set if the referrer is available. + pub referrer: Option, + /// The type of source reported. + #[serde(rename="type")] + pub type_: Option, + /// The remote IP of the resource in ASCII format. Either IPv4 or IPv6. + #[serde(rename="remoteIp")] + pub remote_ip: Option, +} + +impl Part for ThreatSource {} + + /// Request to check entries against lists. /// /// # Activities @@ -478,26 +504,26 @@ impl RequestValue for FindThreatMatchesRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ThreatEntrySet { + /// The encoded 4-byte prefixes of SHA256-formatted entries, using a + /// Golomb-Rice encoding. The hashes are converted to uint32, sorted in + /// ascending order, then delta encoded and stored as encoded_data. + #[serde(rename="riceHashes")] + pub rice_hashes: Option, /// The compression type for the entries in this set. #[serde(rename="compressionType")] pub compression_type: Option, /// The raw removal indices for a local list. #[serde(rename="rawIndices")] pub raw_indices: Option, - /// The raw SHA256-formatted entries. - #[serde(rename="rawHashes")] - pub raw_hashes: Option, /// The encoded local, lexicographically-sorted list indices, using a /// Golomb-Rice encoding. Used for sending compressed removal indices. The /// removal indices (uint32) are sorted in ascending order, then delta encoded /// and stored as encoded_data. #[serde(rename="riceIndices")] pub rice_indices: Option, - /// The encoded 4-byte prefixes of SHA256-formatted entries, using a - /// Golomb-Rice encoding. The hashes are converted to uint32, sorted in - /// ascending order, then delta encoded and stored as encoded_data. - #[serde(rename="riceHashes")] - pub rice_hashes: Option, + /// The raw SHA256-formatted entries. + #[serde(rename="rawHashes")] + pub raw_hashes: Option, } impl Part for ThreatEntrySet {} @@ -531,28 +557,27 @@ pub struct RiceDeltaEncoding { impl Part for RiceDeltaEncoding {} -/// The information regarding one or more threats that a client submits when -/// checking for matches in threat lists. +/// 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: /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// 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*). +/// +/// * [create threat hits](struct.ThreatHitCreateCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ThreatInfo { - /// The threat types to be checked. - #[serde(rename="threatTypes")] - pub threat_types: Option>, - /// The entry types to be checked. - #[serde(rename="threatEntryTypes")] - pub threat_entry_types: Option>, - /// The threat entries to be checked. - #[serde(rename="threatEntries")] - pub threat_entries: Option>, - /// The platform types to be checked. - #[serde(rename="platformTypes")] - pub platform_types: Option>, -} +pub struct Empty { _never_set: Option } -impl Part for ThreatInfo {} +impl ResponseResult for Empty {} /// The constraints for this update. @@ -618,13 +643,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 {} @@ -682,12 +707,12 @@ impl Part for ThreatListDescriptor {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FindFullHashesResponse { - /// The full hashes that matched the requested prefixes. - pub matches: Option>, /// For requested entities that did not match the threat list, how long to /// cache the response. #[serde(rename="negativeCacheDuration")] pub negative_cache_duration: Option, + /// The full hashes that matched the requested prefixes. + pub matches: Option>, /// The minimum duration the client must wait before issuing any find hashes /// request. If this field is not set, clients can issue a request as soon as /// they want. @@ -725,10 +750,10 @@ impl Part for ThreatEntry {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MetadataEntry { - /// 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, + /// The metadata entry key. For JSON requests, the key is base64-encoded. + pub key: Option, } impl Part for MetadataEntry {} @@ -814,6 +839,30 @@ pub struct FetchThreatListUpdatesRequest { impl RequestValue for FetchThreatListUpdatesRequest {} +/// The information regarding one or more threats that a client submits when +/// checking for matches in threat lists. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ThreatInfo { + /// The threat types to be checked. + #[serde(rename="threatTypes")] + pub threat_types: Option>, + /// The entry types to be checked. + #[serde(rename="threatEntryTypes")] + pub threat_entry_types: Option>, + /// The threat entries to be checked. + #[serde(rename="threatEntries")] + pub threat_entries: Option>, + /// The platform types to be checked. + #[serde(rename="platformTypes")] + pub platform_types: Option>, +} + +impl Part for ThreatInfo {} + + /// The uncompressed threat entries in hash format of a particular prefix length. /// Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 /// bytes, but some hashes are lengthened if they collide with the hash of a @@ -868,6 +917,57 @@ pub struct FindFullHashesRequest { impl RequestValue for FindFullHashesRequest {} +/// 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*). +/// +/// * [create threat hits](struct.ThreatHitCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ThreatHit { + /// The threat type reported. + #[serde(rename="threatType")] + pub threat_type: Option, + /// Client-reported identification. + #[serde(rename="clientInfo")] + pub client_info: Option, + /// Details about the user that encountered the threat. + #[serde(rename="userInfo")] + pub user_info: Option, + /// The threat entry responsible for the hit. Full hash should be reported for + /// hash-based hits. + pub entry: Option, + /// The platform type reported. + #[serde(rename="platformType")] + pub platform_type: Option, + /// The resources related to the threat hit. + pub resources: Option>, +} + +impl RequestValue for ThreatHit {} +impl Resource for ThreatHit {} + + +/// Details about the user that encountered the threat. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserInfo { + /// The UN M.49 region code associated with the user's location. + #[serde(rename="regionCode")] + pub region_code: Option, + /// Unique user identifier defined by the client. + #[serde(rename="userId")] + pub user_id: Option, +} + +impl Part for UserInfo {} + + // ################### // MethodBuilders ### @@ -1221,6 +1321,65 @@ impl<'a, C, A> ThreatMatcheMethods<'a, C, A> { +/// A builder providing access to all methods supported on *threatHit* resources. +/// It is not used directly, but through the `Safebrowsing` 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_safebrowsing4 as safebrowsing4; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use safebrowsing4::Safebrowsing; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Safebrowsing::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.threat_hits(); +/// # } +/// ``` +pub struct ThreatHitMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Safebrowsing, +} + +impl<'a, C, A> MethodsBuilder for ThreatHitMethods<'a, C, A> {} + +impl<'a, C, A> ThreatHitMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Reports a Safe Browsing threat list hit to Google. Only projects with + /// TRUSTED_REPORTER visibility can use this method. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: ThreatHit) -> ThreatHitCreateCall<'a, C, A> { + ThreatHitCreateCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + // ################### @@ -1450,10 +1609,10 @@ impl<'a, C, A> EncodedFullHasheGetCall<'a, C, A> where C: BorrowMut FullHasheFindCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -1887,10 +2046,10 @@ impl<'a, C, A> ThreatListUpdateFetchCall<'a, C, A> where C: BorrowMut EncodedUpdateGetCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -2319,10 +2478,10 @@ impl<'a, C, A> ThreatListListCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -2537,10 +2696,10 @@ impl<'a, C, A> ThreatMatcheFindCall<'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"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -2559,3 +2718,222 @@ impl<'a, C, A> ThreatMatcheFindCall<'a, C, A> where C: BorrowMut, } +/// Reports a Safe Browsing threat list hit to Google. Only projects with +/// TRUSTED_REPORTER visibility can use this method. +/// +/// A builder for the *create* method supported by a *threatHit* resource. +/// It is not used directly, but through a `ThreatHitMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_safebrowsing4 as safebrowsing4; +/// use safebrowsing4::ThreatHit; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use safebrowsing4::Safebrowsing; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Safebrowsing::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ThreatHit::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.threat_hits().create(req) +/// .doit(); +/// # } +/// ``` +pub struct ThreatHitCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Safebrowsing, + _request: ThreatHit, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for ThreatHitCreateCall<'a, C, A> {} + +impl<'a, C, A> ThreatHitCreateCall<'a, C, 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: "safebrowsing.threatHits.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() + "v4/threatHits"; + + 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)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).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: ThreatHit) -> ThreatHitCreateCall<'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) -> ThreatHitCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ThreatHitCreateCall<'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/searchconsole1-cli/Cargo.toml b/gen/searchconsole1-cli/Cargo.toml index 65da7cf7a2..0732707508 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+20170926" +version = "1.0.6+20171211" 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+20170926" +version = "1.0.6+20171211" diff --git a/gen/searchconsole1-cli/README.md b/gen/searchconsole1-cli/README.md index d972f474a9..fa0f374391 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 *20170926*. The CLI is at version *1.0.6*. +This documentation was generated from the *Search Console* API at revision *20171211*. 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 c044b1872b..9bd08493f7 100644 --- a/gen/searchconsole1-cli/mkdocs.yml +++ b/gen/searchconsole1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Search Console v1.0.6+20170926 +site_name: Search Console v1.0.6+20171211 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 dd19e13aaf..6c715d3792 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+20170926") + .version("1.0.6+20171211") .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 730bcc0911..ce9d034442 100644 --- a/gen/searchconsole1/Cargo.toml +++ b/gen/searchconsole1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-searchconsole1" -version = "1.0.6+20170926" +version = "1.0.6+20171211" 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+20170926" +documentation = "https://docs.rs/google-searchconsole1/1.0.6+20171211" license = "MIT" keywords = ["searchconsole", "google", "protocol", "web", "api"] diff --git a/gen/searchconsole1/README.md b/gen/searchconsole1/README.md index 3f5eb00d45..3ac6eb743e 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+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*. +This documentation was generated from *Search Console* crate version *1.0.6+20171211*, where *20171211* 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+20170926/google_searchconsole1/struct.SearchConsole.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-searchconsole1/1.0.6+20171211/google_searchconsole1/struct.SearchConsole.html) ... * url testing tools - * [*mobile friendly test run*](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/struct.UrlTestingToolMobileFriendlyTestRunCall.html) + * [*mobile friendly test run*](https://docs.rs/google-searchconsole1/1.0.6+20171211/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+20170926/google_searchconsole1/struct.SearchConsole.html)** +* **[Hub](https://docs.rs/google-searchconsole1/1.0.6+20171211/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+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)** + * creates [*Method Builders*](https://docs.rs/google-searchconsole1/1.0.6+20171211/google_searchconsole1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-searchconsole1/1.0.6+20171211/google_searchconsole1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-searchconsole1/1.0.6+20171211/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+20170926/google_searchconsole1/trait.Part.html)** + * **[Parts](https://docs.rs/google-searchconsole1/1.0.6+20171211/google_searchconsole1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-searchconsole1/1.0.6+20170926/google_searchconsole1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-searchconsole1/1.0.6+20171211/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+20170926/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+20171211/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+20170926/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+20171211/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+20170926/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+20171211/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+20170926/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+20171211/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-searchconsole1/1.0.6+20171211/google_searchconsole1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-searchconsole1/1.0.6+20171211/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+20170926/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+20171211/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-searchconsole1/1.0.6+20171211/google_searchconsole1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-searchconsole1/1.0.6+20171211/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+20170926/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+20171211/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+20170926/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+20171211/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+20170926/google_searchconsole1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-searchconsole1/1.0.6+20171211/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 3f29c6c072..753fa785c5 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+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*. +//! This documentation was generated from *Search Console* crate version *1.0.6+20171211*, where *20171211* 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/). @@ -729,17 +729,17 @@ impl<'a, C, A> UrlTestingToolMobileFriendlyTestRunCall<'a, C, A> where C: Borrow /// /// # 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) -> UrlTestingToolMobileFriendlyTestRunCall<'a, C, A> diff --git a/gen/serviceconsumermanagement1-cli/Cargo.toml b/gen/serviceconsumermanagement1-cli/Cargo.toml new file mode 100644 index 0000000000..f8ee0f88a6 --- /dev/null +++ b/gen/serviceconsumermanagement1-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-serviceconsumermanagement1-cli" +version = "1.0.6+20171211" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Service Consumer Management (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/serviceconsumermanagement1-cli" +homepage = "https://cloud.google.com/service-consumer-management/docs/overview" +documentation = "http://byron.github.io/google-apis-rs/google_serviceconsumermanagement1_cli" +license = "MIT" +keywords = ["serviceconsumermanag", "google", "cli"] + +[[bin]] +name = "serviceconsumermanagement1" + +[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-serviceconsumermanagement1] +path = "../serviceconsumermanagement1" +version = "1.0.6+20171211" diff --git a/gen/serviceconsumermanagement1-cli/LICENSE.md b/gen/serviceconsumermanagement1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/serviceconsumermanagement1-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/serviceconsumermanagement1-cli/README.md b/gen/serviceconsumermanagement1-cli/README.md new file mode 100644 index 0000000000..46743db73a --- /dev/null +++ b/gen/serviceconsumermanagement1-cli/README.md @@ -0,0 +1,124 @@ + +The `serviceconsumermanagement1` command-line interface *(CLI)* allows to use most features of the *Google Service Consumer 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 *Service Consumer Management* API can be found at the +[official documentation site](https://cloud.google.com/service-consumer-management/docs/overview). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-serviceconsumermanagement1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/serviceconsumermanagement1-cli). + +# Usage + +This documentation was generated from the *Service Consumer Management* API at revision *20171211*. The CLI is at version *1.0.6*. + +```bash +serviceconsumermanagement1 [options] + operations + cancel (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + list [-p ]... [-o ] + services + search [-p ]... [-o ] + tenancy-units-add-project (-r )... [-p ]... [-o ] + tenancy-units-create (-r )... [-p ]... [-o ] + tenancy-units-delete [-p ]... [-o ] + tenancy-units-list [-p ]... [-o ] + tenancy-units-remove-project (-r )... [-p ]... [-o ] + serviceconsumermanagement1 --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 `serviceconsumermanagement1-`. 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/serviceconsumermanagement1-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/serviceconsumermanagement1-secret.json`, assuming that the required *serviceconsumermanagement* 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. `serviceconsumermanagement1 --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/serviceconsumermanagement1-cli/mkdocs.yml b/gen/serviceconsumermanagement1-cli/mkdocs.yml new file mode 100644 index 0000000000..c289db33fa --- /dev/null +++ b/gen/serviceconsumermanagement1-cli/mkdocs.yml @@ -0,0 +1,26 @@ +site_name: Service Consumer Management v1.0.6+20171211 +site_url: http://byron.github.io/google-apis-rs/google-serviceconsumermanagement1-cli +site_description: A complete library to interact with Service Consumer Management (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/serviceconsumermanagement1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['operations_cancel.md', 'Operations', 'Cancel'] +- ['operations_delete.md', 'Operations', 'Delete'] +- ['operations_get.md', 'Operations', 'Get'] +- ['operations_list.md', 'Operations', 'List'] +- ['services_search.md', 'Services', 'Search'] +- ['services_tenancy-units-add-project.md', 'Services', 'Tenancy Units Add Project'] +- ['services_tenancy-units-create.md', 'Services', 'Tenancy Units Create'] +- ['services_tenancy-units-delete.md', 'Services', 'Tenancy Units Delete'] +- ['services_tenancy-units-list.md', 'Services', 'Tenancy Units List'] +- ['services_tenancy-units-remove-project.md', 'Services', 'Tenancy Units Remove Project'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/serviceconsumermanagement1-cli/src/cmn.rs b/gen/serviceconsumermanagement1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/serviceconsumermanagement1-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/serviceconsumermanagement1-cli/src/main.rs b/gen/serviceconsumermanagement1-cli/src/main.rs new file mode 100644 index 0000000000..b063c3201f --- /dev/null +++ b/gen/serviceconsumermanagement1-cli/src/main.rs @@ -0,0 +1,1269 @@ +// 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_serviceconsumermanagement1 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::ServiceConsumerManagement>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _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::CancelOperationRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.operations().cancel(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operations().delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_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(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 _services_search(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().search(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 { + "query" => { + call = call.query(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(["query", "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 _services_tenancy_units_add_project(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "project-config.services" => Some(("projectConfig.services", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "project-config.folder" => Some(("projectConfig.folder", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "project-config.labels" => Some(("projectConfig.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "project-config.service-account-config.tenant-project-roles" => Some(("projectConfig.serviceAccountConfig.tenantProjectRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "project-config.service-account-config.account-id" => Some(("projectConfig.serviceAccountConfig.accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "project-config.billing-config.billing-account" => Some(("projectConfig.billingConfig.billingAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag" => Some(("tag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "billing-account", "billing-config", "folder", "labels", "project-config", "service-account-config", "services", "tag", "tenant-project-roles"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AddTenantProjectRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.services().tenancy_units_add_project(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 _services_tenancy_units_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()[..] { + "tenancy-unit-id" => Some(("tenancyUnitId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["tenancy-unit-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::CreateTenancyUnitRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.services().tenancy_units_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 _services_tenancy_units_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().tenancy_units_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 _services_tenancy_units_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().tenancy_units_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 _services_tenancy_units_remove_project(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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" => Some(("tag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["tag"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RemoveTenantProjectRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.services().tenancy_units_remove_project(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() { + ("operations", Some(opt)) => { + match opt.subcommand() { + ("cancel", Some(opt)) => { + call_result = self._operations_cancel(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._operations_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._operations_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._operations_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("operations".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("services", Some(opt)) => { + match opt.subcommand() { + ("search", Some(opt)) => { + call_result = self._services_search(opt, dry_run, &mut err); + }, + ("tenancy-units-add-project", Some(opt)) => { + call_result = self._services_tenancy_units_add_project(opt, dry_run, &mut err); + }, + ("tenancy-units-create", Some(opt)) => { + call_result = self._services_tenancy_units_create(opt, dry_run, &mut err); + }, + ("tenancy-units-delete", Some(opt)) => { + call_result = self._services_tenancy_units_delete(opt, dry_run, &mut err); + }, + ("tenancy-units-list", Some(opt)) => { + call_result = self._services_tenancy_units_list(opt, dry_run, &mut err); + }, + ("tenancy-units-remove-project", Some(opt)) => { + call_result = self._services_tenancy_units_remove_project(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, "serviceconsumermanagement1-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: "serviceconsumermanagement1", + 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::ServiceConsumerManagement::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: 'cancel', 'delete', 'get' and 'list'", vec![ + ("cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server + makes a best effort to cancel the operation, but success is not + guaranteed. 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_serviceconsumermanagement1_cli/operations_cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"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_serviceconsumermanagement1_cli/operations_delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_serviceconsumermanagement1_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_serviceconsumermanagement1_cli/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)), + ]), + ]), + + ("services", "methods: 'search', 'tenancy-units-add-project', 'tenancy-units-create', 'tenancy-units-delete', 'tenancy-units-list' and 'tenancy-units-remove-project'", vec![ + ("search", + Some(r##"Search tenancy units for a service."##), + "Details at http://byron.github.io/google-apis-rs/google_serviceconsumermanagement1_cli/services_search", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Service for which search is performed. + services/{service} + {service} the name of a service, for example 'service.googleapis.com'."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("tenancy-units-add-project", + Some(r##"Add a new tenant project to the tenancy unit. + If there are previously failed AddTenantProject calls, you might need to + call RemoveTenantProject first to clean them before you can make another + AddTenantProject with the same tag. + Operation."##), + "Details at http://byron.github.io/google-apis-rs/google_serviceconsumermanagement1_cli/services_tenancy-units-add-project", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Name of the tenancy unit."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("tenancy-units-create", + Some(r##"Creates a tenancy unit with no tenant resources."##), + "Details at http://byron.github.io/google-apis-rs/google_serviceconsumermanagement1_cli/services_tenancy-units-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"services/{service}/{collection id}/{resource id} + {collection id} is the cloud resource collection type representing the + service consumer, for example 'projects', or 'organizations'. + {resource id} is the consumer numeric id, such as project number: '123456'. + {service} the name of a service, for example 'service.googleapis.com'. + Enabled service binding using the new tenancy unit."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("tenancy-units-delete", + Some(r##"Delete tenancy unit. Before the tenancy unit is deleted, there should be + no tenant resource in it. + Operation."##), + "Details at http://byron.github.io/google-apis-rs/google_serviceconsumermanagement1_cli/services_tenancy-units-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Name of the tenancy unit 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)), + ]), + ("tenancy-units-list", + Some(r##"Find tenancy unit for a service and consumer. + This method should not be used in producers' runtime path, e.g. finding + the tenant project number when creating VMs. Producers should persist + the tenant project information after the project is created."##), + "Details at http://byron.github.io/google-apis-rs/google_serviceconsumermanagement1_cli/services_tenancy-units-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Service and consumer. Required. + services/{service}/{collection id}/{resource id} + {collection id} is the cloud resource collection type representing the + service consumer, for example 'projects', or 'organizations'. + {resource id} is the consumer numeric id, such as project number: '123456'. + {service} the name of a service, for example 'service.googleapis.com'."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("tenancy-units-remove-project", + Some(r##"Removes specified project resource identified by tenant resource tag. + It will remove project lien with 'TenantManager' origin if that was added. + It will then attempt to delete the project. + If that operation fails, this method fails. + Operation."##), + "Details at http://byron.github.io/google-apis-rs/google_serviceconsumermanagement1_cli/services_tenancy-units-remove-project", + vec![ + (Some(r##"name"##), + None, + Some(r##"Name of the tenancy unit. + Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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("serviceconsumermanagement1") + .author("Sebastian Thiel ") + .version("1.0.6+20171211") + .about("Provides management methods for configuring service producer resources on Google Cloud.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_serviceconsumermanagement1_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/serviceconsumermanagement1/Cargo.toml b/gen/serviceconsumermanagement1/Cargo.toml new file mode 100644 index 0000000000..fceb0a1ff7 --- /dev/null +++ b/gen/serviceconsumermanagement1/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-serviceconsumermanagement1" +version = "1.0.6+20171211" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Service Consumer Management (protocol v1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/serviceconsumermanagement1" +homepage = "https://cloud.google.com/service-consumer-management/docs/overview" +documentation = "https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211" +license = "MIT" +keywords = ["serviceconsumermanag", "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/serviceconsumermanagement1/LICENSE.md b/gen/serviceconsumermanagement1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/serviceconsumermanagement1/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/serviceconsumermanagement1/README.md b/gen/serviceconsumermanagement1/README.md new file mode 100644 index 0000000000..8e379d72a6 --- /dev/null +++ b/gen/serviceconsumermanagement1/README.md @@ -0,0 +1,185 @@ + +The `google-serviceconsumermanagement1` library allows access to all features of the *Google Service Consumer Management* service. + +This documentation was generated from *Service Consumer Management* crate version *1.0.6+20171211*, where *20171211* is the exact revision of the *serviceconsumermanagement:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *Service Consumer Management* *v1* API can be found at the +[official documentation site](https://cloud.google.com/service-consumer-management/docs/overview). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.ServiceConsumerManagement.html) ... + +* [operations](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.Operation.html) + * [*cancel*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.OperationListCall.html) +* [services](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.Service.html) + * [*search*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.ServiceSearchCall.html), [*tenancy units add project*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.ServiceTenancyUnitAddProjectCall.html), [*tenancy units create*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.ServiceTenancyUnitCreateCall.html), [*tenancy units delete*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.ServiceTenancyUnitDeleteCall.html), [*tenancy units list*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.ServiceTenancyUnitListCall.html) and [*tenancy units remove project*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.ServiceTenancyUnitRemoveProjectCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/struct.ServiceConsumerManagement.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/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().delete(...).doit() +let r = hub.services().tenancy_units_add_project(...).doit() +let r = hub.operations().list(...).doit() +let r = hub.services().tenancy_units_remove_project(...).doit() +let r = hub.services().tenancy_units_delete(...).doit() +let r = hub.operations().cancel(...).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-serviceconsumermanagement1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_serviceconsumermanagement1 as serviceconsumermanagement1; +use serviceconsumermanagement1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use serviceconsumermanagement1::ServiceConsumerManagement; + +// 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 = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +// You can configure optional parameters by calling the respective setters at will, and +// execute the final call using `doit()`. +// Values shown here are possibly random and not representative ! +let result = hub.operations().list("name") + .page_token("sit") + .page_size(-65) + .filter("sed") + .doit(); + +match result { + Err(e) => match e { + // The Error enum provides details about what exactly happened. + // You can also just use its `Debug`, `Display` or `Error` traits + Error::HttpError(_) + |Error::MissingAPIKey + |Error::MissingToken(_) + |Error::Cancelled + |Error::UploadSizeLimitExceeded(_, _) + |Error::Failure(_) + |Error::BadRequest(_) + |Error::FieldClash(_) + |Error::JsonDecodeError(_, _) => println!("{}", e), + }, + Ok(res) => println!("Success: {:?}", res), +} + +``` +## Handling Errors + +All errors produced by the system are provided either as [Result](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/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-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/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-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/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-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/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-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/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-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/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-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/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-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/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-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/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-serviceconsumermanagement1/1.0.6+20171211/google_serviceconsumermanagement1/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 **serviceconsumermanagement1** 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/serviceconsumermanagement1/src/cmn.rs b/gen/serviceconsumermanagement1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/serviceconsumermanagement1/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/serviceconsumermanagement1/src/lib.rs b/gen/serviceconsumermanagement1/src/lib.rs new file mode 100644 index 0000000000..73d56ba3b4 --- /dev/null +++ b/gen/serviceconsumermanagement1/src/lib.rs @@ -0,0 +1,6357 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Service Consumer Management* crate version *1.0.6+20171211*, where *20171211* is the exact revision of the *serviceconsumermanagement:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *Service Consumer Management* *v1* API can be found at the +//! [official documentation site](https://cloud.google.com/service-consumer-management/docs/overview). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/serviceconsumermanagement1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.ServiceConsumerManagement.html) ... +//! +//! * [operations](struct.Operation.html) +//! * [*cancel*](struct.OperationCancelCall.html), [*delete*](struct.OperationDeleteCall.html), [*get*](struct.OperationGetCall.html) and [*list*](struct.OperationListCall.html) +//! * [services](struct.Service.html) +//! * [*search*](struct.ServiceSearchCall.html), [*tenancy units add project*](struct.ServiceTenancyUnitAddProjectCall.html), [*tenancy units create*](struct.ServiceTenancyUnitCreateCall.html), [*tenancy units delete*](struct.ServiceTenancyUnitDeleteCall.html), [*tenancy units list*](struct.ServiceTenancyUnitListCall.html) and [*tenancy units remove project*](struct.ServiceTenancyUnitRemoveProjectCall.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.ServiceConsumerManagement.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().delete(...).doit() +//! let r = hub.services().tenancy_units_add_project(...).doit() +//! let r = hub.operations().list(...).doit() +//! let r = hub.services().tenancy_units_remove_project(...).doit() +//! let r = hub.services().tenancy_units_delete(...).doit() +//! let r = hub.operations().cancel(...).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-serviceconsumermanagement1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_serviceconsumermanagement1 as serviceconsumermanagement1; +//! use serviceconsumermanagement1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use serviceconsumermanagement1::ServiceConsumerManagement; +//! +//! // 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 = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +//! // You can configure optional parameters by calling the respective setters at will, and +//! // execute the final call using `doit()`. +//! // Values shown here are possibly random and not representative ! +//! let result = hub.operations().list("name") +//! .page_token("dolores") +//! .page_size(-63) +//! .filter("accusam") +//! .doit(); +//! +//! match result { +//! Err(e) => match e { +//! // The Error enum provides details about what exactly happened. +//! // You can also just use its `Debug`, `Display` or `Error` traits +//! Error::HttpError(_) +//! |Error::MissingAPIKey +//! |Error::MissingToken(_) +//! |Error::Cancelled +//! |Error::UploadSizeLimitExceeded(_, _) +//! |Error::Failure(_) +//! |Error::BadRequest(_) +//! |Error::FieldClash(_) +//! |Error::JsonDecodeError(_, _) => println!("{}", e), +//! }, +//! Ok(res) => println!("Success: {:?}", res), +//! } +//! # } +//! ``` +//! ## 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, +} + +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", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::CloudPlatform + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all ServiceConsumerManagement 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_serviceconsumermanagement1 as serviceconsumermanagement1; +/// use serviceconsumermanagement1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// // 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 = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.operations().list("name") +/// .page_token("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 ServiceConsumerManagement { + client: RefCell, + auth: RefCell, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for ServiceConsumerManagement {} + +impl<'a, C, A> ServiceConsumerManagement + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> ServiceConsumerManagement { + ServiceConsumerManagement { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://serviceconsumermanagement.googleapis.com/".to_string(), + _root_url: "https://serviceconsumermanagement.googleapis.com/".to_string(), + } + } + + pub fn operations(&'a self) -> OperationMethods<'a, C, A> { + OperationMethods { 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://serviceconsumermanagement.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://serviceconsumermanagement.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 ### +// ########## +/// Translates to IAM Policy bindings (without auditing at this level) +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PolicyBinding { + /// Role. (https://cloud.google.com/iam/docs/understanding-roles) + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + pub role: Option, + /// Uses the same format as in IAM policy. + /// `member` must include both prefix and id. E.g., `user:{emailId}`, + /// `serviceAccount:{emailId}`, `group:{emailId}`. + pub members: Option>, +} + +impl Part for PolicyBinding {} + + +/// 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 HTTP header name to use for the parameter. It is case + /// insensitive. + #[serde(rename="httpHeader")] + pub http_header: Option, + /// Define the name of the parameter, such as "api_key" . It is case sensitive. + pub name: Option, +} + +impl Part for SystemParameter {} + + +/// 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 {} + + +/// Billing related configuration of the service. +/// +/// The following example shows how to configure monitored resources and metrics +/// for billing: +/// +/// 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/borrowed_count +/// metric_kind: DELTA +/// value_type: INT64 +/// billing: +/// consumer_destinations: +/// - monitored_resource: library.googleapis.com/branch +/// metrics: +/// - library.googleapis.com/book/borrowed_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 Billing { + /// Billing configurations for sending metrics to the consumer project. + /// There can be multiple consumer destinations per service, 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 Billing {} + + +/// Request message to remove tenant project resource from the tenancy 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*). +/// +/// * [tenancy units remove project services](struct.ServiceTenancyUnitRemoveProjectCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RemoveTenantProjectRequest { + /// Tag of the resource within the tenancy unit. + pub tag: Option, +} + +impl RequestValue for RemoveTenantProjectRequest {} + + +/// `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 {} + + +/// `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. + pub metric: Option, + /// Tiered limit values. You must specify this as a key:value pair, with an + /// integer value that is the maximum number of requests allowed for the + /// specified unit. 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. + /// + /// 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. + pub unit: Option, + /// Name of the quota limit. + /// + /// 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. + pub name: Option, +} + +impl Part for QuotaLimit {} + + +/// Describes service account configuration for the tenant 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 ServiceAccountConfig { + /// Roles for the service account above on tenant project. + #[serde(rename="tenantProjectRoles")] + pub tenant_project_roles: Option>, + /// ID of the IAM service account to be created in tenant project. + /// The email format of the service account will be + /// "@.iam.gserviceaccount.com". + /// This account id has to be unique within tenant project and producers + /// have to guarantee it. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl Part for ServiceAccountConfig {} + + +/// 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 {} + + +/// 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 {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete operations](struct.OperationDeleteCall.html) (response) +/// * [cancel operations](struct.OperationCancelCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// Response for the list 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*). +/// +/// * [tenancy units list services](struct.ServiceTenancyUnitListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListTenancyUnitsResponse { + /// Pagination token for large results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Tenancy Units matching the request. + #[serde(rename="tenancyUnits")] + pub tenancy_units: Option>, +} + +impl ResponseResult for ListTenancyUnitsResponse {} + + +/// 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 { + /// 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, + /// 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 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 {} + + +/// `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*). +/// +/// * [tenancy units list services](struct.ServiceTenancyUnitListCall.html) (none) +/// * [tenancy units add project services](struct.ServiceTenancyUnitAddProjectCall.html) (none) +/// * [tenancy units create services](struct.ServiceTenancyUnitCreateCall.html) (none) +/// * [tenancy units remove project services](struct.ServiceTenancyUnitRemoveProjectCall.html) (none) +/// * [tenancy units delete services](struct.ServiceTenancyUnitDeleteCall.html) (none) +/// * [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>, + /// 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, + /// Billing configuration. + pub billing: Option, + /// System parameter configuration. + #[serde(rename="systemParameters")] + pub system_parameters: Option, + /// Additional API documentation. + pub documentation: 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 product title for this service. + pub title: 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 {} + + +/// 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 {} + + +/// Configuration of a specific billing destination (Currently only support +/// bill against 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 BillingDestination { + /// 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 billing destination. + /// Each name must be defined in Service.metrics section. + pub metrics: Option>, +} + +impl Part for BillingDestination {} + + +/// Request to add a newly created and configured tenant project to tenancy +/// 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*). +/// +/// * [tenancy units add project services](struct.ServiceTenancyUnitAddProjectCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddTenantProjectRequest { + /// Configuration of the new tenant project that will be added to tenancy unit + /// resources. + #[serde(rename="projectConfig")] + pub project_config: Option, + /// Tag of the added project. Must be less than 128 characters. Required. + pub tag: Option, +} + +impl RequestValue for AddTenantProjectRequest {} + + +/// 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 {} + + +/// 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 {} + + +/// This structure defines a tenant project to be added to the specified tenancy +/// unit and its initial configuration and properties. A project lien will be +/// created for the tenant project to prevent the tenant project from being +/// deleted accidentally. The lien will be deleted as part of tenant project +/// removal. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TenantProjectConfig { + /// Configuration for IAM service account on tenant project. + #[serde(rename="serviceAccountConfig")] + pub service_account_config: Option, + /// Billing account properties. + /// It may be specified explicitly, or created from the specified group + /// during provisioning + #[serde(rename="billingConfig")] + pub billing_config: Option, + /// Google Cloud API names of services that will be activated on this project + /// during provisioning. If any of these services can not be activated, + /// addTenantProject method will fail. + /// For example: 'compute.googleapis.com','cloudfunctions.googleapis.com' + pub services: Option>, + /// Folder where project in this tenancy unit must be located + /// This folder must have been previously created with proper + /// permissions for the caller to create and configure a project in it. + /// Valid folder resource names have the format `folders/{folder_number}` + /// (for example, `folders/123456`). + pub folder: Option, + /// Labels that will be applied to this project. + pub labels: Option>, + /// Describes ownership and policies for the new tenant project. Required. + #[serde(rename="tenantProjectPolicy")] + pub tenant_project_policy: Option, +} + +impl Part for TenantProjectConfig {} + + +/// Response for the search query. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 SearchTenancyUnitsResponse { + /// Pagination token for large results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Tenancy Units matching the request. + #[serde(rename="tenancyUnits")] + pub tenancy_units: Option>, +} + +impl ResponseResult for SearchTenancyUnitsResponse {} + + +/// ### 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 {} + + +/// 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 {} + + +/// 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 {} + + +/// 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 {} + + +/// 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 {} + + +/// Describes billing configuration for new a Tenant 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 BillingConfig { + /// Name of the billing account. + /// For example `billingAccounts/012345-567890-ABCDEF`. + #[serde(rename="billingAccount")] + pub billing_account: Option, +} + +impl Part for BillingConfig {} + + +/// 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 {} + + +/// 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 {} + + +/// 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 {} + + +/// Request to create a tenancy unit for a consumer of 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*). +/// +/// * [tenancy units create services](struct.ServiceTenancyUnitCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateTenancyUnitRequest { + /// Optional producer provided identifier of the tenancy unit + /// Must be no longer than 40 characters and preferably URI friendly + /// If it is not provided, UID for the tenancy unit will be auto generated + /// It must be unique across a service. + /// If the tenancy unit already exists for the service and consumer pair, + /// CreateTenancyUnit will return existing tenancy unit if provided identifier + /// is identical or empty, otherwise the call will fail. + #[serde(rename="tenancyUnitId")] + pub tenancy_unit_id: Option, +} + +impl RequestValue for CreateTenancyUnitRequest {} + + +/// This resource represents a long-running operation that is the result of a +/// network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete operations](struct.OperationDeleteCall.html) (none) +/// * [tenancy units add project services](struct.ServiceTenancyUnitAddProjectCall.html) (response) +/// * [list operations](struct.OperationListCall.html) (none) +/// * [tenancy units remove project services](struct.ServiceTenancyUnitRemoveProjectCall.html) (response) +/// * [tenancy units delete services](struct.ServiceTenancyUnitDeleteCall.html) (response) +/// * [cancel operations](struct.OperationCancelCall.html) (none) +/// * [get operations](struct.OperationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// 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>, + /// 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, + /// The error result of the operation in case of failure or cancellation. + pub error: Option, +} + +impl Resource for Operation {} +impl ResponseResult for Operation {} + + +/// 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 {} + + +/// 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 {} + + +/// 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 {} + + +/// 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 {} + + +/// Resource constituting the TenancyUnit. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TenantResource { + /// Status of tenant resource. + pub status: Option, + /// Unique per single tenancy unit. + pub tag: Option, + /// @OutputOnly Identifier of the tenant resource. + /// For cloud projects it is in the form 'projects/{number}'. + /// For example 'projects/123456'. + pub resource: Option, +} + +impl Part for TenantResource {} + + +/// 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 {} + + +/// Representation of a tenancy 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*). +/// +/// * [tenancy units create services](struct.ServiceTenancyUnitCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TenancyUnit { + /// Resources constituting the tenancy unit. + #[serde(rename="tenantResources")] + pub tenant_resources: Option>, + /// @OutputOnly Cloud resource One Platform Name of the consumer of this + /// service. For example 'projects/123456'. + pub consumer: Option, + /// @OutputOnly The time this tenancy unit was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// @OutputOnly Google Cloud API name of the service owning this tenancy unit. + /// For example 'serviceconsumermanagement.googleapis.com'. + pub service: Option, + /// Globally unique identifier of this tenancy unit + /// "services/{service}/{collection id}/{resource id}/tenancyUnits/{unit}" + pub name: Option, +} + +impl ResponseResult for TenancyUnit {} + + +/// `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, + /// Selects methods to which this rule applies. + /// + /// Refer to selector for syntax details. + pub selector: 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 bytestream methods. + /// For media support, add instead [][google.bytestream.RestByteStream] as an + /// API to your configuration. + #[serde(rename="mediaDownload")] + pub media_download: 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, + /// 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, + /// 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, + /// 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, + /// 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, + /// 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 {} + + +/// 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 {} + + +/// 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". + /// This field is optional but it is recommended to be set for any metrics + /// associated with user-visible concepts, such as Quota. + #[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` 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, + /// The resource name of the metric descriptor. + pub name: 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 {} + + +/// 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 {} + + +/// 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 {} + + +/// Describes policy settings that need to be applied to a newly +/// created Tenant 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 TenantProjectPolicy { + /// Additional policy bindings to be applied on the tenant + /// project. + /// At least one owner must be set in the bindings. Among the list of members + /// as owners, at least one of them must be either `user` or `group` based. + #[serde(rename="policyBindings")] + pub policy_bindings: Option>, +} + +impl Part for TenantProjectPolicy {} + + +/// 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, + /// A human-readable description of this log. This information appears in + /// the documentation and can contain details. + pub description: 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, +} + +impl Part for LogDescriptor {} + + +/// 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 {} + + +/// `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 { + /// 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 intended + /// aliases. + /// + /// Additional names that this endpoint will be hosted on. + pub aliases: Option>, + /// The list of features enabled on this endpoint. + pub features: Option>, + /// The canonical name of this endpoint. + pub name: 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, +} + +impl Part for Endpoint {} + + +/// 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 {} + + +/// `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 {} + + +/// 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 {} + + +/// 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 {} + + +/// 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 {} + + +/// 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 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 {} + + +/// 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 {} + + +/// 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. + /// This flag is used by ESP to allow some Endpoints customers to bypass + /// Google internal checks. + #[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 {} + + +/// 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 { + /// Enum value number. + pub number: Option, + /// Protocol buffer options. + pub options: 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 {} + + +/// 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*). +/// +/// * [cancel operations](struct.OperationCancelCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CancelOperationRequest { _never_set: Option } + +impl RequestValue for CancelOperationRequest {} + + +/// 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 {} + + +/// `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 *operation* resources. +/// It is not used directly, but through the `ServiceConsumerManagement` 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_serviceconsumermanagement1 as serviceconsumermanagement1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = ServiceConsumerManagement::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 `cancel(...)`, `delete(...)`, `get(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.operations(); +/// # } +/// ``` +pub struct OperationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceConsumerManagement, +} + +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: + /// + /// 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 delete(&self, name: &str) -> OperationDeleteCall<'a, C, A> { + OperationDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// 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 + /// + /// * `request` - No description provided. + /// * `name` - The name of the operation resource to be cancelled. + pub fn cancel(&self, request: CancelOperationRequest, name: &str) -> OperationCancelCall<'a, C, A> { + OperationCancelCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// 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 list(&self, name: &str) -> OperationListCall<'a, C, A> { + OperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// 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 *service* resources. +/// It is not used directly, but through the `ServiceConsumerManagement` 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_serviceconsumermanagement1 as serviceconsumermanagement1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = ServiceConsumerManagement::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(...)`, `tenancy_units_add_project(...)`, `tenancy_units_create(...)`, `tenancy_units_delete(...)`, `tenancy_units_list(...)` and `tenancy_units_remove_project(...)` +/// // to build up your call. +/// let rb = hub.services(); +/// # } +/// ``` +pub struct ServiceMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceConsumerManagement, +} + +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: + /// + /// Find tenancy unit for a service and consumer. + /// This method should not be used in producers' runtime path, e.g. finding + /// the tenant project number when creating VMs. Producers should persist + /// the tenant project information after the project is created. + /// + /// # Arguments + /// + /// * `parent` - Service and consumer. Required. + /// services/{service}/{collection id}/{resource id} + /// {collection id} is the cloud resource collection type representing the + /// service consumer, for example 'projects', or 'organizations'. + /// {resource id} is the consumer numeric id, such as project number: '123456'. + /// {service} the name of a service, for example 'service.googleapis.com'. + pub fn tenancy_units_list(&self, parent: &str) -> ServiceTenancyUnitListCall<'a, C, A> { + ServiceTenancyUnitListCall { + 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: + /// + /// Add a new tenant project to the tenancy unit. + /// If there are previously failed AddTenantProject calls, you might need to + /// call RemoveTenantProject first to clean them before you can make another + /// AddTenantProject with the same tag. + /// Operation. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Name of the tenancy unit. + pub fn tenancy_units_add_project(&self, request: AddTenantProjectRequest, parent: &str) -> ServiceTenancyUnitAddProjectCall<'a, C, A> { + ServiceTenancyUnitAddProjectCall { + 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 tenancy unit with no tenant resources. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - services/{service}/{collection id}/{resource id} + /// {collection id} is the cloud resource collection type representing the + /// service consumer, for example 'projects', or 'organizations'. + /// {resource id} is the consumer numeric id, such as project number: '123456'. + /// {service} the name of a service, for example 'service.googleapis.com'. + /// Enabled service binding using the new tenancy unit. + pub fn tenancy_units_create(&self, request: CreateTenancyUnitRequest, parent: &str) -> ServiceTenancyUnitCreateCall<'a, C, A> { + ServiceTenancyUnitCreateCall { + 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: + /// + /// Removes specified project resource identified by tenant resource tag. + /// It will remove project lien with 'TenantManager' origin if that was added. + /// It will then attempt to delete the project. + /// If that operation fails, this method fails. + /// Operation. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Name of the tenancy unit. + /// Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'. + pub fn tenancy_units_remove_project(&self, request: RemoveTenantProjectRequest, name: &str) -> ServiceTenancyUnitRemoveProjectCall<'a, C, A> { + ServiceTenancyUnitRemoveProjectCall { + 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: + /// + /// Delete tenancy unit. Before the tenancy unit is deleted, there should be + /// no tenant resource in it. + /// Operation. + /// + /// # Arguments + /// + /// * `name` - Name of the tenancy unit to be deleted. + pub fn tenancy_units_delete(&self, name: &str) -> ServiceTenancyUnitDeleteCall<'a, C, A> { + ServiceTenancyUnitDeleteCall { + 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: + /// + /// Search tenancy units for a service. + /// + /// # Arguments + /// + /// * `parent` - Service for which search is performed. + /// services/{service} + /// {service} the name of a service, for example 'service.googleapis.com'. + pub fn search(&self, parent: &str) -> ServiceSearchCall<'a, C, A> { + ServiceSearchCall { + hub: self.hub, + _parent: parent.to_string(), + _query: Default::default(), + _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 *delete* method supported by a *operation* resource. +/// It is not used directly, but through a `OperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_serviceconsumermanagement1 as serviceconsumermanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.operations().delete("name") +/// .doit(); +/// # } +/// ``` +pub struct OperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceConsumerManagement, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> OperationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "serviceconsumermanagement.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) -> OperationDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OperationDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OperationDeleteCall<'a, C, A> + where T: 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 *cancel* method supported by a *operation* resource. +/// It is not used directly, but through a `OperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_serviceconsumermanagement1 as serviceconsumermanagement1; +/// use serviceconsumermanagement1::CancelOperationRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CancelOperationRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.operations().cancel(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct OperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceConsumerManagement, + _request: CancelOperationRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperationCancelCall<'a, C, A> {} + +impl<'a, C, A> OperationCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "serviceconsumermanagement.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() + "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: CancelOperationRequest) -> OperationCancelCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the operation resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OperationCancelCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationCancelCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OperationCancelCall<'a, C, A> + where T: 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 *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_serviceconsumermanagement1 as serviceconsumermanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.operations().list("name") +/// .page_token("dolores") +/// .page_size(-61) +/// .filter("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct OperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceConsumerManagement, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperationListCall<'a, C, A> {} + +impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "serviceconsumermanagement.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) -> OperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The 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 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_serviceconsumermanagement1 as serviceconsumermanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling 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 ServiceConsumerManagement, + _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: "serviceconsumermanagement.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 + } +} + + +/// Find tenancy unit for a service and consumer. +/// This method should not be used in producers' runtime path, e.g. finding +/// the tenant project number when creating VMs. Producers should persist +/// the tenant project information after the project is created. +/// +/// A builder for the *tenancyUnits.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_serviceconsumermanagement1 as serviceconsumermanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling 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().tenancy_units_list("parent") +/// .page_token("no") +/// .page_size(-21) +/// .filter("justo") +/// .doit(); +/// # } +/// ``` +pub struct ServiceTenancyUnitListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceConsumerManagement, + _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 ServiceTenancyUnitListCall<'a, C, A> {} + +impl<'a, C, A> ServiceTenancyUnitListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListTenancyUnitsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "serviceconsumermanagement.services.tenancyUnits.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}/tenancyUnits"; + 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) + } + } + } + } + + + /// Service and consumer. Required. + /// services/{service}/{collection id}/{resource id} + /// {collection id} is the cloud resource collection type representing the + /// service consumer, for example 'projects', or 'organizations'. + /// {resource id} is the consumer numeric id, such as project number: '123456'. + /// {service} the name of a service, for example 'service.googleapis.com'. + /// + /// 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) -> ServiceTenancyUnitListCall<'a, C, A> { + self._parent = 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) -> ServiceTenancyUnitListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of results returned by this request. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ServiceTenancyUnitListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Filter expression over tenancy resources field. Optional. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ServiceTenancyUnitListCall<'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) -> ServiceTenancyUnitListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ServiceTenancyUnitListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceTenancyUnitListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Add a new tenant project to the tenancy unit. +/// If there are previously failed AddTenantProject calls, you might need to +/// call RemoveTenantProject first to clean them before you can make another +/// AddTenantProject with the same tag. +/// Operation. +/// +/// A builder for the *tenancyUnits.addProject* 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_serviceconsumermanagement1 as serviceconsumermanagement1; +/// use serviceconsumermanagement1::AddTenantProjectRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = AddTenantProjectRequest::default(); +/// +/// // You can configure optional parameters by calling 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().tenancy_units_add_project(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ServiceTenancyUnitAddProjectCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceConsumerManagement, + _request: AddTenantProjectRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceTenancyUnitAddProjectCall<'a, C, A> {} + +impl<'a, C, A> ServiceTenancyUnitAddProjectCall<'a, C, 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: "serviceconsumermanagement.services.tenancyUnits.addProject", + 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}:addProject"; + 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: AddTenantProjectRequest) -> ServiceTenancyUnitAddProjectCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the tenancy unit. + /// + /// 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) -> ServiceTenancyUnitAddProjectCall<'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) -> ServiceTenancyUnitAddProjectCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ServiceTenancyUnitAddProjectCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceTenancyUnitAddProjectCall<'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 tenancy unit with no tenant resources. +/// +/// A builder for the *tenancyUnits.create* 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_serviceconsumermanagement1 as serviceconsumermanagement1; +/// use serviceconsumermanagement1::CreateTenancyUnitRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CreateTenancyUnitRequest::default(); +/// +/// // You can configure optional parameters by calling 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().tenancy_units_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ServiceTenancyUnitCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceConsumerManagement, + _request: CreateTenancyUnitRequest, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceTenancyUnitCreateCall<'a, C, A> {} + +impl<'a, C, A> ServiceTenancyUnitCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TenancyUnit)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "serviceconsumermanagement.services.tenancyUnits.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}/tenancyUnits"; + 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: CreateTenancyUnitRequest) -> ServiceTenancyUnitCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// services/{service}/{collection id}/{resource id} + /// {collection id} is the cloud resource collection type representing the + /// service consumer, for example 'projects', or 'organizations'. + /// {resource id} is the consumer numeric id, such as project number: '123456'. + /// {service} the name of a service, for example 'service.googleapis.com'. + /// Enabled service binding using the new tenancy unit. + /// + /// 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) -> ServiceTenancyUnitCreateCall<'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) -> ServiceTenancyUnitCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ServiceTenancyUnitCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceTenancyUnitCreateCall<'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 specified project resource identified by tenant resource tag. +/// It will remove project lien with 'TenantManager' origin if that was added. +/// It will then attempt to delete the project. +/// If that operation fails, this method fails. +/// Operation. +/// +/// A builder for the *tenancyUnits.removeProject* 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_serviceconsumermanagement1 as serviceconsumermanagement1; +/// use serviceconsumermanagement1::RemoveTenantProjectRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = RemoveTenantProjectRequest::default(); +/// +/// // You can configure optional parameters by calling 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().tenancy_units_remove_project(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ServiceTenancyUnitRemoveProjectCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceConsumerManagement, + _request: RemoveTenantProjectRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceTenancyUnitRemoveProjectCall<'a, C, A> {} + +impl<'a, C, A> ServiceTenancyUnitRemoveProjectCall<'a, C, 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: "serviceconsumermanagement.services.tenancyUnits.removeProject", + 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}:removeProject"; + 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: RemoveTenantProjectRequest) -> ServiceTenancyUnitRemoveProjectCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the tenancy unit. + /// Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'. + /// + /// 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) -> ServiceTenancyUnitRemoveProjectCall<'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) -> ServiceTenancyUnitRemoveProjectCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ServiceTenancyUnitRemoveProjectCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceTenancyUnitRemoveProjectCall<'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 tenancy unit. Before the tenancy unit is deleted, there should be +/// no tenant resource in it. +/// Operation. +/// +/// A builder for the *tenancyUnits.delete* 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_serviceconsumermanagement1 as serviceconsumermanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling 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().tenancy_units_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ServiceTenancyUnitDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceConsumerManagement, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceTenancyUnitDeleteCall<'a, C, A> {} + +impl<'a, C, A> ServiceTenancyUnitDeleteCall<'a, C, 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: "serviceconsumermanagement.services.tenancyUnits.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) + } + } + } + } + + + /// Name of the tenancy unit 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) -> ServiceTenancyUnitDeleteCall<'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) -> ServiceTenancyUnitDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ServiceTenancyUnitDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceTenancyUnitDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Search tenancy units for a service. +/// +/// 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_serviceconsumermanagement1 as serviceconsumermanagement1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use serviceconsumermanagement1::ServiceConsumerManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ServiceConsumerManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling 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("parent") +/// .query("et") +/// .page_token("duo") +/// .page_size(-32) +/// .doit(); +/// # } +/// ``` +pub struct ServiceSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ServiceConsumerManagement, + _parent: String, + _query: Option, + _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, SearchTenancyUnitsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "serviceconsumermanagement.services.search", + 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._query { + params.push(("query", 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", "query", "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}:search"; + 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) + } + } + } + } + + + /// Service for which search is performed. + /// services/{service} + /// {service} the name of a service, for example 'service.googleapis.com'. + /// + /// 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) -> ServiceSearchCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Set a query `{expression}` for querying tenancy units. Your `{expression}` + /// must be in the format: `field_name=literal_string`. The `field_name` is the + /// name of the field you want to compare. Supported fields are + /// `tenant_resources.tag` and`tenant_resources.resource`. + /// + /// For example, to search tenancy units that contain at least one tenant + /// resource with given tag 'xyz', use query `tenant_resources.tag=xyz`. + /// To search tenancy units that contain at least one tenant resource with + /// given resource name 'projects/123456', use query + /// `tenant_resources.resource=projects/123456`. + /// + /// Multiple expressions can be joined with `AND`s. Tenancy units must match + /// all expressions to be included in the result set. For example, + /// `tenant_resources.tag=xyz AND tenant_resources.resource=projects/123456` + /// + /// Optional. + /// + /// Sets the *query* query property to the given value. + pub fn query(mut self, new_value: &str) -> ServiceSearchCall<'a, C, A> { + self._query = Some(new_value.to_string()); + self + } + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. + /// + /// Optional. + /// + /// 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 + } + /// The maximum number of results returned by this request. Currently, the + /// default maximum is set to 1000. If page_size is not provided or provided a + /// number larger than 1000, it will be automatically set to 1000. + /// + /// Optional. + /// + /// 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 + } +} + + diff --git a/gen/sourcerepo1-cli/Cargo.toml b/gen/sourcerepo1-cli/Cargo.toml index 651fe37381..1b43f7536c 100644 --- a/gen/sourcerepo1-cli/Cargo.toml +++ b/gen/sourcerepo1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-sourcerepo1-cli" -version = "1.0.6+20170908" +version = "1.0.6+20171110" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-sourcerepo1] path = "../sourcerepo1" -version = "1.0.6+20170908" +version = "1.0.6+20171110" diff --git a/gen/sourcerepo1-cli/README.md b/gen/sourcerepo1-cli/README.md index 1e8f3f1aac..19fe210f4e 100644 --- a/gen/sourcerepo1-cli/README.md +++ b/gen/sourcerepo1-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 Source Repositories* API at revision *20170908*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud Source Repositories* API at revision *20171110*. The CLI is at version *1.0.6*. ```bash sourcerepo1 [options] diff --git a/gen/sourcerepo1-cli/mkdocs.yml b/gen/sourcerepo1-cli/mkdocs.yml index 11e8448b77..9b5d816834 100644 --- a/gen/sourcerepo1-cli/mkdocs.yml +++ b/gen/sourcerepo1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Source Repositories v1.0.6+20170908 +site_name: Cloud Source Repositories v1.0.6+20171110 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) diff --git a/gen/sourcerepo1-cli/src/main.rs b/gen/sourcerepo1-cli/src/main.rs index 26798dd23b..0bc698f2a3 100644 --- a/gen/sourcerepo1-cli/src/main.rs +++ b/gen/sourcerepo1-cli/src/main.rs @@ -70,11 +70,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size" => Some(("size", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", 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())))); @@ -839,7 +839,7 @@ fn main() { let mut app = App::new("sourcerepo1") .author("Sebastian Thiel ") - .version("1.0.6+20170908") + .version("1.0.6+20171110") .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") diff --git a/gen/sourcerepo1/Cargo.toml b/gen/sourcerepo1/Cargo.toml index 03fc0bc7c9..8790908d88 100644 --- a/gen/sourcerepo1/Cargo.toml +++ b/gen/sourcerepo1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-sourcerepo1" -version = "1.0.6+20170908" +version = "1.0.6+20171110" 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" +documentation = "https://docs.rs/google-sourcerepo1/1.0.6+20171110" license = "MIT" keywords = ["sourcerepo", "google", "protocol", "web", "api"] diff --git a/gen/sourcerepo1/README.md b/gen/sourcerepo1/README.md index 084142c30b..6ead822100 100644 --- a/gen/sourcerepo1/README.md +++ b/gen/sourcerepo1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Cloud Source Repositories* crate version *1.0.6+20171110*, where *20171110* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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) + * [*repos create*](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/struct.ProjectRepoCreateCall.html), [*repos delete*](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/struct.ProjectRepoDeleteCall.html), [*repos get*](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/struct.ProjectRepoGetCall.html), [*repos get iam policy*](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/struct.ProjectRepoGetIamPolicyCall.html), [*repos list*](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/struct.ProjectRepoListCall.html), [*repos set iam policy*](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/struct.ProjectRepoSetIamPolicyCall.html) and [*repos test iam permissions*](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/struct.ProjectRepoTestIamPermissionCall.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-sourcerepo1/1.0.6+20170908/google_sourcerepo1/struct.CloudSourceRepositories.html)** +* **[Hub](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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)** + * creates [*Method Builders*](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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)** + * **[Parts](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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)** +* **[Activities](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/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-sourcerepo1/1.0.6+20170908/google_sourcerepo1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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). +[Hub Delegate](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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. +If such a method also supports a [Response Result](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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. +The [delegate trait](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-sourcerepo1/1.0.6+20171110/google_sourcerepo1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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 +Most optionals are are considered [Parts](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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. +Using [method builders](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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 +* [request values](https://docs.rs/google-sourcerepo1/1.0.6+20171110/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. diff --git a/gen/sourcerepo1/src/lib.rs b/gen/sourcerepo1/src/lib.rs index fa1f22ef8f..cb7bcdf0bb 100644 --- a/gen/sourcerepo1/src/lib.rs +++ b/gen/sourcerepo1/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 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*. +//! This documentation was generated from *Cloud Source Repositories* crate version *1.0.6+20171110*, where *20171110* 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). @@ -570,17 +570,19 @@ impl Part for Binding {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Repo { /// URL to clone the repository from Google Cloud Source Repositories. + /// Read-only field. pub url: Option, - /// The disk usage of the repo, in bytes. - /// Only returned by GetRepo. - pub size: Option, + /// How this repository mirrors a repository managed by another service. + /// Read-only field. + #[serde(rename="mirrorConfig")] + pub mirror_config: 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, + /// The disk usage of the repo, in bytes. Read-only field. Size is only + /// returned by GetRepo. + pub size: Option, } impl RequestValue for Repo {} @@ -669,7 +671,7 @@ 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 + /// Removing this webhook from the other hosting service will stop /// Google Cloud Source Repositories from receiving notifications, /// and thereby disabling mirroring. #[serde(rename="webhookId")] @@ -1209,12 +1211,12 @@ impl<'a, C, A> ProjectRepoDeleteCall<'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) -> ProjectRepoDeleteCall<'a, C, A> @@ -1496,12 +1498,12 @@ impl<'a, C, A> ProjectRepoTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRepoTestIamPermissionCall<'a, C, A> @@ -1782,12 +1784,12 @@ impl<'a, C, A> ProjectRepoSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRepoSetIamPolicyCall<'a, C, A> @@ -2038,12 +2040,12 @@ impl<'a, C, A> ProjectRepoGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectRepoGetIamPolicyCall<'a, C, A> @@ -2326,12 +2328,12 @@ impl<'a, C, A> ProjectRepoCreateCall<'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) -> ProjectRepoCreateCall<'a, C, A> @@ -2608,12 +2610,12 @@ impl<'a, C, A> ProjectRepoListCall<'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) -> ProjectRepoListCall<'a, C, A> @@ -2862,12 +2864,12 @@ impl<'a, C, A> ProjectRepoGetCall<'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) -> ProjectRepoGetCall<'a, C, A> diff --git a/gen/spanner1-cli/Cargo.toml b/gen/spanner1-cli/Cargo.toml index 24a2d2af74..8e731e138a 100644 --- a/gen/spanner1-cli/Cargo.toml +++ b/gen/spanner1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-spanner1-cli" -version = "1.0.6+20170914" +version = "1.0.6+20171204" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-spanner1] path = "../spanner1" -version = "1.0.6+20170914" +version = "1.0.6+20171204" diff --git a/gen/spanner1-cli/README.md b/gen/spanner1-cli/README.md index a08f054537..da146e5438 100644 --- a/gen/spanner1-cli/README.md +++ b/gen/spanner1-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 *Spanner* API at revision *20170914*. The CLI is at version *1.0.6*. +This documentation was generated from the *Spanner* API at revision *20171204*. The CLI is at version *1.0.6*. ```bash spanner1 [options] diff --git a/gen/spanner1-cli/mkdocs.yml b/gen/spanner1-cli/mkdocs.yml index 90b4856c57..8a5c761529 100644 --- a/gen/spanner1-cli/mkdocs.yml +++ b/gen/spanner1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Spanner v1.0.6+20170914 +site_name: Spanner v1.0.6+20171204 site_url: http://byron.github.io/google-apis-rs/google-spanner1-cli site_description: A complete library to interact with Spanner (protocol v1) diff --git a/gen/spanner1-cli/src/main.rs b/gen/spanner1-cli/src/main.rs index 6bdcad098e..270c14b287 100644 --- a/gen/spanner1-cli/src/main.rs +++ b/gen/spanner1-cli/src/main.rs @@ -1800,8 +1800,8 @@ impl<'n> Engine<'n> { 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.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())))); @@ -2616,8 +2616,8 @@ impl<'n> Engine<'n> { 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.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())))); @@ -4177,7 +4177,7 @@ fn main() { let mut app = App::new("spanner1") .author("Sebastian Thiel ") - .version("1.0.6+20170914") + .version("1.0.6+20171204") .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") diff --git a/gen/spanner1/Cargo.toml b/gen/spanner1/Cargo.toml index 3cf9658a30..c6c7d4398a 100644 --- a/gen/spanner1/Cargo.toml +++ b/gen/spanner1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-spanner1" -version = "1.0.6+20170914" +version = "1.0.6+20171204" 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" +documentation = "https://docs.rs/google-spanner1/1.0.6+20171204" license = "MIT" keywords = ["spanner", "google", "protocol", "web", "api"] diff --git a/gen/spanner1/README.md b/gen/spanner1/README.md index 7f7d89fb3b..be7a2426ab 100644 --- a/gen/spanner1/README.md +++ b/gen/spanner1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Spanner* crate version *1.0.6+20171204*, where *20171204* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-spanner1/1.0.6+20171204/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) + * [*instance configs get*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceConfigGetCall.html), [*instance configs list*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceConfigListCall.html), [*instances create*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceCreateCall.html), [*instances databases create*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseCreateCall.html), [*instances databases drop database*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseDropDatabaseCall.html), [*instances databases get*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseGetCall.html), [*instances databases get ddl*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseGetDdlCall.html), [*instances databases get iam policy*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseGetIamPolicyCall.html), [*instances databases list*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseListCall.html), [*instances databases operations cancel*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseOperationCancelCall.html), [*instances databases operations delete*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseOperationDeleteCall.html), [*instances databases operations get*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseOperationGetCall.html), [*instances databases operations list*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseOperationListCall.html), [*instances databases sessions begin transaction*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSessionBeginTransactionCall.html), [*instances databases sessions commit*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSessionCommitCall.html), [*instances databases sessions create*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSessionCreateCall.html), [*instances databases sessions delete*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSessionDeleteCall.html), [*instances databases sessions execute sql*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSessionExecuteSqlCall.html), [*instances databases sessions execute streaming sql*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSessionExecuteStreamingSqlCall.html), [*instances databases sessions get*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSessionGetCall.html), [*instances databases sessions list*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSessionListCall.html), [*instances databases sessions read*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSessionReadCall.html), [*instances databases sessions rollback*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSessionRollbackCall.html), [*instances databases sessions streaming read*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSessionStreamingReadCall.html), [*instances databases set iam policy*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseSetIamPolicyCall.html), [*instances databases test iam permissions*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseTestIamPermissionCall.html), [*instances databases update ddl*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDatabaseUpdateDdlCall.html), [*instances delete*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceDeleteCall.html), [*instances get*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceGetCall.html), [*instances get iam policy*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceGetIamPolicyCall.html), [*instances list*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceListCall.html), [*instances operations cancel*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceOperationCancelCall.html), [*instances operations delete*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceOperationDeleteCall.html), [*instances operations get*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceOperationGetCall.html), [*instances operations list*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceOperationListCall.html), [*instances patch*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstancePatchCall.html), [*instances set iam policy*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceSetIamPolicyCall.html) and [*instances test iam permissions*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/struct.ProjectInstanceTestIamPermissionCall.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-spanner1/1.0.6+20170914/google_spanner1/struct.Spanner.html)** +* **[Hub](https://docs.rs/google-spanner1/1.0.6+20171204/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)** + * creates [*Method Builders*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-spanner1/1.0.6+20171204/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)** + * **[Parts](https://docs.rs/google-spanner1/1.0.6+20171204/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)** +* **[Activities](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/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-spanner1/1.0.6+20170914/google_spanner1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-spanner1/1.0.6+20171204/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). +[Hub Delegate](https://docs.rs/google-spanner1/1.0.6+20171204/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-spanner1/1.0.6+20171204/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. +If such a method also supports a [Response Result](https://docs.rs/google-spanner1/1.0.6+20171204/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-spanner1/1.0.6+20171204/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. +The [delegate trait](https://docs.rs/google-spanner1/1.0.6+20171204/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-spanner1/1.0.6+20171204/google_spanner1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-spanner1/1.0.6+20171204/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 +Most optionals are are considered [Parts](https://docs.rs/google-spanner1/1.0.6+20171204/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. +Using [method builders](https://docs.rs/google-spanner1/1.0.6+20171204/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 +* [request values](https://docs.rs/google-spanner1/1.0.6+20171204/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. diff --git a/gen/spanner1/src/lib.rs b/gen/spanner1/src/lib.rs index 6b348cc8d7..59d9881f33 100644 --- a/gen/spanner1/src/lib.rs +++ b/gen/spanner1/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 *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*. +//! This documentation was generated from *Spanner* crate version *1.0.6+20171204*, where *20171204* 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/). @@ -568,19 +568,8 @@ pub struct Instance { /// 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. + /// See [the documentation](https://cloud.google.com/spanner/docs/instances#node_count) + /// for more information about nodes. #[serde(rename="nodeCount")] pub node_count: Option, /// Cloud Labels are a flexible and lightweight mechanism for organizing cloud @@ -638,20 +627,37 @@ pub struct ListDatabasesResponse { impl ResponseResult for ListDatabasesResponse {} -/// Request message for `GetIamPolicy` method. +/// 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 get iam policy projects](struct.ProjectInstanceGetIamPolicyCall.html) (request) -/// * [instances databases get iam policy projects](struct.ProjectInstanceDatabaseGetIamPolicyCall.html) (request) +/// * [instances databases sessions begin transaction projects](struct.ProjectInstanceDatabaseSessionBeginTransactionCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetIamPolicyRequest { _never_set: Option } +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. + /// + /// A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + /// Example: `"2014-10-02T15:01:23.045123456Z"`. + #[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 RequestValue for GetIamPolicyRequest {} +impl ResponseResult for Transaction {} /// KeyRange represents a range of rows in a table or index. @@ -845,8 +851,6 @@ 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 @@ -858,6 +862,8 @@ 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 {} @@ -1346,34 +1352,20 @@ pub struct StructType { impl Part for StructType {} -/// A transaction. +/// 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 databases sessions begin transaction projects](struct.ProjectInstanceDatabaseSessionBeginTransactionCall.html) (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 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, -} +pub struct GetIamPolicyRequest { _never_set: Option } -impl ResponseResult for Transaction {} +impl RequestValue for GetIamPolicyRequest {} /// Request message for `TestIamPermissions` method. @@ -1482,28 +1474,117 @@ pub struct GetDatabaseDdlResponse { impl ResponseResult for GetDatabaseDdlResponse {} -/// The response for ListInstanceConfigs. +/// 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*). /// -/// * [instance configs list projects](struct.ProjectInstanceConfigListCall.html) (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 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>, +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 ListInstanceConfigsResponse {} +impl ResponseResult for PartialResultSet {} /// Additional statistics about a ResultSet or PartialResultSet. @@ -1774,11 +1855,11 @@ impl Part for Status {} /// #[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 {} @@ -1947,6 +2028,9 @@ pub struct ReadOnly { /// previously committed transaction whose timestamp is known. /// /// Note that this option can only be used in single-use transactions. + /// + /// A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + /// Example: `"2014-10-02T15:01:23.045123456Z"`. #[serde(rename="minReadTimestamp")] pub min_read_timestamp: Option, /// Executes all reads at the given timestamp. Unlike other modes, @@ -1958,6 +2042,9 @@ pub struct ReadOnly { /// Useful for large scale consistent reads such as mapreduces, or /// for coordinating many reads against a consistent snapshot of the /// data. + /// + /// A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + /// Example: `"2014-10-02T15:01:23.045123456Z"`. #[serde(rename="readTimestamp")] pub read_timestamp: Option, /// Read at a timestamp where all previously committed transactions @@ -2040,7 +2127,6 @@ pub struct ReadRequest { 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 @@ -2090,7 +2176,9 @@ pub struct Session { /// 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. + /// * No more than 64 labels can be associated with a given session. + /// + /// See https://goo.gl/xmQnxf for more information on and examples of labels. pub labels: Option>, /// Output only. The timestamp when the session is created. #[serde(rename="createTime")] @@ -2099,7 +2187,8 @@ pub struct Session { /// typically earlier than the actual last use time. #[serde(rename="approximateLastUseTime")] pub approximate_last_use_time: Option, - /// The name of the session. + /// The name of the session. This is always system-assigned; values provided + /// when creating a session are ignored. pub name: Option, } @@ -2130,117 +2219,28 @@ pub struct ResultSetMetadata { 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. +/// 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*). /// -/// * [instances databases sessions streaming read projects](struct.ProjectInstanceDatabaseSessionStreamingReadCall.html) (response) -/// * [instances databases sessions execute streaming sql projects](struct.ProjectInstanceDatabaseSessionExecuteStreamingSqlCall.html) (response) +/// * [instance configs list projects](struct.ProjectInstanceConfigListCall.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, +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 PartialResultSet {} +impl ResponseResult for ListInstanceConfigsResponse {} /// This resource represents a long-running operation that is the result of a @@ -3518,17 +3518,17 @@ impl<'a, C, A> ProjectInstanceDatabaseGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceDatabaseGetCall<'a, C, A> @@ -3809,17 +3809,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionCommitCall<'a, C, A> where C: Borro /// /// # 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) -> ProjectInstanceDatabaseSessionCommitCall<'a, C, A> @@ -4097,17 +4097,17 @@ impl<'a, C, A> ProjectInstanceGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceGetIamPolicyCall<'a, C, A> @@ -4393,17 +4393,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionReadCall<'a, C, A> where C: BorrowM /// /// # 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) -> ProjectInstanceDatabaseSessionReadCall<'a, C, A> @@ -4681,17 +4681,17 @@ impl<'a, C, A> ProjectInstanceSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceSetIamPolicyCall<'a, C, A> @@ -4970,17 +4970,17 @@ impl<'a, C, A> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> where C: B /// /// # 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) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> @@ -5251,17 +5251,17 @@ impl<'a, C, A> ProjectInstanceDatabaseListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceDatabaseListCall<'a, C, A> @@ -5542,17 +5542,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionRollbackCall<'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) -> ProjectInstanceDatabaseSessionRollbackCall<'a, C, A> @@ -5796,17 +5796,17 @@ impl<'a, C, A> ProjectInstanceGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceGetCall<'a, C, A> @@ -6051,17 +6051,17 @@ impl<'a, C, A> ProjectInstanceDatabaseOperationGetCall<'a, C, A> where C: Borrow /// /// # 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) -> ProjectInstanceDatabaseOperationGetCall<'a, C, A> @@ -6339,17 +6339,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionStreamingReadCall<'a, C, A> where C /// /// # 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) -> ProjectInstanceDatabaseSessionStreamingReadCall<'a, C, A> @@ -6608,20 +6608,20 @@ impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut 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 + /// * `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 + /// * `name:howl labels.env:dev` --> The instance's name contains "howl" and /// it has the label "env" with its value /// containing "dev". /// @@ -6650,17 +6650,17 @@ impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceListCall<'a, C, A> @@ -6952,17 +6952,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionCreateCall<'a, C, A> where C: Borro /// /// # 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) -> ProjectInstanceDatabaseSessionCreateCall<'a, C, A> @@ -7244,17 +7244,17 @@ impl<'a, C, A> ProjectInstanceDatabaseCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceDatabaseCreateCall<'a, C, A> @@ -7534,17 +7534,17 @@ impl<'a, C, A> ProjectInstanceDatabaseUpdateDdlCall<'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) -> ProjectInstanceDatabaseUpdateDdlCall<'a, C, A> @@ -7822,17 +7822,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSetIamPolicyCall<'a, C, A> where C: Borrow /// /// # 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) -> ProjectInstanceDatabaseSetIamPolicyCall<'a, C, A> @@ -8148,17 +8148,17 @@ impl<'a, C, A> ProjectInstancePatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstancePatchCall<'a, C, A> @@ -8401,17 +8401,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionDeleteCall<'a, C, A> where C: Borro /// /// # 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) -> ProjectInstanceDatabaseSessionDeleteCall<'a, C, A> @@ -8655,17 +8655,17 @@ impl<'a, C, A> ProjectInstanceConfigGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceConfigGetCall<'a, C, A> @@ -8949,17 +8949,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionExecuteSqlCall<'a, C, A> where C: B /// /// # 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) -> ProjectInstanceDatabaseSessionExecuteSqlCall<'a, C, A> @@ -9238,17 +9238,17 @@ impl<'a, C, A> ProjectInstanceTestIamPermissionCall<'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) -> ProjectInstanceTestIamPermissionCall<'a, C, A> @@ -9493,17 +9493,17 @@ impl<'a, C, A> ProjectInstanceDatabaseGetDdlCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceDatabaseGetDdlCall<'a, C, A> @@ -9780,17 +9780,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionBeginTransactionCall<'a, C, A> wher /// /// # 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) -> ProjectInstanceDatabaseSessionBeginTransactionCall<'a, C, A> @@ -10078,17 +10078,17 @@ impl<'a, C, A> ProjectInstanceOperationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceOperationListCall<'a, C, A> @@ -10360,17 +10360,17 @@ impl<'a, C, A> ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceConfigListCall<'a, C, A> @@ -10648,17 +10648,17 @@ impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: Borrow /// /// # 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) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> @@ -10936,17 +10936,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'a, C, A> w /// /// # 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) -> ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'a, C, A> @@ -11191,17 +11191,17 @@ impl<'a, C, A> ProjectInstanceOperationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceOperationGetCall<'a, C, A> @@ -11453,17 +11453,17 @@ impl<'a, C, A> ProjectInstanceDatabaseOperationCancelCall<'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) -> ProjectInstanceDatabaseOperationCancelCall<'a, C, A> @@ -11721,12 +11721,12 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowM /// 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 + /// * `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 + /// * `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. @@ -11754,17 +11754,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowM /// /// # 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) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> @@ -12052,17 +12052,17 @@ impl<'a, C, A> ProjectInstanceDatabaseOperationListCall<'a, C, A> where C: Borro /// /// # 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) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> @@ -12370,17 +12370,17 @@ impl<'a, C, A> ProjectInstanceCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceCreateCall<'a, C, A> @@ -12623,17 +12623,17 @@ impl<'a, C, A> ProjectInstanceDatabaseDropDatabaseCall<'a, C, A> where C: Borrow /// /// # 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) -> ProjectInstanceDatabaseDropDatabaseCall<'a, C, A> @@ -12879,17 +12879,17 @@ impl<'a, C, A> ProjectInstanceOperationDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceOperationDeleteCall<'a, C, A> @@ -13135,17 +13135,17 @@ impl<'a, C, A> ProjectInstanceDatabaseOperationDeleteCall<'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) -> ProjectInstanceDatabaseOperationDeleteCall<'a, C, A> @@ -13399,17 +13399,17 @@ impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceDeleteCall<'a, C, A> @@ -13661,17 +13661,17 @@ impl<'a, C, A> ProjectInstanceOperationCancelCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceOperationCancelCall<'a, C, A> @@ -13916,17 +13916,17 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionGetCall<'a, C, A> where C: BorrowMu /// /// # 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) -> ProjectInstanceDatabaseSessionGetCall<'a, C, A> diff --git a/gen/sqladmin1_beta4-cli/Cargo.toml b/gen/sqladmin1_beta4-cli/Cargo.toml index b2181d097a..9f539676b5 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+20170807" +version = "1.0.6+20171011" 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+20170807" +version = "1.0.6+20171011" diff --git a/gen/sqladmin1_beta4-cli/README.md b/gen/sqladmin1_beta4-cli/README.md index f2b6ac2d3b..6e6ef1800b 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 *20170807*. The CLI is at version *1.0.6*. +This documentation was generated from the *SQL Admin* API at revision *20171011*. The CLI is at version *1.0.6*. ```bash sqladmin1-beta4 [options] @@ -46,6 +46,7 @@ sqladmin1-beta4 [options] instances clone (-r )... [-p ]... [-o ] delete [-p ]... [-o ] + demote-master (-r )... [-p ]... [-o ] export (-r )... [-p ]... [-o ] failover (-r )... [-p ]... [-o ] get [-p ]... [-o ] diff --git a/gen/sqladmin1_beta4-cli/mkdocs.yml b/gen/sqladmin1_beta4-cli/mkdocs.yml index 7ca932ddbd..8a5325f220 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+20170807 +site_name: SQL Admin v1.0.6+20171011 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) @@ -22,6 +22,7 @@ pages: - ['flags_list.md', 'Flags', 'List'] - ['instances_clone.md', 'Instances', 'Clone'] - ['instances_delete.md', 'Instances', 'Delete'] +- ['instances_demote-master.md', 'Instances', 'Demote Master'] - ['instances_export.md', 'Instances', 'Export'] - ['instances_failover.md', 'Instances', 'Failover'] - ['instances_get.md', 'Instances', 'Get'] diff --git a/gen/sqladmin1_beta4-cli/src/main.rs b/gen/sqladmin1_beta4-cli/src/main.rs index 0b978d3b1f..563d382314 100644 --- a/gen/sqladmin1_beta4-cli/src/main.rs +++ b/gen/sqladmin1_beta4-cli/src/main.rs @@ -936,6 +936,99 @@ impl<'n> Engine<'n> { } } + fn _instances_demote_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()[..] { + "demote-master-context.kind" => Some(("demoteMasterContext.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "demote-master-context.master-instance-name" => Some(("demoteMasterContext.masterInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "demote-master-context.replica-configuration.kind" => Some(("demoteMasterContext.replicaConfiguration.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "demote-master-context.replica-configuration.mysql-replica-configuration.username" => Some(("demoteMasterContext.replicaConfiguration.mysqlReplicaConfiguration.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "demote-master-context.replica-configuration.mysql-replica-configuration.kind" => Some(("demoteMasterContext.replicaConfiguration.mysqlReplicaConfiguration.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "demote-master-context.replica-configuration.mysql-replica-configuration.client-key" => Some(("demoteMasterContext.replicaConfiguration.mysqlReplicaConfiguration.clientKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "demote-master-context.replica-configuration.mysql-replica-configuration.ca-certificate" => Some(("demoteMasterContext.replicaConfiguration.mysqlReplicaConfiguration.caCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "demote-master-context.replica-configuration.mysql-replica-configuration.client-certificate" => Some(("demoteMasterContext.replicaConfiguration.mysqlReplicaConfiguration.clientCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "demote-master-context.replica-configuration.mysql-replica-configuration.password" => Some(("demoteMasterContext.replicaConfiguration.mysqlReplicaConfiguration.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["ca-certificate", "client-certificate", "client-key", "demote-master-context", "kind", "master-instance-name", "mysql-replica-configuration", "password", "replica-configuration", "username"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstancesDemoteMasterRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instances().demote_master(request, opt.value_of("project").unwrap_or(""), opt.value_of("instance").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _instances_export(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -3067,6 +3160,9 @@ impl<'n> Engine<'n> { ("delete", Some(opt)) => { call_result = self._instances_delete(opt, dry_run, &mut err); }, + ("demote-master", Some(opt)) => { + call_result = self._instances_demote_master(opt, dry_run, &mut err); + }, ("export", Some(opt)) => { call_result = self._instances_export(opt, dry_run, &mut err); }, @@ -3633,7 +3729,7 @@ fn main() { ]), ]), - ("instances", "methods: 'clone', 'delete', 'export', 'failover', 'get', 'import', 'insert', 'list', 'patch', 'promote-replica', 'reset-ssl-config', 'restart', 'restore-backup', 'start-replica', 'stop-replica', 'truncate-log' and 'update'", vec![ + ("instances", "methods: 'clone', 'delete', 'demote-master', 'export', 'failover', 'get', 'import', 'insert', 'list', 'patch', 'promote-replica', 'reset-ssl-config', 'restart', 'restore-backup', 'start-replica', 'stop-replica', 'truncate-log' and 'update'", vec![ ("clone", Some(r##"Creates a Cloud SQL instance as a clone of the source instance. The API is not ready for Second Generation instances yet."##), "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_clone", @@ -3690,6 +3786,40 @@ 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)), + ]), + ("demote-master", + Some(r##"Demotes the standalone instance to be a read replica Cloud SQL instance of an on-premises master."##), + "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_demote-master", + vec![ + (Some(r##"project"##), + None, + Some(r##"ID of the project that contains the instance."##), + Some(true), + Some(false)), + + (Some(r##"instance"##), + None, + Some(r##"Cloud SQL instance 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"##), @@ -4560,7 +4690,7 @@ fn main() { let mut app = App::new("sqladmin1-beta4") .author("Sebastian Thiel ") - .version("1.0.6+20170807") + .version("1.0.6+20171011") .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 2b14738401..ab87a243c6 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+20170807" +version = "1.0.6+20171011" 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+20170807" +documentation = "https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011" license = "MIT" keywords = ["sqladmin", "google", "protocol", "web", "api"] diff --git a/gen/sqladmin1_beta4/README.md b/gen/sqladmin1_beta4/README.md index 0fe1b09b08..1cf2b93e74 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+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*. +This documentation was generated from *SQL Admin* crate version *1.0.6+20171011*, where *20171011* 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+20170807/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+20171011/google_sqladmin1_beta4/struct.SQLAdmin.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) +* [backup runs](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.BackupRun.html) + * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.BackupRunDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.BackupRunGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.BackupRunInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.BackupRunListCall.html) +* [databases](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.Database.html) + * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.DatabaseDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.DatabaseGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.DatabaseInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.DatabaseListCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.DatabasePatchCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.DatabaseUpdateCall.html) +* [flags](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.Flag.html) + * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.FlagListCall.html) * instances - * [*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) + * [*clone*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceCloneCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceDeleteCall.html), [*demote master*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceDemoteMasterCall.html), [*export*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceExportCall.html), [*failover*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceFailoverCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceGetCall.html), [*import*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceImportCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceListCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstancePatchCall.html), [*promote replica*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstancePromoteReplicaCall.html), [*reset ssl config*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceResetSslConfigCall.html), [*restart*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceRestartCall.html), [*restore backup*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceRestoreBackupCall.html), [*start replica*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceStartReplicaCall.html), [*stop replica*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceStopReplicaCall.html), [*truncate log*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceTruncateLogCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.InstanceUpdateCall.html) +* [operations](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.Operation.html) + * [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.OperationListCall.html) +* [ssl certs](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.SslCert.html) + * [*create ephemeral*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.SslCertCreateEphemeralCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.SslCertDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.SslCertGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.SslCertInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.SslCertListCall.html) +* [tiers](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.Tier.html) + * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.TierListCall.html) +* [users](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.User.html) + * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.UserDeleteCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.UserInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/struct.UserListCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/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+20170807/google_sqladmin1_beta4/struct.SQLAdmin.html)** +* **[Hub](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/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+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)** + * creates [*Method Builders*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/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+20170807/google_sqladmin1_beta4/trait.Part.html)** + * **[Parts](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/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+20170807/google_sqladmin1_beta4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/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. @@ -63,6 +63,7 @@ Or specifically ... ```ignore let r = hub.ssl_certs().delete(...).doit() let r = hub.instances().truncate_log(...).doit() +let r = hub.instances().demote_master(...).doit() let r = hub.users().delete(...).doit() let r = hub.databases().delete(...).doit() let r = hub.instances().failover(...).doit() @@ -162,17 +163,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+20170807/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+20171011/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+20170807/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+20171011/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+20170807/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+20171011/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+20170807/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+20171011/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 +183,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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/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+20170807/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+20171011/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/google_sqladmin1_beta4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/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+20170807/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+20171011/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+20170807/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+20171011/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+20170807/google_sqladmin1_beta4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-sqladmin1_beta4/1.0.6+20171011/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 18a69b25dc..7f7d180386 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+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*. +//! This documentation was generated from *SQL Admin* crate version *1.0.6+20171011*, where *20171011* 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). @@ -18,7 +18,7 @@ //! * [flags](struct.Flag.html) //! * [*list*](struct.FlagListCall.html) //! * instances -//! * [*clone*](struct.InstanceCloneCall.html), [*delete*](struct.InstanceDeleteCall.html), [*export*](struct.InstanceExportCall.html), [*failover*](struct.InstanceFailoverCall.html), [*get*](struct.InstanceGetCall.html), [*import*](struct.InstanceImportCall.html), [*insert*](struct.InstanceInsertCall.html), [*list*](struct.InstanceListCall.html), [*patch*](struct.InstancePatchCall.html), [*promote replica*](struct.InstancePromoteReplicaCall.html), [*reset ssl config*](struct.InstanceResetSslConfigCall.html), [*restart*](struct.InstanceRestartCall.html), [*restore backup*](struct.InstanceRestoreBackupCall.html), [*start replica*](struct.InstanceStartReplicaCall.html), [*stop replica*](struct.InstanceStopReplicaCall.html), [*truncate log*](struct.InstanceTruncateLogCall.html) and [*update*](struct.InstanceUpdateCall.html) +//! * [*clone*](struct.InstanceCloneCall.html), [*delete*](struct.InstanceDeleteCall.html), [*demote master*](struct.InstanceDemoteMasterCall.html), [*export*](struct.InstanceExportCall.html), [*failover*](struct.InstanceFailoverCall.html), [*get*](struct.InstanceGetCall.html), [*import*](struct.InstanceImportCall.html), [*insert*](struct.InstanceInsertCall.html), [*list*](struct.InstanceListCall.html), [*patch*](struct.InstancePatchCall.html), [*promote replica*](struct.InstancePromoteReplicaCall.html), [*reset ssl config*](struct.InstanceResetSslConfigCall.html), [*restart*](struct.InstanceRestartCall.html), [*restore backup*](struct.InstanceRestoreBackupCall.html), [*start replica*](struct.InstanceStartReplicaCall.html), [*stop replica*](struct.InstanceStopReplicaCall.html), [*truncate log*](struct.InstanceTruncateLogCall.html) and [*update*](struct.InstanceUpdateCall.html) //! * [operations](struct.Operation.html) //! * [*get*](struct.OperationGetCall.html) and [*list*](struct.OperationListCall.html) //! * [ssl certs](struct.SslCert.html) @@ -63,6 +63,7 @@ //! ```ignore //! let r = hub.ssl_certs().delete(...).doit() //! let r = hub.instances().truncate_log(...).doit() +//! let r = hub.instances().demote_master(...).doit() //! let r = hub.users().delete(...).doit() //! let r = hub.databases().delete(...).doit() //! let r = hub.instances().failover(...).doit() @@ -574,6 +575,25 @@ pub struct RestoreBackupContext { impl Part for RestoreBackupContext {} +/// Database instance demote master 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 DemoteMasterContext { + /// This is always sql#demoteMasterContext. + pub kind: Option, + /// The name of the instance which will act as on-premises master in the replication setup. + #[serde(rename="masterInstanceName")] + pub master_instance_name: Option, + /// Configuration specific to read-replicas replicating from the on-premises master. + #[serde(rename="replicaConfiguration")] + pub replica_configuration: Option, +} + +impl Part for DemoteMasterContext {} + + /// Options for exporting data as CSV. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1306,6 +1326,25 @@ pub struct AclEntry { impl Part for AclEntry {} +/// Database demote master 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*). +/// +/// * [demote master instances](struct.InstanceDemoteMasterCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesDemoteMasterRequest { + /// Contains details about the demoteMaster operation. + #[serde(rename="demoteMasterContext")] + pub demote_master_context: Option, +} + +impl RequestValue for InstancesDemoteMasterRequest {} + + /// SslCerts create ephemeral certificate request. /// /// # Activities @@ -1324,6 +1363,22 @@ pub struct SslCertsCreateEphemeralRequest { impl RequestValue for SslCertsCreateEphemeralRequest {} +/// Read-replica configuration for connecting to the on-premises master. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DemoteMasterConfiguration { + /// This is always sql#demoteMasterConfiguration. + pub kind: Option, + /// MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory. + #[serde(rename="mysqlReplicaConfiguration")] + pub mysql_replica_configuration: Option, +} + +impl Part for DemoteMasterConfiguration {} + + /// Instance truncate log request. /// /// # Activities @@ -1527,6 +1582,32 @@ impl RequestValue for DatabaseInstance {} impl ResponseResult for DatabaseInstance {} +/// Read-replica configuration specific to MySQL databases. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DemoteMasterMySqlReplicaConfiguration { + /// The username for the replication connection. + pub username: Option, + /// This is always sql#demoteMasterMysqlReplicaConfiguration. + pub kind: Option, + /// PEM representation of the slave's x509 certificate. + #[serde(rename="clientCertificate")] + pub client_certificate: Option, + /// PEM representation of the trusted CA's x509 certificate. + #[serde(rename="caCertificate")] + pub ca_certificate: Option, + /// The password for the replication connection. + pub password: Option, + /// PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate. The format of the slave's private key can be either PKCS #1 or PKCS #8. + #[serde(rename="clientKey")] + pub client_key: Option, +} + +impl Part for DemoteMasterMySqlReplicaConfiguration {} + + /// Database instance import request. /// /// # Activities @@ -1610,6 +1691,7 @@ impl Part for BinLogCoordinates {} /// /// * [delete ssl certs](struct.SslCertDeleteCall.html) (response) /// * [truncate log instances](struct.InstanceTruncateLogCall.html) (response) +/// * [demote master instances](struct.InstanceDemoteMasterCall.html) (response) /// * [delete users](struct.UserDeleteCall.html) (response) /// * [delete databases](struct.DatabaseDeleteCall.html) (response) /// * [failover instances](struct.InstanceFailoverCall.html) (response) @@ -2035,7 +2117,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// ::default(), None); /// let mut hub = SQLAdmin::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 `clone(...)`, `delete(...)`, `export(...)`, `failover(...)`, `get(...)`, `import(...)`, `insert(...)`, `list(...)`, `patch(...)`, `promote_replica(...)`, `reset_ssl_config(...)`, `restart(...)`, `restore_backup(...)`, `start_replica(...)`, `stop_replica(...)`, `truncate_log(...)` and `update(...)` +/// // like `clone(...)`, `delete(...)`, `demote_master(...)`, `export(...)`, `failover(...)`, `get(...)`, `import(...)`, `insert(...)`, `list(...)`, `patch(...)`, `promote_replica(...)`, `reset_ssl_config(...)`, `restart(...)`, `restore_backup(...)`, `start_replica(...)`, `stop_replica(...)`, `truncate_log(...)` and `update(...)` /// // to build up your call. /// let rb = hub.instances(); /// # } @@ -2071,6 +2153,27 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Demotes the standalone instance to be a read replica Cloud SQL instance of an on-premises master. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - ID of the project that contains the instance. + /// * `instance` - Cloud SQL instance name. + pub fn demote_master(&self, request: InstancesDemoteMasterRequest, project: &str, instance: &str) -> InstanceDemoteMasterCall<'a, C, A> { + InstanceDemoteMasterCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _instance: instance.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Failover the instance to its failover replica instance. @@ -5088,6 +5191,292 @@ impl<'a, C, A> InstanceTruncateLogCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = SQLAdmin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = InstancesDemoteMasterRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.instances().demote_master(req, "project", "instance") +/// .doit(); +/// # } +/// ``` +pub struct InstanceDemoteMasterCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SQLAdmin, + _request: InstancesDemoteMasterRequest, + _project: String, + _instance: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceDemoteMasterCall<'a, C, A> {} + +impl<'a, C, A> InstanceDemoteMasterCall<'a, C, 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: "sql.instances.demoteMaster", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("project", self._project.to_string())); + params.push(("instance", self._instance.to_string())); + for &field in ["alt", "project", "instance"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) 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/{project}/instances/{instance}/demoteMaster"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["instance", "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 { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: InstancesDemoteMasterRequest) -> InstanceDemoteMasterCall<'a, C, A> { + self._request = new_value; + self + } + /// ID of the project that contains the instance. + /// + /// 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) -> InstanceDemoteMasterCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Cloud SQL instance name. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> InstanceDemoteMasterCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstanceDemoteMasterCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceDemoteMasterCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceDemoteMasterCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Failover the instance to its failover replica instance. /// /// A builder for the *failover* method supported by a *instance* resource. @@ -7778,9 +8167,9 @@ impl<'a, C, A> InstanceInsertCall<'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.instances().list("project") -/// .page_token("sanctus") -/// .max_results(79) -/// .filter("amet") +/// .page_token("amet") +/// .max_results(78) +/// .filter("consetetur") /// .doit(); /// # } /// ``` @@ -9456,7 +9845,7 @@ impl<'a, C, A> InstanceRestoreBackupCall<'a, C, A> where C: BorrowMut SslCertListCall<'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.backup_runs().list("project", "instance") -/// .page_token("sadipscing") -/// .max_results(-66) +/// .page_token("dolore") +/// .max_results(-41) /// .doit(); /// # } /// ``` diff --git a/gen/storage1-cli/Cargo.toml b/gen/storage1-cli/Cargo.toml index 2029411fed..8461d9ae59 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+20170915" +version = "1.0.6+20171101" 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+20170915" +version = "1.0.6+20171101" diff --git a/gen/storage1-cli/README.md b/gen/storage1-cli/README.md index 87e3890f1e..cc3f03edd0 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 *20170915*. The CLI is at version *1.0.6*. +This documentation was generated from the *storage* API at revision *20171101*. 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 4065868dda..f0bbd10d9a 100644 --- a/gen/storage1-cli/mkdocs.yml +++ b/gen/storage1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: storage v1.0.6+20170915 +site_name: storage v1.0.6+20171101 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 e102152afc..2a1e67f17b 100644 --- a/gen/storage1-cli/src/main.rs +++ b/gen/storage1-cli/src/main.rs @@ -2625,7 +2625,6 @@ impl<'n> Engine<'n> { } } let mut request: api::ComposeRequest = json::value::from_value(object).unwrap(); - let mut download_mode = false; let mut call = self.hub.objects().compose(request, opt.value_of("destination-bucket").unwrap_or(""), opt.value_of("destination-object").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); @@ -2649,9 +2648,6 @@ impl<'n> Engine<'n> { 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; @@ -2685,15 +2681,10 @@ impl<'n> Engine<'n> { } { 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(()) } } @@ -2763,7 +2754,6 @@ impl<'n> Engine<'n> { } } let mut request: api::Object = json::value::from_value(object).unwrap(); - let mut download_mode = false; let mut call = self.hub.objects().copy(request, opt.value_of("source-bucket").unwrap_or(""), opt.value_of("source-object").unwrap_or(""), opt.value_of("destination-bucket").unwrap_or(""), opt.value_of("destination-object").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); @@ -2808,9 +2798,6 @@ impl<'n> Engine<'n> { 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; @@ -2844,15 +2831,10 @@ impl<'n> Engine<'n> { } { 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(()) } } @@ -3206,8 +3188,6 @@ impl<'n> Engine<'n> { remove_json_null_values(&mut value); json::to_writer_pretty(&mut ostream, &value).unwrap(); ostream.flush().unwrap(); - io::copy(&mut response, &mut ostream).unwrap(); - ostream.flush().unwrap(); Ok(()) } } @@ -3801,7 +3781,6 @@ impl<'n> Engine<'n> { } } let mut request: api::Object = json::value::from_value(object).unwrap(); - let mut download_mode = false; let mut call = self.hub.objects().update(request, opt.value_of("bucket").unwrap_or(""), opt.value_of("object").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); @@ -3834,9 +3813,6 @@ impl<'n> Engine<'n> { 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; @@ -3870,15 +3846,10 @@ impl<'n> Engine<'n> { } { 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(()) } } @@ -5459,7 +5430,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates an object's metadata. This method supports patch semantics."##), + Some(r##"Patches an object's metadata."##), "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/objects_patch", vec![ (Some(r##"bucket"##), @@ -5699,7 +5670,7 @@ fn main() { let mut app = App::new("storage1") .author("Sebastian Thiel ") - .version("1.0.6+20170915") + .version("1.0.6+20171101") .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 75f7f37918..59891559f3 100644 --- a/gen/storage1/Cargo.toml +++ b/gen/storage1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-storage1" -version = "1.0.6+20170915" +version = "1.0.6+20171101" 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+20170915" +documentation = "https://docs.rs/google-storage1/1.0.6+20171101" license = "MIT" keywords = ["storage", "google", "protocol", "web", "api"] diff --git a/gen/storage1/README.md b/gen/storage1/README.md index d1871da407..afe0388e6a 100644 --- a/gen/storage1/README.md +++ b/gen/storage1/README.md @@ -5,48 +5,44 @@ 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+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*. +This documentation was generated from *storage* crate version *1.0.6+20171101*, where *20171101* 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+20170915/google_storage1/struct.Storage.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.Storage.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) +* [bucket access controls](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketAccessControl.html) + * [*delete*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketAccessControlUpdateCall.html) +* [buckets](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.Bucket.html) + * [*delete*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketPatchCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketTestIamPermissionCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.BucketUpdateCall.html) +* [channels](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.Channel.html) + * [*stop*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ChannelStopCall.html) * default object access controls - * [*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) + * [*delete*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.DefaultObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.DefaultObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.DefaultObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.DefaultObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.DefaultObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.DefaultObjectAccessControlUpdateCall.html) +* [notifications](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.Notification.html) + * [*delete*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.NotificationGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.NotificationInsertCall.html) and [*list*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.NotificationListCall.html) +* [object access controls](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectAccessControl.html) + * [*delete*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectAccessControlUpdateCall.html) +* [objects](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.Object.html) + * [*compose*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectComposeCall.html), [*copy*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectCopyCall.html), [*delete*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectPatchCall.html), [*rewrite*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectRewriteCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectTestIamPermissionCall.html), [*update*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectUpdateCall.html) and [*watch all*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectWatchAllCall.html) * projects - * [*service account get*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ProjectServiceAccountGetCall.html) + * [*service account get*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ProjectServiceAccountGetCall.html) Upload supported by ... -* [*insert objects*](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.ObjectInsertCall.html) +* [*insert objects*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectInsertCall.html) Download supported by ... -* [*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) +* [*get objects*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectGetCall.html) Subscription supported by ... -* [*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) +* [*watch all objects*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectWatchAllCall.html) +* [*list objects*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/struct.ObjectListCall.html) @@ -54,17 +50,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/struct.Storage.html)** +* **[Hub](https://docs.rs/google-storage1/1.0.6+20171101/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+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)** + * creates [*Method Builders*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-storage1/1.0.6+20171101/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+20170915/google_storage1/trait.Part.html)** + * **[Parts](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-storage1/1.0.6+20170915/google_storage1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -180,17 +176,17 @@ match result { ``` ## Handling Errors -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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-storage1/1.0.6+20171101/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+20170915/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+20171101/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+20170915/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+20171101/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+20170915/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+20171101/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")`. @@ -200,29 +196,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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-storage1/1.0.6+20171101/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+20170915/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+20171101/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-storage1/1.0.6+20171101/google_storage1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-storage1/1.0.6+20171101/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+20170915/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+20171101/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+20170915/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+20171101/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+20170915/google_storage1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-storage1/1.0.6+20171101/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 34fe4bf581..78c6aad1d1 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+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*. +//! This documentation was generated from *storage* crate version *1.0.6+20171101*, where *20171101* 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/). @@ -36,10 +36,6 @@ //! Download supported by ... //! //! * [*get objects*](struct.ObjectGetCall.html) -//! * [*update objects*](struct.ObjectUpdateCall.html) -//! * [*insert objects*](struct.ObjectInsertCall.html) -//! * [*compose objects*](struct.ObjectComposeCall.html) -//! * [*copy objects*](struct.ObjectCopyCall.html) //! //! Subscription supported by ... //! @@ -2320,7 +2316,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates an object's metadata. This method supports patch semantics. + /// Patches an object's metadata. /// /// # Arguments /// @@ -3054,7 +3050,7 @@ impl<'a, C, A> DefaultObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut self._bucket = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -3319,7 +3315,7 @@ impl<'a, C, A> DefaultObjectAccessControlListCall<'a, C, A> where C: BorrowMut DefaultObjectAccessControlListCall<'a, C, A> { @@ -3631,7 +3627,7 @@ impl<'a, C, A> DefaultObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut< self._entity = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -3887,7 +3883,7 @@ impl<'a, C, A> DefaultObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut self._entity = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -4185,7 +4181,7 @@ impl<'a, C, A> DefaultObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut self._entity = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -4452,7 +4448,7 @@ impl<'a, C, A> DefaultObjectAccessControlGetCall<'a, C, A> where C: BorrowMut DefaultObjectAccessControlGetCall<'a, C, A> { @@ -4750,7 +4746,7 @@ impl<'a, C, A> BucketAccessControlPatchCall<'a, C, A> where C: BorrowMut BucketAccessControlPatchCall<'a, C, A> { @@ -5006,7 +5002,7 @@ impl<'a, C, A> BucketAccessControlDeleteCall<'a, C, A> where C: BorrowMut BucketAccessControlDeleteCall<'a, C, A> { @@ -5292,7 +5288,7 @@ impl<'a, C, A> BucketAccessControlInsertCall<'a, C, A> where C: BorrowMut BucketAccessControlInsertCall<'a, C, A> { @@ -5559,7 +5555,7 @@ impl<'a, C, A> BucketAccessControlGetCall<'a, C, A> where C: BorrowMut BucketAccessControlGetCall<'a, C, A> { @@ -5857,7 +5853,7 @@ impl<'a, C, A> BucketAccessControlUpdateCall<'a, C, A> where C: BorrowMut BucketAccessControlUpdateCall<'a, C, A> { @@ -6112,7 +6108,7 @@ impl<'a, C, A> BucketAccessControlListCall<'a, C, A> where C: BorrowMut BucketAccessControlListCall<'a, C, A> { @@ -6628,7 +6624,7 @@ impl<'a, C, A> NotificationInsertCall<'a, C, A> where C: BorrowMut NotificationInsertCall<'a, C, A> { @@ -6884,7 +6880,7 @@ impl<'a, C, A> NotificationDeleteCall<'a, C, A> where C: BorrowMut NotificationDeleteCall<'a, C, A> { @@ -7151,7 +7147,7 @@ impl<'a, C, A> NotificationGetCall<'a, C, A> where C: BorrowMut, self._notification = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -7406,7 +7402,7 @@ impl<'a, C, A> NotificationListCall<'a, C, A> where C: BorrowMut, self._bucket = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -7798,7 +7794,7 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: self._destination_object = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -8214,7 +8210,7 @@ impl<'a, C, A> ObjectGetCall<'a, C, A> where C: BorrowMut, A: oau self._object = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -8579,7 +8575,7 @@ impl<'a, C, A> ObjectWatchAllCall<'a, C, A> where C: BorrowMut, A self._versions = Some(new_value); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -8917,7 +8913,7 @@ impl<'a, C, A> ObjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ObjectSetIamPolicyCall<'a, C, A> { @@ -9196,7 +9192,7 @@ impl<'a, C, A> ObjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ObjectGetIamPolicyCall<'a, C, A> { @@ -9271,11 +9267,6 @@ impl<'a, C, A> ObjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "storage.objects.update", http_method: hyper::method::Method::Put }); - 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())); params.push(("object", self._object.to_string())); if let Some(value) = self._user_project { @@ -9382,7 +9373,7 @@ impl<'a, C, A> ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._generation { params.push(("generation", value.to_string())); } - for &field in ["bucket", "object", "userProject", "projection", "predefinedAcl", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "generation"].iter() { + for &field in ["alt", "bucket", "object", "userProject", "projection", "predefinedAcl", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "generation"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9392,23 +9383,7 @@ impl<'a, C, A> ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: 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())); - } + params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "b/{bucket}/o/{object}"; if self._scopes.len() == 0 { @@ -9508,7 +9483,7 @@ impl<'a, C, A> ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: Ok(serr) => Err(Error::BadRequest(serr)) } } - let result_value = if enable_resource_parsing { + let result_value = { let mut json_response = String::new(); res.read_to_string(&mut json_response).unwrap(); match json::from_str(&json_response) { @@ -9518,7 +9493,7 @@ impl<'a, C, A> ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: return Err(Error::JsonDecodeError(json_response, err)); } } - } else { (res, Default::default()) }; + }; dlg.finished(true); return Ok(result_value) @@ -9557,7 +9532,7 @@ impl<'a, C, A> ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: self._object = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -9674,11 +9649,6 @@ impl<'a, C, A> ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: /// Stores a new object and metadata. /// -/// 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 `Object` structure that you would usually get. The latter will be a default value. -/// /// A builder for the *insert* method supported by a *object* resource. /// It is not used directly, but through a `ObjectMethods` instance. /// @@ -9763,7 +9733,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((13 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((14 + self._additional_params.len())); params.push(("bucket", self._bucket.to_string())); if let Some(value) = self._user_project { params.push(("userProject", value.to_string())); @@ -9795,7 +9765,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", "kmsKeyName", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "contentEncoding"].iter() { + for &field in ["alt", "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)); @@ -9805,23 +9775,7 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: 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())); - } + params.push(("alt", "json".to_string())); let (mut url, upload_type) = if protocol == "simple" { @@ -10003,7 +9957,7 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: } } } - let result_value = if enable_resource_parsing { + let result_value = { let mut json_response = String::new(); res.read_to_string(&mut json_response).unwrap(); match json::from_str(&json_response) { @@ -10013,7 +9967,7 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: return Err(Error::JsonDecodeError(json_response, err)); } } - } else { (res, Default::default()) }; + }; dlg.finished(true); return Ok(result_value) @@ -10068,7 +10022,7 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: self._bucket = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -10199,11 +10153,6 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: /// Concatenates a list of existing objects into a new object in the same bucket. /// -/// 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 `Object` structure that you would usually get. The latter will be a default value. -/// /// A builder for the *compose* method supported by a *object* resource. /// It is not used directly, but through a `ObjectMethods` instance. /// @@ -10277,7 +10226,7 @@ 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((9 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + 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 { @@ -10295,7 +10244,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", "kmsKeyName", "ifMetagenerationMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { + for &field in ["alt", "destinationBucket", "destinationObject", "userProject", "kmsKeyName", "ifMetagenerationMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10305,23 +10254,7 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: 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())); - } + params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "b/{destinationBucket}/o/{destinationObject}/compose"; if self._scopes.len() == 0 { @@ -10421,7 +10354,7 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: Ok(serr) => Err(Error::BadRequest(serr)) } } - let result_value = if enable_resource_parsing { + let result_value = { let mut json_response = String::new(); res.read_to_string(&mut json_response).unwrap(); match json::from_str(&json_response) { @@ -10431,7 +10364,7 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: return Err(Error::JsonDecodeError(json_response, err)); } } - } else { (res, Default::default()) }; + }; dlg.finished(true); return Ok(result_value) @@ -10470,7 +10403,7 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: self._destination_object = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -10779,7 +10712,7 @@ impl<'a, C, A> ObjectDeleteCall<'a, C, A> where C: BorrowMut, A: self._object = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -11106,7 +11039,7 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa self._versions = Some(new_value); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -11430,7 +11363,7 @@ impl<'a, C, A> ObjectTestIamPermissionCall<'a, C, A> where C: BorrowMut ObjectTestIamPermissionCall<'a, C, A> { @@ -11505,11 +11438,6 @@ impl<'a, C, A> ObjectTestIamPermissionCall<'a, C, A> where C: BorrowMut ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "storage.objects.copy", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((18 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((19 + 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())); @@ -11640,7 +11568,7 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._destination_predefined_acl { params.push(("destinationPredefinedAcl", value.to_string())); } - for &field in ["sourceBucket", "sourceObject", "destinationBucket", "destinationObject", "userProject", "sourceGeneration", "projection", "ifSourceMetagenerationNotMatch", "ifSourceMetagenerationMatch", "ifSourceGenerationNotMatch", "ifSourceGenerationMatch", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { + for &field in ["alt", "sourceBucket", "sourceObject", "destinationBucket", "destinationObject", "userProject", "sourceGeneration", "projection", "ifSourceMetagenerationNotMatch", "ifSourceMetagenerationMatch", "ifSourceGenerationNotMatch", "ifSourceGenerationMatch", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11650,23 +11578,7 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa 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())); - } + params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}"; if self._scopes.len() == 0 { @@ -11766,7 +11678,7 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa Ok(serr) => Err(Error::BadRequest(serr)) } } - let result_value = if enable_resource_parsing { + let result_value = { let mut json_response = String::new(); res.read_to_string(&mut json_response).unwrap(); match json::from_str(&json_response) { @@ -11776,7 +11688,7 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa return Err(Error::JsonDecodeError(json_response, err)); } } - } else { (res, Default::default()) }; + }; dlg.finished(true); return Ok(result_value) @@ -11835,7 +11747,7 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa self._destination_object = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -11978,7 +11890,7 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa } -/// Updates an object's metadata. This method supports patch semantics. +/// Patches an object's metadata. /// /// A builder for the *patch* method supported by a *object* resource. /// It is not used directly, but through a `ObjectMethods` instance. @@ -12578,7 +12490,7 @@ impl<'a, C, A> ObjectAccessControlGetCall<'a, C, A> where C: BorrowMut ObjectAccessControlGetCall<'a, C, A> { @@ -12900,7 +12812,7 @@ impl<'a, C, A> ObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut ObjectAccessControlPatchCall<'a, C, A> { @@ -13179,7 +13091,7 @@ impl<'a, C, A> ObjectAccessControlListCall<'a, C, A> where C: BorrowMut ObjectAccessControlListCall<'a, C, A> { @@ -13459,7 +13371,7 @@ impl<'a, C, A> ObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut ObjectAccessControlDeleteCall<'a, C, A> { @@ -13781,7 +13693,7 @@ impl<'a, C, A> ObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut ObjectAccessControlUpdateCall<'a, C, A> { @@ -14091,7 +14003,7 @@ impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut ObjectAccessControlInsertCall<'a, C, A> { @@ -14409,7 +14321,7 @@ impl<'a, C, A> BucketPatchCall<'a, C, A> where C: BorrowMut, A: o self._bucket = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -14755,7 +14667,7 @@ impl<'a, C, A> BucketUpdateCall<'a, C, A> where C: BorrowMut, A: self._bucket = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -15060,7 +14972,7 @@ impl<'a, C, A> BucketGetCall<'a, C, A> where C: BorrowMut, A: oau self._bucket = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -15335,7 +15247,7 @@ impl<'a, C, A> BucketDeleteCall<'a, C, A> where C: BorrowMut, A: self._bucket = new_value.to_string(); self } - /// The project to be billed for this request, for Requester Pays buckets. + /// The project to be billed for this request. Required 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> { @@ -15629,7 +15541,7 @@ 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. + /// The project to be billed for this request. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> BucketInsertCall<'a, C, A> { @@ -15922,7 +15834,7 @@ impl<'a, C, A> BucketTestIamPermissionCall<'a, C, A> where C: BorrowMut BucketTestIamPermissionCall<'a, C, A> { @@ -16208,7 +16120,7 @@ impl<'a, C, A> BucketSetIamPolicyCall<'a, C, A> where C: BorrowMut BucketSetIamPolicyCall<'a, C, A> { @@ -16463,7 +16375,7 @@ impl<'a, C, A> BucketGetIamPolicyCall<'a, C, A> where C: BorrowMut BucketGetIamPolicyCall<'a, C, A> { @@ -16717,7 +16629,7 @@ 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. + /// The project to be billed for this request. /// /// Sets the *user project* query property to the given value. pub fn user_project(mut self, new_value: &str) -> BucketListCall<'a, C, A> { @@ -17000,7 +16912,7 @@ impl<'a, C, A> ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetCall<'a, C, A> { diff --git a/gen/storagetransfer1-cli/Cargo.toml b/gen/storagetransfer1-cli/Cargo.toml index a90b534db9..4dc4ade4a8 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+20170921" +version = "1.0.6+20171202" 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+20170921" +version = "1.0.6+20171202" diff --git a/gen/storagetransfer1-cli/README.md b/gen/storagetransfer1-cli/README.md index e30713362c..8f8d71b0df 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 *20170921*. The CLI is at version *1.0.6*. +This documentation was generated from the *storagetransfer* API at revision *20171202*. 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 e28c547199..ed7ef80b04 100644 --- a/gen/storagetransfer1-cli/mkdocs.yml +++ b/gen/storagetransfer1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: storagetransfer v1.0.6+20170921 +site_name: storagetransfer v1.0.6+20171202 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 479ec8261e..adcff8fba1 100644 --- a/gen/storagetransfer1-cli/src/main.rs +++ b/gen/storagetransfer1-cli/src/main.rs @@ -136,10 +136,10 @@ impl<'n> Engine<'n> { "transfer-spec.aws-s3-data-source.bucket-name" => Some(("transferSpec.awsS3DataSource.bucketName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deletion-time" => Some(("deletionTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "schedule.start-time-of-day.hours" => Some(("schedule.startTimeOfDay.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "schedule.start-time-of-day.nanos" => Some(("schedule.startTimeOfDay.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "schedule.start-time-of-day.minutes" => Some(("schedule.startTimeOfDay.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "schedule.start-time-of-day.seconds" => Some(("schedule.startTimeOfDay.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "schedule.start-time-of-day.hours" => Some(("schedule.startTimeOfDay.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "schedule.start-time-of-day.minutes" => Some(("schedule.startTimeOfDay.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "schedule.schedule-start-date.month" => Some(("schedule.scheduleStartDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "schedule.schedule-start-date.day" => Some(("schedule.scheduleStartDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "schedule.schedule-start-date.year" => Some(("schedule.scheduleStartDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -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())))); @@ -370,10 +370,10 @@ impl<'n> Engine<'n> { "transfer-job.transfer-spec.aws-s3-data-source.bucket-name" => Some(("transferJob.transferSpec.awsS3DataSource.bucketName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.status" => Some(("transferJob.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.deletion-time" => Some(("transferJob.deletionTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "transfer-job.schedule.start-time-of-day.hours" => Some(("transferJob.schedule.startTimeOfDay.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "transfer-job.schedule.start-time-of-day.nanos" => Some(("transferJob.schedule.startTimeOfDay.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "transfer-job.schedule.start-time-of-day.minutes" => Some(("transferJob.schedule.startTimeOfDay.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "transfer-job.schedule.start-time-of-day.seconds" => Some(("transferJob.schedule.startTimeOfDay.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "transfer-job.schedule.start-time-of-day.hours" => Some(("transferJob.schedule.startTimeOfDay.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "transfer-job.schedule.start-time-of-day.minutes" => Some(("transferJob.schedule.startTimeOfDay.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "transfer-job.schedule.schedule-start-date.month" => Some(("transferJob.schedule.scheduleStartDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "transfer-job.schedule.schedule-start-date.day" => Some(("transferJob.schedule.scheduleStartDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "transfer-job.schedule.schedule-start-date.year" => Some(("transferJob.schedule.scheduleStartDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -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())))); @@ -1273,7 +1273,7 @@ fn main() { let mut app = App::new("storagetransfer1") .author("Sebastian Thiel ") - .version("1.0.6+20170921") + .version("1.0.6+20171202") .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 6493d4dd28..38ce7e167d 100644 --- a/gen/storagetransfer1/Cargo.toml +++ b/gen/storagetransfer1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-storagetransfer1" -version = "1.0.6+20170921" +version = "1.0.6+20171202" 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+20170921" +documentation = "https://docs.rs/google-storagetransfer1/1.0.6+20171202" license = "MIT" keywords = ["storagetransfer", "google", "protocol", "web", "api"] diff --git a/gen/storagetransfer1/README.md b/gen/storagetransfer1/README.md index e34f9c13fc..55f80e5f22 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+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*. +This documentation was generated from *storagetransfer* crate version *1.0.6+20171202*, where *20171202* 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+20170921/google_storagetransfer1/struct.Storagetransfer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.Storagetransfer.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) +* [google service accounts](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.GoogleServiceAccount.html) + * [*get*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.GoogleServiceAccountGetCall.html) +* [transfer jobs](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.TransferJob.html) + * [*create*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.TransferJobCreateCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.TransferJobGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.TransferJobListCall.html) and [*patch*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.TransferJobPatchCall.html) +* [transfer operations](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.TransferOperation.html) + * [*cancel*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.TransferOperationCancelCall.html), [*delete*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.TransferOperationDeleteCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.TransferOperationGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.TransferOperationListCall.html), [*pause*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/struct.TransferOperationPauseCall.html) and [*resume*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/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+20170921/google_storagetransfer1/struct.Storagetransfer.html)** +* **[Hub](https://docs.rs/google-storagetransfer1/1.0.6+20171202/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+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)** + * creates [*Method Builders*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-storagetransfer1/1.0.6+20171202/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+20170921/google_storagetransfer1/trait.Part.html)** + * **[Parts](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-storagetransfer1/1.0.6+20170921/google_storagetransfer1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-storagetransfer1/1.0.6+20171202/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+20170921/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+20171202/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+20170921/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+20171202/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+20170921/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+20171202/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+20170921/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+20171202/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-storagetransfer1/1.0.6+20171202/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+20170921/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+20171202/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-storagetransfer1/1.0.6+20171202/google_storagetransfer1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-storagetransfer1/1.0.6+20171202/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+20170921/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+20171202/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+20170921/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+20171202/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+20170921/google_storagetransfer1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-storagetransfer1/1.0.6+20171202/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 003dcdb130..35a8d8559c 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+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*. +//! This documentation was generated from *storagetransfer* crate version *1.0.6+20171202*, where *20171202* 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). @@ -371,21 +371,6 @@ impl<'a, C, A> Storagetransfer // ############ // SCHEMAS ### // ########## -/// Request passed to PauseTransferOperation. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [pause transfer operations](struct.TransferOperationPauseCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PauseTransferOperationRequest { _never_set: Option } - -impl RequestValue for PauseTransferOperationRequest {} - - /// Configuration for running a transfer. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -419,6 +404,21 @@ pub struct TransferSpec { impl Part for TransferSpec {} +/// Request passed to PauseTransferOperation. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [pause transfer operations](struct.TransferOperationPauseCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PauseTransferOperationRequest { _never_set: Option } + +impl RequestValue for PauseTransferOperationRequest {} + + /// AWS access key (see /// [AWS Security Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). /// @@ -515,8 +515,8 @@ pub struct TransferCounters { #[serde(rename="bytesFromSourceSkippedBySync")] pub bytes_from_source_skipped_by_sync: Option, /// Objects found in the data source that are scheduled to be transferred, - /// which will be copied, excluded based on conditions, or skipped due to - /// failures. + /// excluding any that are filtered based on object conditions or skipped due + /// to sync. #[serde(rename="objectsFoundFromSource")] pub objects_found_from_source: Option, /// Bytes that failed to be deleted from the data sink. @@ -535,20 +535,20 @@ pub struct TransferCounters { /// Bytes that are copied to the data sink. #[serde(rename="bytesCopiedToSink")] pub bytes_copied_to_sink: Option, - /// Bytes found in the data source that are scheduled to be transferred, - /// which will be copied, excluded based on conditions, or skipped due to - /// failures. - #[serde(rename="bytesFoundFromSource")] - pub bytes_found_from_source: Option, + /// Bytes in the data source that failed during the transfer. + #[serde(rename="bytesFromSourceFailed")] + pub bytes_from_source_failed: Option, /// Objects that are deleted from the data source. #[serde(rename="objectsDeletedFromSource")] pub objects_deleted_from_source: Option, /// Bytes found only in the data sink that are scheduled to be deleted. #[serde(rename="bytesFoundOnlyFromSink")] pub bytes_found_only_from_sink: Option, - /// Bytes in the data source that failed during the transfer. - #[serde(rename="bytesFromSourceFailed")] - pub bytes_from_source_failed: Option, + /// Bytes found in the data source that are scheduled to be transferred, + /// excluding any that are filtered based on object conditions or skipped due + /// to sync. + #[serde(rename="bytesFoundFromSource")] + pub bytes_found_from_source: Option, /// Bytes that are deleted from the data source. #[serde(rename="bytesDeletedFromSource")] pub bytes_deleted_from_source: Option, @@ -616,26 +616,27 @@ pub struct TransferOperation { impl Resource for TransferOperation {} -/// 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 {} /// An entry describing an error that has occurred. @@ -644,13 +645,13 @@ impl ResponseResult for ListTransferJobsResponse {} /// #[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 {} @@ -739,16 +740,16 @@ impl Part for HttpData {} /// #[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, - /// Minutes of hour of day. Must be from 0 to 59. - pub minutes: 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 TimeOfDay {} @@ -882,11 +883,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 {} @@ -995,27 +996,26 @@ pub struct UpdateTransferJobRequest { impl RequestValue for UpdateTransferJobRequest {} -/// 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 {} /// TransferOptions uses three boolean parameters to define the actions @@ -1053,8 +1053,8 @@ impl Part for TransferOptions {} /// /// * [list transfer jobs](struct.TransferJobListCall.html) (none) /// * [create transfer jobs](struct.TransferJobCreateCall.html) (request|response) -/// * [patch transfer jobs](struct.TransferJobPatchCall.html) (response) /// * [get transfer jobs](struct.TransferJobGetCall.html) (response) +/// * [patch transfer jobs](struct.TransferJobPatchCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TransferJob { @@ -1072,9 +1072,6 @@ 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. pub schedule: Option, /// The ID of the Google Cloud Platform Console project that owns the job. @@ -1091,6 +1088,9 @@ 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 {} @@ -1452,20 +1452,15 @@ impl<'a, C, A> TransferJobMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a transfer job. Updating a job's transfer spec does not affect - /// transfer operations that are running already. Updating the scheduling - /// of a job is not allowed. + /// Creates a transfer job that runs periodically. /// /// # Arguments /// /// * `request` - No description provided. - /// * `jobName` - The name of job to update. - /// Required. - pub fn patch(&self, request: UpdateTransferJobRequest, job_name: &str) -> TransferJobPatchCall<'a, C, A> { - TransferJobPatchCall { + pub fn create(&self, request: TransferJob) -> TransferJobCreateCall<'a, C, A> { + TransferJobCreateCall { hub: self.hub, _request: request, - _job_name: job_name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1493,15 +1488,20 @@ impl<'a, C, A> TransferJobMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a transfer job that runs periodically. + /// Updates a transfer job. Updating a job's transfer spec does not affect + /// transfer operations that are running already. Updating the scheduling + /// of a job is not allowed. /// /// # Arguments /// /// * `request` - No description provided. - pub fn create(&self, request: TransferJob) -> TransferJobCreateCall<'a, C, A> { - TransferJobCreateCall { + /// * `jobName` - The name of job to update. + /// Required. + pub fn patch(&self, request: UpdateTransferJobRequest, job_name: &str) -> TransferJobPatchCall<'a, C, A> { + TransferJobPatchCall { hub: self.hub, _request: request, + _job_name: job_name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1762,12 +1762,12 @@ impl<'a, C, A> TransferOperationPauseCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationPauseCall<'a, C, A> @@ -2047,12 +2047,12 @@ impl<'a, C, A> TransferOperationResumeCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationResumeCall<'a, C, A> @@ -2300,12 +2300,12 @@ impl<'a, C, A> TransferOperationDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationDeleteCall<'a, C, A> @@ -2555,12 +2555,12 @@ impl<'a, C, A> TransferOperationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationGetCall<'a, C, A> @@ -2853,12 +2853,12 @@ impl<'a, C, A> TransferOperationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationListCall<'a, C, A> @@ -3106,12 +3106,12 @@ impl<'a, C, A> TransferOperationCancelCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationCancelCall<'a, C, A> @@ -3364,12 +3364,12 @@ impl<'a, C, A> GoogleServiceAccountGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> GoogleServiceAccountGetCall<'a, C, A> @@ -3623,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. - /// * *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) -> TransferJobListCall<'a, C, A> @@ -3663,6 +3663,520 @@ impl<'a, C, A> TransferJobListCall<'a, C, A> where C: BorrowMut, } +/// Creates a transfer job that runs periodically. +/// +/// A builder for the *create* method supported by a *transferJob* resource. +/// It is not used directly, but through a `TransferJobMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storagetransfer1 as storagetransfer1; +/// use storagetransfer1::TransferJob; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storagetransfer1::Storagetransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Storagetransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = TransferJob::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.transfer_jobs().create(req) +/// .doit(); +/// # } +/// ``` +pub struct TransferJobCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storagetransfer, + _request: TransferJob, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TransferJobCreateCall<'a, C, A> {} + +impl<'a, C, A> TransferJobCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TransferJob)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storagetransfer.transferJobs.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/transferJobs"; + 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: TransferJob) -> TransferJobCreateCall<'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) -> TransferJobCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> TransferJobCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TransferJobCreateCall<'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 transfer job. +/// +/// A builder for the *get* method supported by a *transferJob* resource. +/// It is not used directly, but through a `TransferJobMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storagetransfer1 as storagetransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storagetransfer1::Storagetransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Storagetransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.transfer_jobs().get("jobName") +/// .project_id("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct TransferJobGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storagetransfer, + _job_name: String, + _project_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TransferJobGetCall<'a, C, A> {} + +impl<'a, C, A> TransferJobGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TransferJob)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storagetransfer.transferJobs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("jobName", self._job_name.to_string())); + if let Some(value) = self._project_id { + params.push(("projectId", value.to_string())); + } + for &field in ["alt", "jobName", "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/{+jobName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+jobName}", "jobName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["jobName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 job to get. + /// Required. + /// + /// Sets the *job 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 job_name(mut self, new_value: &str) -> TransferJobGetCall<'a, C, A> { + self._job_name = new_value.to_string(); + self + } + /// The ID of the Google Cloud Platform Console project that owns the job. + /// Required. + /// + /// Sets the *project id* query property to the given value. + pub fn project_id(mut self, new_value: &str) -> TransferJobGetCall<'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) -> TransferJobGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> TransferJobGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TransferJobGetCall<'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 transfer job. Updating a job's transfer spec does not affect /// transfer operations that are running already. Updating the scheduling /// of a job is not allowed. @@ -3910,12 +4424,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. - /// * *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) -> TransferJobPatchCall<'a, C, A> @@ -3950,517 +4464,3 @@ impl<'a, C, A> TransferJobPatchCall<'a, C, A> where C: BorrowMut, } -/// Gets a transfer job. -/// -/// A builder for the *get* method supported by a *transferJob* resource. -/// It is not used directly, but through a `TransferJobMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_storagetransfer1 as storagetransfer1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use storagetransfer1::Storagetransfer; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Storagetransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.transfer_jobs().get("jobName") -/// .project_id("Lorem") -/// .doit(); -/// # } -/// ``` -pub struct TransferJobGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Storagetransfer, - _job_name: String, - _project_id: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TransferJobGetCall<'a, C, A> {} - -impl<'a, C, A> TransferJobGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TransferJob)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "storagetransfer.transferJobs.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("jobName", self._job_name.to_string())); - if let Some(value) = self._project_id { - params.push(("projectId", value.to_string())); - } - for &field in ["alt", "jobName", "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/{+jobName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+jobName}", "jobName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["jobName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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 job to get. - /// Required. - /// - /// Sets the *job 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 job_name(mut self, new_value: &str) -> TransferJobGetCall<'a, C, A> { - self._job_name = new_value.to_string(); - self - } - /// The ID of the Google Cloud Platform Console project that owns the job. - /// Required. - /// - /// Sets the *project id* query property to the given value. - pub fn project_id(mut self, new_value: &str) -> TransferJobGetCall<'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) -> TransferJobGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response 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) -> TransferJobGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TransferJobGetCall<'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 transfer job that runs periodically. -/// -/// A builder for the *create* method supported by a *transferJob* resource. -/// It is not used directly, but through a `TransferJobMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_storagetransfer1 as storagetransfer1; -/// use storagetransfer1::TransferJob; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use storagetransfer1::Storagetransfer; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Storagetransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = TransferJob::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.transfer_jobs().create(req) -/// .doit(); -/// # } -/// ``` -pub struct TransferJobCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Storagetransfer, - _request: TransferJob, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TransferJobCreateCall<'a, C, A> {} - -impl<'a, C, A> TransferJobCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TransferJob)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "storagetransfer.transferJobs.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/transferJobs"; - 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: TransferJob) -> TransferJobCreateCall<'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) -> TransferJobCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response 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) -> TransferJobCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TransferJobCreateCall<'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/tagmanager1-cli/Cargo.toml b/gen/tagmanager1-cli/Cargo.toml index 6269210d3c..9c23ea24b1 100644 --- a/gen/tagmanager1-cli/Cargo.toml +++ b/gen/tagmanager1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tagmanager1-cli" -version = "1.0.6+20160310" +version = "1.0.6+20171108" authors = ["Sebastian Thiel "] description = "A complete library to interact with Tag Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1-cli" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-tagmanager1] path = "../tagmanager1" -version = "1.0.6+20160310" +version = "1.0.6+20171108" diff --git a/gen/tagmanager1-cli/README.md b/gen/tagmanager1-cli/README.md index a05a2b3213..95af74439d 100644 --- a/gen/tagmanager1-cli/README.md +++ b/gen/tagmanager1-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 *Tag Manager* API at revision *20160310*. The CLI is at version *1.0.6*. +This documentation was generated from the *Tag Manager* API at revision *20171108*. The CLI is at version *1.0.6*. ```bash tagmanager1 [options] diff --git a/gen/tagmanager1-cli/mkdocs.yml b/gen/tagmanager1-cli/mkdocs.yml index 00be16dfd0..61919c2b76 100644 --- a/gen/tagmanager1-cli/mkdocs.yml +++ b/gen/tagmanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Tag Manager v1.0.6+20160310 +site_name: Tag Manager v1.0.6+20171108 site_url: http://byron.github.io/google-apis-rs/google-tagmanager1-cli site_description: A complete library to interact with Tag Manager (protocol v1) diff --git a/gen/tagmanager1-cli/src/main.rs b/gen/tagmanager1-cli/src/main.rs index 2babb7dcd6..65b26d01d3 100644 --- a/gen/tagmanager1-cli/src/main.rs +++ b/gen/tagmanager1-cli/src/main.rs @@ -1325,6 +1325,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "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 })), "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 })), @@ -1333,9 +1336,7 @@ impl<'n> Engine<'n> { "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 })), + "paused" => Some(("paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "blocking-rule-id" => Some(("blockingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "live-only" => Some(("liveOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1345,7 +1346,7 @@ impl<'n> Engine<'n> { "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", "priority", "schedule-end-ms", "schedule-start-ms", "tag-firing-option", "tag-id", "type", "value"]); + 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", "paused", "priority", "schedule-end-ms", "schedule-start-ms", "tag-firing-option", "tag-id", "type", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1576,6 +1577,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "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 })), "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 })), @@ -1584,9 +1588,7 @@ impl<'n> Engine<'n> { "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 })), + "paused" => Some(("paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "blocking-rule-id" => Some(("blockingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "live-only" => Some(("liveOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1596,7 +1598,7 @@ impl<'n> Engine<'n> { "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", "priority", "schedule-end-ms", "schedule-start-ms", "tag-firing-option", "tag-id", "type", "value"]); + 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", "paused", "priority", "schedule-end-ms", "schedule-start-ms", "tag-firing-option", "tag-id", "type", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1683,42 +1685,66 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "video-percentage-list.type" => Some(("videoPercentageList.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "video-percentage-list.value" => Some(("videoPercentageList.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "video-percentage-list.key" => Some(("videoPercentageList.key", 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.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 })), - "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "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 })), - "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 })), - "name" => Some(("name", 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 })), + "account-id" => Some(("accountId", 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 })), + "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 })), + "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 })), + "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 })), + "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 })), - "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "enable-all-videos.type" => Some(("enableAllVideos.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "enable-all-videos.value" => Some(("enableAllVideos.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "enable-all-videos.key" => Some(("enableAllVideos.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "parent-folder-id" => Some(("parentFolderId", 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", "check-validation", "container-id", "enable-all-videos", "event-name", "fingerprint", "interval", "key", "limit", "name", "parent-folder-id", "trigger-id", "type", "unique-trigger-id", "value", "video-percentage-list", "wait-for-tags", "wait-for-tags-timeout"]); + 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", "parent-folder-id", "selector", "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"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1949,42 +1975,66 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "video-percentage-list.type" => Some(("videoPercentageList.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "video-percentage-list.value" => Some(("videoPercentageList.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "video-percentage-list.key" => Some(("videoPercentageList.key", 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.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 })), - "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "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 })), - "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 })), - "name" => Some(("name", 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 })), + "account-id" => Some(("accountId", 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 })), + "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 })), + "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 })), + "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 })), + "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 })), - "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "enable-all-videos.type" => Some(("enableAllVideos.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "enable-all-videos.value" => Some(("enableAllVideos.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "enable-all-videos.key" => Some(("enableAllVideos.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "parent-folder-id" => Some(("parentFolderId", 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", "check-validation", "container-id", "enable-all-videos", "event-name", "fingerprint", "interval", "key", "limit", "name", "parent-folder-id", "trigger-id", "type", "unique-trigger-id", "value", "video-percentage-list", "wait-for-tags", "wait-for-tags-timeout"]); + 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", "parent-folder-id", "selector", "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"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5339,7 +5389,7 @@ fn main() { let mut app = App::new("tagmanager1") .author("Sebastian Thiel ") - .version("1.0.6+20160310") + .version("1.0.6+20171108") .about("Accesses Tag Manager accounts and containers.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tagmanager1_cli") .arg(Arg::with_name("url") diff --git a/gen/tagmanager1/Cargo.toml b/gen/tagmanager1/Cargo.toml index aa58ea6749..dd28414291 100644 --- a/gen/tagmanager1/Cargo.toml +++ b/gen/tagmanager1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-tagmanager1" -version = "1.0.6+20160310" +version = "1.0.6+20171108" authors = ["Sebastian Thiel "] description = "A complete library to interact with Tag Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1" homepage = "https://developers.google.com/tag-manager/api/v1/" -documentation = "https://docs.rs/google-tagmanager1/1.0.6+20160310" +documentation = "https://docs.rs/google-tagmanager1/1.0.6+20171108" license = "MIT" keywords = ["tagmanager", "google", "protocol", "web", "api"] diff --git a/gen/tagmanager1/README.md b/gen/tagmanager1/README.md index 2712a27f85..639618e236 100644 --- a/gen/tagmanager1/README.md +++ b/gen/tagmanager1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-tagmanager1` library allows access to all features of the *Google Tag Manager* service. -This documentation was generated from *Tag Manager* crate version *1.0.6+20160310*, where *20160310* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +This documentation was generated from *Tag Manager* crate version *1.0.6+20171108*, where *20171108* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. Everything else about the *Tag Manager* *v1* API can be found at the [official documentation site](https://developers.google.com/tag-manager/api/v1/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.TagManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.TagManager.html) ... -* [accounts](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.Account.html) - * [*containers create*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerCreateCall.html), [*containers delete*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerDeleteCall.html), [*containers environments create*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerEnvironmentCreateCall.html), [*containers environments delete*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerEnvironmentDeleteCall.html), [*containers environments get*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerEnvironmentGetCall.html), [*containers environments list*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerEnvironmentListCall.html), [*containers environments patch*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerEnvironmentPatchCall.html), [*containers environments update*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerEnvironmentUpdateCall.html), [*containers folders create*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerFolderCreateCall.html), [*containers folders delete*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerFolderDeleteCall.html), [*containers folders entities list*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerFolderEntityListCall.html), [*containers folders get*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerFolderGetCall.html), [*containers folders list*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerFolderListCall.html), [*containers folders update*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerFolderUpdateCall.html), [*containers get*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerGetCall.html), [*containers list*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerListCall.html), [*containers move_folders update*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerMoveFolderUpdateCall.html), [*containers reauthorize_environments update*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerReauthorizeEnvironmentUpdateCall.html), [*containers tags create*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerTagCreateCall.html), [*containers tags delete*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerTagDeleteCall.html), [*containers tags get*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerTagGetCall.html), [*containers tags list*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerTagListCall.html), [*containers tags update*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerTagUpdateCall.html), [*containers triggers create*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerTriggerCreateCall.html), [*containers triggers delete*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerTriggerDeleteCall.html), [*containers triggers get*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerTriggerGetCall.html), [*containers triggers list*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerTriggerListCall.html), [*containers triggers update*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerTriggerUpdateCall.html), [*containers update*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerUpdateCall.html), [*containers variables create*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVariableCreateCall.html), [*containers variables delete*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVariableDeleteCall.html), [*containers variables get*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVariableGetCall.html), [*containers variables list*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVariableListCall.html), [*containers variables update*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVariableUpdateCall.html), [*containers versions create*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVersionCreateCall.html), [*containers versions delete*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVersionDeleteCall.html), [*containers versions get*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVersionGetCall.html), [*containers versions list*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVersionListCall.html), [*containers versions publish*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVersionPublishCall.html), [*containers versions restore*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVersionRestoreCall.html), [*containers versions undelete*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVersionUndeleteCall.html), [*containers versions update*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountContainerVersionUpdateCall.html), [*get*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountGetCall.html), [*list*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountListCall.html), [*permissions create*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountPermissionCreateCall.html), [*permissions delete*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountPermissionDeleteCall.html), [*permissions get*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountPermissionGetCall.html), [*permissions list*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountPermissionListCall.html), [*permissions update*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountPermissionUpdateCall.html) and [*update*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.AccountUpdateCall.html) +* [accounts](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.Account.html) + * [*containers create*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerCreateCall.html), [*containers delete*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerDeleteCall.html), [*containers environments create*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerEnvironmentCreateCall.html), [*containers environments delete*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerEnvironmentDeleteCall.html), [*containers environments get*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerEnvironmentGetCall.html), [*containers environments list*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerEnvironmentListCall.html), [*containers environments patch*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerEnvironmentPatchCall.html), [*containers environments update*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerEnvironmentUpdateCall.html), [*containers folders create*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerFolderCreateCall.html), [*containers folders delete*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerFolderDeleteCall.html), [*containers folders entities list*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerFolderEntityListCall.html), [*containers folders get*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerFolderGetCall.html), [*containers folders list*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerFolderListCall.html), [*containers folders update*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerFolderUpdateCall.html), [*containers get*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerGetCall.html), [*containers list*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerListCall.html), [*containers move_folders update*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerMoveFolderUpdateCall.html), [*containers reauthorize_environments update*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerReauthorizeEnvironmentUpdateCall.html), [*containers tags create*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerTagCreateCall.html), [*containers tags delete*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerTagDeleteCall.html), [*containers tags get*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerTagGetCall.html), [*containers tags list*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerTagListCall.html), [*containers tags update*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerTagUpdateCall.html), [*containers triggers create*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerTriggerCreateCall.html), [*containers triggers delete*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerTriggerDeleteCall.html), [*containers triggers get*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerTriggerGetCall.html), [*containers triggers list*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerTriggerListCall.html), [*containers triggers update*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerTriggerUpdateCall.html), [*containers update*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerUpdateCall.html), [*containers variables create*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVariableCreateCall.html), [*containers variables delete*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVariableDeleteCall.html), [*containers variables get*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVariableGetCall.html), [*containers variables list*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVariableListCall.html), [*containers variables update*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVariableUpdateCall.html), [*containers versions create*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVersionCreateCall.html), [*containers versions delete*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVersionDeleteCall.html), [*containers versions get*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVersionGetCall.html), [*containers versions list*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVersionListCall.html), [*containers versions publish*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVersionPublishCall.html), [*containers versions restore*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVersionRestoreCall.html), [*containers versions undelete*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVersionUndeleteCall.html), [*containers versions update*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountContainerVersionUpdateCall.html), [*get*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountGetCall.html), [*list*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountListCall.html), [*permissions create*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountPermissionCreateCall.html), [*permissions delete*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountPermissionDeleteCall.html), [*permissions get*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountPermissionGetCall.html), [*permissions list*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountPermissionListCall.html), [*permissions update*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountPermissionUpdateCall.html) and [*update*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.AccountUpdateCall.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-tagmanager1/1.0.6+20160310/google_tagmanager1/struct.TagManager.html)** +* **[Hub](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/struct.TagManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.Part.html)** + * **[Parts](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -174,17 +174,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/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-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/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-tagmanager1/1.0.6+20160310/google_tagmanager1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/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-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/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")`. @@ -194,29 +194,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-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/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-tagmanager1/1.0.6+20171108/google_tagmanager1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/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-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/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-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-tagmanager1/1.0.6+20160310/google_tagmanager1/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-tagmanager1/1.0.6+20171108/google_tagmanager1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/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-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/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-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/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-tagmanager1/1.0.6+20160310/google_tagmanager1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-tagmanager1/1.0.6+20171108/google_tagmanager1/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/tagmanager1/src/lib.rs b/gen/tagmanager1/src/lib.rs index 89f05fbd39..bbb55a62b0 100644 --- a/gen/tagmanager1/src/lib.rs +++ b/gen/tagmanager1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Tag Manager* crate version *1.0.6+20160310*, where *20160310* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! This documentation was generated from *Tag Manager* crate version *1.0.6+20171108*, where *20171108* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. //! //! Everything else about the *Tag Manager* *v1* API can be found at the //! [official documentation site](https://developers.google.com/tag-manager/api/v1/). @@ -482,6 +482,8 @@ pub struct Tag { /// The Tag ID uniquely identifies the GTM Tag. #[serde(rename="tagId")] pub tag_id: Option, + /// True if the tag is paused. + pub paused: Option, /// The list of setup tags. Currently we only allow one. #[serde(rename="setupTag")] pub setup_tag: Option>, @@ -1094,41 +1096,64 @@ impl ResponseResult for ListTagsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Trigger { - /// GTM Container ID. - #[serde(rename="containerId")] - pub container_id: Option, + /// 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 continuous visible time (in milliseconds). Only valid for AMP Visibility trigger. + #[serde(rename="continuousTimeMinMilliseconds")] + pub continuous_time_min_milliseconds: 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 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, + /// 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 Container ID. + #[serde(rename="containerId")] + pub container_id: Option, /// The fingerprint of the GTM Trigger as computed at storage time. This value is recomputed whenever the trigger is modified. pub fingerprint: Option, - /// Reloads the videos in the page that don't already have the YT API enabled. If false, only capture events from videos that already have the API enabled. Only valid for YouTube triggers. - #[serde(rename="enableAllVideos")] - pub enable_all_videos: Option, + /// A visibility trigger maximum percent visibility. Only valid for AMP Visibility trigger. + #[serde(rename="visiblePercentageMax")] + pub visible_percentage_max: Option, /// GTM Account ID. #[serde(rename="accountId")] pub account_id: Option, - /// Name of the GTM event that is fired. Only valid for Timer triggers. - #[serde(rename="eventName")] - pub event_name: Option, - /// List of integer percentage values. The trigger will fire as each percentage is reached in any instrumented videos. Only valid for YouTube triggers. - #[serde(rename="videoPercentageList")] - pub video_percentage_list: Option, + /// The trigger will only fire iff all Conditions are true. + pub filter: 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, /// 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, /// Time between triggering recurring Timer Events (in milliseconds). Only valid for Timer triggers. pub interval: Option, - /// Used in the case of auto event tracking. - #[serde(rename="autoEventFilter")] - pub auto_event_filter: Option>, - /// The trigger will only fire iff all Conditions are true. - pub filter: 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, /// 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, @@ -1140,12 +1165,14 @@ pub struct Trigger { /// Used in the case of custom event, which is fired iff all Conditions are true. #[serde(rename="customEventFilter")] pub custom_event_filter: Option>, - /// Defines the data layer event that causes this trigger. - #[serde(rename="type")] - pub type_: Option, + /// Additional parameters. + pub parameter: Option>, /// Parent folder id. #[serde(rename="parentFolderId")] pub parent_folder_id: Option, + /// Used in the case of auto event tracking. + #[serde(rename="autoEventFilter")] + pub auto_event_filter: Option>, } impl RequestValue for Trigger {} diff --git a/gen/tagmanager2-cli/Cargo.toml b/gen/tagmanager2-cli/Cargo.toml index 7251480ff1..72e3935978 100644 --- a/gen/tagmanager2-cli/Cargo.toml +++ b/gen/tagmanager2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tagmanager2-cli" -version = "1.0.6+20170915" +version = "1.0.6+20171108" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-tagmanager2] path = "../tagmanager2" -version = "1.0.6+20170915" +version = "1.0.6+20171108" diff --git a/gen/tagmanager2-cli/README.md b/gen/tagmanager2-cli/README.md index 2b9b7531ea..d0aec17056 100644 --- a/gen/tagmanager2-cli/README.md +++ b/gen/tagmanager2-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 *Tag Manager* API at revision *20170915*. The CLI is at version *1.0.6*. +This documentation was generated from the *Tag Manager* API at revision *20171108*. The CLI is at version *1.0.6*. ```bash tagmanager2 [options] diff --git a/gen/tagmanager2-cli/mkdocs.yml b/gen/tagmanager2-cli/mkdocs.yml index d5c147a0b6..db35a5f2e3 100644 --- a/gen/tagmanager2-cli/mkdocs.yml +++ b/gen/tagmanager2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Tag Manager v1.0.6+20170915 +site_name: Tag Manager v1.0.6+20171108 site_url: http://byron.github.io/google-apis-rs/google-tagmanager2-cli site_description: A complete library to interact with Tag Manager (protocol v2) diff --git a/gen/tagmanager2-cli/src/main.rs b/gen/tagmanager2-cli/src/main.rs index b431a56db8..f91a451011 100644 --- a/gen/tagmanager2-cli/src/main.rs +++ b/gen/tagmanager2-cli/src/main.rs @@ -2952,6 +2952,9 @@ impl<'n> Engine<'n> { "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.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.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 })), @@ -2960,9 +2963,7 @@ impl<'n> Engine<'n> { "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.paused" => Some(("tag.paused", JsonTypeInfo { jtype: JsonType::Boolean, 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 })), @@ -2984,7 +2985,7 @@ impl<'n> Engine<'n> { "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"]); + 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", "paused", "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 } @@ -3115,6 +3116,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "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 })), "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 })), @@ -3123,9 +3127,7 @@ impl<'n> Engine<'n> { "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 })), + "paused" => Some(("paused", JsonTypeInfo { jtype: JsonType::Boolean, 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 })), @@ -3138,7 +3140,7 @@ impl<'n> Engine<'n> { "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"]); + 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", "paused", "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 } @@ -3429,6 +3431,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "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 })), "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 })), @@ -3437,9 +3442,7 @@ impl<'n> Engine<'n> { "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 })), + "paused" => Some(("paused", JsonTypeInfo { jtype: JsonType::Boolean, 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 })), @@ -3452,7 +3455,7 @@ impl<'n> Engine<'n> { "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"]); + 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", "paused", "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 } @@ -7133,7 +7136,7 @@ fn main() { let mut app = App::new("tagmanager2") .author("Sebastian Thiel ") - .version("1.0.6+20170915") + .version("1.0.6+20171108") .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") diff --git a/gen/tagmanager2/Cargo.toml b/gen/tagmanager2/Cargo.toml index de8a44052f..423afabd1b 100644 --- a/gen/tagmanager2/Cargo.toml +++ b/gen/tagmanager2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-tagmanager2" -version = "1.0.6+20170915" +version = "1.0.6+20171108" 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" +documentation = "https://docs.rs/google-tagmanager2/1.0.6+20171108" license = "MIT" keywords = ["tagmanager", "google", "protocol", "web", "api"] diff --git a/gen/tagmanager2/README.md b/gen/tagmanager2/README.md index 4ef6bbfacf..4590a322ac 100644 --- a/gen/tagmanager2/README.md +++ b/gen/tagmanager2/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Tag Manager* crate version *1.0.6+20171108*, where *20171108* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tagmanager2/1.0.6+20171108/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) +* [accounts](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.Account.html) + * [*containers create*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerCreateCall.html), [*containers delete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerDeleteCall.html), [*containers environments create*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerEnvironmentCreateCall.html), [*containers environments delete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerEnvironmentDeleteCall.html), [*containers environments get*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerEnvironmentGetCall.html), [*containers environments list*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerEnvironmentListCall.html), [*containers environments patch*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerEnvironmentPatchCall.html), [*containers environments reauthorize*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerEnvironmentReauthorizeCall.html), [*containers environments update*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerEnvironmentUpdateCall.html), [*containers get*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerGetCall.html), [*containers list*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerListCall.html), [*containers update*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerUpdateCall.html), [*containers version_headers latest*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerVersionHeaderLatestCall.html), [*containers version_headers list*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerVersionHeaderListCall.html), [*containers versions delete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerVersionDeleteCall.html), [*containers versions get*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerVersionGetCall.html), [*containers versions live*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerVersionLiveCall.html), [*containers versions publish*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerVersionPublishCall.html), [*containers versions set_latest*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerVersionSetLatestCall.html), [*containers versions undelete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerVersionUndeleteCall.html), [*containers versions update*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerVersionUpdateCall.html), [*containers workspaces built_in_variables create*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableCreateCall.html), [*containers workspaces built_in_variables delete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableDeleteCall.html), [*containers workspaces built_in_variables list*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableListCall.html), [*containers workspaces built_in_variables revert*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableRevertCall.html), [*containers workspaces create*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceCreateCall.html), [*containers workspaces create_version*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceCreateVersionCall.html), [*containers workspaces delete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceDeleteCall.html), [*containers workspaces folders create*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceFolderCreateCall.html), [*containers workspaces folders delete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceFolderDeleteCall.html), [*containers workspaces folders entities*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceFolderEntityCall.html), [*containers workspaces folders get*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceFolderGetCall.html), [*containers workspaces folders list*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceFolderListCall.html), [*containers workspaces folders move_entities_to_folder*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceFolderMoveEntitiesToFolderCall.html), [*containers workspaces folders revert*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceFolderRevertCall.html), [*containers workspaces folders update*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceFolderUpdateCall.html), [*containers workspaces get*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceGetCall.html), [*containers workspaces get proposal*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceGetProposalCall.html), [*containers workspaces get status*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceGetStatuCall.html), [*containers workspaces list*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceListCall.html), [*containers workspaces proposal create*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceProposalCreateCall.html), [*containers workspaces proposal delete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceProposalDeleteCall.html), [*containers workspaces quick_preview*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceQuickPreviewCall.html), [*containers workspaces resolve_conflict*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceResolveConflictCall.html), [*containers workspaces sync*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceSyncCall.html), [*containers workspaces tags create*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTagCreateCall.html), [*containers workspaces tags delete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTagDeleteCall.html), [*containers workspaces tags get*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTagGetCall.html), [*containers workspaces tags list*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTagListCall.html), [*containers workspaces tags revert*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTagRevertCall.html), [*containers workspaces tags update*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTagUpdateCall.html), [*containers workspaces triggers create*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTriggerCreateCall.html), [*containers workspaces triggers delete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTriggerDeleteCall.html), [*containers workspaces triggers get*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTriggerGetCall.html), [*containers workspaces triggers list*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTriggerListCall.html), [*containers workspaces triggers revert*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTriggerRevertCall.html), [*containers workspaces triggers update*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceTriggerUpdateCall.html), [*containers workspaces update*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceUpdateCall.html), [*containers workspaces update proposal*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceUpdateProposalCall.html), [*containers workspaces variables create*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceVariableCreateCall.html), [*containers workspaces variables delete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceVariableDeleteCall.html), [*containers workspaces variables get*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceVariableGetCall.html), [*containers workspaces variables list*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceVariableListCall.html), [*containers workspaces variables revert*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceVariableRevertCall.html), [*containers workspaces variables update*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountContainerWorkspaceVariableUpdateCall.html), [*get*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountGetCall.html), [*list*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountListCall.html), [*update*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountUpdateCall.html), [*user_permissions create*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountUserPermissionCreateCall.html), [*user_permissions delete*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountUserPermissionDeleteCall.html), [*user_permissions get*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountUserPermissionGetCall.html), [*user_permissions list*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountUserPermissionListCall.html) and [*user_permissions update*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/struct.AccountUserPermissionUpdateCall.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-tagmanager2/1.0.6+20170915/google_tagmanager2/struct.TagManager.html)** +* **[Hub](https://docs.rs/google-tagmanager2/1.0.6+20171108/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)** + * creates [*Method Builders*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-tagmanager2/1.0.6+20171108/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)** + * **[Parts](https://docs.rs/google-tagmanager2/1.0.6+20171108/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)** +* **[Activities](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -197,17 +197,17 @@ match result { ``` ## 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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-tagmanager2/1.0.6+20171108/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). +[Hub Delegate](https://docs.rs/google-tagmanager2/1.0.6+20171108/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tagmanager2/1.0.6+20171108/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. +If such a method also supports a [Response Result](https://docs.rs/google-tagmanager2/1.0.6+20171108/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")`. @@ -217,29 +217,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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-tagmanager2/1.0.6+20171108/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. +The [delegate trait](https://docs.rs/google-tagmanager2/1.0.6+20171108/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-tagmanager2/1.0.6+20171108/google_tagmanager2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-tagmanager2/1.0.6+20171108/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 +Most optionals are are considered [Parts](https://docs.rs/google-tagmanager2/1.0.6+20171108/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. +Using [method builders](https://docs.rs/google-tagmanager2/1.0.6+20171108/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 +* [request values](https://docs.rs/google-tagmanager2/1.0.6+20171108/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. diff --git a/gen/tagmanager2/src/lib.rs b/gen/tagmanager2/src/lib.rs index ee51c88668..300f7bba74 100644 --- a/gen/tagmanager2/src/lib.rs +++ b/gen/tagmanager2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Tag Manager* crate version *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*. +//! This documentation was generated from *Tag Manager* crate version *1.0.6+20171108*, where *20171108* 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/). @@ -1722,6 +1722,8 @@ pub struct Tag { /// The Tag ID uniquely identifies the GTM Tag. #[serde(rename="tagId")] pub tag_id: Option, + /// Indicates whether the tag is paused, which prevents the tag from firing. + pub paused: Option, /// The list of setup tags. Currently we only allow one. #[serde(rename="setupTag")] pub setup_tag: Option>, diff --git a/gen/testing1-cli/Cargo.toml b/gen/testing1-cli/Cargo.toml index f1b431162b..48e1572ca2 100644 --- a/gen/testing1-cli/Cargo.toml +++ b/gen/testing1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-testing1-cli" -version = "1.0.6+20170922" +version = "1.0.6+20171201" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-testing1] path = "../testing1" -version = "1.0.6+20170922" +version = "1.0.6+20171201" diff --git a/gen/testing1-cli/README.md b/gen/testing1-cli/README.md index 5fb2b641f3..7316906065 100644 --- a/gen/testing1-cli/README.md +++ b/gen/testing1-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 *testing* API at revision *20170922*. The CLI is at version *1.0.6*. +This documentation was generated from the *testing* API at revision *20171201*. The CLI is at version *1.0.6*. ```bash testing1 [options] diff --git a/gen/testing1-cli/mkdocs.yml b/gen/testing1-cli/mkdocs.yml index 316167ad26..a78b8a958b 100644 --- a/gen/testing1-cli/mkdocs.yml +++ b/gen/testing1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: testing v1.0.6+20170922 +site_name: testing v1.0.6+20171201 site_url: http://byron.github.io/google-apis-rs/google-testing1-cli site_description: A complete library to interact with testing (protocol v1) diff --git a/gen/testing1-cli/src/main.rs b/gen/testing1-cli/src/main.rs index 359b8e7a46..70cb541128 100644 --- a/gen/testing1-cli/src/main.rs +++ b/gen/testing1-cli/src/main.rs @@ -122,7 +122,7 @@ impl<'n> Engine<'n> { 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 })), + "timestamp" => Some(("timestamp", 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 })), @@ -145,20 +145,20 @@ impl<'n> Engine<'n> { "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-runner-class" => Some(("testSpecification.androidInstrumentationTest.testRunnerClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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 })), + "test-specification.android-instrumentation-test.test-targets" => Some(("testSpecification.androidInstrumentationTest.testTargets", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "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 })), + "project-id" => Some(("projectId", 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 })), + "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 })), _ => { 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())))); @@ -596,7 +596,7 @@ fn main() { let mut app = App::new("testing1") .author("Sebastian Thiel ") - .version("1.0.6+20170922") + .version("1.0.6+20171201") .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") diff --git a/gen/testing1/Cargo.toml b/gen/testing1/Cargo.toml index 0f5e3c6877..d75b847513 100644 --- a/gen/testing1/Cargo.toml +++ b/gen/testing1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-testing1" -version = "1.0.6+20170922" +version = "1.0.6+20171201" 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" +documentation = "https://docs.rs/google-testing1/1.0.6+20171201" license = "MIT" keywords = ["testing", "google", "protocol", "web", "api"] diff --git a/gen/testing1/README.md b/gen/testing1/README.md index 5b0c574042..8096487ec2 100644 --- a/gen/testing1/README.md +++ b/gen/testing1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *testing* crate version *1.0.6+20171201*, where *20171201* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-testing1/1.0.6+20171201/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) + * [*test matrices cancel*](https://docs.rs/google-testing1/1.0.6+20171201/google_testing1/struct.ProjectTestMatriceCancelCall.html), [*test matrices create*](https://docs.rs/google-testing1/1.0.6+20171201/google_testing1/struct.ProjectTestMatriceCreateCall.html) and [*test matrices get*](https://docs.rs/google-testing1/1.0.6+20171201/google_testing1/struct.ProjectTestMatriceGetCall.html) +* [test environment catalog](https://docs.rs/google-testing1/1.0.6+20171201/google_testing1/struct.TestEnvironmentCatalog.html) + * [*get*](https://docs.rs/google-testing1/1.0.6+20171201/google_testing1/struct.TestEnvironmentCatalogGetCall.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-testing1/1.0.6+20170922/google_testing1/struct.Testing.html)** +* **[Hub](https://docs.rs/google-testing1/1.0.6+20171201/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)** + * creates [*Method Builders*](https://docs.rs/google-testing1/1.0.6+20171201/google_testing1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-testing1/1.0.6+20171201/google_testing1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-testing1/1.0.6+20171201/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)** + * **[Parts](https://docs.rs/google-testing1/1.0.6+20171201/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)** +* **[Activities](https://docs.rs/google-testing1/1.0.6+20171201/google_testing1/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-testing1/1.0.6+20170922/google_testing1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-testing1/1.0.6+20171201/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). +[Hub Delegate](https://docs.rs/google-testing1/1.0.6+20171201/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-testing1/1.0.6+20171201/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. +If such a method also supports a [Response Result](https://docs.rs/google-testing1/1.0.6+20171201/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-testing1/1.0.6+20171201/google_testing1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-testing1/1.0.6+20171201/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. +The [delegate trait](https://docs.rs/google-testing1/1.0.6+20171201/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-testing1/1.0.6+20171201/google_testing1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-testing1/1.0.6+20171201/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 +Most optionals are are considered [Parts](https://docs.rs/google-testing1/1.0.6+20171201/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. +Using [method builders](https://docs.rs/google-testing1/1.0.6+20171201/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 +* [request values](https://docs.rs/google-testing1/1.0.6+20171201/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. diff --git a/gen/testing1/src/lib.rs b/gen/testing1/src/lib.rs index 601ec84b85..665e24bd18 100644 --- a/gen/testing1/src/lib.rs +++ b/gen/testing1/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 *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*. +//! This documentation was generated from *testing* crate version *1.0.6+20171201*, where *20171201* 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/). @@ -409,9 +409,10 @@ impl Part for AndroidDevice {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TestExecution { - /// The time this test execution was initially created. + /// The cloud project that owns the test execution. /// @OutputOnly - pub timestamp: Option, + #[serde(rename="projectId")] + pub project_id: Option, /// Id of the containing TestMatrix. /// @OutputOnly #[serde(rename="matrixId")] @@ -429,10 +430,9 @@ pub struct TestExecution { /// @OutputOnly #[serde(rename="testSpecification")] pub test_specification: Option, - /// The cloud project that owns the test execution. + /// The time this test execution was initially created. /// @OutputOnly - #[serde(rename="projectId")] - pub project_id: Option, + pub timestamp: Option, /// Where the results for this execution are written. /// @OutputOnly #[serde(rename="toolResultsStep")] @@ -496,14 +496,6 @@ impl Part for Environment {} /// #[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 @@ -514,6 +506,14 @@ pub struct AndroidMatrix { /// Required #[serde(rename="androidModelIds")] pub android_model_ids: Option>, + /// 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>, } impl Part for AndroidMatrix {} @@ -569,24 +569,45 @@ pub struct ToolResultsStep { impl Part for ToolResultsStep {} -/// Data about the relative number of devices running a -/// given configuration of the Android platform. +/// 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 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, +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 Distribution {} +impl Part for AndroidRoboTest {} /// Network emulation parameters @@ -618,10 +639,10 @@ impl Part for TrafficRule {} /// #[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, + /// Value for the environment variable + pub value: Option, } impl Part for EnvironmentVariable {} @@ -708,22 +729,30 @@ impl Part for ResultStorage {} /// #[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 device will be logged in on this account for the duration of the test. + /// Optional + pub account: Option, + /// List of files to push to the device before starting the test. + /// + /// Optional + #[serde(rename="filesToPush")] + pub files_to_push: Option>, + /// List of directories on the device to upload to GCS at the end of the test; + /// they must be absolute paths under /sdcard or /data/local/tmp. + /// Path names are restricted to characters a-z A-Z 0-9 _ - . + and / + /// + /// Note: The paths /sdcard and /data will be made available and treated as + /// implicit path substitutions. E.g. if /sdcard on a particular device does + /// not map to external storage, the system will replace it with the external + /// storage path prefix for that device. + /// + /// Optional + #[serde(rename="directoriesToPull")] + pub directories_to_pull: Option>, /// The network traffic profile used for running the test. /// Optional #[serde(rename="networkProfile")] @@ -733,25 +762,38 @@ pub struct TestSetup { impl Part for TestSetup {} -/// The currently supported Android devices. +/// 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 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>, +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 AndroidDeviceCatalog {} +impl Part for AndroidTestLoop {} /// An opaque binary blob file to install on the device before the test starts @@ -789,35 +831,38 @@ impl Part for ObbFile {} /// #[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, + /// 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 Date {} -/// The matrix of environments in which the test is to be executed. +/// 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 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, +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 EnvironmentMatrix {} +impl Part for AndroidDeviceCatalog {} /// Additional details about the progress of the running test. @@ -940,45 +985,42 @@ pub struct TestSpecification { 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. +/// 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 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, +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 AndroidRoboTest {} +impl Part for EnvironmentMatrix {} + + +/// 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 {} /// A reference to a file, used for user inputs. @@ -1085,15 +1127,10 @@ pub struct AndroidInstrumentationTest { /// 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 InstrumentationTestRunner class. + /// Optional, default is determined by examining the application's manifest. + #[serde(rename="testRunnerClass")] + pub test_runner_class: Option, /// The java package for the test to be executed. /// Optional, default is determined by examining the application's manifest. #[serde(rename="testPackageId")] @@ -1122,10 +1159,15 @@ pub struct AndroidInstrumentationTest { /// 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, + /// 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>, } impl Part for AndroidInstrumentationTest {} @@ -1157,9 +1199,6 @@ impl Part for NetworkConfiguration {} /// #[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 @@ -1168,6 +1207,9 @@ pub struct Orientation { /// Example: "portrait" /// @OutputOnly pub name: Option, + /// Tags for this dimension. + /// Examples: "default" + pub tags: Option>, } impl Part for Orientation {} @@ -1179,7 +1221,7 @@ impl Part for Orientation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Locale { - /// A human-friendy string representing the region for this locale. + /// A human-friendly string representing the region for this locale. /// Example: "United States" /// Not present for every locale. /// @OutputOnly @@ -1245,10 +1287,6 @@ impl ResponseResult for TestEnvironmentCatalog {} /// #[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 @@ -1268,6 +1306,10 @@ pub struct AndroidModel { /// Example: "Google", "Samsung" /// @OutputOnly pub brand: Option, + /// The unique opaque id for this model. + /// Use this for invoking the TestExecutionService. + /// @OutputOnly + pub id: Option, /// The set of Android versions this device supports. /// @OutputOnly #[serde(rename="supportedVersionIds")] @@ -1287,10 +1329,10 @@ pub struct AndroidModel { /// @OutputOnly #[serde(rename="screenX")] pub screen_x: Option, - /// The unique opaque id for this model. - /// Use this for invoking the TestExecutionService. + /// Screen size in the vertical (Y) dimension measured in pixels. /// @OutputOnly - pub id: Option, + #[serde(rename="screenY")] + pub screen_y: Option, /// The manufacturer of this device. /// @OutputOnly pub manufacturer: Option, @@ -1320,10 +1362,9 @@ pub struct TestMatrix { /// Optional #[serde(rename="clientInfo")] pub client_info: Option, - /// The cloud project that owns the test matrix. + /// The time this test matrix was initially created. /// @OutputOnly - #[serde(rename="projectId")] - pub project_id: Option, + pub timestamp: Option, /// Where the results for the matrix are written. /// Required #[serde(rename="resultStorage")] @@ -1343,9 +1384,10 @@ pub struct TestMatrix { /// @OutputOnly #[serde(rename="testMatrixId")] pub test_matrix_id: Option, - /// The time this test matrix was initially created. + /// The cloud project that owns the test matrix. /// @OutputOnly - pub timestamp: Option, + #[serde(rename="projectId")] + pub project_id: Option, /// Describes why the matrix is considered invalid. /// Only useful for matrices in the INVALID state. /// @OutputOnly @@ -1361,40 +1403,6 @@ 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. diff --git a/gen/tpu1_alpha1-cli/Cargo.toml b/gen/tpu1_alpha1-cli/Cargo.toml new file mode 100644 index 0000000000..f419364499 --- /dev/null +++ b/gen/tpu1_alpha1-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-tpu1_alpha1-cli" +version = "1.0.6+20171121" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with TPU (protocol v1alpha1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tpu1_alpha1-cli" +homepage = "https://cloud.google.com/tpu/" +documentation = "http://byron.github.io/google-apis-rs/google_tpu1_alpha1_cli" +license = "MIT" +keywords = ["tpu", "google", "cli"] + +[[bin]] +name = "tpu1-alpha1" + +[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-tpu1_alpha1] +path = "../tpu1_alpha1" +version = "1.0.6+20171121" diff --git a/gen/tpu1_alpha1-cli/LICENSE.md b/gen/tpu1_alpha1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/tpu1_alpha1-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/tpu1_alpha1-cli/README.md b/gen/tpu1_alpha1-cli/README.md new file mode 100644 index 0000000000..c5f65aadea --- /dev/null +++ b/gen/tpu1_alpha1-cli/README.md @@ -0,0 +1,125 @@ + +The `tpu1-alpha1` command-line interface *(CLI)* allows to use most features of the *Google TPU* 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 *TPU* API can be found at the +[official documentation site](https://cloud.google.com/tpu/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-tpu1_alpha1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/tpu1_alpha1-cli). + +# Usage + +This documentation was generated from the *TPU* API at revision *20171121*. The CLI is at version *1.0.6*. + +```bash +tpu1-alpha1 [options] + projects + locations-get [-p ]... [-o ] + locations-list [-p ]... [-o ] + locations-nodes-create (-r )... [-p ]... [-o ] + locations-nodes-delete [-p ]... [-o ] + locations-nodes-get [-p ]... [-o ] + locations-nodes-list [-p ]... [-o ] + locations-nodes-reimage (-r )... [-p ]... [-o ] + locations-nodes-reset (-r )... [-p ]... [-o ] + locations-operations-cancel [-p ]... [-o ] + locations-operations-delete [-p ]... [-o ] + locations-operations-get [-p ]... [-o ] + locations-operations-list [-p ]... [-o ] + tpu1-alpha1 --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 `tpu1-alpha1-`. 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/tpu1-alpha1-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/tpu1-alpha1-secret.json`, assuming that the required *tpu* 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. `tpu1-alpha1 --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/tpu1_alpha1-cli/mkdocs.yml b/gen/tpu1_alpha1-cli/mkdocs.yml new file mode 100644 index 0000000000..4ef883cfbd --- /dev/null +++ b/gen/tpu1_alpha1-cli/mkdocs.yml @@ -0,0 +1,28 @@ +site_name: TPU v1.0.6+20171121 +site_url: http://byron.github.io/google-apis-rs/google-tpu1_alpha1-cli +site_description: A complete library to interact with TPU (protocol v1alpha1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/tpu1_alpha1-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-nodes-create.md', 'Projects', 'Locations Nodes Create'] +- ['projects_locations-nodes-delete.md', 'Projects', 'Locations Nodes Delete'] +- ['projects_locations-nodes-get.md', 'Projects', 'Locations Nodes Get'] +- ['projects_locations-nodes-list.md', 'Projects', 'Locations Nodes List'] +- ['projects_locations-nodes-reimage.md', 'Projects', 'Locations Nodes Reimage'] +- ['projects_locations-nodes-reset.md', 'Projects', 'Locations Nodes Reset'] +- ['projects_locations-operations-cancel.md', 'Projects', 'Locations Operations Cancel'] +- ['projects_locations-operations-delete.md', 'Projects', 'Locations Operations Delete'] +- ['projects_locations-operations-get.md', 'Projects', 'Locations Operations Get'] +- ['projects_locations-operations-list.md', 'Projects', 'Locations Operations List'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/tpu1_alpha1-cli/src/cmn.rs b/gen/tpu1_alpha1-cli/src/cmn.rs new file mode 100644 index 0000000000..acddb75913 --- /dev/null +++ b/gen/tpu1_alpha1-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/tpu1_alpha1-cli/src/main.rs b/gen/tpu1_alpha1-cli/src/main.rs new file mode 100644 index 0000000000..4fb417ec67 --- /dev/null +++ b/gen/tpu1_alpha1-cli/src/main.rs @@ -0,0 +1,1353 @@ +// 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_tpu1_alpha1 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::TPU>, + 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_nodes_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()[..] { + "cidr-block" => Some(("cidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "health-description" => Some(("healthDescription", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-account" => Some(("serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tensorflow-version" => Some(("tensorflowVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "accelerator-type" => Some(("acceleratorType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ip-address" => Some(("ipAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "port" => Some(("port", 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!["accelerator-type", "cidr-block", "create-time", "description", "health-description", "ip-address", "name", "network", "port", "service-account", "state", "tensorflow-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::Node = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_nodes_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 { + "node-id" => { + call = call.node_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(["node-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_nodes_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_nodes_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_nodes_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_nodes_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_nodes_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_nodes_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_nodes_reimage(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "tensorflow-version" => Some(("tensorflowVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["tensorflow-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::ReimageNodeRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_nodes_reimage(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_nodes_reset(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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::ResetNodeRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_nodes_reset(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_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_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_locations_operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_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_locations_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_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_locations_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_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 _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-nodes-create", Some(opt)) => { + call_result = self._projects_locations_nodes_create(opt, dry_run, &mut err); + }, + ("locations-nodes-delete", Some(opt)) => { + call_result = self._projects_locations_nodes_delete(opt, dry_run, &mut err); + }, + ("locations-nodes-get", Some(opt)) => { + call_result = self._projects_locations_nodes_get(opt, dry_run, &mut err); + }, + ("locations-nodes-list", Some(opt)) => { + call_result = self._projects_locations_nodes_list(opt, dry_run, &mut err); + }, + ("locations-nodes-reimage", Some(opt)) => { + call_result = self._projects_locations_nodes_reimage(opt, dry_run, &mut err); + }, + ("locations-nodes-reset", Some(opt)) => { + call_result = self._projects_locations_nodes_reset(opt, dry_run, &mut err); + }, + ("locations-operations-cancel", Some(opt)) => { + call_result = self._projects_locations_operations_cancel(opt, dry_run, &mut err); + }, + ("locations-operations-delete", Some(opt)) => { + call_result = self._projects_locations_operations_delete(opt, dry_run, &mut err); + }, + ("locations-operations-get", Some(opt)) => { + call_result = self._projects_locations_operations_get(opt, dry_run, &mut err); + }, + ("locations-operations-list", Some(opt)) => { + call_result = self._projects_locations_operations_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, "tpu1-alpha1-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: "tpu1-alpha1", + 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::TPU::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-nodes-create', 'locations-nodes-delete', 'locations-nodes-get', 'locations-nodes-list', 'locations-nodes-reimage', 'locations-nodes-reset', 'locations-operations-cancel', 'locations-operations-delete', 'locations-operations-get' and 'locations-operations-list'", vec![ + ("locations-get", + Some(r##"Get information about a location."##), + "Details at http://byron.github.io/google-apis-rs/google_tpu1_alpha1_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_tpu1_alpha1_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-nodes-create", + Some(r##"Creates a node."##), + "Details at http://byron.github.io/google-apis-rs/google_tpu1_alpha1_cli/projects_locations-nodes-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The parent resource 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)), + ]), + ("locations-nodes-delete", + Some(r##"Deletes a node."##), + "Details at http://byron.github.io/google-apis-rs/google_tpu1_alpha1_cli/projects_locations-nodes-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource 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)), + ]), + ("locations-nodes-get", + Some(r##"Gets the details of a node."##), + "Details at http://byron.github.io/google-apis-rs/google_tpu1_alpha1_cli/projects_locations-nodes-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource 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)), + ]), + ("locations-nodes-list", + Some(r##"Lists nodes."##), + "Details at http://byron.github.io/google-apis-rs/google_tpu1_alpha1_cli/projects_locations-nodes-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The parent resource 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)), + ]), + ("locations-nodes-reimage", + Some(r##"Reimage a node's OS."##), + "Details at http://byron.github.io/google-apis-rs/google_tpu1_alpha1_cli/projects_locations-nodes-reimage", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource 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)), + ]), + ("locations-nodes-reset", + Some(r##"Resets a node, which stops and starts the VM."##), + "Details at http://byron.github.io/google-apis-rs/google_tpu1_alpha1_cli/projects_locations-nodes-reset", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource 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)), + ]), + ("locations-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_tpu1_alpha1_cli/projects_locations-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)), + ]), + ("locations-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_tpu1_alpha1_cli/projects_locations-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)), + ]), + ("locations-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_tpu1_alpha1_cli/projects_locations-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)), + ]), + ("locations-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_tpu1_alpha1_cli/projects_locations-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)), + ]), + ]), + + ]; + + let mut app = App::new("tpu1-alpha1") + .author("Sebastian Thiel ") + .version("1.0.6+20171121") + .about("TPU API provides customers with access to Google TPU technology.") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tpu1_alpha1_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/tpu1_alpha1/Cargo.toml b/gen/tpu1_alpha1/Cargo.toml new file mode 100644 index 0000000000..27f80b6cef --- /dev/null +++ b/gen/tpu1_alpha1/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-tpu1_alpha1" +version = "1.0.6+20171121" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with TPU (protocol v1alpha1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tpu1_alpha1" +homepage = "https://cloud.google.com/tpu/" +documentation = "https://docs.rs/google-tpu1_alpha1/1.0.6+20171121" +license = "MIT" +keywords = ["tpu", "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/tpu1_alpha1/LICENSE.md b/gen/tpu1_alpha1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/tpu1_alpha1/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/tpu1_alpha1/README.md b/gen/tpu1_alpha1/README.md new file mode 100644 index 0000000000..9c006d23a3 --- /dev/null +++ b/gen/tpu1_alpha1/README.md @@ -0,0 +1,185 @@ + +The `google-tpu1_alpha1` library allows access to all features of the *Google TPU* service. + +This documentation was generated from *TPU* crate version *1.0.6+20171121*, where *20171121* is the exact revision of the *tpu:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. + +Everything else about the *TPU* *v1_alpha1* API can be found at the +[official documentation site](https://cloud.google.com/tpu/). +# Features + +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.TPU.html) ... + +* projects + * [*locations get*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationListCall.html), [*locations nodes create*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationNodeCreateCall.html), [*locations nodes delete*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationNodeDeleteCall.html), [*locations nodes get*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationNodeGetCall.html), [*locations nodes list*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationNodeListCall.html), [*locations nodes reimage*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationNodeReimageCall.html), [*locations nodes reset*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationNodeResetCall.html), [*locations operations cancel*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.ProjectLocationOperationListCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/struct.TPU.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/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_nodes_delete(...).doit() +let r = hub.projects().locations_nodes_reset(...).doit() +let r = hub.projects().locations_nodes_reimage(...).doit() +let r = hub.projects().locations_operations_get(...).doit() +let r = hub.projects().locations_nodes_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-tpu1_alpha1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate hyper_rustls; +extern crate yup_oauth2 as oauth2; +extern crate google_tpu1_alpha1 as tpu1_alpha1; +use tpu1_alpha1::Node; +use tpu1_alpha1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use tpu1_alpha1::TPU; + +// 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 = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +// As the method needs a request, you would usually fill it with the desired information +// into the respective structure. Some of the parts shown here might not be applicable ! +// Values shown here are possibly random and not representative ! +let mut req = Node::default(); + +// You can configure optional parameters by calling the 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_nodes_create(req, "parent") + .node_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-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/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-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/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-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/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-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/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-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/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-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/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-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/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-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/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-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/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-tpu1_alpha1/1.0.6+20171121/google_tpu1_alpha1/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 **tpu1_alpha1** 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/tpu1_alpha1/src/cmn.rs b/gen/tpu1_alpha1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/tpu1_alpha1/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/tpu1_alpha1/src/lib.rs b/gen/tpu1_alpha1/src/lib.rs new file mode 100644 index 0000000000..a5f1ee0fa4 --- /dev/null +++ b/gen/tpu1_alpha1/src/lib.rs @@ -0,0 +1,4284 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *TPU* crate version *1.0.6+20171121*, where *20171121* is the exact revision of the *tpu:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.6*. +//! +//! Everything else about the *TPU* *v1_alpha1* API can be found at the +//! [official documentation site](https://cloud.google.com/tpu/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/tpu1_alpha1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.TPU.html) ... +//! +//! * projects +//! * [*locations get*](struct.ProjectLocationGetCall.html), [*locations list*](struct.ProjectLocationListCall.html), [*locations nodes create*](struct.ProjectLocationNodeCreateCall.html), [*locations nodes delete*](struct.ProjectLocationNodeDeleteCall.html), [*locations nodes get*](struct.ProjectLocationNodeGetCall.html), [*locations nodes list*](struct.ProjectLocationNodeListCall.html), [*locations nodes reimage*](struct.ProjectLocationNodeReimageCall.html), [*locations nodes reset*](struct.ProjectLocationNodeResetCall.html), [*locations operations cancel*](struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](struct.ProjectLocationOperationListCall.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.TPU.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_nodes_delete(...).doit() +//! let r = hub.projects().locations_nodes_reset(...).doit() +//! let r = hub.projects().locations_nodes_reimage(...).doit() +//! let r = hub.projects().locations_operations_get(...).doit() +//! let r = hub.projects().locations_nodes_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-tpu1_alpha1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate hyper_rustls; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_tpu1_alpha1 as tpu1_alpha1; +//! use tpu1_alpha1::Node; +//! use tpu1_alpha1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use tpu1_alpha1::TPU; +//! +//! // 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 = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +//! // As the method needs a request, you would usually fill it with the desired information +//! // into the respective structure. Some of the parts shown here might not be applicable ! +//! // Values shown here are possibly random and not representative ! +//! let mut req = Node::default(); +//! +//! // You can configure optional parameters by calling the 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_nodes_create(req, "parent") +//! .node_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, +} + +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 TPU 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_tpu1_alpha1 as tpu1_alpha1; +/// use tpu1_alpha1::Node; +/// use tpu1_alpha1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use tpu1_alpha1::TPU; +/// +/// // 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 = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Node::default(); +/// +/// // You can configure optional parameters by calling the 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_nodes_create(req, "parent") +/// .node_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 TPU { + client: RefCell, + auth: RefCell
, + _user_agent: String, + _base_url: String, + _root_url: String, +} + +impl<'a, C, A> Hub for TPU {} + +impl<'a, C, A> TPU + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> TPU { + TPU { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.6".to_string(), + _base_url: "https://tpu.googleapis.com/".to_string(), + _root_url: "https://tpu.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://tpu.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://tpu.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 {} + + +/// A TPU instance. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 nodes create projects](struct.ProjectLocationNodeCreateCall.html) (request) +/// * [locations nodes get projects](struct.ProjectLocationNodeGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Node { + /// Output only. + /// DEPRECATED! Use network_endpoints instead. + /// The network address for the TPU Node as visible to GCE instances. + #[serde(rename="ipAddress")] + pub ip_address: Option, + /// The name of a network they wish to peer the TPU node to. It must be a + /// preexisting GCE network inside of the project on which this API has been + /// activated. If none is provided, "default" will be used. + pub network: Option, + /// If this field is populated, it contains a description of why the TPU Node + /// is unhealthy. + /// Output only. + #[serde(rename="healthDescription")] + pub health_description: Option, + /// The user-supplied description of the TPU. Maximum of 512 characters. + pub description: Option, + /// The service account used to run the tensor flow services within the node. + /// To share resources, including Google Cloud Storage data, with the + /// Tensorflow job running in the Node, this account must have permissions to + /// that data. + /// Output only. + #[serde(rename="serviceAccount")] + pub service_account: Option, + /// Output only. + /// DEPRECATED! Use network_endpoints instead. + /// The network port for the TPU Node as visible to GCE instances. + pub port: Option, + /// The version of Tensorflow running in the Node. + /// Required. + #[serde(rename="tensorflowVersion")] + pub tensorflow_version: Option, + /// The current state for the TPU Node. + /// Output only. + pub state: Option, + /// Output only. The network endpoints where TPU workers can be accessed and sent work. + /// It is recommended that Tensorflow clients of the node reach out to the 0th + /// entry in this map first. + #[serde(rename="networkEndpoints")] + pub network_endpoints: Option>, + /// The type of hardware accelerators associated with this node. + /// Required. + #[serde(rename="acceleratorType")] + pub accelerator_type: Option, + /// The CIDR block that the TPU node will use when selecting //an IP address. + /// This CIDR block must be a /29 block; the GCE networks API forbids a smaller + /// block, and using a larger block would be wasteful (a node can only consume + /// one IP address). Errors will occur if the CIDR block has already been used + /// for a currently existing TPU node, the CIDR block conflicts with any + /// subnetworks in the user's provided network, or the provided network is + /// peered with another network that is using that CIDR block. + /// Required. + #[serde(rename="cidrBlock")] + pub cidr_block: Option, + /// The time when the node was created. + /// Output only. + #[serde(rename="createTime")] + pub create_time: Option, + /// The immutable name of the TPU + pub name: Option, +} + +impl RequestValue for Node {} +impl ResponseResult for Node {} + + +/// A network endpoint over which a TPU worker can be reached. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpoint { + /// The IP address of this network endpoint. + #[serde(rename="ipAddress")] + pub ip_address: Option, + /// The port of this network endpoint. + pub port: Option, +} + +impl Part for NetworkEndpoint {} + + +/// Request for ReimageNode. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 nodes reimage projects](struct.ProjectLocationNodeReimageCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReimageNodeRequest { + /// The version for reimage to create. + #[serde(rename="tensorflowVersion")] + pub tensorflow_version: Option, +} + +impl RequestValue for ReimageNodeRequest {} + + +/// Request for ResetNode. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 nodes reset projects](struct.ProjectLocationNodeResetCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResetNodeRequest { _never_set: Option } + +impl RequestValue for ResetNodeRequest {} + + +/// 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 {} + + +/// 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*). +/// +/// * [locations nodes delete projects](struct.ProjectLocationNodeDeleteCall.html) (response) +/// * [locations nodes reset projects](struct.ProjectLocationNodeResetCall.html) (response) +/// * [locations nodes reimage projects](struct.ProjectLocationNodeReimageCall.html) (response) +/// * [locations operations get projects](struct.ProjectLocationOperationGetCall.html) (response) +/// * [locations nodes create projects](struct.ProjectLocationNodeCreateCall.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 {} + + +/// Response for ListNodes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 nodes list projects](struct.ProjectLocationNodeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListNodesResponse { + /// The next page token or empty if none. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The listed nodes. + pub nodes: Option>, +} + +impl ResponseResult for ListNodesResponse {} + + +/// 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 operations delete projects](struct.ProjectLocationOperationDeleteCall.html) (response) +/// * [locations operations cancel projects](struct.ProjectLocationOperationCancelCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// 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*). +/// +/// * [locations operations list projects](struct.ProjectLocationOperationListCall.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 {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `TPU` 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_tpu1_alpha1 as tpu1_alpha1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use tpu1_alpha1::TPU; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = TPU::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_nodes_create(...)`, `locations_nodes_delete(...)`, `locations_nodes_get(...)`, `locations_nodes_list(...)`, `locations_nodes_reimage(...)`, `locations_nodes_reset(...)`, `locations_operations_cancel(...)`, `locations_operations_delete(...)`, `locations_operations_get(...)` and `locations_operations_list(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, +} + +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 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 locations_operations_list(&self, name: &str) -> ProjectLocationOperationListCall<'a, C, A> { + ProjectLocationOperationListCall { + 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 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: + /// + /// Resets a node, which stops and starts the VM. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name. + pub fn locations_nodes_reset(&self, request: ResetNodeRequest, name: &str) -> ProjectLocationNodeResetCall<'a, C, A> { + ProjectLocationNodeResetCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn locations_operations_get(&self, name: &str) -> ProjectLocationOperationGetCall<'a, C, A> { + ProjectLocationOperationGetCall { + 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 node. + /// + /// # Arguments + /// + /// * `name` - The resource name. + pub fn locations_nodes_delete(&self, name: &str) -> ProjectLocationNodeDeleteCall<'a, C, A> { + ProjectLocationNodeDeleteCall { + 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 locations_operations_delete(&self, name: &str) -> ProjectLocationOperationDeleteCall<'a, C, A> { + ProjectLocationOperationDeleteCall { + 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: + /// + /// Reimage a node's OS. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name. + pub fn locations_nodes_reimage(&self, request: ReimageNodeRequest, name: &str) -> ProjectLocationNodeReimageCall<'a, C, A> { + ProjectLocationNodeReimageCall { + 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: + /// + /// 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 locations_operations_cancel(&self, name: &str) -> ProjectLocationOperationCancelCall<'a, C, A> { + ProjectLocationOperationCancelCall { + 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 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: + /// + /// Creates a node. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The parent resource name. + pub fn locations_nodes_create(&self, request: Node, parent: &str) -> ProjectLocationNodeCreateCall<'a, C, A> { + ProjectLocationNodeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _node_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 details of a node. + /// + /// # Arguments + /// + /// * `name` - The resource name. + pub fn locations_nodes_get(&self, name: &str) -> ProjectLocationNodeGetCall<'a, C, A> { + ProjectLocationNodeGetCall { + 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 nodes. + /// + /// # Arguments + /// + /// * `parent` - The parent resource name. + pub fn locations_nodes_list(&self, parent: &str) -> ProjectLocationNodeListCall<'a, C, A> { + ProjectLocationNodeListCall { + 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 ### +// ################# + +/// 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 *locations.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_tpu1_alpha1 as tpu1_alpha1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_operations_list("name") +/// .page_token("accusam") +/// .page_size(-8) +/// .filter("justo") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, + _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 ProjectLocationOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationOperationListCall<'a, C, 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: "tpu.projects.locations.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() + "v1alpha1/{+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) -> ProjectLocationOperationListCall<'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) -> ProjectLocationOperationListCall<'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) -> ProjectLocationOperationListCall<'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) -> ProjectLocationOperationListCall<'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) -> ProjectLocationOperationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationOperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationListCall<'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_tpu1_alpha1 as tpu1_alpha1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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("erat") +/// .page_size(-35) +/// .filter("sea") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, + _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: "tpu.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() + "v1alpha1/{+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 + } +} + + +/// Resets a node, which stops and starts the VM. +/// +/// A builder for the *locations.nodes.reset* 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_tpu1_alpha1 as tpu1_alpha1; +/// use tpu1_alpha1::ResetNodeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ResetNodeRequest::default(); +/// +/// // You can configure optional parameters by calling the 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_nodes_reset(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationNodeResetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, + _request: ResetNodeRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationNodeResetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationNodeResetCall<'a, C, 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: "tpu.projects.locations.nodes.reset", + 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() + "v1alpha1/{+name}:reset"; + 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: ResetNodeRequest) -> ProjectLocationNodeResetCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource 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) -> ProjectLocationNodeResetCall<'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) -> ProjectLocationNodeResetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationNodeResetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationNodeResetCall<'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 *locations.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_tpu1_alpha1 as tpu1_alpha1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationOperationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationOperationGetCall<'a, C, 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: "tpu.projects.locations.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() + "v1alpha1/{+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) -> ProjectLocationOperationGetCall<'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) -> ProjectLocationOperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationOperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationGetCall<'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. +/// +/// A builder for the *locations.nodes.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_tpu1_alpha1 as tpu1_alpha1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_nodes_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationNodeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationNodeDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationNodeDeleteCall<'a, C, 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: "tpu.projects.locations.nodes.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() + "v1alpha1/{+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. + /// + /// 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) -> ProjectLocationNodeDeleteCall<'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) -> ProjectLocationNodeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationNodeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationNodeDeleteCall<'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 *locations.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_tpu1_alpha1 as tpu1_alpha1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_operations_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationOperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationOperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationOperationDeleteCall<'a, C, 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: "tpu.projects.locations.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() + "v1alpha1/{+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) -> ProjectLocationOperationDeleteCall<'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) -> ProjectLocationOperationDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationOperationDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reimage a node's OS. +/// +/// A builder for the *locations.nodes.reimage* 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_tpu1_alpha1 as tpu1_alpha1; +/// use tpu1_alpha1::ReimageNodeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ReimageNodeRequest::default(); +/// +/// // You can configure optional parameters by calling the 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_nodes_reimage(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationNodeReimageCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, + _request: ReimageNodeRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationNodeReimageCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationNodeReimageCall<'a, C, 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: "tpu.projects.locations.nodes.reimage", + 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() + "v1alpha1/{+name}:reimage"; + 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: ReimageNodeRequest) -> ProjectLocationNodeReimageCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource 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) -> ProjectLocationNodeReimageCall<'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) -> ProjectLocationNodeReimageCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationNodeReimageCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationNodeReimageCall<'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 *locations.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_tpu1_alpha1 as tpu1_alpha1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_operations_cancel("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationOperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationOperationCancelCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationOperationCancelCall<'a, C, 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: "tpu.projects.locations.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() + "v1alpha1/{+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) -> ProjectLocationOperationCancelCall<'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) -> ProjectLocationOperationCancelCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationOperationCancelCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationCancelCall<'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_tpu1_alpha1 as tpu1_alpha1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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 TPU, + _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: "tpu.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() + "v1alpha1/{+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 + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing 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 + } +} + + +/// Creates a node. +/// +/// A builder for the *locations.nodes.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_tpu1_alpha1 as tpu1_alpha1; +/// use tpu1_alpha1::Node; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Node::default(); +/// +/// // You can configure optional parameters by calling the 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_nodes_create(req, "parent") +/// .node_id("justo") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationNodeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, + _request: Node, + _parent: String, + _node_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationNodeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationNodeCreateCall<'a, C, 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: "tpu.projects.locations.nodes.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._node_id { + params.push(("nodeId", value.to_string())); + } + for &field in ["alt", "parent", "nodeId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1alpha1/{+parent}/nodes"; + 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: Node) -> ProjectLocationNodeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The parent resource 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) -> ProjectLocationNodeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The unqualified resource name. + /// + /// Sets the *node id* query property to the given value. + pub fn node_id(mut self, new_value: &str) -> ProjectLocationNodeCreateCall<'a, C, A> { + self._node_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) -> ProjectLocationNodeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationNodeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationNodeCreateCall<'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 node. +/// +/// A builder for the *locations.nodes.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_tpu1_alpha1 as tpu1_alpha1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_nodes_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationNodeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationNodeGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationNodeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Node)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tpu.projects.locations.nodes.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() + "v1alpha1/{+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. + /// + /// 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) -> ProjectLocationNodeGetCall<'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) -> ProjectLocationNodeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationNodeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationNodeGetCall<'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 nodes. +/// +/// A builder for the *locations.nodes.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_tpu1_alpha1 as tpu1_alpha1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use tpu1_alpha1::TPU; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = TPU::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the 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_nodes_list("parent") +/// .page_token("diam") +/// .page_size(-55) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationNodeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a TPU, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationNodeListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationNodeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListNodesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "tpu.projects.locations.nodes.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() + "v1alpha1/{+parent}/nodes"; + 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 parent resource 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) -> ProjectLocationNodeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The next_page_token value returned from a previous List request, if any. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationNodeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of items to return. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationNodeListCall<'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) -> ProjectLocationNodeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response 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) -> ProjectLocationNodeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationNodeListCall<'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/src/lib.rs b/gen/translate2/src/lib.rs index 3f87d37f65..6d4c58a0f3 100644 --- a/gen/translate2/src/lib.rs +++ b/gen/translate2/src/lib.rs @@ -528,19 +528,19 @@ impl RequestValue for TranslateTextRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TranslationsResource { + /// Text translated into the target language. + #[serde(rename="translatedText")] + pub translated_text: 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, /// 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 {} diff --git a/gen/vault1-cli/Cargo.toml b/gen/vault1-cli/Cargo.toml index c2360fa6d2..e93c446d14 100644 --- a/gen/vault1-cli/Cargo.toml +++ b/gen/vault1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-vault1-cli" -version = "1.0.6+20170812" +version = "1.0.6+20171026" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-vault1] path = "../vault1" -version = "1.0.6+20170812" +version = "1.0.6+20171026" diff --git a/gen/vault1-cli/README.md b/gen/vault1-cli/README.md index fb32e5b50d..ae04bd504a 100644 --- a/gen/vault1-cli/README.md +++ b/gen/vault1-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 *Vault* API at revision *20170812*. The CLI is at version *1.0.6*. +This documentation was generated from the *Vault* API at revision *20171026*. The CLI is at version *1.0.6*. ```bash vault1 [options] diff --git a/gen/vault1-cli/mkdocs.yml b/gen/vault1-cli/mkdocs.yml index e166adda15..7a3682b3c8 100644 --- a/gen/vault1-cli/mkdocs.yml +++ b/gen/vault1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Vault v1.0.6+20170812 +site_name: Vault v1.0.6+20171026 site_url: http://byron.github.io/google-apis-rs/google-vault1-cli site_description: A complete library to interact with Vault (protocol v1) diff --git a/gen/vault1-cli/src/main.rs b/gen/vault1-cli/src/main.rs index c69c0eec27..22c536b62c 100644 --- a/gen/vault1-cli/src/main.rs +++ b/gen/vault1-cli/src/main.rs @@ -2027,7 +2027,7 @@ fn main() { let mut app = App::new("vault1") .author("Sebastian Thiel ") - .version("1.0.6+20170812") + .version("1.0.6+20171026") .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") diff --git a/gen/vault1/Cargo.toml b/gen/vault1/Cargo.toml index d96e36364f..1809aabb45 100644 --- a/gen/vault1/Cargo.toml +++ b/gen/vault1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-vault1" -version = "1.0.6+20170812" +version = "1.0.6+20171026" 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" +documentation = "https://docs.rs/google-vault1/1.0.6+20171026" license = "MIT" keywords = ["vault", "google", "protocol", "web", "api"] diff --git a/gen/vault1/README.md b/gen/vault1/README.md index 9df5ed779a..47248ae482 100644 --- a/gen/vault1/README.md +++ b/gen/vault1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Vault* crate version *1.0.6+20171026*, where *20171026* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-vault1/1.0.6+20171026/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) +* [matters](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.Matter.html) + * [*add permissions*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterAddPermissionCall.html), [*close*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterCloseCall.html), [*create*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterCreateCall.html), [*delete*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterDeleteCall.html), [*get*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterGetCall.html), [*holds accounts create*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterHoldAccountCreateCall.html), [*holds accounts delete*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterHoldAccountDeleteCall.html), [*holds accounts list*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterHoldAccountListCall.html), [*holds create*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterHoldCreateCall.html), [*holds delete*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterHoldDeleteCall.html), [*holds get*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterHoldGetCall.html), [*holds list*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterHoldListCall.html), [*holds update*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterHoldUpdateCall.html), [*list*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterListCall.html), [*remove permissions*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterRemovePermissionCall.html), [*reopen*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterReopenCall.html), [*undelete*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterUndeleteCall.html) and [*update*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/struct.MatterUpdateCall.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-vault1/1.0.6+20170812/google_vault1/struct.Vault.html)** +* **[Hub](https://docs.rs/google-vault1/1.0.6+20171026/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)** + * creates [*Method Builders*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-vault1/1.0.6+20171026/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)** + * **[Parts](https://docs.rs/google-vault1/1.0.6+20171026/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)** +* **[Activities](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/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-vault1/1.0.6+20170812/google_vault1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-vault1/1.0.6+20171026/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). +[Hub Delegate](https://docs.rs/google-vault1/1.0.6+20171026/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-vault1/1.0.6+20171026/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. +If such a method also supports a [Response Result](https://docs.rs/google-vault1/1.0.6+20171026/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-vault1/1.0.6+20171026/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. +The [delegate trait](https://docs.rs/google-vault1/1.0.6+20171026/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-vault1/1.0.6+20171026/google_vault1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-vault1/1.0.6+20171026/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 +Most optionals are are considered [Parts](https://docs.rs/google-vault1/1.0.6+20171026/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. +Using [method builders](https://docs.rs/google-vault1/1.0.6+20171026/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 +* [request values](https://docs.rs/google-vault1/1.0.6+20171026/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. diff --git a/gen/vault1/src/lib.rs b/gen/vault1/src/lib.rs index 4858ece342..84d57acef3 100644 --- a/gen/vault1/src/lib.rs +++ b/gen/vault1/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 *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*. +//! This documentation was generated from *Vault* crate version *1.0.6+20171026*, where *20171026* 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). @@ -652,13 +652,13 @@ impl ResponseResult for ListHeldAccountsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct HeldMailQuery { - /// The end date range for the search query. These timestamps are in GMT and + /// The end time 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 + /// The start time 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, @@ -718,13 +718,13 @@ impl RequestValue for ReopenMatterRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct HeldGroupsQuery { - /// The end date range for the search query. These timestamps are in GMT and + /// The end time 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 + /// The start time 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, diff --git a/gen/videointelligence1_beta1-cli/Cargo.toml b/gen/videointelligence1_beta1-cli/Cargo.toml index fdbd3cdfa6..53875c00da 100644 --- a/gen/videointelligence1_beta1-cli/Cargo.toml +++ b/gen/videointelligence1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-videointelligence1_beta1-cli" -version = "1.0.6+20170923" +version = "1.0.6+20171122" 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" @@ -37,4 +37,4 @@ clap = "^2.0" [dependencies.google-videointelligence1_beta1] path = "../videointelligence1_beta1" -version = "1.0.6+20170923" +version = "1.0.6+20171122" diff --git a/gen/videointelligence1_beta1-cli/README.md b/gen/videointelligence1_beta1-cli/README.md index 56ce5cc1ea..61ef6c7250 100644 --- a/gen/videointelligence1_beta1-cli/README.md +++ b/gen/videointelligence1_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 Video Intelligence* API at revision *20170923*. The CLI is at version *1.0.6*. +This documentation was generated from the *Cloud Video Intelligence* API at revision *20171122*. The CLI is at version *1.0.6*. ```bash videointelligence1-beta1 [options] diff --git a/gen/videointelligence1_beta1-cli/mkdocs.yml b/gen/videointelligence1_beta1-cli/mkdocs.yml index aabf96a332..b182158d3b 100644 --- a/gen/videointelligence1_beta1-cli/mkdocs.yml +++ b/gen/videointelligence1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Video Intelligence v1.0.6+20170923 +site_name: Cloud Video Intelligence v1.0.6+20171122 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) diff --git a/gen/videointelligence1_beta1-cli/src/main.rs b/gen/videointelligence1_beta1-cli/src/main.rs index 1c1e3f1212..0941f22927 100644 --- a/gen/videointelligence1_beta1-cli/src/main.rs +++ b/gen/videointelligence1_beta1-cli/src/main.rs @@ -274,7 +274,7 @@ fn main() { let mut app = App::new("videointelligence1-beta1") .author("Sebastian Thiel ") - .version("1.0.6+20170923") + .version("1.0.6+20171122") .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") diff --git a/gen/videointelligence1_beta1/Cargo.toml b/gen/videointelligence1_beta1/Cargo.toml index 3ce9658e73..184e05c6f9 100644 --- a/gen/videointelligence1_beta1/Cargo.toml +++ b/gen/videointelligence1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-videointelligence1_beta1" -version = "1.0.6+20170923" +version = "1.0.6+20171122" 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" +documentation = "https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122" license = "MIT" keywords = ["videointelligence", "google", "protocol", "web", "api"] diff --git a/gen/videointelligence1_beta1/README.md b/gen/videointelligence1_beta1/README.md index 306624fbd4..8f2cd3f39a 100644 --- a/gen/videointelligence1_beta1/README.md +++ b/gen/videointelligence1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> 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*. +This documentation was generated from *Cloud Video Intelligence* crate version *1.0.6+20171122*, where *20171122* 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) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/google_videointelligence1_beta1/struct.CloudVideoIntelligence.html) ... * videos - * [*annotate*](https://docs.rs/google-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/struct.VideoAnnotateCall.html) + * [*annotate*](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/google_videointelligence1_beta1/struct.VideoAnnotateCall.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-videointelligence1_beta1/1.0.6+20170923/google_videointelligence1_beta1/struct.CloudVideoIntelligence.html)** +* **[Hub](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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)** + * creates [*Method Builders*](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/google_videointelligence1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/google_videointelligence1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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)** + * **[Parts](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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)** +* **[Activities](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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. @@ -122,17 +122,17 @@ match result { ``` ## 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 +All errors produced by the system are provided either as [Result](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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). +[Hub Delegate](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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 +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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. +If such a method also supports a [Response Result](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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")`. @@ -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-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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/google_videointelligence1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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. +The [delegate trait](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/google_videointelligence1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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 +Most optionals are are considered [Parts](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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. +Using [method builders](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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 +* [request values](https://docs.rs/google-videointelligence1_beta1/1.0.6+20171122/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. diff --git a/gen/videointelligence1_beta1/src/lib.rs b/gen/videointelligence1_beta1/src/lib.rs index 1a9f86edcb..638e211fb7 100644 --- a/gen/videointelligence1_beta1/src/lib.rs +++ b/gen/videointelligence1_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 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*. +//! This documentation was generated from *Cloud Video Intelligence* crate version *1.0.6+20171122*, where *20171122* 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/). @@ -412,47 +412,6 @@ pub struct GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest { 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: @@ -541,6 +500,47 @@ pub struct GoogleCloudVideointelligenceV1beta1_VideoSegment { impl Part for GoogleCloudVideointelligenceV1beta1_VideoSegment {} +/// 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 {} + + /// Video context and/or feature-specific parameters. /// /// This type is not used in any activity, and only used as *part* of another schema. diff --git a/gen/youtube3-cli/Cargo.toml b/gen/youtube3-cli/Cargo.toml index e2405650cf..4ee2815290 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+20170918" +version = "1.0.6+20171129" 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+20170918" +version = "1.0.6+20171129" diff --git a/gen/youtube3-cli/README.md b/gen/youtube3-cli/README.md index a7f1695913..77f0a3b38d 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 *20170918*. The CLI is at version *1.0.6*. +This documentation was generated from the *YouTube* API at revision *20171129*. 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 4bb510ce26..ffdf0cc020 100644 --- a/gen/youtube3-cli/mkdocs.yml +++ b/gen/youtube3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube v1.0.6+20170918 +site_name: YouTube v1.0.6+20171129 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 aa0f118541..cdbe145984 100644 --- a/gen/youtube3-cli/src/main.rs +++ b/gen/youtube3-cli/src/main.rs @@ -2547,21 +2547,22 @@ impl<'n> Engine<'n> { "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.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.projection" => Some(("contentDetails.projection", JsonTypeInfo { jtype: JsonType::String, 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.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.latency-preference" => Some(("contentDetails.latencyPreference", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.enable-embed" => Some(("contentDetails.enableEmbed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-closed-captions" => Some(("contentDetails.enableClosedCaptions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.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.start-with-slate" => Some(("contentDetails.startWithSlate", 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 })), - "content-details.projection" => Some(("contentDetails.projection", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.enable-auto-start" => Some(("contentDetails.enableAutoStart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "snippet.actual-end-time" => Some(("snippet.actualEndTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.description" => Some(("snippet.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.title" => Some(("snippet.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2590,7 +2591,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", "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"]); + 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-auto-start", "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 } @@ -2824,21 +2825,22 @@ impl<'n> Engine<'n> { "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.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.projection" => Some(("contentDetails.projection", JsonTypeInfo { jtype: JsonType::String, 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.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.latency-preference" => Some(("contentDetails.latencyPreference", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.enable-embed" => Some(("contentDetails.enableEmbed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-closed-captions" => Some(("contentDetails.enableClosedCaptions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.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.start-with-slate" => Some(("contentDetails.startWithSlate", 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 })), - "content-details.projection" => Some(("contentDetails.projection", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.enable-auto-start" => Some(("contentDetails.enableAutoStart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "snippet.actual-end-time" => Some(("snippet.actualEndTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.description" => Some(("snippet.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.title" => Some(("snippet.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2867,7 +2869,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", "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"]); + 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-auto-start", "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 } @@ -5426,6 +5428,7 @@ impl<'n> Engine<'n> { "statistics.favorite-count" => Some(("statistics.favoriteCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "statistics.dislike-count" => Some(("statistics.dislikeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "statistics.like-count" => Some(("statistics.likeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "access-token" => Some(("accessToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.definition" => Some(("contentDetails.definition", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.projection" => Some(("contentDetails.projection", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.country-restriction.exception" => Some(("contentDetails.countryRestriction.exception", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -5578,7 +5581,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", "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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "access-token", "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 } @@ -5916,6 +5919,7 @@ impl<'n> Engine<'n> { "statistics.favorite-count" => Some(("statistics.favoriteCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "statistics.dislike-count" => Some(("statistics.dislikeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "statistics.like-count" => Some(("statistics.likeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "access-token" => Some(("accessToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.definition" => Some(("contentDetails.definition", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.projection" => Some(("contentDetails.projection", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.country-restriction.exception" => Some(("contentDetails.countryRestriction.exception", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -6068,7 +6072,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", "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"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "access-token", "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 } @@ -8483,7 +8487,7 @@ fn main() { let mut app = App::new("youtube3") .author("Sebastian Thiel ") - .version("1.0.6+20170918") + .version("1.0.6+20171129") .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 5aca2d544b..89a2868be0 100644 --- a/gen/youtube3/Cargo.toml +++ b/gen/youtube3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-youtube3" -version = "1.0.6+20170918" +version = "1.0.6+20171129" 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+20170918" +documentation = "https://docs.rs/google-youtube3/1.0.6+20171129" license = "MIT" keywords = ["youtube", "google", "protocol", "web", "api"] diff --git a/gen/youtube3/README.md b/gen/youtube3/README.md index 959a93f7d5..504ed0f76d 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+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*. +This documentation was generated from *YouTube* crate version *1.0.6+20171129*, where *20171129* 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+20170918/google_youtube3/struct.YouTube.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.YouTube.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) +* [activities](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.Activity.html) + * [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ActivityListCall.html) +* [captions](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.Caption.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CaptionDeleteCall.html), [*download*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CaptionDownloadCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CaptionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CaptionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CaptionUpdateCall.html) * channel banners - * [*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) + * [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ChannelBannerInsertCall.html) +* [channel sections](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ChannelSection.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ChannelSectionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ChannelSectionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ChannelSectionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ChannelSectionUpdateCall.html) +* [channels](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.Channel.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ChannelListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ChannelUpdateCall.html) +* [comment threads](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CommentThread.html) + * [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CommentThreadInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CommentThreadListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CommentThreadUpdateCall.html) +* [comments](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.Comment.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CommentDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CommentListCall.html), [*mark as spam*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CommentMarkAsSpamCall.html), [*set moderation status*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CommentSetModerationStatuCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CommentUpdateCall.html) +* [fan funding events](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.FanFundingEvent.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.FanFundingEventListCall.html) +* [guide categories](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.GuideCategory.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.GuideCategoryListCall.html) +* [i18n languages](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.I18nLanguage.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.I18nLanguageListCall.html) +* [i18n regions](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.I18nRegion.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.I18nRegionListCall.html) +* [live broadcasts](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveBroadcast.html) + * [*bind*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveBroadcastBindCall.html), [*control*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveBroadcastControlCall.html), [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveBroadcastDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveBroadcastInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveBroadcastListCall.html), [*transition*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveBroadcastTransitionCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveBroadcastUpdateCall.html) +* [live chat bans](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveChatBan.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveChatBanDeleteCall.html) and [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveChatBanInsertCall.html) +* [live chat messages](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveChatMessage.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveChatMessageDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveChatMessageInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveChatMessageListCall.html) +* [live chat moderators](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveChatModerator.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveChatModeratorDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveChatModeratorInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveChatModeratorListCall.html) +* [live streams](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveStream.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveStreamDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveStreamInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveStreamListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.LiveStreamUpdateCall.html) +* [playlist items](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.PlaylistItem.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.PlaylistItemDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.PlaylistItemInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.PlaylistItemListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.PlaylistItemUpdateCall.html) +* [playlists](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.Playlist.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.PlaylistDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.PlaylistInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.PlaylistListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.PlaylistUpdateCall.html) * search - * [*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) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.SearchListCall.html) +* [sponsors](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.Sponsor.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.SponsorListCall.html) +* [subscriptions](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.Subscription.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.SubscriptionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.SubscriptionInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.SubscriptionListCall.html) +* [super chat events](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.SuperChatEvent.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.SuperChatEventListCall.html) +* [thumbnails](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.Thumbnail.html) + * [*set*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ThumbnailSetCall.html) +* [video abuse report reasons](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoAbuseReportReason.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoAbuseReportReasonListCall.html) +* [video categories](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoCategory.html) + * [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoCategoryListCall.html) +* [videos](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.Video.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoDeleteCall.html), [*get rating*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoGetRatingCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoListCall.html), [*rate*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoRateCall.html), [*report abuse*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoReportAbuseCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoUpdateCall.html) * watermarks - * [*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) + * [*set*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.WatermarkSetCall.html) and [*unset*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.WatermarkUnsetCall.html) Upload supported by ... -* [*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) +* [*set thumbnails*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ThumbnailSetCall.html) +* [*insert captions*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CaptionInsertCall.html) +* [*insert videos*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.VideoInsertCall.html) +* [*set watermarks*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.WatermarkSetCall.html) +* [*insert channel banners*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.ChannelBannerInsertCall.html) +* [*update captions*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CaptionUpdateCall.html) Download supported by ... -* [*download captions*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.CaptionDownloadCall.html) +* [*download captions*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/struct.CaptionDownloadCall.html) Subscription supported by ... -* [*list playlist items*](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/struct.PlaylistItemListCall.html) +* [*list playlist items*](https://docs.rs/google-youtube3/1.0.6+20171129/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+20170918/google_youtube3/struct.YouTube.html)** +* **[Hub](https://docs.rs/google-youtube3/1.0.6+20171129/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+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)** + * creates [*Method Builders*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-youtube3/1.0.6+20171129/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+20170918/google_youtube3/trait.Part.html)** + * **[Parts](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-youtube3/1.0.6+20170918/google_youtube3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-youtube3/1.0.6+20171129/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+20170918/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+20171129/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+20170918/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+20171129/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+20170918/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+20171129/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+20170918/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+20171129/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-youtube3/1.0.6+20171129/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+20170918/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+20171129/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-youtube3/1.0.6+20171129/google_youtube3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-youtube3/1.0.6+20171129/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+20170918/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+20171129/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+20170918/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+20171129/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+20170918/google_youtube3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-youtube3/1.0.6+20171129/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 b2949e8f1e..1cca49fd78 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+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*. +//! This documentation was generated from *YouTube* crate version *1.0.6+20171129*, where *20171129* 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). @@ -4633,6 +4633,9 @@ pub struct Video { pub kind: Option, /// The statistics object contains statistics about the video. pub statistics: Option, + /// The access token to uniquely identify a revocable unlisted video. + #[serde(rename="accessToken")] + pub access_token: Option, /// The projectDetails object contains information about the project specific video metadata. #[serde(rename="projectDetails")] pub project_details: Option, @@ -4674,6 +4677,7 @@ impl ToParts for Video { 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.access_token.is_some() { r = r + "accessToken,"; } if self.project_details.is_some() { r = r + "projectDetails,"; } if self.processing_details.is_some() { r = r + "processingDetails,"; } if self.etag.is_some() { r = r + "etag,"; } @@ -5765,14 +5769,17 @@ pub struct LiveBroadcastContentDetails { /// 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 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, /// This value uniquely identifies the live stream bound to the broadcast. #[serde(rename="boundStreamId")] pub bound_stream_id: Option, + /// This setting indicates whether auto start is enabled for this broadcast. + #[serde(rename="enableAutoStart")] + pub enable_auto_start: 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, @@ -5784,9 +5791,9 @@ pub struct LiveBroadcastContentDetails { /// Indicates whether this broadcast has low latency enabled. #[serde(rename="enableLowLatency")] pub enable_low_latency: 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, + /// 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 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, diff --git a/gen/youtubeanalytics1-cli/Cargo.toml b/gen/youtubeanalytics1-cli/Cargo.toml index b3c2634451..74ca89b2ce 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+20170925" +version = "1.0.6+20171206" 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+20170925" +version = "1.0.6+20171206" diff --git a/gen/youtubeanalytics1-cli/README.md b/gen/youtubeanalytics1-cli/README.md index e721d9300a..61715bccfe 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 *20170925*. The CLI is at version *1.0.6*. +This documentation was generated from the *YouTube Analytics* API at revision *20171206*. 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 5a41dd30b2..7ac4e88e1f 100644 --- a/gen/youtubeanalytics1-cli/mkdocs.yml +++ b/gen/youtubeanalytics1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube Analytics v1.0.6+20170925 +site_name: YouTube Analytics v1.0.6+20171206 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 826797159a..5ff10dcc59 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+20170925") + .version("1.0.6+20171206") .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 85aec11a7c..1ae2f2e0e2 100644 --- a/gen/youtubeanalytics1/Cargo.toml +++ b/gen/youtubeanalytics1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-youtubeanalytics1" -version = "1.0.6+20170925" +version = "1.0.6+20171206" 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+20170925" +documentation = "https://docs.rs/google-youtubeanalytics1/1.0.6+20171206" license = "MIT" keywords = ["youtubeAnalytics", "google", "protocol", "web", "api"] diff --git a/gen/youtubeanalytics1/README.md b/gen/youtubeanalytics1/README.md index bcccf4b701..b1701d0474 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+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*. +This documentation was generated from *YouTube Analytics* crate version *1.0.6+20171206*, where *20171206* 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+20170925/google_youtubeanalytics1/struct.YouTubeAnalytics.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/struct.YouTubeAnalytics.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) +* [group items](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/struct.GroupItem.html) + * [*delete*](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/struct.GroupItemDeleteCall.html), [*insert*](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/struct.GroupItemInsertCall.html) and [*list*](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/struct.GroupItemListCall.html) +* [groups](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/struct.Group.html) + * [*delete*](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/struct.GroupDeleteCall.html), [*insert*](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/struct.GroupListCall.html) and [*update*](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/struct.GroupUpdateCall.html) * reports - * [*query*](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/struct.ReportQueryCall.html) + * [*query*](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/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+20170925/google_youtubeanalytics1/struct.YouTubeAnalytics.html)** +* **[Hub](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/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+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)** + * creates [*Method Builders*](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/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+20170925/google_youtubeanalytics1/trait.Part.html)** + * **[Parts](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-youtubeanalytics1/1.0.6+20170925/google_youtubeanalytics1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/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+20170925/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+20171206/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+20170925/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+20171206/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+20170925/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+20171206/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+20170925/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+20171206/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/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+20170925/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+20171206/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/google_youtubeanalytics1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/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+20170925/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+20171206/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+20170925/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+20171206/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+20170925/google_youtubeanalytics1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-youtubeanalytics1/1.0.6+20171206/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 8db476c2d4..ab2be914bc 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+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*. +//! This documentation was generated from *YouTube Analytics* crate version *1.0.6+20171206*, where *20171206* 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 acccb9a7c8..2437dc2042 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+20170926" +version = "1.0.6+20171208" 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+20170926" +version = "1.0.6+20171208" diff --git a/gen/youtubereporting1-cli/README.md b/gen/youtubereporting1-cli/README.md index 0e2c3a30ef..10af30c143 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 *20170926*. The CLI is at version *1.0.6*. +This documentation was generated from the *YouTube Reporting* API at revision *20171208*. 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 0add16ba8f..dd6dd04f9a 100644 --- a/gen/youtubereporting1-cli/mkdocs.yml +++ b/gen/youtubereporting1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube Reporting v1.0.6+20170926 +site_name: YouTube Reporting v1.0.6+20171208 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 6287424e1f..d2d9e813f4 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+20170926") + .version("1.0.6+20171208") .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 98f4fe4989..3e0c10a7d8 100644 --- a/gen/youtubereporting1/Cargo.toml +++ b/gen/youtubereporting1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-youtubereporting1" -version = "1.0.6+20170926" +version = "1.0.6+20171208" 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+20170926" +documentation = "https://docs.rs/google-youtubereporting1/1.0.6+20171208" license = "MIT" keywords = ["youtubereporting", "google", "protocol", "web", "api"] diff --git a/gen/youtubereporting1/README.md b/gen/youtubereporting1/README.md index ca5136b4ee..e58c940aaf 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+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*. +This documentation was generated from *YouTube Reporting* crate version *1.0.6+20171208*, where *20171208* 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+20170926/google_youtubereporting1/struct.YouTubeReporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.YouTubeReporting.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) +* [jobs](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.Job.html) + * [*create*](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.JobCreateCall.html), [*delete*](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.JobDeleteCall.html), [*get*](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.JobGetCall.html), [*list*](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.JobListCall.html), [*reports get*](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.JobReportGetCall.html) and [*reports list*](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.JobReportListCall.html) +* [media](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.Media.html) + * [*download*](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.MediaDownloadCall.html) +* [report types](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.ReportType.html) + * [*list*](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/struct.ReportTypeListCall.html) Download supported by ... -* [*download media*](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/struct.MediaDownloadCall.html) +* [*download media*](https://docs.rs/google-youtubereporting1/1.0.6+20171208/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+20170926/google_youtubereporting1/struct.YouTubeReporting.html)** +* **[Hub](https://docs.rs/google-youtubereporting1/1.0.6+20171208/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+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)** + * creates [*Method Builders*](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-youtubereporting1/1.0.6+20171208/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+20170926/google_youtubereporting1/trait.Part.html)** + * **[Parts](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-youtubereporting1/1.0.6+20170926/google_youtubereporting1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-youtubereporting1/1.0.6+20171208/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+20170926/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+20171208/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+20170926/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+20171208/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+20170926/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+20171208/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+20170926/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+20171208/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+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. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-youtubereporting1/1.0.6+20171208/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+20170926/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+20171208/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+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 +All structures provided by this library are made to be [enocodable](https://docs.rs/google-youtubereporting1/1.0.6+20171208/google_youtubereporting1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-youtubereporting1/1.0.6+20171208/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+20170926/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+20171208/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+20170926/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+20171208/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+20170926/google_youtubereporting1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-youtubereporting1/1.0.6+20171208/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 41cf458097..9eb1040682 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+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*. +//! This documentation was generated from *YouTube Reporting* crate version *1.0.6+20171208*, where *20171208* 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/). @@ -1129,17 +1129,17 @@ impl<'a, C, A> MediaDownloadCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. 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) -> MediaDownloadCall<'a, C, A> @@ -1400,17 +1400,17 @@ impl<'a, C, A> ReportTypeListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. 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) -> ReportTypeListCall<'a, C, A> @@ -1662,17 +1662,17 @@ impl<'a, C, A> JobDeleteCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. 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) -> JobDeleteCall<'a, C, A> @@ -1936,17 +1936,17 @@ impl<'a, C, A> JobReportGetCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. 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) -> JobReportGetCall<'a, C, A> @@ -2198,17 +2198,17 @@ impl<'a, C, A> JobGetCall<'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. - /// * *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) -> JobGetCall<'a, C, A> @@ -2527,17 +2527,17 @@ impl<'a, C, A> JobReportListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. 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) -> JobReportListCall<'a, C, A> @@ -2798,17 +2798,17 @@ impl<'a, C, A> JobListCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. 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) -> JobListCall<'a, C, A> @@ -3058,17 +3058,17 @@ impl<'a, C, A> JobCreateCall<'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. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. 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) -> JobCreateCall<'a, C, A>